diff --git a/air/v2/client/air/air_api_airline1_parameters.go b/air/v2/client/air/air_api_airline1_parameters.go
index f1b6310c..1ef4e918 100644
--- a/air/v2/client/air/air_api_airline1_parameters.go
+++ b/air/v2/client/air/air_api_airline1_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIAirline1Params creates a new AirAPIAirline1Params object
-// with the default values initialized.
+// NewAirAPIAirline1Params creates a new AirAPIAirline1Params 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 NewAirAPIAirline1Params() *AirAPIAirline1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIAirline1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIAirline1ParamsWithTimeout creates a new AirAPIAirline1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIAirline1ParamsWithTimeout(timeout time.Duration) *AirAPIAirline1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIAirline1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIAirline1ParamsWithContext creates a new AirAPIAirline1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIAirline1ParamsWithContext(ctx context.Context) *AirAPIAirline1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIAirline1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIAirline1ParamsWithHTTPClient creates a new AirAPIAirline1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIAirline1ParamsWithHTTPClient(client *http.Client) *AirAPIAirline1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIAirline1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIAirline1Params contains all the parameters to send to the API endpoint
-for the air Api airline 1 operation typically these are written to a http.Request
+/* AirAPIAirline1Params contains all the parameters to send to the API endpoint
+ for the air Api airline 1 operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIAirline1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type AirAPIAirline1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api airline 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIAirline1Params) WithDefaults() *AirAPIAirline1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api airline 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIAirline1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIAirline1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api airline 1 params
func (o *AirAPIAirline1Params) WithTimeout(timeout time.Duration) *AirAPIAirline1Params {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *AirAPIAirline1Params) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
@@ -245,64 +267,68 @@ func (o *AirAPIAirline1Params) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_airline1_responses.go b/air/v2/client/air/air_api_airline1_responses.go
index b6838bbc..595e5d8c 100644
--- a/air/v2/client/air/air_api_airline1_responses.go
+++ b/air/v2/client/air/air_api_airline1_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIAirline1Reader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIAirline1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIAirline1OK() *AirAPIAirline1OK {
return &AirAPIAirline1OK{}
}
-/*AirAPIAirline1OK handles this case with default header values.
+/* AirAPIAirline1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIAirline1OK struct {
func (o *AirAPIAirline1OK) Error() string {
return fmt.Sprintf("[GET /v2/Air/Airline][%d] airApiAirline1OK %+v", 200, o.Payload)
}
-
func (o *AirAPIAirline1OK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2Airline {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIAirline1OK) readResponse(response runtime.ClientResponse, consume
return nil
}
+
+// NewAirAPIAirline1NotModified creates a AirAPIAirline1NotModified with default headers values
+func NewAirAPIAirline1NotModified() *AirAPIAirline1NotModified {
+ return &AirAPIAirline1NotModified{}
+}
+
+/* AirAPIAirline1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIAirline1NotModified struct {
+}
+
+func (o *AirAPIAirline1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/Airline][%d] airApiAirline1NotModified ", 304)
+}
+
+func (o *AirAPIAirline1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_airline_parameters.go b/air/v2/client/air/air_api_airline_parameters.go
index 876a2de7..a687207f 100644
--- a/air/v2/client/air/air_api_airline_parameters.go
+++ b/air/v2/client/air/air_api_airline_parameters.go
@@ -16,58 +16,58 @@ import (
"github.com/go-openapi/strfmt"
)
-// NewAirAPIAirlineParams creates a new AirAPIAirlineParams object
-// with the default values initialized.
+// NewAirAPIAirlineParams creates a new AirAPIAirlineParams 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 NewAirAPIAirlineParams() *AirAPIAirlineParams {
- var ()
return &AirAPIAirlineParams{
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIAirlineParamsWithTimeout creates a new AirAPIAirlineParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIAirlineParamsWithTimeout(timeout time.Duration) *AirAPIAirlineParams {
- var ()
return &AirAPIAirlineParams{
-
timeout: timeout,
}
}
// NewAirAPIAirlineParamsWithContext creates a new AirAPIAirlineParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIAirlineParamsWithContext(ctx context.Context) *AirAPIAirlineParams {
- var ()
return &AirAPIAirlineParams{
-
Context: ctx,
}
}
// NewAirAPIAirlineParamsWithHTTPClient creates a new AirAPIAirlineParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIAirlineParamsWithHTTPClient(client *http.Client) *AirAPIAirlineParams {
- var ()
return &AirAPIAirlineParams{
HTTPClient: client,
}
}
-/*AirAPIAirlineParams contains all the parameters to send to the API endpoint
-for the air Api airline operation typically these are written to a http.Request
+/* AirAPIAirlineParams contains all the parameters to send to the API endpoint
+ for the air Api airline operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIAirlineParams struct {
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+ 指定來源格式
*/
DollarFormat string
- /*IATA
- 航空公司代碼
+ /* IATA.
+
+ 航空公司代碼
*/
IATA string
@@ -76,6 +76,21 @@ type AirAPIAirlineParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api airline params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIAirlineParams) WithDefaults() *AirAPIAirlineParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api airline params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIAirlineParams) SetDefaults() {
+ // no default values defined for this parameter
+}
+
// WithTimeout adds the timeout to the air Api airline params
func (o *AirAPIAirlineParams) WithTimeout(timeout time.Duration) *AirAPIAirlineParams {
o.SetTimeout(timeout)
@@ -143,6 +158,7 @@ func (o *AirAPIAirlineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
qrDollarFormat := o.DollarFormat
qDollarFormat := qrDollarFormat
if qDollarFormat != "" {
+
if err := r.SetQueryParam("$format", qDollarFormat); err != nil {
return err
}
diff --git a/air/v2/client/air/air_api_airline_responses.go b/air/v2/client/air/air_api_airline_responses.go
index 447d751b..aba8738f 100644
--- a/air/v2/client/air/air_api_airline_responses.go
+++ b/air/v2/client/air/air_api_airline_responses.go
@@ -29,7 +29,6 @@ func (o *AirAPIAirlineReader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewAirAPIAirlineOK() *AirAPIAirlineOK {
return &AirAPIAirlineOK{}
}
-/*AirAPIAirlineOK handles this case with default header values.
+/* AirAPIAirlineOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type AirAPIAirlineOK struct {
func (o *AirAPIAirlineOK) Error() string {
return fmt.Sprintf("[GET /v2/Air/Airline/{IATA}][%d] airApiAirlineOK %+v", 200, o.Payload)
}
-
func (o *AirAPIAirlineOK) GetPayload() *models.PTXServiceDTOAirSpecificationV2Airline {
return o.Payload
}
diff --git a/air/v2/client/air/air_api_airport1_parameters.go b/air/v2/client/air/air_api_airport1_parameters.go
index e58504ba..cd56f241 100644
--- a/air/v2/client/air/air_api_airport1_parameters.go
+++ b/air/v2/client/air/air_api_airport1_parameters.go
@@ -16,58 +16,58 @@ import (
"github.com/go-openapi/strfmt"
)
-// NewAirAPIAirport1Params creates a new AirAPIAirport1Params object
-// with the default values initialized.
+// NewAirAPIAirport1Params creates a new AirAPIAirport1Params 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 NewAirAPIAirport1Params() *AirAPIAirport1Params {
- var ()
return &AirAPIAirport1Params{
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIAirport1ParamsWithTimeout creates a new AirAPIAirport1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIAirport1ParamsWithTimeout(timeout time.Duration) *AirAPIAirport1Params {
- var ()
return &AirAPIAirport1Params{
-
timeout: timeout,
}
}
// NewAirAPIAirport1ParamsWithContext creates a new AirAPIAirport1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIAirport1ParamsWithContext(ctx context.Context) *AirAPIAirport1Params {
- var ()
return &AirAPIAirport1Params{
-
Context: ctx,
}
}
// NewAirAPIAirport1ParamsWithHTTPClient creates a new AirAPIAirport1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIAirport1ParamsWithHTTPClient(client *http.Client) *AirAPIAirport1Params {
- var ()
return &AirAPIAirport1Params{
HTTPClient: client,
}
}
-/*AirAPIAirport1Params contains all the parameters to send to the API endpoint
-for the air Api airport 1 operation typically these are written to a http.Request
+/* AirAPIAirport1Params contains all the parameters to send to the API endpoint
+ for the air Api airport 1 operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIAirport1Params struct {
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+ 指定來源格式
*/
DollarFormat string
- /*IATA
- 機場代碼
+ /* IATA.
+
+ 機場代碼
*/
IATA string
@@ -76,6 +76,21 @@ type AirAPIAirport1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api airport 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIAirport1Params) WithDefaults() *AirAPIAirport1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api airport 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIAirport1Params) SetDefaults() {
+ // no default values defined for this parameter
+}
+
// WithTimeout adds the timeout to the air Api airport 1 params
func (o *AirAPIAirport1Params) WithTimeout(timeout time.Duration) *AirAPIAirport1Params {
o.SetTimeout(timeout)
@@ -143,6 +158,7 @@ func (o *AirAPIAirport1Params) WriteToRequest(r runtime.ClientRequest, reg strfm
qrDollarFormat := o.DollarFormat
qDollarFormat := qrDollarFormat
if qDollarFormat != "" {
+
if err := r.SetQueryParam("$format", qDollarFormat); err != nil {
return err
}
diff --git a/air/v2/client/air/air_api_airport1_responses.go b/air/v2/client/air/air_api_airport1_responses.go
index 5f01607f..079da81c 100644
--- a/air/v2/client/air/air_api_airport1_responses.go
+++ b/air/v2/client/air/air_api_airport1_responses.go
@@ -29,7 +29,6 @@ func (o *AirAPIAirport1Reader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewAirAPIAirport1OK() *AirAPIAirport1OK {
return &AirAPIAirport1OK{}
}
-/*AirAPIAirport1OK handles this case with default header values.
+/* AirAPIAirport1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type AirAPIAirport1OK struct {
func (o *AirAPIAirport1OK) Error() string {
return fmt.Sprintf("[GET /v2/Air/Airport/{IATA}][%d] airApiAirport1OK %+v", 200, o.Payload)
}
-
func (o *AirAPIAirport1OK) GetPayload() *models.PTXServiceDTOAirSpecificationV2Airport {
return o.Payload
}
diff --git a/air/v2/client/air/air_api_airport_parameters.go b/air/v2/client/air/air_api_airport_parameters.go
index 5b227a32..a907f0b9 100644
--- a/air/v2/client/air/air_api_airport_parameters.go
+++ b/air/v2/client/air/air_api_airport_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIAirportParams creates a new AirAPIAirportParams object
-// with the default values initialized.
+// NewAirAPIAirportParams creates a new AirAPIAirportParams 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 NewAirAPIAirportParams() *AirAPIAirportParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIAirportParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIAirportParamsWithTimeout creates a new AirAPIAirportParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIAirportParamsWithTimeout(timeout time.Duration) *AirAPIAirportParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIAirportParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIAirportParamsWithContext creates a new AirAPIAirportParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIAirportParamsWithContext(ctx context.Context) *AirAPIAirportParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIAirportParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIAirportParamsWithHTTPClient creates a new AirAPIAirportParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIAirportParamsWithHTTPClient(client *http.Client) *AirAPIAirportParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIAirportParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIAirportParams contains all the parameters to send to the API endpoint
-for the air Api airport operation typically these are written to a http.Request
+/* AirAPIAirportParams contains all the parameters to send to the API endpoint
+ for the air Api airport operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIAirportParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type AirAPIAirportParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api airport params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIAirportParams) WithDefaults() *AirAPIAirportParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api airport params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIAirportParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIAirportParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api airport params
func (o *AirAPIAirportParams) WithTimeout(timeout time.Duration) *AirAPIAirportParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *AirAPIAirportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
@@ -261,80 +284,85 @@ func (o *AirAPIAirportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_airport_responses.go b/air/v2/client/air/air_api_airport_responses.go
index 82291ae8..e57273f7 100644
--- a/air/v2/client/air/air_api_airport_responses.go
+++ b/air/v2/client/air/air_api_airport_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIAirportReader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIAirportNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIAirportOK() *AirAPIAirportOK {
return &AirAPIAirportOK{}
}
-/*AirAPIAirportOK handles this case with default header values.
+/* AirAPIAirportOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIAirportOK struct {
func (o *AirAPIAirportOK) Error() string {
return fmt.Sprintf("[GET /v2/Air/Airport][%d] airApiAirportOK %+v", 200, o.Payload)
}
-
func (o *AirAPIAirportOK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2Airport {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIAirportOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewAirAPIAirportNotModified creates a AirAPIAirportNotModified with default headers values
+func NewAirAPIAirportNotModified() *AirAPIAirportNotModified {
+ return &AirAPIAirportNotModified{}
+}
+
+/* AirAPIAirportNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIAirportNotModified struct {
+}
+
+func (o *AirAPIAirportNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/Airport][%d] airApiAirportNotModified ", 304)
+}
+
+func (o *AirAPIAirportNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_arrival1_parameters.go b/air/v2/client/air/air_api_arrival1_parameters.go
index 44263369..eb0d4b21 100644
--- a/air/v2/client/air/air_api_arrival1_parameters.go
+++ b/air/v2/client/air/air_api_arrival1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIArrival1Params creates a new AirAPIArrival1Params object
-// with the default values initialized.
+// NewAirAPIArrival1Params creates a new AirAPIArrival1Params 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 NewAirAPIArrival1Params() *AirAPIArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIArrival1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIArrival1ParamsWithTimeout creates a new AirAPIArrival1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIArrival1ParamsWithTimeout(timeout time.Duration) *AirAPIArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIArrival1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIArrival1ParamsWithContext creates a new AirAPIArrival1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIArrival1ParamsWithContext(ctx context.Context) *AirAPIArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIArrival1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIArrival1ParamsWithHTTPClient creates a new AirAPIArrival1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIArrival1ParamsWithHTTPClient(client *http.Client) *AirAPIArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIArrival1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIArrival1Params contains all the parameters to send to the API endpoint
-for the air Api arrival 1 operation typically these are written to a http.Request
+/* AirAPIArrival1Params contains all the parameters to send to the API endpoint
+ for the air Api arrival 1 operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIArrival1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*IATA
- 機場代碼
+ /* IATA.
+
+ 機場代碼
*/
IATA string
- /*IsCargo
- 是否為貨機
+ /* IsCargo.
+
+ 是否為貨機
*/
IsCargo *bool
@@ -119,6 +115,32 @@ type AirAPIArrival1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api arrival 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIArrival1Params) WithDefaults() *AirAPIArrival1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api arrival 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIArrival1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIArrival1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api arrival 1 params
func (o *AirAPIArrival1Params) WithTimeout(timeout time.Duration) *AirAPIArrival1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *AirAPIArrival1Params) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
@@ -277,64 +301,68 @@ func (o *AirAPIArrival1Params) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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 IATA
@@ -346,16 +374,17 @@ func (o *AirAPIArrival1Params) WriteToRequest(r runtime.ClientRequest, reg strfm
// query param IsCargo
var qrIsCargo bool
+
if o.IsCargo != nil {
qrIsCargo = *o.IsCargo
}
qIsCargo := swag.FormatBool(qrIsCargo)
if qIsCargo != "" {
+
if err := r.SetQueryParam("IsCargo", qIsCargo); err != nil {
return err
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_arrival1_responses.go b/air/v2/client/air/air_api_arrival1_responses.go
index 364df207..41cc2d46 100644
--- a/air/v2/client/air/air_api_arrival1_responses.go
+++ b/air/v2/client/air/air_api_arrival1_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIArrival1Reader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIArrival1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIArrival1OK() *AirAPIArrival1OK {
return &AirAPIArrival1OK{}
}
-/*AirAPIArrival1OK handles this case with default header values.
+/* AirAPIArrival1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIArrival1OK struct {
func (o *AirAPIArrival1OK) Error() string {
return fmt.Sprintf("[GET /v2/Air/FIDS/Airport/Arrival/{IATA}][%d] airApiArrival1OK %+v", 200, o.Payload)
}
-
func (o *AirAPIArrival1OK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2FIDSArrival {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIArrival1OK) readResponse(response runtime.ClientResponse, consume
return nil
}
+
+// NewAirAPIArrival1NotModified creates a AirAPIArrival1NotModified with default headers values
+func NewAirAPIArrival1NotModified() *AirAPIArrival1NotModified {
+ return &AirAPIArrival1NotModified{}
+}
+
+/* AirAPIArrival1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIArrival1NotModified struct {
+}
+
+func (o *AirAPIArrival1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/FIDS/Airport/Arrival/{IATA}][%d] airApiArrival1NotModified ", 304)
+}
+
+func (o *AirAPIArrival1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_arrival_parameters.go b/air/v2/client/air/air_api_arrival_parameters.go
index ee19ef07..74e0c55c 100644
--- a/air/v2/client/air/air_api_arrival_parameters.go
+++ b/air/v2/client/air/air_api_arrival_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIArrivalParams creates a new AirAPIArrivalParams object
-// with the default values initialized.
+// NewAirAPIArrivalParams creates a new AirAPIArrivalParams 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 NewAirAPIArrivalParams() *AirAPIArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIArrivalParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIArrivalParamsWithTimeout creates a new AirAPIArrivalParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIArrivalParamsWithTimeout(timeout time.Duration) *AirAPIArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIArrivalParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIArrivalParamsWithContext creates a new AirAPIArrivalParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIArrivalParamsWithContext(ctx context.Context) *AirAPIArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIArrivalParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIArrivalParamsWithHTTPClient creates a new AirAPIArrivalParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIArrivalParamsWithHTTPClient(client *http.Client) *AirAPIArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIArrivalParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIArrivalParams contains all the parameters to send to the API endpoint
-for the air Api arrival operation typically these are written to a http.Request
+/* AirAPIArrivalParams contains all the parameters to send to the API endpoint
+ for the air Api arrival operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIArrivalParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*IsCargo
- 是否為貨機
+ /* IsCargo.
+
+ 是否為貨機
*/
IsCargo *bool
@@ -114,6 +109,32 @@ type AirAPIArrivalParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api arrival params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIArrivalParams) WithDefaults() *AirAPIArrivalParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api arrival params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIArrivalParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIArrivalParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api arrival params
func (o *AirAPIArrivalParams) WithTimeout(timeout time.Duration) *AirAPIArrivalParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *AirAPIArrivalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
@@ -261,80 +284,85 @@ func (o *AirAPIArrivalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
}
-
}
if o.IsCargo != nil {
// query param IsCargo
var qrIsCargo bool
+
if o.IsCargo != nil {
qrIsCargo = *o.IsCargo
}
qIsCargo := swag.FormatBool(qrIsCargo)
if qIsCargo != "" {
+
if err := r.SetQueryParam("IsCargo", qIsCargo); err != nil {
return err
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_arrival_responses.go b/air/v2/client/air/air_api_arrival_responses.go
index d4390f5f..54e1d478 100644
--- a/air/v2/client/air/air_api_arrival_responses.go
+++ b/air/v2/client/air/air_api_arrival_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIArrivalReader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIArrivalNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIArrivalOK() *AirAPIArrivalOK {
return &AirAPIArrivalOK{}
}
-/*AirAPIArrivalOK handles this case with default header values.
+/* AirAPIArrivalOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIArrivalOK struct {
func (o *AirAPIArrivalOK) Error() string {
return fmt.Sprintf("[GET /v2/Air/FIDS/Airport/Arrival][%d] airApiArrivalOK %+v", 200, o.Payload)
}
-
func (o *AirAPIArrivalOK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2FIDSArrival {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIArrivalOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewAirAPIArrivalNotModified creates a AirAPIArrivalNotModified with default headers values
+func NewAirAPIArrivalNotModified() *AirAPIArrivalNotModified {
+ return &AirAPIArrivalNotModified{}
+}
+
+/* AirAPIArrivalNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIArrivalNotModified struct {
+}
+
+func (o *AirAPIArrivalNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/FIDS/Airport/Arrival][%d] airApiArrivalNotModified ", 304)
+}
+
+func (o *AirAPIArrivalNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_departure1_parameters.go b/air/v2/client/air/air_api_departure1_parameters.go
index 8ece3e3f..6dd6c982 100644
--- a/air/v2/client/air/air_api_departure1_parameters.go
+++ b/air/v2/client/air/air_api_departure1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIDeparture1Params creates a new AirAPIDeparture1Params object
-// with the default values initialized.
+// NewAirAPIDeparture1Params creates a new AirAPIDeparture1Params 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 NewAirAPIDeparture1Params() *AirAPIDeparture1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDeparture1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIDeparture1ParamsWithTimeout creates a new AirAPIDeparture1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIDeparture1ParamsWithTimeout(timeout time.Duration) *AirAPIDeparture1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDeparture1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIDeparture1ParamsWithContext creates a new AirAPIDeparture1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIDeparture1ParamsWithContext(ctx context.Context) *AirAPIDeparture1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDeparture1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIDeparture1ParamsWithHTTPClient creates a new AirAPIDeparture1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIDeparture1ParamsWithHTTPClient(client *http.Client) *AirAPIDeparture1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDeparture1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIDeparture1Params contains all the parameters to send to the API endpoint
-for the air Api departure 1 operation typically these are written to a http.Request
+/* AirAPIDeparture1Params contains all the parameters to send to the API endpoint
+ for the air Api departure 1 operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIDeparture1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*IATA
- 機場代碼
+ /* IATA.
+
+ 機場代碼
*/
IATA string
- /*IsCargo
- 是否為貨機
+ /* IsCargo.
+
+ 是否為貨機
*/
IsCargo *bool
@@ -119,6 +115,32 @@ type AirAPIDeparture1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api departure 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIDeparture1Params) WithDefaults() *AirAPIDeparture1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api departure 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIDeparture1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIDeparture1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api departure 1 params
func (o *AirAPIDeparture1Params) WithTimeout(timeout time.Duration) *AirAPIDeparture1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *AirAPIDeparture1Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -277,64 +301,68 @@ func (o *AirAPIDeparture1Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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 IATA
@@ -346,16 +374,17 @@ func (o *AirAPIDeparture1Params) WriteToRequest(r runtime.ClientRequest, reg str
// query param IsCargo
var qrIsCargo bool
+
if o.IsCargo != nil {
qrIsCargo = *o.IsCargo
}
qIsCargo := swag.FormatBool(qrIsCargo)
if qIsCargo != "" {
+
if err := r.SetQueryParam("IsCargo", qIsCargo); err != nil {
return err
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_departure1_responses.go b/air/v2/client/air/air_api_departure1_responses.go
index 6b669112..5697907f 100644
--- a/air/v2/client/air/air_api_departure1_responses.go
+++ b/air/v2/client/air/air_api_departure1_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIDeparture1Reader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIDeparture1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIDeparture1OK() *AirAPIDeparture1OK {
return &AirAPIDeparture1OK{}
}
-/*AirAPIDeparture1OK handles this case with default header values.
+/* AirAPIDeparture1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIDeparture1OK struct {
func (o *AirAPIDeparture1OK) Error() string {
return fmt.Sprintf("[GET /v2/Air/FIDS/Airport/Departure/{IATA}][%d] airApiDeparture1OK %+v", 200, o.Payload)
}
-
func (o *AirAPIDeparture1OK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2FIDSDeparture {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIDeparture1OK) readResponse(response runtime.ClientResponse, consu
return nil
}
+
+// NewAirAPIDeparture1NotModified creates a AirAPIDeparture1NotModified with default headers values
+func NewAirAPIDeparture1NotModified() *AirAPIDeparture1NotModified {
+ return &AirAPIDeparture1NotModified{}
+}
+
+/* AirAPIDeparture1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIDeparture1NotModified struct {
+}
+
+func (o *AirAPIDeparture1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/FIDS/Airport/Departure/{IATA}][%d] airApiDeparture1NotModified ", 304)
+}
+
+func (o *AirAPIDeparture1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_departure_parameters.go b/air/v2/client/air/air_api_departure_parameters.go
index 4c15c7fd..b9fc57e3 100644
--- a/air/v2/client/air/air_api_departure_parameters.go
+++ b/air/v2/client/air/air_api_departure_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIDepartureParams creates a new AirAPIDepartureParams object
-// with the default values initialized.
+// NewAirAPIDepartureParams creates a new AirAPIDepartureParams 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 NewAirAPIDepartureParams() *AirAPIDepartureParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDepartureParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIDepartureParamsWithTimeout creates a new AirAPIDepartureParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIDepartureParamsWithTimeout(timeout time.Duration) *AirAPIDepartureParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDepartureParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIDepartureParamsWithContext creates a new AirAPIDepartureParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIDepartureParamsWithContext(ctx context.Context) *AirAPIDepartureParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDepartureParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIDepartureParamsWithHTTPClient creates a new AirAPIDepartureParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIDepartureParamsWithHTTPClient(client *http.Client) *AirAPIDepartureParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDepartureParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIDepartureParams contains all the parameters to send to the API endpoint
-for the air Api departure operation typically these are written to a http.Request
+/* AirAPIDepartureParams contains all the parameters to send to the API endpoint
+ for the air Api departure operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIDepartureParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*IsCargo
- 是否為貨機
+ /* IsCargo.
+
+ 是否為貨機
*/
IsCargo *bool
@@ -114,6 +109,32 @@ type AirAPIDepartureParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api departure params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIDepartureParams) WithDefaults() *AirAPIDepartureParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api departure params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIDepartureParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIDepartureParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api departure params
func (o *AirAPIDepartureParams) WithTimeout(timeout time.Duration) *AirAPIDepartureParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *AirAPIDepartureParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -261,80 +284,85 @@ func (o *AirAPIDepartureParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
}
-
}
if o.IsCargo != nil {
// query param IsCargo
var qrIsCargo bool
+
if o.IsCargo != nil {
qrIsCargo = *o.IsCargo
}
qIsCargo := swag.FormatBool(qrIsCargo)
if qIsCargo != "" {
+
if err := r.SetQueryParam("IsCargo", qIsCargo); err != nil {
return err
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_departure_responses.go b/air/v2/client/air/air_api_departure_responses.go
index 04e16fa8..efff6c68 100644
--- a/air/v2/client/air/air_api_departure_responses.go
+++ b/air/v2/client/air/air_api_departure_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIDepartureReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIDepartureNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIDepartureOK() *AirAPIDepartureOK {
return &AirAPIDepartureOK{}
}
-/*AirAPIDepartureOK handles this case with default header values.
+/* AirAPIDepartureOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIDepartureOK struct {
func (o *AirAPIDepartureOK) Error() string {
return fmt.Sprintf("[GET /v2/Air/FIDS/Airport/Departure][%d] airApiDepartureOK %+v", 200, o.Payload)
}
-
func (o *AirAPIDepartureOK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2FIDSDeparture {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIDepartureOK) readResponse(response runtime.ClientResponse, consum
return nil
}
+
+// NewAirAPIDepartureNotModified creates a AirAPIDepartureNotModified with default headers values
+func NewAirAPIDepartureNotModified() *AirAPIDepartureNotModified {
+ return &AirAPIDepartureNotModified{}
+}
+
+/* AirAPIDepartureNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIDepartureNotModified struct {
+}
+
+func (o *AirAPIDepartureNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/FIDS/Airport/Departure][%d] airApiDepartureNotModified ", 304)
+}
+
+func (o *AirAPIDepartureNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_domestic_parameters.go b/air/v2/client/air/air_api_domestic_parameters.go
index 43cfff34..8a539169 100644
--- a/air/v2/client/air/air_api_domestic_parameters.go
+++ b/air/v2/client/air/air_api_domestic_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIDomesticParams creates a new AirAPIDomesticParams object
-// with the default values initialized.
+// NewAirAPIDomesticParams creates a new AirAPIDomesticParams 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 NewAirAPIDomesticParams() *AirAPIDomesticParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDomesticParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIDomesticParamsWithTimeout creates a new AirAPIDomesticParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIDomesticParamsWithTimeout(timeout time.Duration) *AirAPIDomesticParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDomesticParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIDomesticParamsWithContext creates a new AirAPIDomesticParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIDomesticParamsWithContext(ctx context.Context) *AirAPIDomesticParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDomesticParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIDomesticParamsWithHTTPClient creates a new AirAPIDomesticParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIDomesticParamsWithHTTPClient(client *http.Client) *AirAPIDomesticParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIDomesticParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIDomesticParams contains all the parameters to send to the API endpoint
-for the air Api domestic operation typically these are written to a http.Request
+/* AirAPIDomesticParams contains all the parameters to send to the API endpoint
+ for the air Api domestic operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIDomesticParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type AirAPIDomesticParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api domestic params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIDomesticParams) WithDefaults() *AirAPIDomesticParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api domestic params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIDomesticParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIDomesticParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api domestic params
func (o *AirAPIDomesticParams) WithTimeout(timeout time.Duration) *AirAPIDomesticParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *AirAPIDomesticParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
@@ -245,64 +267,68 @@ func (o *AirAPIDomesticParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_domestic_responses.go b/air/v2/client/air/air_api_domestic_responses.go
index 258e8922..04c43541 100644
--- a/air/v2/client/air/air_api_domestic_responses.go
+++ b/air/v2/client/air/air_api_domestic_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIDomesticReader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIDomesticNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIDomesticOK() *AirAPIDomesticOK {
return &AirAPIDomesticOK{}
}
-/*AirAPIDomesticOK handles this case with default header values.
+/* AirAPIDomesticOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIDomesticOK struct {
func (o *AirAPIDomesticOK) Error() string {
return fmt.Sprintf("[GET /v2/Air/GeneralSchedule/Domestic][%d] airApiDomesticOK %+v", 200, o.Payload)
}
-
func (o *AirAPIDomesticOK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2GeneralFlightSchedule {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIDomesticOK) readResponse(response runtime.ClientResponse, consume
return nil
}
+
+// NewAirAPIDomesticNotModified creates a AirAPIDomesticNotModified with default headers values
+func NewAirAPIDomesticNotModified() *AirAPIDomesticNotModified {
+ return &AirAPIDomesticNotModified{}
+}
+
+/* AirAPIDomesticNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIDomesticNotModified struct {
+}
+
+func (o *AirAPIDomesticNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/GeneralSchedule/Domestic][%d] airApiDomesticNotModified ", 304)
+}
+
+func (o *AirAPIDomesticNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_f_id_s1_parameters.go b/air/v2/client/air/air_api_f_id_s1_parameters.go
index d280aa8c..a29f2053 100644
--- a/air/v2/client/air/air_api_f_id_s1_parameters.go
+++ b/air/v2/client/air/air_api_f_id_s1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIFIDS1Params creates a new AirAPIFIDS1Params object
-// with the default values initialized.
+// NewAirAPIFIDS1Params creates a new AirAPIFIDS1Params 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 NewAirAPIFIDS1Params() *AirAPIFIDS1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFIDS1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIFIDS1ParamsWithTimeout creates a new AirAPIFIDS1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIFIDS1ParamsWithTimeout(timeout time.Duration) *AirAPIFIDS1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFIDS1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIFIDS1ParamsWithContext creates a new AirAPIFIDS1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIFIDS1ParamsWithContext(ctx context.Context) *AirAPIFIDS1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFIDS1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIFIDS1ParamsWithHTTPClient creates a new AirAPIFIDS1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIFIDS1ParamsWithHTTPClient(client *http.Client) *AirAPIFIDS1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFIDS1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIFIDS1Params contains all the parameters to send to the API endpoint
-for the air Api f ID s 1 operation typically these are written to a http.Request
+/* AirAPIFIDS1Params contains all the parameters to send to the API endpoint
+ for the air Api f ID s 1 operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIFIDS1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*IATA
- 機場代碼
+ /* IATA.
+
+ 機場代碼
*/
IATA string
@@ -114,6 +109,32 @@ type AirAPIFIDS1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api f ID s 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIFIDS1Params) WithDefaults() *AirAPIFIDS1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api f ID s 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIFIDS1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIFIDS1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api f ID s 1 params
func (o *AirAPIFIDS1Params) WithTimeout(timeout time.Duration) *AirAPIFIDS1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *AirAPIFIDS1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// 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
}
@@ -261,64 +284,68 @@ func (o *AirAPIFIDS1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// 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 IATA
diff --git a/air/v2/client/air/air_api_f_id_s1_responses.go b/air/v2/client/air/air_api_f_id_s1_responses.go
index b6bbb0ca..a0e1c372 100644
--- a/air/v2/client/air/air_api_f_id_s1_responses.go
+++ b/air/v2/client/air/air_api_f_id_s1_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIFIDS1Reader) ReadResponse(response runtime.ClientResponse, consum
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIFIDS1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIFIDS1OK() *AirAPIFIDS1OK {
return &AirAPIFIDS1OK{}
}
-/*AirAPIFIDS1OK handles this case with default header values.
+/* AirAPIFIDS1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIFIDS1OK struct {
func (o *AirAPIFIDS1OK) Error() string {
return fmt.Sprintf("[GET /v2/Air/FIDS/Airport/{IATA}][%d] airApiFIdS1OK %+v", 200, o.Payload)
}
-
func (o *AirAPIFIDS1OK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2AirportFIDS {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIFIDS1OK) readResponse(response runtime.ClientResponse, consumer r
return nil
}
+
+// NewAirAPIFIDS1NotModified creates a AirAPIFIDS1NotModified with default headers values
+func NewAirAPIFIDS1NotModified() *AirAPIFIDS1NotModified {
+ return &AirAPIFIDS1NotModified{}
+}
+
+/* AirAPIFIDS1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIFIDS1NotModified struct {
+}
+
+func (o *AirAPIFIDS1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/FIDS/Airport/{IATA}][%d] airApiFIdS1NotModified ", 304)
+}
+
+func (o *AirAPIFIDS1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_f_id_s_parameters.go b/air/v2/client/air/air_api_f_id_s_parameters.go
index 772fe5a1..1216612c 100644
--- a/air/v2/client/air/air_api_f_id_s_parameters.go
+++ b/air/v2/client/air/air_api_f_id_s_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIFIDSParams creates a new AirAPIFIDSParams object
-// with the default values initialized.
+// NewAirAPIFIDSParams creates a new AirAPIFIDSParams 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 NewAirAPIFIDSParams() *AirAPIFIDSParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFIDSParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIFIDSParamsWithTimeout creates a new AirAPIFIDSParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIFIDSParamsWithTimeout(timeout time.Duration) *AirAPIFIDSParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFIDSParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIFIDSParamsWithContext creates a new AirAPIFIDSParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIFIDSParamsWithContext(ctx context.Context) *AirAPIFIDSParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFIDSParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIFIDSParamsWithHTTPClient creates a new AirAPIFIDSParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIFIDSParamsWithHTTPClient(client *http.Client) *AirAPIFIDSParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFIDSParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIFIDSParams contains all the parameters to send to the API endpoint
-for the air Api f ID s operation typically these are written to a http.Request
+/* AirAPIFIDSParams contains all the parameters to send to the API endpoint
+ for the air Api f ID s operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIFIDSParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type AirAPIFIDSParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api f ID s params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIFIDSParams) WithDefaults() *AirAPIFIDSParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api f ID s params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIFIDSParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIFIDSParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api f ID s params
func (o *AirAPIFIDSParams) WithTimeout(timeout time.Duration) *AirAPIFIDSParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *AirAPIFIDSParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re
// 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
}
@@ -245,64 +267,68 @@ func (o *AirAPIFIDSParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_f_id_s_responses.go b/air/v2/client/air/air_api_f_id_s_responses.go
index 1da7e1c6..1d68c27f 100644
--- a/air/v2/client/air/air_api_f_id_s_responses.go
+++ b/air/v2/client/air/air_api_f_id_s_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIFIDSReader) ReadResponse(response runtime.ClientResponse, consume
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIFIDSNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIFIDSOK() *AirAPIFIDSOK {
return &AirAPIFIDSOK{}
}
-/*AirAPIFIDSOK handles this case with default header values.
+/* AirAPIFIDSOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIFIDSOK struct {
func (o *AirAPIFIDSOK) Error() string {
return fmt.Sprintf("[GET /v2/Air/FIDS/Airport][%d] airApiFIdSOK %+v", 200, o.Payload)
}
-
func (o *AirAPIFIDSOK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2AirportFIDS {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIFIDSOK) readResponse(response runtime.ClientResponse, consumer ru
return nil
}
+
+// NewAirAPIFIDSNotModified creates a AirAPIFIDSNotModified with default headers values
+func NewAirAPIFIDSNotModified() *AirAPIFIDSNotModified {
+ return &AirAPIFIDSNotModified{}
+}
+
+/* AirAPIFIDSNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIFIDSNotModified struct {
+}
+
+func (o *AirAPIFIDSNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/FIDS/Airport][%d] airApiFIdSNotModified ", 304)
+}
+
+func (o *AirAPIFIDSNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_flight1_parameters.go b/air/v2/client/air/air_api_flight1_parameters.go
index 877a2162..1166a4a4 100644
--- a/air/v2/client/air/air_api_flight1_parameters.go
+++ b/air/v2/client/air/air_api_flight1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIFlight1Params creates a new AirAPIFlight1Params object
-// with the default values initialized.
+// NewAirAPIFlight1Params creates a new AirAPIFlight1Params 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 NewAirAPIFlight1Params() *AirAPIFlight1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFlight1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIFlight1ParamsWithTimeout creates a new AirAPIFlight1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIFlight1ParamsWithTimeout(timeout time.Duration) *AirAPIFlight1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFlight1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIFlight1ParamsWithContext creates a new AirAPIFlight1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIFlight1ParamsWithContext(ctx context.Context) *AirAPIFlight1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFlight1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIFlight1ParamsWithHTTPClient creates a new AirAPIFlight1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIFlight1ParamsWithHTTPClient(client *http.Client) *AirAPIFlight1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFlight1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIFlight1Params contains all the parameters to send to the API endpoint
-for the air Api flight 1 operation typically these are written to a http.Request
+/* AirAPIFlight1Params contains all the parameters to send to the API endpoint
+ for the air Api flight 1 operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIFlight1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*FlightNo
- 航機班號
+ /* FlightNo.
+
+ 航機班號
*/
FlightNo string
- /*IsCargo
- 是否為貨機
+ /* IsCargo.
+
+ 是否為貨機
*/
IsCargo *bool
@@ -119,6 +115,32 @@ type AirAPIFlight1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api flight 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIFlight1Params) WithDefaults() *AirAPIFlight1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api flight 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIFlight1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIFlight1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api flight 1 params
func (o *AirAPIFlight1Params) WithTimeout(timeout time.Duration) *AirAPIFlight1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *AirAPIFlight1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
@@ -277,64 +301,68 @@ func (o *AirAPIFlight1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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 FlightNo
@@ -346,16 +374,17 @@ func (o *AirAPIFlight1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt
// query param IsCargo
var qrIsCargo bool
+
if o.IsCargo != nil {
qrIsCargo = *o.IsCargo
}
qIsCargo := swag.FormatBool(qrIsCargo)
if qIsCargo != "" {
+
if err := r.SetQueryParam("IsCargo", qIsCargo); err != nil {
return err
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_flight1_responses.go b/air/v2/client/air/air_api_flight1_responses.go
index aeaee729..2563a9be 100644
--- a/air/v2/client/air/air_api_flight1_responses.go
+++ b/air/v2/client/air/air_api_flight1_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIFlight1Reader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIFlight1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIFlight1OK() *AirAPIFlight1OK {
return &AirAPIFlight1OK{}
}
-/*AirAPIFlight1OK handles this case with default header values.
+/* AirAPIFlight1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIFlight1OK struct {
func (o *AirAPIFlight1OK) Error() string {
return fmt.Sprintf("[GET /v2/Air/FIDS/Flight/{FlightNo}][%d] airApiFlight1OK %+v", 200, o.Payload)
}
-
func (o *AirAPIFlight1OK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2FIDS {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIFlight1OK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewAirAPIFlight1NotModified creates a AirAPIFlight1NotModified with default headers values
+func NewAirAPIFlight1NotModified() *AirAPIFlight1NotModified {
+ return &AirAPIFlight1NotModified{}
+}
+
+/* AirAPIFlight1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIFlight1NotModified struct {
+}
+
+func (o *AirAPIFlight1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/FIDS/Flight/{FlightNo}][%d] airApiFlight1NotModified ", 304)
+}
+
+func (o *AirAPIFlight1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_flight_parameters.go b/air/v2/client/air/air_api_flight_parameters.go
index 55ae2f9c..2e1c3760 100644
--- a/air/v2/client/air/air_api_flight_parameters.go
+++ b/air/v2/client/air/air_api_flight_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIFlightParams creates a new AirAPIFlightParams object
-// with the default values initialized.
+// NewAirAPIFlightParams creates a new AirAPIFlightParams 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 NewAirAPIFlightParams() *AirAPIFlightParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFlightParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIFlightParamsWithTimeout creates a new AirAPIFlightParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIFlightParamsWithTimeout(timeout time.Duration) *AirAPIFlightParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFlightParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIFlightParamsWithContext creates a new AirAPIFlightParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIFlightParamsWithContext(ctx context.Context) *AirAPIFlightParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFlightParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIFlightParamsWithHTTPClient creates a new AirAPIFlightParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIFlightParamsWithHTTPClient(client *http.Client) *AirAPIFlightParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIFlightParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIFlightParams contains all the parameters to send to the API endpoint
-for the air Api flight operation typically these are written to a http.Request
+/* AirAPIFlightParams contains all the parameters to send to the API endpoint
+ for the air Api flight operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIFlightParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*IsCargo
- 是否為貨機
+ /* IsCargo.
+
+ 是否為貨機
*/
IsCargo *bool
@@ -114,6 +109,32 @@ type AirAPIFlightParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api flight params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIFlightParams) WithDefaults() *AirAPIFlightParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api flight params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIFlightParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIFlightParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api flight params
func (o *AirAPIFlightParams) WithTimeout(timeout time.Duration) *AirAPIFlightParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *AirAPIFlightParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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
}
@@ -261,80 +284,85 @@ func (o *AirAPIFlightParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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
}
}
-
}
if o.IsCargo != nil {
// query param IsCargo
var qrIsCargo bool
+
if o.IsCargo != nil {
qrIsCargo = *o.IsCargo
}
qIsCargo := swag.FormatBool(qrIsCargo)
if qIsCargo != "" {
+
if err := r.SetQueryParam("IsCargo", qIsCargo); err != nil {
return err
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_flight_responses.go b/air/v2/client/air/air_api_flight_responses.go
index ff966c43..4a02e8f5 100644
--- a/air/v2/client/air/air_api_flight_responses.go
+++ b/air/v2/client/air/air_api_flight_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIFlightReader) ReadResponse(response runtime.ClientResponse, consu
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIFlightNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIFlightOK() *AirAPIFlightOK {
return &AirAPIFlightOK{}
}
-/*AirAPIFlightOK handles this case with default header values.
+/* AirAPIFlightOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIFlightOK struct {
func (o *AirAPIFlightOK) Error() string {
return fmt.Sprintf("[GET /v2/Air/FIDS/Flight][%d] airApiFlightOK %+v", 200, o.Payload)
}
-
func (o *AirAPIFlightOK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2FIDS {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIFlightOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewAirAPIFlightNotModified creates a AirAPIFlightNotModified with default headers values
+func NewAirAPIFlightNotModified() *AirAPIFlightNotModified {
+ return &AirAPIFlightNotModified{}
+}
+
+/* AirAPIFlightNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIFlightNotModified struct {
+}
+
+func (o *AirAPIFlightNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/FIDS/Flight][%d] airApiFlightNotModified ", 304)
+}
+
+func (o *AirAPIFlightNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_international_parameters.go b/air/v2/client/air/air_api_international_parameters.go
index 62dd8521..5a5e64cb 100644
--- a/air/v2/client/air/air_api_international_parameters.go
+++ b/air/v2/client/air/air_api_international_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIInternationalParams creates a new AirAPIInternationalParams object
-// with the default values initialized.
+// NewAirAPIInternationalParams creates a new AirAPIInternationalParams 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 NewAirAPIInternationalParams() *AirAPIInternationalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIInternationalParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIInternationalParamsWithTimeout creates a new AirAPIInternationalParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIInternationalParamsWithTimeout(timeout time.Duration) *AirAPIInternationalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIInternationalParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIInternationalParamsWithContext creates a new AirAPIInternationalParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIInternationalParamsWithContext(ctx context.Context) *AirAPIInternationalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIInternationalParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIInternationalParamsWithHTTPClient creates a new AirAPIInternationalParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIInternationalParamsWithHTTPClient(client *http.Client) *AirAPIInternationalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIInternationalParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIInternationalParams contains all the parameters to send to the API endpoint
-for the air Api international operation typically these are written to a http.Request
+/* AirAPIInternationalParams contains all the parameters to send to the API endpoint
+ for the air Api international operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIInternationalParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type AirAPIInternationalParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api international params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIInternationalParams) WithDefaults() *AirAPIInternationalParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api international params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIInternationalParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIInternationalParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api international params
func (o *AirAPIInternationalParams) WithTimeout(timeout time.Duration) *AirAPIInternationalParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *AirAPIInternationalParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -245,64 +267,68 @@ func (o *AirAPIInternationalParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_international_responses.go b/air/v2/client/air/air_api_international_responses.go
index 8b856e06..2d5cbbaf 100644
--- a/air/v2/client/air/air_api_international_responses.go
+++ b/air/v2/client/air/air_api_international_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIInternationalReader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIInternationalNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIInternationalOK() *AirAPIInternationalOK {
return &AirAPIInternationalOK{}
}
-/*AirAPIInternationalOK handles this case with default header values.
+/* AirAPIInternationalOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIInternationalOK struct {
func (o *AirAPIInternationalOK) Error() string {
return fmt.Sprintf("[GET /v2/Air/GeneralSchedule/International][%d] airApiInternationalOK %+v", 200, o.Payload)
}
-
func (o *AirAPIInternationalOK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2GeneralFlightSchedule {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIInternationalOK) readResponse(response runtime.ClientResponse, co
return nil
}
+
+// NewAirAPIInternationalNotModified creates a AirAPIInternationalNotModified with default headers values
+func NewAirAPIInternationalNotModified() *AirAPIInternationalNotModified {
+ return &AirAPIInternationalNotModified{}
+}
+
+/* AirAPIInternationalNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIInternationalNotModified struct {
+}
+
+func (o *AirAPIInternationalNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/GeneralSchedule/International][%d] airApiInternationalNotModified ", 304)
+}
+
+func (o *AirAPIInternationalNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_m_e_t_a_r1_parameters.go b/air/v2/client/air/air_api_m_e_t_a_r1_parameters.go
index ae1898b8..360aa10e 100644
--- a/air/v2/client/air/air_api_m_e_t_a_r1_parameters.go
+++ b/air/v2/client/air/air_api_m_e_t_a_r1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIMETAR1Params creates a new AirAPIMETAR1Params object
-// with the default values initialized.
+// NewAirAPIMETAR1Params creates a new AirAPIMETAR1Params 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 NewAirAPIMETAR1Params() *AirAPIMETAR1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIMETAR1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIMETAR1ParamsWithTimeout creates a new AirAPIMETAR1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIMETAR1ParamsWithTimeout(timeout time.Duration) *AirAPIMETAR1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIMETAR1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIMETAR1ParamsWithContext creates a new AirAPIMETAR1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIMETAR1ParamsWithContext(ctx context.Context) *AirAPIMETAR1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIMETAR1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIMETAR1ParamsWithHTTPClient creates a new AirAPIMETAR1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIMETAR1ParamsWithHTTPClient(client *http.Client) *AirAPIMETAR1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIMETAR1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIMETAR1Params contains all the parameters to send to the API endpoint
-for the air Api m e t a r 1 operation typically these are written to a http.Request
+/* AirAPIMETAR1Params contains all the parameters to send to the API endpoint
+ for the air Api m e t a r 1 operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIMETAR1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*IATA
- 機場代碼
+ /* IATA.
+
+ 機場代碼
*/
IATA string
@@ -119,6 +115,32 @@ type AirAPIMETAR1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api m e t a r 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIMETAR1Params) WithDefaults() *AirAPIMETAR1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api m e t a r 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIMETAR1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIMETAR1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api m e t a r 1 params
func (o *AirAPIMETAR1Params) WithTimeout(timeout time.Duration) *AirAPIMETAR1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *AirAPIMETAR1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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
}
@@ -277,80 +301,85 @@ func (o *AirAPIMETAR1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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 IATA
diff --git a/air/v2/client/air/air_api_m_e_t_a_r1_responses.go b/air/v2/client/air/air_api_m_e_t_a_r1_responses.go
index 965f552c..edc65a7a 100644
--- a/air/v2/client/air/air_api_m_e_t_a_r1_responses.go
+++ b/air/v2/client/air/air_api_m_e_t_a_r1_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIMETAR1Reader) ReadResponse(response runtime.ClientResponse, consu
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIMETAR1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIMETAR1OK() *AirAPIMETAR1OK {
return &AirAPIMETAR1OK{}
}
-/*AirAPIMETAR1OK handles this case with default header values.
+/* AirAPIMETAR1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIMETAR1OK struct {
func (o *AirAPIMETAR1OK) Error() string {
return fmt.Sprintf("[GET /v2/Air/METAR/Airport/{IATA}][%d] airApiMETAR1OK %+v", 200, o.Payload)
}
-
func (o *AirAPIMETAR1OK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2METAR {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIMETAR1OK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewAirAPIMETAR1NotModified creates a AirAPIMETAR1NotModified with default headers values
+func NewAirAPIMETAR1NotModified() *AirAPIMETAR1NotModified {
+ return &AirAPIMETAR1NotModified{}
+}
+
+/* AirAPIMETAR1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIMETAR1NotModified struct {
+}
+
+func (o *AirAPIMETAR1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/METAR/Airport/{IATA}][%d] airApiMETAR1NotModified ", 304)
+}
+
+func (o *AirAPIMETAR1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/client/air/air_api_m_e_t_a_r_parameters.go b/air/v2/client/air/air_api_m_e_t_a_r_parameters.go
index 31bcfab4..6454c193 100644
--- a/air/v2/client/air/air_api_m_e_t_a_r_parameters.go
+++ b/air/v2/client/air/air_api_m_e_t_a_r_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewAirAPIMETARParams creates a new AirAPIMETARParams object
-// with the default values initialized.
+// NewAirAPIMETARParams creates a new AirAPIMETARParams 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 NewAirAPIMETARParams() *AirAPIMETARParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIMETARParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAirAPIMETARParamsWithTimeout creates a new AirAPIMETARParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAirAPIMETARParamsWithTimeout(timeout time.Duration) *AirAPIMETARParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIMETARParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAirAPIMETARParamsWithContext creates a new AirAPIMETARParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAirAPIMETARParamsWithContext(ctx context.Context) *AirAPIMETARParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIMETARParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAirAPIMETARParamsWithHTTPClient creates a new AirAPIMETARParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAirAPIMETARParamsWithHTTPClient(client *http.Client) *AirAPIMETARParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AirAPIMETARParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AirAPIMETARParams contains all the parameters to send to the API endpoint
-for the air Api m e t a r operation typically these are written to a http.Request
+/* AirAPIMETARParams contains all the parameters to send to the API endpoint
+ for the air Api m e t a r operation.
+
+ Typically these are written to a http.Request.
*/
type AirAPIMETARParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type AirAPIMETARParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the air Api m e t a r params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIMETARParams) WithDefaults() *AirAPIMETARParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the air Api m e t a r params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AirAPIMETARParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AirAPIMETARParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the air Api m e t a r params
func (o *AirAPIMETARParams) WithTimeout(timeout time.Duration) *AirAPIMETARParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *AirAPIMETARParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// 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
}
@@ -261,80 +284,85 @@ func (o *AirAPIMETARParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
if len(res) > 0 {
diff --git a/air/v2/client/air/air_api_m_e_t_a_r_responses.go b/air/v2/client/air/air_api_m_e_t_a_r_responses.go
index 6462b2f2..8eabc539 100644
--- a/air/v2/client/air/air_api_m_e_t_a_r_responses.go
+++ b/air/v2/client/air/air_api_m_e_t_a_r_responses.go
@@ -29,7 +29,12 @@ func (o *AirAPIMETARReader) ReadResponse(response runtime.ClientResponse, consum
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAirAPIMETARNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAirAPIMETAROK() *AirAPIMETAROK {
return &AirAPIMETAROK{}
}
-/*AirAPIMETAROK handles this case with default header values.
+/* AirAPIMETAROK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AirAPIMETAROK struct {
func (o *AirAPIMETAROK) Error() string {
return fmt.Sprintf("[GET /v2/Air/METAR/Airport][%d] airApiMETAROK %+v", 200, o.Payload)
}
-
func (o *AirAPIMETAROK) GetPayload() []*models.PTXServiceDTOAirSpecificationV2METAR {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *AirAPIMETAROK) readResponse(response runtime.ClientResponse, consumer r
return nil
}
+
+// NewAirAPIMETARNotModified creates a AirAPIMETARNotModified with default headers values
+func NewAirAPIMETARNotModified() *AirAPIMETARNotModified {
+ return &AirAPIMETARNotModified{}
+}
+
+/* AirAPIMETARNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AirAPIMETARNotModified struct {
+}
+
+func (o *AirAPIMETARNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Air/METAR/Airport][%d] airApiMETARNotModified ", 304)
+}
+
+func (o *AirAPIMETARNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airline.go b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airline.go
index d6649c56..bd90715a 100644
--- a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airline.go
+++ b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airline.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -122,7 +124,6 @@ func (m *PTXServiceDTOAirSpecificationV2Airline) validateAirlineID(formats strfm
}
func (m *PTXServiceDTOAirSpecificationV2Airline) validateAirlineName(formats strfmt.Registry) error {
-
if swag.IsZero(m.AirlineName) { // not required
return nil
}
@@ -131,7 +132,6 @@ func (m *PTXServiceDTOAirSpecificationV2Airline) validateAirlineName(formats str
}
func (m *PTXServiceDTOAirSpecificationV2Airline) validateAirlineNameAlias(formats strfmt.Registry) error {
-
if swag.IsZero(m.AirlineNameAlias) { // not required
return nil
}
@@ -157,6 +157,34 @@ func (m *PTXServiceDTOAirSpecificationV2Airline) validateVersionID(formats strfm
return nil
}
+// ContextValidate validate this p t x service d t o air specification v2 airline based on the context it is used
+func (m *PTXServiceDTOAirSpecificationV2Airline) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAirlineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateAirlineNameAlias(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2Airline) contextValidateAirlineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2Airline) contextValidateAirlineNameAlias(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOAirSpecificationV2Airline) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airport.go b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airport.go
index d9bf76e2..ab6f0838 100644
--- a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airport.go
+++ b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airport.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -22,7 +24,7 @@ type PTXServiceDTOAirSpecificationV2Airport struct {
// String
//
// 機場地址
- AirportAdrress string `json:"AirportAdrress,omitempty"`
+ AirportAddress string `json:"AirportAddress,omitempty"`
// NameType
//
@@ -124,7 +126,6 @@ func (m *PTXServiceDTOAirSpecificationV2Airport) Validate(formats strfmt.Registr
}
func (m *PTXServiceDTOAirSpecificationV2Airport) validateAirportCityName(formats strfmt.Registry) error {
-
if swag.IsZero(m.AirportCityName) { // not required
return nil
}
@@ -142,7 +143,6 @@ func (m *PTXServiceDTOAirSpecificationV2Airport) validateAirportID(formats strfm
}
func (m *PTXServiceDTOAirSpecificationV2Airport) validateAirportName(formats strfmt.Registry) error {
-
if swag.IsZero(m.AirportName) { // not required
return nil
}
@@ -151,7 +151,6 @@ func (m *PTXServiceDTOAirSpecificationV2Airport) validateAirportName(formats str
}
func (m *PTXServiceDTOAirSpecificationV2Airport) validateAirportPosition(formats strfmt.Registry) error {
-
if swag.IsZero(m.AirportPosition) { // not required
return nil
}
@@ -177,6 +176,43 @@ func (m *PTXServiceDTOAirSpecificationV2Airport) validateVersionID(formats strfm
return nil
}
+// ContextValidate validate this p t x service d t o air specification v2 airport based on the context it is used
+func (m *PTXServiceDTOAirSpecificationV2Airport) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAirportCityName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateAirportName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateAirportPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2Airport) contextValidateAirportCityName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2Airport) contextValidateAirportName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2Airport) contextValidateAirportPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOAirSpecificationV2Airport) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airport_f_id_s.go b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airport_f_id_s.go
index 9060f759..97b09d69 100644
--- a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airport_f_id_s.go
+++ b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_airport_f_id_s.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -80,7 +81,6 @@ func (m *PTXServiceDTOAirSpecificationV2AirportFIDS) validateAirportID(formats s
}
func (m *PTXServiceDTOAirSpecificationV2AirportFIDS) validateFIDSArrival(formats strfmt.Registry) error {
-
if swag.IsZero(m.FIDSArrival) { // not required
return nil
}
@@ -105,7 +105,6 @@ func (m *PTXServiceDTOAirSpecificationV2AirportFIDS) validateFIDSArrival(formats
}
func (m *PTXServiceDTOAirSpecificationV2AirportFIDS) validateFIDSDeparture(formats strfmt.Registry) error {
-
if swag.IsZero(m.FIDSDeparture) { // not required
return nil
}
@@ -138,6 +137,60 @@ func (m *PTXServiceDTOAirSpecificationV2AirportFIDS) validateUpdateTime(formats
return nil
}
+// ContextValidate validate this p t x service d t o air specification v2 airport f ID s based on the context it is used
+func (m *PTXServiceDTOAirSpecificationV2AirportFIDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFIDSArrival(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFIDSDeparture(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2AirportFIDS) contextValidateFIDSArrival(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.FIDSArrival); i++ {
+
+ if m.FIDSArrival[i] != nil {
+ if err := m.FIDSArrival[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("FIDSArrival" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2AirportFIDS) contextValidateFIDSDeparture(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.FIDSDeparture); i++ {
+
+ if m.FIDSDeparture[i] != nil {
+ if err := m.FIDSDeparture[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("FIDSDeparture" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOAirSpecificationV2AirportFIDS) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_code_share.go b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_code_share.go
index ded1a403..2e3bb5b5 100644
--- a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_code_share.go
+++ b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_code_share.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -68,6 +70,11 @@ func (m *PTXServiceDTOAirSpecificationV2CodeShare) validateFlightNumber(formats
return nil
}
+// ContextValidate validates this p t x service d t o air specification v2 code share based on context it is used
+func (m *PTXServiceDTOAirSpecificationV2CodeShare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOAirSpecificationV2CodeShare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s.go b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s.go
index c484c740..c6df54e3 100644
--- a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s.go
+++ b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -274,6 +276,11 @@ func (m *PTXServiceDTOAirSpecificationV2FIDS) validateUpdateTime(formats strfmt.
return nil
}
+// ContextValidate validates this p t x service d t o air specification v2 f ID s based on context it is used
+func (m *PTXServiceDTOAirSpecificationV2FIDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOAirSpecificationV2FIDS) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s_arrival.go b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s_arrival.go
index 37954754..9ef6c4a3 100644
--- a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s_arrival.go
+++ b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s_arrival.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -214,6 +216,11 @@ func (m *PTXServiceDTOAirSpecificationV2FIDSArrival) validateUpdateTime(formats
return nil
}
+// ContextValidate validates this p t x service d t o air specification v2 f ID s arrival based on context it is used
+func (m *PTXServiceDTOAirSpecificationV2FIDSArrival) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOAirSpecificationV2FIDSArrival) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s_departure.go b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s_departure.go
index cd16d726..7edd25a6 100644
--- a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s_departure.go
+++ b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_f_id_s_departure.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -214,6 +216,11 @@ func (m *PTXServiceDTOAirSpecificationV2FIDSDeparture) validateUpdateTime(format
return nil
}
+// ContextValidate validates this p t x service d t o air specification v2 f ID s departure based on context it is used
+func (m *PTXServiceDTOAirSpecificationV2FIDSDeparture) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOAirSpecificationV2FIDSDeparture) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_general_flight_schedule.go b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_general_flight_schedule.go
index eaafd1eb..2b786b32 100644
--- a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_general_flight_schedule.go
+++ b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_general_flight_schedule.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -244,7 +245,6 @@ func (m *PTXServiceDTOAirSpecificationV2GeneralFlightSchedule) validateArrivalTi
}
func (m *PTXServiceDTOAirSpecificationV2GeneralFlightSchedule) validateCodeShare(formats strfmt.Registry) error {
-
if swag.IsZero(m.CodeShare) { // not required
return nil
}
@@ -394,6 +394,38 @@ func (m *PTXServiceDTOAirSpecificationV2GeneralFlightSchedule) validateWednesday
return nil
}
+// ContextValidate validate this p t x service d t o air specification v2 general flight schedule based on the context it is used
+func (m *PTXServiceDTOAirSpecificationV2GeneralFlightSchedule) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateCodeShare(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2GeneralFlightSchedule) contextValidateCodeShare(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.CodeShare); i++ {
+
+ if m.CodeShare[i] != nil {
+ if err := m.CodeShare[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("CodeShare" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOAirSpecificationV2GeneralFlightSchedule) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_m_e_t_a_r.go b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_m_e_t_a_r.go
index 3c4a4ac8..68505ed6 100644
--- a/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_m_e_t_a_r.go
+++ b/air/v2/models/p_t_x_service_d_t_o_air_specification_v2_m_e_t_a_r.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -322,6 +324,61 @@ func (m *PTXServiceDTOAirSpecificationV2METAR) validateWindSpeed(formats strfmt.
return nil
}
+// ContextValidate validate this p t x service d t o air specification v2 m e t a r based on the context it is used
+func (m *PTXServiceDTOAirSpecificationV2METAR) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAirportName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateCityName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateCountryName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateWeatherDescription(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2METAR) contextValidateAirportName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2METAR) contextValidateCityName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2METAR) contextValidateCountryName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2METAR) contextValidateStationPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOAirSpecificationV2METAR) contextValidateWeatherDescription(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOAirSpecificationV2METAR) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/air/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go b/air/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
index ae2f0ea5..b757afa0 100644
--- a/air/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
+++ b/air/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -33,6 +35,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) Validate(formats strfmt
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base name type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/air/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go b/air/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
index 65354297..02645203 100644
--- a/air/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
+++ b/air/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -19,7 +21,7 @@ type PTXServiceDTOSharedSpecificationV2BasePointType struct {
// String
//
- // 位置雜湊
+ // 地理空間編碼
GeoHash string `json:"GeoHash,omitempty"`
// 位置緯度(WGS84)
@@ -34,6 +36,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BasePointType) Validate(formats strfm
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base point type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BasePointType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BasePointType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/basic/v2/client/basic/basic_api_authority_parameters.go b/basic/v2/client/basic/basic_api_authority_parameters.go
index 1e662b27..7fb4f013 100644
--- a/basic/v2/client/basic/basic_api_authority_parameters.go
+++ b/basic/v2/client/basic/basic_api_authority_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewBasicAPIAuthorityParams creates a new BasicAPIAuthorityParams object
-// with the default values initialized.
+// NewBasicAPIAuthorityParams creates a new BasicAPIAuthorityParams 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 NewBasicAPIAuthorityParams() *BasicAPIAuthorityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIAuthorityParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewBasicAPIAuthorityParamsWithTimeout creates a new BasicAPIAuthorityParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewBasicAPIAuthorityParamsWithTimeout(timeout time.Duration) *BasicAPIAuthorityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIAuthorityParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewBasicAPIAuthorityParamsWithContext creates a new BasicAPIAuthorityParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewBasicAPIAuthorityParamsWithContext(ctx context.Context) *BasicAPIAuthorityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIAuthorityParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewBasicAPIAuthorityParamsWithHTTPClient creates a new BasicAPIAuthorityParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewBasicAPIAuthorityParamsWithHTTPClient(client *http.Client) *BasicAPIAuthorityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIAuthorityParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*BasicAPIAuthorityParams contains all the parameters to send to the API endpoint
-for the basic Api authority operation typically these are written to a http.Request
+/* BasicAPIAuthorityParams contains all the parameters to send to the API endpoint
+ for the basic Api authority operation.
+
+ Typically these are written to a http.Request.
*/
type BasicAPIAuthorityParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type BasicAPIAuthorityParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the basic Api authority params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BasicAPIAuthorityParams) WithDefaults() *BasicAPIAuthorityParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the basic Api authority params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BasicAPIAuthorityParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BasicAPIAuthorityParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the basic Api authority params
func (o *BasicAPIAuthorityParams) WithTimeout(timeout time.Duration) *BasicAPIAuthorityParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *BasicAPIAuthorityParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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
}
@@ -245,64 +267,68 @@ func (o *BasicAPIAuthorityParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/basic/v2/client/basic/basic_api_authority_responses.go b/basic/v2/client/basic/basic_api_authority_responses.go
index 8a0e2122..9610c6c1 100644
--- a/basic/v2/client/basic/basic_api_authority_responses.go
+++ b/basic/v2/client/basic/basic_api_authority_responses.go
@@ -29,7 +29,12 @@ func (o *BasicAPIAuthorityReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewBasicAPIAuthorityNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewBasicAPIAuthorityOK() *BasicAPIAuthorityOK {
return &BasicAPIAuthorityOK{}
}
-/*BasicAPIAuthorityOK handles this case with default header values.
+/* BasicAPIAuthorityOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type BasicAPIAuthorityOK struct {
func (o *BasicAPIAuthorityOK) Error() string {
return fmt.Sprintf("[GET /v2/Basic/Authority][%d] basicApiAuthorityOK %+v", 200, o.Payload)
}
-
func (o *BasicAPIAuthorityOK) GetPayload() []*models.PTXServiceDTOSharedSpecificationV2BaseAuthority {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *BasicAPIAuthorityOK) readResponse(response runtime.ClientResponse, cons
return nil
}
+
+// NewBasicAPIAuthorityNotModified creates a BasicAPIAuthorityNotModified with default headers values
+func NewBasicAPIAuthorityNotModified() *BasicAPIAuthorityNotModified {
+ return &BasicAPIAuthorityNotModified{}
+}
+
+/* BasicAPIAuthorityNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BasicAPIAuthorityNotModified struct {
+}
+
+func (o *BasicAPIAuthorityNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Basic/Authority][%d] basicApiAuthorityNotModified ", 304)
+}
+
+func (o *BasicAPIAuthorityNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/basic/v2/client/basic/basic_api_operator_parameters.go b/basic/v2/client/basic/basic_api_operator_parameters.go
index bf47726a..a8724602 100644
--- a/basic/v2/client/basic/basic_api_operator_parameters.go
+++ b/basic/v2/client/basic/basic_api_operator_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewBasicAPIOperatorParams creates a new BasicAPIOperatorParams object
-// with the default values initialized.
+// NewBasicAPIOperatorParams creates a new BasicAPIOperatorParams 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 NewBasicAPIOperatorParams() *BasicAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewBasicAPIOperatorParamsWithTimeout creates a new BasicAPIOperatorParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewBasicAPIOperatorParamsWithTimeout(timeout time.Duration) *BasicAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewBasicAPIOperatorParamsWithContext creates a new BasicAPIOperatorParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewBasicAPIOperatorParamsWithContext(ctx context.Context) *BasicAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewBasicAPIOperatorParamsWithHTTPClient creates a new BasicAPIOperatorParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewBasicAPIOperatorParamsWithHTTPClient(client *http.Client) *BasicAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIOperatorParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*BasicAPIOperatorParams contains all the parameters to send to the API endpoint
-for the basic Api operator operation typically these are written to a http.Request
+/* BasicAPIOperatorParams contains all the parameters to send to the API endpoint
+ for the basic Api operator operation.
+
+ Typically these are written to a http.Request.
*/
type BasicAPIOperatorParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type BasicAPIOperatorParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the basic Api operator params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BasicAPIOperatorParams) WithDefaults() *BasicAPIOperatorParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the basic Api operator params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BasicAPIOperatorParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BasicAPIOperatorParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the basic Api operator params
func (o *BasicAPIOperatorParams) WithTimeout(timeout time.Duration) *BasicAPIOperatorParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *BasicAPIOperatorParams) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -245,64 +267,68 @@ func (o *BasicAPIOperatorParams) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/basic/v2/client/basic/basic_api_operator_responses.go b/basic/v2/client/basic/basic_api_operator_responses.go
index 90391f15..4809216e 100644
--- a/basic/v2/client/basic/basic_api_operator_responses.go
+++ b/basic/v2/client/basic/basic_api_operator_responses.go
@@ -29,7 +29,12 @@ func (o *BasicAPIOperatorReader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewBasicAPIOperatorNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewBasicAPIOperatorOK() *BasicAPIOperatorOK {
return &BasicAPIOperatorOK{}
}
-/*BasicAPIOperatorOK handles this case with default header values.
+/* BasicAPIOperatorOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type BasicAPIOperatorOK struct {
func (o *BasicAPIOperatorOK) Error() string {
return fmt.Sprintf("[GET /v2/Basic/Operator][%d] basicApiOperatorOK %+v", 200, o.Payload)
}
-
func (o *BasicAPIOperatorOK) GetPayload() []*models.PTXServiceDTOSharedSpecificationV2BaseOperator {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *BasicAPIOperatorOK) readResponse(response runtime.ClientResponse, consu
return nil
}
+
+// NewBasicAPIOperatorNotModified creates a BasicAPIOperatorNotModified with default headers values
+func NewBasicAPIOperatorNotModified() *BasicAPIOperatorNotModified {
+ return &BasicAPIOperatorNotModified{}
+}
+
+/* BasicAPIOperatorNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BasicAPIOperatorNotModified struct {
+}
+
+func (o *BasicAPIOperatorNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Basic/Operator][%d] basicApiOperatorNotModified ", 304)
+}
+
+func (o *BasicAPIOperatorNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/basic/v2/client/basic/basic_api_provider_parameters.go b/basic/v2/client/basic/basic_api_provider_parameters.go
index cb4a0431..9ca4f081 100644
--- a/basic/v2/client/basic/basic_api_provider_parameters.go
+++ b/basic/v2/client/basic/basic_api_provider_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewBasicAPIProviderParams creates a new BasicAPIProviderParams object
-// with the default values initialized.
+// NewBasicAPIProviderParams creates a new BasicAPIProviderParams 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 NewBasicAPIProviderParams() *BasicAPIProviderParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIProviderParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewBasicAPIProviderParamsWithTimeout creates a new BasicAPIProviderParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewBasicAPIProviderParamsWithTimeout(timeout time.Duration) *BasicAPIProviderParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIProviderParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewBasicAPIProviderParamsWithContext creates a new BasicAPIProviderParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewBasicAPIProviderParamsWithContext(ctx context.Context) *BasicAPIProviderParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIProviderParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewBasicAPIProviderParamsWithHTTPClient creates a new BasicAPIProviderParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewBasicAPIProviderParamsWithHTTPClient(client *http.Client) *BasicAPIProviderParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BasicAPIProviderParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*BasicAPIProviderParams contains all the parameters to send to the API endpoint
-for the basic Api provider operation typically these are written to a http.Request
+/* BasicAPIProviderParams contains all the parameters to send to the API endpoint
+ for the basic Api provider operation.
+
+ Typically these are written to a http.Request.
*/
type BasicAPIProviderParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type BasicAPIProviderParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the basic Api provider params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BasicAPIProviderParams) WithDefaults() *BasicAPIProviderParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the basic Api provider params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BasicAPIProviderParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BasicAPIProviderParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the basic Api provider params
func (o *BasicAPIProviderParams) WithTimeout(timeout time.Duration) *BasicAPIProviderParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *BasicAPIProviderParams) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -245,64 +267,68 @@ func (o *BasicAPIProviderParams) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/basic/v2/client/basic/basic_api_provider_responses.go b/basic/v2/client/basic/basic_api_provider_responses.go
index b427f8d7..7beef94f 100644
--- a/basic/v2/client/basic/basic_api_provider_responses.go
+++ b/basic/v2/client/basic/basic_api_provider_responses.go
@@ -29,7 +29,12 @@ func (o *BasicAPIProviderReader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewBasicAPIProviderNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewBasicAPIProviderOK() *BasicAPIProviderOK {
return &BasicAPIProviderOK{}
}
-/*BasicAPIProviderOK handles this case with default header values.
+/* BasicAPIProviderOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type BasicAPIProviderOK struct {
func (o *BasicAPIProviderOK) Error() string {
return fmt.Sprintf("[GET /v2/Basic/Provider][%d] basicApiProviderOK %+v", 200, o.Payload)
}
-
func (o *BasicAPIProviderOK) GetPayload() []*models.PTXServiceDTOSharedSpecificationV2BaseProvider {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *BasicAPIProviderOK) readResponse(response runtime.ClientResponse, consu
return nil
}
+
+// NewBasicAPIProviderNotModified creates a BasicAPIProviderNotModified with default headers values
+func NewBasicAPIProviderNotModified() *BasicAPIProviderNotModified {
+ return &BasicAPIProviderNotModified{}
+}
+
+/* BasicAPIProviderNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BasicAPIProviderNotModified struct {
+}
+
+func (o *BasicAPIProviderNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Basic/Provider][%d] basicApiProviderNotModified ", 304)
+}
+
+func (o *BasicAPIProviderNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/basic/v2/client/basic/web_site_api_news_parameters.go b/basic/v2/client/basic/web_site_api_news_parameters.go
index 86c9ddb9..9982dc11 100644
--- a/basic/v2/client/basic/web_site_api_news_parameters.go
+++ b/basic/v2/client/basic/web_site_api_news_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewWebSiteAPINewsParams creates a new WebSiteAPINewsParams object
-// with the default values initialized.
+// NewWebSiteAPINewsParams creates a new WebSiteAPINewsParams 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 NewWebSiteAPINewsParams() *WebSiteAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &WebSiteAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewWebSiteAPINewsParamsWithTimeout creates a new WebSiteAPINewsParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewWebSiteAPINewsParamsWithTimeout(timeout time.Duration) *WebSiteAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &WebSiteAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewWebSiteAPINewsParamsWithContext creates a new WebSiteAPINewsParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewWebSiteAPINewsParamsWithContext(ctx context.Context) *WebSiteAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &WebSiteAPINewsParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewWebSiteAPINewsParamsWithHTTPClient creates a new WebSiteAPINewsParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewWebSiteAPINewsParamsWithHTTPClient(client *http.Client) *WebSiteAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &WebSiteAPINewsParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*WebSiteAPINewsParams contains all the parameters to send to the API endpoint
-for the web site Api news operation typically these are written to a http.Request
+/* WebSiteAPINewsParams contains all the parameters to send to the API endpoint
+ for the web site Api news operation.
+
+ Typically these are written to a http.Request.
*/
type WebSiteAPINewsParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type WebSiteAPINewsParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the web site Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *WebSiteAPINewsParams) WithDefaults() *WebSiteAPINewsParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the web site Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *WebSiteAPINewsParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := WebSiteAPINewsParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the web site Api news params
func (o *WebSiteAPINewsParams) WithTimeout(timeout time.Duration) *WebSiteAPINewsParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *WebSiteAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
@@ -277,64 +301,68 @@ func (o *WebSiteAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/basic/v2/client/basic/web_site_api_news_responses.go b/basic/v2/client/basic/web_site_api_news_responses.go
index 73d47273..1b0b6168 100644
--- a/basic/v2/client/basic/web_site_api_news_responses.go
+++ b/basic/v2/client/basic/web_site_api_news_responses.go
@@ -29,7 +29,12 @@ func (o *WebSiteAPINewsReader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewWebSiteAPINewsNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewWebSiteAPINewsOK() *WebSiteAPINewsOK {
return &WebSiteAPINewsOK{}
}
-/*WebSiteAPINewsOK handles this case with default header values.
+/* WebSiteAPINewsOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type WebSiteAPINewsOK struct {
func (o *WebSiteAPINewsOK) Error() string {
return fmt.Sprintf("[GET /v2/PTX/Web/News][%d] webSiteApiNewsOK %+v", 200, o.Payload)
}
-
func (o *WebSiteAPINewsOK) GetPayload() *models.PTXAPIBasicModelV2BasicWrapperPTXServiceDTOSharedSpecificationV2BaseNews {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *WebSiteAPINewsOK) readResponse(response runtime.ClientResponse, consume
return nil
}
+
+// NewWebSiteAPINewsNotModified creates a WebSiteAPINewsNotModified with default headers values
+func NewWebSiteAPINewsNotModified() *WebSiteAPINewsNotModified {
+ return &WebSiteAPINewsNotModified{}
+}
+
+/* WebSiteAPINewsNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type WebSiteAPINewsNotModified struct {
+}
+
+func (o *WebSiteAPINewsNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/PTX/Web/News][%d] webSiteApiNewsNotModified ", 304)
+}
+
+func (o *WebSiteAPINewsNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
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 0a4f58dd..97753261 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
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -106,6 +107,38 @@ func (m *PTXAPIBasicModelV2BasicWrapperPTXServiceDTOSharedSpecificationV2BaseNew
return nil
}
+// ContextValidate validate this p t x API basic model v2 basic wrapper p t x service d t o shared specification v2 base news based on the context it is used
+func (m *PTXAPIBasicModelV2BasicWrapperPTXServiceDTOSharedSpecificationV2BaseNews) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateNewses(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIBasicModelV2BasicWrapperPTXServiceDTOSharedSpecificationV2BaseNews) contextValidateNewses(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Newses); i++ {
+
+ if m.Newses[i] != nil {
+ if err := m.Newses[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Newses" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIBasicModelV2BasicWrapperPTXServiceDTOSharedSpecificationV2BaseNews) MarshalBinary() ([]byte, error) {
if m == 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 17239dba..02059141 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
@@ -6,6 +6,8 @@ package models
// 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"
@@ -119,6 +121,25 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseAuthority) validateUpdateTime(for
return nil
}
+// ContextValidate validate this p t x service d t o shared specification v2 base authority based on the context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseAuthority) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAuthorityName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOSharedSpecificationV2BaseAuthority) contextValidateAuthorityName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseAuthority) MarshalBinary() ([]byte, error) {
if m == 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 ae2f0ea5..b757afa0 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
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -33,6 +35,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) Validate(formats strfmt
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base name type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) MarshalBinary() ([]byte, error) {
if m == nil {
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 a095e3ce..2520e839 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
@@ -6,6 +6,8 @@ package models
// 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"
@@ -137,6 +139,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNews) validateNewsID(formats strf
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
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseNews) MarshalBinary() ([]byte, error) {
if m == 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 84cf731f..cead550e 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
@@ -6,6 +6,8 @@ package models
// 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"
@@ -191,6 +193,25 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) validateUpdateTime(form
return nil
}
+// ContextValidate validate this p t x service d t o shared specification v2 base operator based on the context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) MarshalBinary() ([]byte, error) {
if m == 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 22517637..2c4c1e9b 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
@@ -6,6 +6,8 @@ package models
// 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"
@@ -119,6 +121,25 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseProvider) validateUpdateTime(form
return nil
}
+// ContextValidate validate this p t x service d t o shared specification v2 base provider based on the context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseProvider) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateProviderName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOSharedSpecificationV2BaseProvider) contextValidateProviderName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseProvider) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bike/v2/client/advanced/advanced_client.go b/bike/v2/client/advanced/advanced_client.go
new file mode 100644
index 00000000..e33a0b09
--- /dev/null
+++ b/bike/v2/client/advanced/advanced_client.go
@@ -0,0 +1,112 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "fmt"
+
+ "github.com/go-openapi/runtime"
+ "github.com/go-openapi/strfmt"
+)
+
+// New creates a new advanced API client.
+func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
+ return &Client{transport: transport, formats: formats}
+}
+
+/*
+Client for advanced API
+*/
+type Client struct {
+ transport runtime.ClientTransport
+ formats strfmt.Registry
+}
+
+// ClientService is the interface for Client methods
+type ClientService interface {
+ BikeAPIAvailabilityAllCityNearBy(params *BikeAPIAvailabilityAllCityNearByParams) (*BikeAPIAvailabilityAllCityNearByOK, error)
+
+ BikeAPIStationAllCityNearBy(params *BikeAPIStationAllCityNearByParams) (*BikeAPIStationAllCityNearByOK, error)
+
+ SetTransport(transport runtime.ClientTransport)
+}
+
+/*
+ BikeAPIAvailabilityAllCityNearBy 取得指定s 位置 範圍 的全臺公共自行車即時車位資料
+
+ 取得指定[位置,範圍]的全臺公共自行車即時車位資料
+*/
+func (a *Client) BikeAPIAvailabilityAllCityNearBy(params *BikeAPIAvailabilityAllCityNearByParams) (*BikeAPIAvailabilityAllCityNearByOK, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewBikeAPIAvailabilityAllCityNearByParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "BikeApi_Availability_AllCity_NearBy",
+ Method: "GET",
+ PathPattern: "/v2/Bike/Availability/NearBy",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &BikeAPIAvailabilityAllCityNearByReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, err
+ }
+ success, ok := result.(*BikeAPIAvailabilityAllCityNearByOK)
+ if ok {
+ return success, nil
+ }
+ // unexpected success response
+ // 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 BikeApi_Availability_AllCity_NearBy: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+/*
+ BikeAPIStationAllCityNearBy 取得指定s 位置 範圍 的全臺公共自行車租借站位資料
+
+ 取得指定[位置,範圍]的全臺公共自行車租借站位資料
+*/
+func (a *Client) BikeAPIStationAllCityNearBy(params *BikeAPIStationAllCityNearByParams) (*BikeAPIStationAllCityNearByOK, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewBikeAPIStationAllCityNearByParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "BikeApi_Station_AllCity_NearBy",
+ Method: "GET",
+ PathPattern: "/v2/Bike/Station/NearBy",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &BikeAPIStationAllCityNearByReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, err
+ }
+ success, ok := result.(*BikeAPIStationAllCityNearByOK)
+ if ok {
+ return success, nil
+ }
+ // unexpected success response
+ // 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 BikeApi_Station_AllCity_NearBy: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+// SetTransport changes the transport on the client
+func (a *Client) SetTransport(transport runtime.ClientTransport) {
+ a.transport = transport
+}
diff --git a/bike/v2/client/advanced/bike_api_availability_all_city_near_by_parameters.go b/bike/v2/client/advanced/bike_api_availability_all_city_near_by_parameters.go
new file mode 100644
index 00000000..465abb62
--- /dev/null
+++ b/bike/v2/client/advanced/bike_api_availability_all_city_near_by_parameters.go
@@ -0,0 +1,365 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// NewBikeAPIAvailabilityAllCityNearByParams creates a new BikeAPIAvailabilityAllCityNearByParams 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 NewBikeAPIAvailabilityAllCityNearByParams() *BikeAPIAvailabilityAllCityNearByParams {
+ return &BikeAPIAvailabilityAllCityNearByParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewBikeAPIAvailabilityAllCityNearByParamsWithTimeout creates a new BikeAPIAvailabilityAllCityNearByParams object
+// with the ability to set a timeout on a request.
+func NewBikeAPIAvailabilityAllCityNearByParamsWithTimeout(timeout time.Duration) *BikeAPIAvailabilityAllCityNearByParams {
+ return &BikeAPIAvailabilityAllCityNearByParams{
+ timeout: timeout,
+ }
+}
+
+// NewBikeAPIAvailabilityAllCityNearByParamsWithContext creates a new BikeAPIAvailabilityAllCityNearByParams object
+// with the ability to set a context for a request.
+func NewBikeAPIAvailabilityAllCityNearByParamsWithContext(ctx context.Context) *BikeAPIAvailabilityAllCityNearByParams {
+ return &BikeAPIAvailabilityAllCityNearByParams{
+ Context: ctx,
+ }
+}
+
+// NewBikeAPIAvailabilityAllCityNearByParamsWithHTTPClient creates a new BikeAPIAvailabilityAllCityNearByParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewBikeAPIAvailabilityAllCityNearByParamsWithHTTPClient(client *http.Client) *BikeAPIAvailabilityAllCityNearByParams {
+ return &BikeAPIAvailabilityAllCityNearByParams{
+ HTTPClient: client,
+ }
+}
+
+/* BikeAPIAvailabilityAllCityNearByParams contains all the parameters to send to the API endpoint
+ for the bike Api availability all city near by operation.
+
+ Typically these are written to a http.Request.
+*/
+type BikeAPIAvailabilityAllCityNearByParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarSpatialFilter.
+
+ 空間過濾(最大搜尋半徑為1000公尺)
+ */
+ DollarSpatialFilter string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the bike Api availability all city near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithDefaults() *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the bike Api availability all city near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BikeAPIAvailabilityAllCityNearByParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithTimeout(timeout time.Duration) *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithContext(ctx context.Context) *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithHTTPClient(client *http.Client) *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithDollarFilter(dollarFilter *string) *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithDollarFormat(dollarFormat string) *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithDollarOrderby(dollarOrderby *string) *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithDollarSelect(dollarSelect *string) *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithDollarSkip(dollarSkip *string) *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarSpatialFilter adds the dollarSpatialFilter to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithDollarSpatialFilter(dollarSpatialFilter string) *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetDollarSpatialFilter(dollarSpatialFilter)
+ return o
+}
+
+// SetDollarSpatialFilter adds the dollarSpatialFilter to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetDollarSpatialFilter(dollarSpatialFilter string) {
+ o.DollarSpatialFilter = dollarSpatialFilter
+}
+
+// WithDollarTop adds the dollarTop to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) WithDollarTop(dollarTop *int64) *BikeAPIAvailabilityAllCityNearByParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the bike Api availability all city near by params
+func (o *BikeAPIAvailabilityAllCityNearByParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *BikeAPIAvailabilityAllCityNearByParams) 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
+ }
+ }
+ }
+
+ // query param $spatialFilter
+ qrDollarSpatialFilter := o.DollarSpatialFilter
+ qDollarSpatialFilter := qrDollarSpatialFilter
+ if qDollarSpatialFilter != "" {
+
+ if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
+ }
+ }
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
diff --git a/bike/v2/client/advanced/bike_api_availability_all_city_near_by_responses.go b/bike/v2/client/advanced/bike_api_availability_all_city_near_by_responses.go
new file mode 100644
index 00000000..a625680d
--- /dev/null
+++ b/bike/v2/client/advanced/bike_api_availability_all_city_near_by_responses.go
@@ -0,0 +1,92 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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/bike/v2/models"
+)
+
+// BikeAPIAvailabilityAllCityNearByReader is a Reader for the BikeAPIAvailabilityAllCityNearBy structure.
+type BikeAPIAvailabilityAllCityNearByReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *BikeAPIAvailabilityAllCityNearByReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewBikeAPIAvailabilityAllCityNearByOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewBikeAPIAvailabilityAllCityNearByNotModified()
+ 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())
+ }
+}
+
+// NewBikeAPIAvailabilityAllCityNearByOK creates a BikeAPIAvailabilityAllCityNearByOK with default headers values
+func NewBikeAPIAvailabilityAllCityNearByOK() *BikeAPIAvailabilityAllCityNearByOK {
+ return &BikeAPIAvailabilityAllCityNearByOK{}
+}
+
+/* BikeAPIAvailabilityAllCityNearByOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type BikeAPIAvailabilityAllCityNearByOK struct {
+ Payload []*models.PTXServiceDTOBikeSpecificationV2BikeAvailability
+}
+
+func (o *BikeAPIAvailabilityAllCityNearByOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bike/Availability/NearBy][%d] bikeApiAvailabilityAllCityNearByOK %+v", 200, o.Payload)
+}
+func (o *BikeAPIAvailabilityAllCityNearByOK) GetPayload() []*models.PTXServiceDTOBikeSpecificationV2BikeAvailability {
+ return o.Payload
+}
+
+func (o *BikeAPIAvailabilityAllCityNearByOK) 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
+}
+
+// NewBikeAPIAvailabilityAllCityNearByNotModified creates a BikeAPIAvailabilityAllCityNearByNotModified with default headers values
+func NewBikeAPIAvailabilityAllCityNearByNotModified() *BikeAPIAvailabilityAllCityNearByNotModified {
+ return &BikeAPIAvailabilityAllCityNearByNotModified{}
+}
+
+/* BikeAPIAvailabilityAllCityNearByNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BikeAPIAvailabilityAllCityNearByNotModified struct {
+}
+
+func (o *BikeAPIAvailabilityAllCityNearByNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bike/Availability/NearBy][%d] bikeApiAvailabilityAllCityNearByNotModified ", 304)
+}
+
+func (o *BikeAPIAvailabilityAllCityNearByNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bike/v2/client/advanced/bike_api_station_all_city_near_by_parameters.go b/bike/v2/client/advanced/bike_api_station_all_city_near_by_parameters.go
new file mode 100644
index 00000000..1d423ca1
--- /dev/null
+++ b/bike/v2/client/advanced/bike_api_station_all_city_near_by_parameters.go
@@ -0,0 +1,365 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// NewBikeAPIStationAllCityNearByParams creates a new BikeAPIStationAllCityNearByParams 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 NewBikeAPIStationAllCityNearByParams() *BikeAPIStationAllCityNearByParams {
+ return &BikeAPIStationAllCityNearByParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewBikeAPIStationAllCityNearByParamsWithTimeout creates a new BikeAPIStationAllCityNearByParams object
+// with the ability to set a timeout on a request.
+func NewBikeAPIStationAllCityNearByParamsWithTimeout(timeout time.Duration) *BikeAPIStationAllCityNearByParams {
+ return &BikeAPIStationAllCityNearByParams{
+ timeout: timeout,
+ }
+}
+
+// NewBikeAPIStationAllCityNearByParamsWithContext creates a new BikeAPIStationAllCityNearByParams object
+// with the ability to set a context for a request.
+func NewBikeAPIStationAllCityNearByParamsWithContext(ctx context.Context) *BikeAPIStationAllCityNearByParams {
+ return &BikeAPIStationAllCityNearByParams{
+ Context: ctx,
+ }
+}
+
+// NewBikeAPIStationAllCityNearByParamsWithHTTPClient creates a new BikeAPIStationAllCityNearByParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewBikeAPIStationAllCityNearByParamsWithHTTPClient(client *http.Client) *BikeAPIStationAllCityNearByParams {
+ return &BikeAPIStationAllCityNearByParams{
+ HTTPClient: client,
+ }
+}
+
+/* BikeAPIStationAllCityNearByParams contains all the parameters to send to the API endpoint
+ for the bike Api station all city near by operation.
+
+ Typically these are written to a http.Request.
+*/
+type BikeAPIStationAllCityNearByParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarSpatialFilter.
+
+ 空間過濾(最大搜尋半徑為1000公尺)
+ */
+ DollarSpatialFilter string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the bike Api station all city near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BikeAPIStationAllCityNearByParams) WithDefaults() *BikeAPIStationAllCityNearByParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the bike Api station all city near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BikeAPIStationAllCityNearByParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BikeAPIStationAllCityNearByParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) WithTimeout(timeout time.Duration) *BikeAPIStationAllCityNearByParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) WithContext(ctx context.Context) *BikeAPIStationAllCityNearByParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) WithHTTPClient(client *http.Client) *BikeAPIStationAllCityNearByParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) WithDollarFilter(dollarFilter *string) *BikeAPIStationAllCityNearByParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) WithDollarFormat(dollarFormat string) *BikeAPIStationAllCityNearByParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) WithDollarOrderby(dollarOrderby *string) *BikeAPIStationAllCityNearByParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) WithDollarSelect(dollarSelect *string) *BikeAPIStationAllCityNearByParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) WithDollarSkip(dollarSkip *string) *BikeAPIStationAllCityNearByParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarSpatialFilter adds the dollarSpatialFilter to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) WithDollarSpatialFilter(dollarSpatialFilter string) *BikeAPIStationAllCityNearByParams {
+ o.SetDollarSpatialFilter(dollarSpatialFilter)
+ return o
+}
+
+// SetDollarSpatialFilter adds the dollarSpatialFilter to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) SetDollarSpatialFilter(dollarSpatialFilter string) {
+ o.DollarSpatialFilter = dollarSpatialFilter
+}
+
+// WithDollarTop adds the dollarTop to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) WithDollarTop(dollarTop *int64) *BikeAPIStationAllCityNearByParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the bike Api station all city near by params
+func (o *BikeAPIStationAllCityNearByParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *BikeAPIStationAllCityNearByParams) 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
+ }
+ }
+ }
+
+ // query param $spatialFilter
+ qrDollarSpatialFilter := o.DollarSpatialFilter
+ qDollarSpatialFilter := qrDollarSpatialFilter
+ if qDollarSpatialFilter != "" {
+
+ if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
+ }
+ }
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
diff --git a/bike/v2/client/advanced/bike_api_station_all_city_near_by_responses.go b/bike/v2/client/advanced/bike_api_station_all_city_near_by_responses.go
new file mode 100644
index 00000000..cd68f535
--- /dev/null
+++ b/bike/v2/client/advanced/bike_api_station_all_city_near_by_responses.go
@@ -0,0 +1,92 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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/bike/v2/models"
+)
+
+// BikeAPIStationAllCityNearByReader is a Reader for the BikeAPIStationAllCityNearBy structure.
+type BikeAPIStationAllCityNearByReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *BikeAPIStationAllCityNearByReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewBikeAPIStationAllCityNearByOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewBikeAPIStationAllCityNearByNotModified()
+ 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())
+ }
+}
+
+// NewBikeAPIStationAllCityNearByOK creates a BikeAPIStationAllCityNearByOK with default headers values
+func NewBikeAPIStationAllCityNearByOK() *BikeAPIStationAllCityNearByOK {
+ return &BikeAPIStationAllCityNearByOK{}
+}
+
+/* BikeAPIStationAllCityNearByOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type BikeAPIStationAllCityNearByOK struct {
+ Payload []*models.PTXServiceDTOBikeSpecificationV2BikeStation
+}
+
+func (o *BikeAPIStationAllCityNearByOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bike/Station/NearBy][%d] bikeApiStationAllCityNearByOK %+v", 200, o.Payload)
+}
+func (o *BikeAPIStationAllCityNearByOK) GetPayload() []*models.PTXServiceDTOBikeSpecificationV2BikeStation {
+ return o.Payload
+}
+
+func (o *BikeAPIStationAllCityNearByOK) 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
+}
+
+// NewBikeAPIStationAllCityNearByNotModified creates a BikeAPIStationAllCityNearByNotModified with default headers values
+func NewBikeAPIStationAllCityNearByNotModified() *BikeAPIStationAllCityNearByNotModified {
+ return &BikeAPIStationAllCityNearByNotModified{}
+}
+
+/* BikeAPIStationAllCityNearByNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BikeAPIStationAllCityNearByNotModified struct {
+}
+
+func (o *BikeAPIStationAllCityNearByNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bike/Station/NearBy][%d] bikeApiStationAllCityNearByNotModified ", 304)
+}
+
+func (o *BikeAPIStationAllCityNearByNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bike/v2/client/bike/bike_api_availability_parameters.go b/bike/v2/client/bike/bike_api_availability_parameters.go
index 9b9c90e1..008256d4 100644
--- a/bike/v2/client/bike/bike_api_availability_parameters.go
+++ b/bike/v2/client/bike/bike_api_availability_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewBikeAPIAvailabilityParams creates a new BikeAPIAvailabilityParams object
-// with the default values initialized.
+// NewBikeAPIAvailabilityParams creates a new BikeAPIAvailabilityParams 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 NewBikeAPIAvailabilityParams() *BikeAPIAvailabilityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BikeAPIAvailabilityParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewBikeAPIAvailabilityParamsWithTimeout creates a new BikeAPIAvailabilityParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewBikeAPIAvailabilityParamsWithTimeout(timeout time.Duration) *BikeAPIAvailabilityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BikeAPIAvailabilityParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewBikeAPIAvailabilityParamsWithContext creates a new BikeAPIAvailabilityParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewBikeAPIAvailabilityParamsWithContext(ctx context.Context) *BikeAPIAvailabilityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BikeAPIAvailabilityParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewBikeAPIAvailabilityParamsWithHTTPClient creates a new BikeAPIAvailabilityParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewBikeAPIAvailabilityParamsWithHTTPClient(client *http.Client) *BikeAPIAvailabilityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BikeAPIAvailabilityParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*BikeAPIAvailabilityParams contains all the parameters to send to the API endpoint
-for the bike Api availability operation typically these are written to a http.Request
+/* BikeAPIAvailabilityParams contains all the parameters to send to the API endpoint
+ for the bike Api availability operation.
+
+ Typically these are written to a http.Request.
*/
type BikeAPIAvailabilityParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
@@ -114,6 +109,32 @@ type BikeAPIAvailabilityParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the bike Api availability params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BikeAPIAvailabilityParams) WithDefaults() *BikeAPIAvailabilityParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the bike Api availability params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BikeAPIAvailabilityParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BikeAPIAvailabilityParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the bike Api availability params
func (o *BikeAPIAvailabilityParams) WithTimeout(timeout time.Duration) *BikeAPIAvailabilityParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *BikeAPIAvailabilityParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -261,64 +284,68 @@ func (o *BikeAPIAvailabilityParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
diff --git a/bike/v2/client/bike/bike_api_availability_responses.go b/bike/v2/client/bike/bike_api_availability_responses.go
index 56bd7ed5..7945da1c 100644
--- a/bike/v2/client/bike/bike_api_availability_responses.go
+++ b/bike/v2/client/bike/bike_api_availability_responses.go
@@ -29,7 +29,12 @@ func (o *BikeAPIAvailabilityReader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewBikeAPIAvailabilityNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewBikeAPIAvailabilityOK() *BikeAPIAvailabilityOK {
return &BikeAPIAvailabilityOK{}
}
-/*BikeAPIAvailabilityOK handles this case with default header values.
+/* BikeAPIAvailabilityOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type BikeAPIAvailabilityOK struct {
func (o *BikeAPIAvailabilityOK) Error() string {
return fmt.Sprintf("[GET /v2/Bike/Availability/{City}][%d] bikeApiAvailabilityOK %+v", 200, o.Payload)
}
-
func (o *BikeAPIAvailabilityOK) GetPayload() []*models.PTXServiceDTOBikeSpecificationV2BikeAvailability {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *BikeAPIAvailabilityOK) readResponse(response runtime.ClientResponse, co
return nil
}
+
+// NewBikeAPIAvailabilityNotModified creates a BikeAPIAvailabilityNotModified with default headers values
+func NewBikeAPIAvailabilityNotModified() *BikeAPIAvailabilityNotModified {
+ return &BikeAPIAvailabilityNotModified{}
+}
+
+/* BikeAPIAvailabilityNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BikeAPIAvailabilityNotModified struct {
+}
+
+func (o *BikeAPIAvailabilityNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bike/Availability/{City}][%d] bikeApiAvailabilityNotModified ", 304)
+}
+
+func (o *BikeAPIAvailabilityNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bike/v2/client/bike/bike_api_station_parameters.go b/bike/v2/client/bike/bike_api_station_parameters.go
index 4362f1cd..449b6ece 100644
--- a/bike/v2/client/bike/bike_api_station_parameters.go
+++ b/bike/v2/client/bike/bike_api_station_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewBikeAPIStationParams creates a new BikeAPIStationParams object
-// with the default values initialized.
+// NewBikeAPIStationParams creates a new BikeAPIStationParams 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 NewBikeAPIStationParams() *BikeAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BikeAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewBikeAPIStationParamsWithTimeout creates a new BikeAPIStationParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewBikeAPIStationParamsWithTimeout(timeout time.Duration) *BikeAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BikeAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewBikeAPIStationParamsWithContext creates a new BikeAPIStationParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewBikeAPIStationParamsWithContext(ctx context.Context) *BikeAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BikeAPIStationParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewBikeAPIStationParamsWithHTTPClient creates a new BikeAPIStationParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewBikeAPIStationParamsWithHTTPClient(client *http.Client) *BikeAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &BikeAPIStationParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*BikeAPIStationParams contains all the parameters to send to the API endpoint
-for the bike Api station operation typically these are written to a http.Request
+/* BikeAPIStationParams contains all the parameters to send to the API endpoint
+ for the bike Api station operation.
+
+ Typically these are written to a http.Request.
*/
type BikeAPIStationParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
@@ -119,6 +115,32 @@ type BikeAPIStationParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the bike Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BikeAPIStationParams) WithDefaults() *BikeAPIStationParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the bike Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BikeAPIStationParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BikeAPIStationParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the bike Api station params
func (o *BikeAPIStationParams) WithTimeout(timeout time.Duration) *BikeAPIStationParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *BikeAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
@@ -277,80 +301,85 @@ func (o *BikeAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
diff --git a/bike/v2/client/bike/bike_api_station_responses.go b/bike/v2/client/bike/bike_api_station_responses.go
index 0e5649ac..a4bf9d9f 100644
--- a/bike/v2/client/bike/bike_api_station_responses.go
+++ b/bike/v2/client/bike/bike_api_station_responses.go
@@ -29,7 +29,12 @@ func (o *BikeAPIStationReader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewBikeAPIStationNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewBikeAPIStationOK() *BikeAPIStationOK {
return &BikeAPIStationOK{}
}
-/*BikeAPIStationOK handles this case with default header values.
+/* BikeAPIStationOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type BikeAPIStationOK struct {
func (o *BikeAPIStationOK) Error() string {
return fmt.Sprintf("[GET /v2/Bike/Station/{City}][%d] bikeApiStationOK %+v", 200, o.Payload)
}
-
func (o *BikeAPIStationOK) GetPayload() []*models.PTXServiceDTOBikeSpecificationV2BikeStation {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *BikeAPIStationOK) readResponse(response runtime.ClientResponse, consume
return nil
}
+
+// NewBikeAPIStationNotModified creates a BikeAPIStationNotModified with default headers values
+func NewBikeAPIStationNotModified() *BikeAPIStationNotModified {
+ return &BikeAPIStationNotModified{}
+}
+
+/* BikeAPIStationNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BikeAPIStationNotModified struct {
+}
+
+func (o *BikeAPIStationNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bike/Station/{City}][%d] bikeApiStationNotModified ", 304)
+}
+
+func (o *BikeAPIStationNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bike/v2/client/bike/cycling_api_shape_parameters.go b/bike/v2/client/bike/cycling_api_shape_parameters.go
index 92dbcf57..7b5ba211 100644
--- a/bike/v2/client/bike/cycling_api_shape_parameters.go
+++ b/bike/v2/client/bike/cycling_api_shape_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewCyclingAPIShapeParams creates a new CyclingAPIShapeParams object
-// with the default values initialized.
+// NewCyclingAPIShapeParams creates a new CyclingAPIShapeParams 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 NewCyclingAPIShapeParams() *CyclingAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CyclingAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCyclingAPIShapeParamsWithTimeout creates a new CyclingAPIShapeParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCyclingAPIShapeParamsWithTimeout(timeout time.Duration) *CyclingAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CyclingAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCyclingAPIShapeParamsWithContext creates a new CyclingAPIShapeParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCyclingAPIShapeParamsWithContext(ctx context.Context) *CyclingAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CyclingAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCyclingAPIShapeParamsWithHTTPClient creates a new CyclingAPIShapeParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCyclingAPIShapeParamsWithHTTPClient(client *http.Client) *CyclingAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CyclingAPIShapeParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CyclingAPIShapeParams contains all the parameters to send to the API endpoint
-for the cycling Api shape operation typically these are written to a http.Request
+/* CyclingAPIShapeParams contains all the parameters to send to the API endpoint
+ for the cycling Api shape operation.
+
+ Typically these are written to a http.Request.
*/
type CyclingAPIShapeParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
@@ -114,6 +109,32 @@ type CyclingAPIShapeParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the cycling Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CyclingAPIShapeParams) WithDefaults() *CyclingAPIShapeParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the cycling Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CyclingAPIShapeParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CyclingAPIShapeParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the cycling Api shape params
func (o *CyclingAPIShapeParams) WithTimeout(timeout time.Duration) *CyclingAPIShapeParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *CyclingAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -261,64 +284,68 @@ func (o *CyclingAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
diff --git a/bike/v2/client/bike/cycling_api_shape_responses.go b/bike/v2/client/bike/cycling_api_shape_responses.go
index ea7ffdda..6abdb70f 100644
--- a/bike/v2/client/bike/cycling_api_shape_responses.go
+++ b/bike/v2/client/bike/cycling_api_shape_responses.go
@@ -29,7 +29,12 @@ func (o *CyclingAPIShapeReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCyclingAPIShapeNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewCyclingAPIShapeOK() *CyclingAPIShapeOK {
return &CyclingAPIShapeOK{}
}
-/*CyclingAPIShapeOK handles this case with default header values.
+/* CyclingAPIShapeOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type CyclingAPIShapeOK struct {
func (o *CyclingAPIShapeOK) Error() string {
return fmt.Sprintf("[GET /v2/Cycling/Shape/{City}][%d] cyclingApiShapeOK %+v", 200, o.Payload)
}
-
func (o *CyclingAPIShapeOK) GetPayload() []*models.PTXServiceDTOBikeSpecificationV2BikeShape {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *CyclingAPIShapeOK) readResponse(response runtime.ClientResponse, consum
return nil
}
+
+// NewCyclingAPIShapeNotModified creates a CyclingAPIShapeNotModified with default headers values
+func NewCyclingAPIShapeNotModified() *CyclingAPIShapeNotModified {
+ return &CyclingAPIShapeNotModified{}
+}
+
+/* CyclingAPIShapeNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CyclingAPIShapeNotModified struct {
+}
+
+func (o *CyclingAPIShapeNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Cycling/Shape/{City}][%d] cyclingApiShapeNotModified ", 304)
+}
+
+func (o *CyclingAPIShapeNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bike/v2/client/m_o_t_c_transport_api_v2_client.go b/bike/v2/client/m_o_t_c_transport_api_v2_client.go
index 108c89b5..7a779d09 100644
--- a/bike/v2/client/m_o_t_c_transport_api_v2_client.go
+++ b/bike/v2/client/m_o_t_c_transport_api_v2_client.go
@@ -10,6 +10,7 @@ import (
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
+ "github.com/minchao/go-ptx/bike/v2/client/advanced"
"github.com/minchao/go-ptx/bike/v2/client/bike"
)
@@ -55,6 +56,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *MOTCTransp
cli := new(MOTCTransportAPIV2)
cli.Transport = transport
+ cli.Advanced = advanced.New(transport, formats)
cli.Bike = bike.New(transport, formats)
return cli
}
@@ -100,6 +102,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
// MOTCTransportAPIV2 is a client for m o t c transport API v2
type MOTCTransportAPIV2 struct {
+ Advanced advanced.ClientService
+
Bike bike.ClientService
Transport runtime.ClientTransport
@@ -108,5 +112,6 @@ type MOTCTransportAPIV2 struct {
// SetTransport changes the transport on the client and all its subresources
func (c *MOTCTransportAPIV2) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
+ c.Advanced.SetTransport(transport)
c.Bike.SetTransport(transport)
}
diff --git a/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_availability.go b/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_availability.go
index 8f93d184..2ce9cbb7 100644
--- a/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_availability.go
+++ b/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_availability.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -79,6 +81,11 @@ func (m *PTXServiceDTOBikeSpecificationV2BikeAvailability) validateUpdateTime(fo
return nil
}
+// ContextValidate validates this p t x service d t o bike specification v2 bike availability based on context it is used
+func (m *PTXServiceDTOBikeSpecificationV2BikeAvailability) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBikeSpecificationV2BikeAvailability) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_shape.go b/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_shape.go
index c9a49819..4bd006a8 100644
--- a/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_shape.go
+++ b/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_shape.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -180,6 +182,11 @@ func (m *PTXServiceDTOBikeSpecificationV2BikeShape) validateUpdateTime(formats s
return nil
}
+// ContextValidate validates this p t x service d t o bike specification v2 bike shape based on context it is used
+func (m *PTXServiceDTOBikeSpecificationV2BikeShape) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBikeSpecificationV2BikeShape) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_station.go b/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_station.go
index 0d4b5586..83393bac 100644
--- a/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_station.go
+++ b/bike/v2/models/p_t_x_service_d_t_o_bike_specification_v2_bike_station.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -104,7 +106,6 @@ func (m *PTXServiceDTOBikeSpecificationV2BikeStation) Validate(formats strfmt.Re
}
func (m *PTXServiceDTOBikeSpecificationV2BikeStation) validateStationAddress(formats strfmt.Registry) error {
-
if swag.IsZero(m.StationAddress) { // not required
return nil
}
@@ -113,7 +114,6 @@ func (m *PTXServiceDTOBikeSpecificationV2BikeStation) validateStationAddress(for
}
func (m *PTXServiceDTOBikeSpecificationV2BikeStation) validateStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StationName) { // not required
return nil
}
@@ -122,7 +122,6 @@ func (m *PTXServiceDTOBikeSpecificationV2BikeStation) validateStationName(format
}
func (m *PTXServiceDTOBikeSpecificationV2BikeStation) validateStationPosition(formats strfmt.Registry) error {
-
if swag.IsZero(m.StationPosition) { // not required
return nil
}
@@ -139,6 +138,43 @@ func (m *PTXServiceDTOBikeSpecificationV2BikeStation) validateUpdateTime(formats
return nil
}
+// ContextValidate validate this p t x service d t o bike specification v2 bike station based on the context it is used
+func (m *PTXServiceDTOBikeSpecificationV2BikeStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationAddress(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBikeSpecificationV2BikeStation) contextValidateStationAddress(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBikeSpecificationV2BikeStation) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBikeSpecificationV2BikeStation) contextValidateStationPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBikeSpecificationV2BikeStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bike/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go b/bike/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
index ae2f0ea5..b757afa0 100644
--- a/bike/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
+++ b/bike/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -33,6 +35,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) Validate(formats strfmt
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base name type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bike/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go b/bike/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
index 33cfe90a..02645203 100644
--- a/bike/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
+++ b/bike/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -34,6 +36,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BasePointType) Validate(formats strfm
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base point type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BasePointType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BasePointType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/client/advanced/advanced_client.go b/bus/v2/client/advanced/advanced_client.go
new file mode 100644
index 00000000..a5bbe588
--- /dev/null
+++ b/bus/v2/client/advanced/advanced_client.go
@@ -0,0 +1,270 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "fmt"
+
+ "github.com/go-openapi/runtime"
+ "github.com/go-openapi/strfmt"
+)
+
+// New creates a new advanced API client.
+func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
+ return &Client{transport: transport, formats: formats}
+}
+
+/*
+Client for advanced API
+*/
+type Client struct {
+ transport runtime.ClientTransport
+ formats strfmt.Registry
+}
+
+// ClientService is the interface for Client methods
+type ClientService interface {
+ BusAPIEstimatedTimeOfArrivalNearBy(params *BusAPIEstimatedTimeOfArrivalNearByParams) (*BusAPIEstimatedTimeOfArrivalNearByOK, *BusAPIEstimatedTimeOfArrivalNearByStatus299, error)
+
+ BusAPIRealTimeByFrequencyNearBy(params *BusAPIRealTimeByFrequencyNearByParams) (*BusAPIRealTimeByFrequencyNearByOK, *BusAPIRealTimeByFrequencyNearByStatus299, error)
+
+ BusAPIRealTimeNearStopNearBy(params *BusAPIRealTimeNearStopNearByParams) (*BusAPIRealTimeNearStopNearByOK, *BusAPIRealTimeNearStopNearByStatus299, error)
+
+ BusAPIRouteNearBy(params *BusAPIRouteNearByParams) (*BusAPIRouteNearByOK, *BusAPIRouteNearByStatus299, error)
+
+ BusAPIStationNearBy(params *BusAPIStationNearByParams) (*BusAPIStationNearByOK, *BusAPIStationNearByStatus299, error)
+
+ BusAPIStopNearBy(params *BusAPIStopNearByParams) (*BusAPIStopNearByOK, *BusAPIStopNearByStatus299, error)
+
+ SetTransport(transport runtime.ClientTransport)
+}
+
+/*
+ BusAPIEstimatedTimeOfArrivalNearBy 取得指定s 位置 範圍 的全臺公車預估到站資料 n1
+
+ 取得指定[位置,範圍]的全臺公車預估到站資料(N1)
+*/
+func (a *Client) BusAPIEstimatedTimeOfArrivalNearBy(params *BusAPIEstimatedTimeOfArrivalNearByParams) (*BusAPIEstimatedTimeOfArrivalNearByOK, *BusAPIEstimatedTimeOfArrivalNearByStatus299, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewBusAPIEstimatedTimeOfArrivalNearByParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "BusApi_EstimatedTimeOfArrival_NearBy",
+ Method: "GET",
+ PathPattern: "/v2/Bus/EstimatedTimeOfArrival/NearBy",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &BusAPIEstimatedTimeOfArrivalNearByReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, nil, err
+ }
+ switch value := result.(type) {
+ case *BusAPIEstimatedTimeOfArrivalNearByOK:
+ return value, nil, nil
+ case *BusAPIEstimatedTimeOfArrivalNearByStatus299:
+ 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 advanced: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+/*
+ BusAPIRealTimeByFrequencyNearBy 取得指定s 位置 範圍 的全臺公車動態定時資料 a1
+
+ 取得指定[位置,範圍]的全臺公車動態定時資料(A1)
+*/
+func (a *Client) BusAPIRealTimeByFrequencyNearBy(params *BusAPIRealTimeByFrequencyNearByParams) (*BusAPIRealTimeByFrequencyNearByOK, *BusAPIRealTimeByFrequencyNearByStatus299, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewBusAPIRealTimeByFrequencyNearByParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "BusApi_RealTimeByFrequency_NearBy",
+ Method: "GET",
+ PathPattern: "/v2/Bus/RealTimeByFrequency/NearBy",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &BusAPIRealTimeByFrequencyNearByReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, nil, err
+ }
+ switch value := result.(type) {
+ case *BusAPIRealTimeByFrequencyNearByOK:
+ return value, nil, nil
+ case *BusAPIRealTimeByFrequencyNearByStatus299:
+ 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 advanced: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+/*
+ BusAPIRealTimeNearStopNearBy 取得指定s 位置 範圍 的全臺公車動態定點資料 a2
+
+ 取得指定[位置,範圍]的全臺公車動態定點資料(A2)
+*/
+func (a *Client) BusAPIRealTimeNearStopNearBy(params *BusAPIRealTimeNearStopNearByParams) (*BusAPIRealTimeNearStopNearByOK, *BusAPIRealTimeNearStopNearByStatus299, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewBusAPIRealTimeNearStopNearByParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "BusApi_RealTimeNearStop_NearBy",
+ Method: "GET",
+ PathPattern: "/v2/Bus/RealTimeNearStop/NearBy",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &BusAPIRealTimeNearStopNearByReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, nil, err
+ }
+ switch value := result.(type) {
+ case *BusAPIRealTimeNearStopNearByOK:
+ return value, nil, nil
+ case *BusAPIRealTimeNearStopNearByStatus299:
+ 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 advanced: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+/*
+ BusAPIRouteNearBy 取得指定s 位置 範圍 的全臺公車路線資料
+
+ 取得指定[位置,範圍]的全臺公車路線資料
+*/
+func (a *Client) BusAPIRouteNearBy(params *BusAPIRouteNearByParams) (*BusAPIRouteNearByOK, *BusAPIRouteNearByStatus299, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewBusAPIRouteNearByParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "BusApi_Route_NearBy",
+ Method: "GET",
+ PathPattern: "/v2/Bus/Route/NearBy",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &BusAPIRouteNearByReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, nil, err
+ }
+ switch value := result.(type) {
+ case *BusAPIRouteNearByOK:
+ return value, nil, nil
+ case *BusAPIRouteNearByStatus299:
+ 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 advanced: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+/*
+ BusAPIStationNearBy 取得指定s 位置 範圍 的全臺公車站位資料
+
+ 取得指定[位置,範圍]的全臺公車站位資料
+*/
+func (a *Client) BusAPIStationNearBy(params *BusAPIStationNearByParams) (*BusAPIStationNearByOK, *BusAPIStationNearByStatus299, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewBusAPIStationNearByParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "BusApi_Station_NearBy",
+ Method: "GET",
+ PathPattern: "/v2/Bus/Station/NearBy",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &BusAPIStationNearByReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, nil, err
+ }
+ switch value := result.(type) {
+ case *BusAPIStationNearByOK:
+ return value, nil, nil
+ case *BusAPIStationNearByStatus299:
+ 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 advanced: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+/*
+ BusAPIStopNearBy 取得指定s 位置 範圍 的全臺公車站牌資料
+
+ 取得指定[位置,範圍]的全臺公車站牌資料
+*/
+func (a *Client) BusAPIStopNearBy(params *BusAPIStopNearByParams) (*BusAPIStopNearByOK, *BusAPIStopNearByStatus299, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewBusAPIStopNearByParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "BusApi_Stop_NearBy",
+ Method: "GET",
+ PathPattern: "/v2/Bus/Stop/NearBy",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &BusAPIStopNearByReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, nil, err
+ }
+ switch value := result.(type) {
+ case *BusAPIStopNearByOK:
+ return value, nil, nil
+ case *BusAPIStopNearByStatus299:
+ 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 advanced: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+// SetTransport changes the transport on the client
+func (a *Client) SetTransport(transport runtime.ClientTransport) {
+ a.transport = transport
+}
diff --git a/bus/v2/client/advanced/bus_api_estimated_time_of_arrival_near_by_parameters.go b/bus/v2/client/advanced/bus_api_estimated_time_of_arrival_near_by_parameters.go
new file mode 100644
index 00000000..35bd1e42
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_estimated_time_of_arrival_near_by_parameters.go
@@ -0,0 +1,399 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// NewBusAPIEstimatedTimeOfArrivalNearByParams creates a new BusAPIEstimatedTimeOfArrivalNearByParams 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 NewBusAPIEstimatedTimeOfArrivalNearByParams() *BusAPIEstimatedTimeOfArrivalNearByParams {
+ return &BusAPIEstimatedTimeOfArrivalNearByParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewBusAPIEstimatedTimeOfArrivalNearByParamsWithTimeout creates a new BusAPIEstimatedTimeOfArrivalNearByParams object
+// with the ability to set a timeout on a request.
+func NewBusAPIEstimatedTimeOfArrivalNearByParamsWithTimeout(timeout time.Duration) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ return &BusAPIEstimatedTimeOfArrivalNearByParams{
+ timeout: timeout,
+ }
+}
+
+// NewBusAPIEstimatedTimeOfArrivalNearByParamsWithContext creates a new BusAPIEstimatedTimeOfArrivalNearByParams object
+// with the ability to set a context for a request.
+func NewBusAPIEstimatedTimeOfArrivalNearByParamsWithContext(ctx context.Context) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ return &BusAPIEstimatedTimeOfArrivalNearByParams{
+ Context: ctx,
+ }
+}
+
+// NewBusAPIEstimatedTimeOfArrivalNearByParamsWithHTTPClient creates a new BusAPIEstimatedTimeOfArrivalNearByParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewBusAPIEstimatedTimeOfArrivalNearByParamsWithHTTPClient(client *http.Client) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ return &BusAPIEstimatedTimeOfArrivalNearByParams{
+ HTTPClient: client,
+ }
+}
+
+/* BusAPIEstimatedTimeOfArrivalNearByParams contains all the parameters to send to the API endpoint
+ for the bus Api estimated time of arrival near by operation.
+
+ Typically these are written to a http.Request.
+*/
+type BusAPIEstimatedTimeOfArrivalNearByParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarSpatialFilter.
+
+ 空間過濾(最大搜尋半徑為1000公尺)
+ */
+ DollarSpatialFilter string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
+ */
+ Health *string
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the bus Api estimated time of arrival near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithDefaults() *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the bus Api estimated time of arrival near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BusAPIEstimatedTimeOfArrivalNearByParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithTimeout(timeout time.Duration) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithContext(ctx context.Context) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithHTTPClient(client *http.Client) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithDollarFilter(dollarFilter *string) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithDollarFormat(dollarFormat string) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithDollarOrderby(dollarOrderby *string) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithDollarSelect(dollarSelect *string) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithDollarSkip(dollarSkip *string) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarSpatialFilter adds the dollarSpatialFilter to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithDollarSpatialFilter(dollarSpatialFilter string) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetDollarSpatialFilter(dollarSpatialFilter)
+ return o
+}
+
+// SetDollarSpatialFilter adds the dollarSpatialFilter to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetDollarSpatialFilter(dollarSpatialFilter string) {
+ o.DollarSpatialFilter = dollarSpatialFilter
+}
+
+// WithDollarTop adds the dollarTop to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithDollarTop(dollarTop *int64) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WithHealth adds the health to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) WithHealth(health *string) *BusAPIEstimatedTimeOfArrivalNearByParams {
+ o.SetHealth(health)
+ return o
+}
+
+// SetHealth adds the health to the bus Api estimated time of arrival near by params
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) SetHealth(health *string) {
+ o.Health = health
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *BusAPIEstimatedTimeOfArrivalNearByParams) 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
+ }
+ }
+ }
+
+ // query param $spatialFilter
+ qrDollarSpatialFilter := o.DollarSpatialFilter
+ qDollarSpatialFilter := qrDollarSpatialFilter
+ if qDollarSpatialFilter != "" {
+
+ if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
+ }
+ }
+ }
+
+ 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/advanced/bus_api_estimated_time_of_arrival_near_by_responses.go b/bus/v2/client/advanced/bus_api_estimated_time_of_arrival_near_by_responses.go
new file mode 100644
index 00000000..31b77d2d
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_estimated_time_of_arrival_near_by_responses.go
@@ -0,0 +1,130 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// BusAPIEstimatedTimeOfArrivalNearByReader is a Reader for the BusAPIEstimatedTimeOfArrivalNearBy structure.
+type BusAPIEstimatedTimeOfArrivalNearByReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *BusAPIEstimatedTimeOfArrivalNearByReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewBusAPIEstimatedTimeOfArrivalNearByOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 299:
+ result := NewBusAPIEstimatedTimeOfArrivalNearByStatus299()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewBusAPIEstimatedTimeOfArrivalNearByNotModified()
+ 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())
+ }
+}
+
+// NewBusAPIEstimatedTimeOfArrivalNearByOK creates a BusAPIEstimatedTimeOfArrivalNearByOK with default headers values
+func NewBusAPIEstimatedTimeOfArrivalNearByOK() *BusAPIEstimatedTimeOfArrivalNearByOK {
+ return &BusAPIEstimatedTimeOfArrivalNearByOK{}
+}
+
+/* BusAPIEstimatedTimeOfArrivalNearByOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type BusAPIEstimatedTimeOfArrivalNearByOK struct {
+ Payload []*models.PTXServiceDTOBusSpecificationV2BusN1EstimateTime
+}
+
+func (o *BusAPIEstimatedTimeOfArrivalNearByOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/NearBy][%d] busApiEstimatedTimeOfArrivalNearByOK %+v", 200, o.Payload)
+}
+func (o *BusAPIEstimatedTimeOfArrivalNearByOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusN1EstimateTime {
+ return o.Payload
+}
+
+func (o *BusAPIEstimatedTimeOfArrivalNearByOK) 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
+}
+
+// NewBusAPIEstimatedTimeOfArrivalNearByStatus299 creates a BusAPIEstimatedTimeOfArrivalNearByStatus299 with default headers values
+func NewBusAPIEstimatedTimeOfArrivalNearByStatus299() *BusAPIEstimatedTimeOfArrivalNearByStatus299 {
+ return &BusAPIEstimatedTimeOfArrivalNearByStatus299{}
+}
+
+/* BusAPIEstimatedTimeOfArrivalNearByStatus299 describes a response with status code 299, with default header values.
+
+加入參數'?health=true'即可查詢此API服務的健康狀態
+*/
+type BusAPIEstimatedTimeOfArrivalNearByStatus299 struct {
+ Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth
+}
+
+func (o *BusAPIEstimatedTimeOfArrivalNearByStatus299) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/NearBy][%d] busApiEstimatedTimeOfArrivalNearByStatus299 %+v", 299, o.Payload)
+}
+func (o *BusAPIEstimatedTimeOfArrivalNearByStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
+ return o.Payload
+}
+
+func (o *BusAPIEstimatedTimeOfArrivalNearByStatus299) 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
+}
+
+// NewBusAPIEstimatedTimeOfArrivalNearByNotModified creates a BusAPIEstimatedTimeOfArrivalNearByNotModified with default headers values
+func NewBusAPIEstimatedTimeOfArrivalNearByNotModified() *BusAPIEstimatedTimeOfArrivalNearByNotModified {
+ return &BusAPIEstimatedTimeOfArrivalNearByNotModified{}
+}
+
+/* BusAPIEstimatedTimeOfArrivalNearByNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BusAPIEstimatedTimeOfArrivalNearByNotModified struct {
+}
+
+func (o *BusAPIEstimatedTimeOfArrivalNearByNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/NearBy][%d] busApiEstimatedTimeOfArrivalNearByNotModified ", 304)
+}
+
+func (o *BusAPIEstimatedTimeOfArrivalNearByNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/advanced/bus_api_real_time_by_frequency_near_by_parameters.go b/bus/v2/client/advanced/bus_api_real_time_by_frequency_near_by_parameters.go
new file mode 100644
index 00000000..d6d68b65
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_real_time_by_frequency_near_by_parameters.go
@@ -0,0 +1,399 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// NewBusAPIRealTimeByFrequencyNearByParams creates a new BusAPIRealTimeByFrequencyNearByParams 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 NewBusAPIRealTimeByFrequencyNearByParams() *BusAPIRealTimeByFrequencyNearByParams {
+ return &BusAPIRealTimeByFrequencyNearByParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewBusAPIRealTimeByFrequencyNearByParamsWithTimeout creates a new BusAPIRealTimeByFrequencyNearByParams object
+// with the ability to set a timeout on a request.
+func NewBusAPIRealTimeByFrequencyNearByParamsWithTimeout(timeout time.Duration) *BusAPIRealTimeByFrequencyNearByParams {
+ return &BusAPIRealTimeByFrequencyNearByParams{
+ timeout: timeout,
+ }
+}
+
+// NewBusAPIRealTimeByFrequencyNearByParamsWithContext creates a new BusAPIRealTimeByFrequencyNearByParams object
+// with the ability to set a context for a request.
+func NewBusAPIRealTimeByFrequencyNearByParamsWithContext(ctx context.Context) *BusAPIRealTimeByFrequencyNearByParams {
+ return &BusAPIRealTimeByFrequencyNearByParams{
+ Context: ctx,
+ }
+}
+
+// NewBusAPIRealTimeByFrequencyNearByParamsWithHTTPClient creates a new BusAPIRealTimeByFrequencyNearByParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewBusAPIRealTimeByFrequencyNearByParamsWithHTTPClient(client *http.Client) *BusAPIRealTimeByFrequencyNearByParams {
+ return &BusAPIRealTimeByFrequencyNearByParams{
+ HTTPClient: client,
+ }
+}
+
+/* BusAPIRealTimeByFrequencyNearByParams contains all the parameters to send to the API endpoint
+ for the bus Api real time by frequency near by operation.
+
+ Typically these are written to a http.Request.
+*/
+type BusAPIRealTimeByFrequencyNearByParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarSpatialFilter.
+
+ 空間過濾(最大搜尋半徑為1000公尺)
+ */
+ DollarSpatialFilter string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
+ */
+ Health *string
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the bus Api real time by frequency near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithDefaults() *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the bus Api real time by frequency near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BusAPIRealTimeByFrequencyNearByParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithTimeout(timeout time.Duration) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithContext(ctx context.Context) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithHTTPClient(client *http.Client) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithDollarFilter(dollarFilter *string) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithDollarFormat(dollarFormat string) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithDollarOrderby(dollarOrderby *string) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithDollarSelect(dollarSelect *string) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithDollarSkip(dollarSkip *string) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarSpatialFilter adds the dollarSpatialFilter to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithDollarSpatialFilter(dollarSpatialFilter string) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetDollarSpatialFilter(dollarSpatialFilter)
+ return o
+}
+
+// SetDollarSpatialFilter adds the dollarSpatialFilter to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetDollarSpatialFilter(dollarSpatialFilter string) {
+ o.DollarSpatialFilter = dollarSpatialFilter
+}
+
+// WithDollarTop adds the dollarTop to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithDollarTop(dollarTop *int64) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WithHealth adds the health to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) WithHealth(health *string) *BusAPIRealTimeByFrequencyNearByParams {
+ o.SetHealth(health)
+ return o
+}
+
+// SetHealth adds the health to the bus Api real time by frequency near by params
+func (o *BusAPIRealTimeByFrequencyNearByParams) SetHealth(health *string) {
+ o.Health = health
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *BusAPIRealTimeByFrequencyNearByParams) 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
+ }
+ }
+ }
+
+ // query param $spatialFilter
+ qrDollarSpatialFilter := o.DollarSpatialFilter
+ qDollarSpatialFilter := qrDollarSpatialFilter
+ if qDollarSpatialFilter != "" {
+
+ if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
+ }
+ }
+ }
+
+ 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/advanced/bus_api_real_time_by_frequency_near_by_responses.go b/bus/v2/client/advanced/bus_api_real_time_by_frequency_near_by_responses.go
new file mode 100644
index 00000000..214a2f63
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_real_time_by_frequency_near_by_responses.go
@@ -0,0 +1,130 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// BusAPIRealTimeByFrequencyNearByReader is a Reader for the BusAPIRealTimeByFrequencyNearBy structure.
+type BusAPIRealTimeByFrequencyNearByReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *BusAPIRealTimeByFrequencyNearByReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewBusAPIRealTimeByFrequencyNearByOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 299:
+ result := NewBusAPIRealTimeByFrequencyNearByStatus299()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewBusAPIRealTimeByFrequencyNearByNotModified()
+ 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())
+ }
+}
+
+// NewBusAPIRealTimeByFrequencyNearByOK creates a BusAPIRealTimeByFrequencyNearByOK with default headers values
+func NewBusAPIRealTimeByFrequencyNearByOK() *BusAPIRealTimeByFrequencyNearByOK {
+ return &BusAPIRealTimeByFrequencyNearByOK{}
+}
+
+/* BusAPIRealTimeByFrequencyNearByOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type BusAPIRealTimeByFrequencyNearByOK struct {
+ Payload []*models.PTXServiceDTOBusSpecificationV2BusA1Data
+}
+
+func (o *BusAPIRealTimeByFrequencyNearByOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/NearBy][%d] busApiRealTimeByFrequencyNearByOK %+v", 200, o.Payload)
+}
+func (o *BusAPIRealTimeByFrequencyNearByOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA1Data {
+ return o.Payload
+}
+
+func (o *BusAPIRealTimeByFrequencyNearByOK) 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
+}
+
+// NewBusAPIRealTimeByFrequencyNearByStatus299 creates a BusAPIRealTimeByFrequencyNearByStatus299 with default headers values
+func NewBusAPIRealTimeByFrequencyNearByStatus299() *BusAPIRealTimeByFrequencyNearByStatus299 {
+ return &BusAPIRealTimeByFrequencyNearByStatus299{}
+}
+
+/* BusAPIRealTimeByFrequencyNearByStatus299 describes a response with status code 299, with default header values.
+
+加入參數'?health=true'即可查詢此API服務的健康狀態
+*/
+type BusAPIRealTimeByFrequencyNearByStatus299 struct {
+ Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth
+}
+
+func (o *BusAPIRealTimeByFrequencyNearByStatus299) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/NearBy][%d] busApiRealTimeByFrequencyNearByStatus299 %+v", 299, o.Payload)
+}
+func (o *BusAPIRealTimeByFrequencyNearByStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
+ return o.Payload
+}
+
+func (o *BusAPIRealTimeByFrequencyNearByStatus299) 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
+}
+
+// NewBusAPIRealTimeByFrequencyNearByNotModified creates a BusAPIRealTimeByFrequencyNearByNotModified with default headers values
+func NewBusAPIRealTimeByFrequencyNearByNotModified() *BusAPIRealTimeByFrequencyNearByNotModified {
+ return &BusAPIRealTimeByFrequencyNearByNotModified{}
+}
+
+/* BusAPIRealTimeByFrequencyNearByNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BusAPIRealTimeByFrequencyNearByNotModified struct {
+}
+
+func (o *BusAPIRealTimeByFrequencyNearByNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/NearBy][%d] busApiRealTimeByFrequencyNearByNotModified ", 304)
+}
+
+func (o *BusAPIRealTimeByFrequencyNearByNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/advanced/bus_api_real_time_near_stop_near_by_parameters.go b/bus/v2/client/advanced/bus_api_real_time_near_stop_near_by_parameters.go
new file mode 100644
index 00000000..63f8ac9d
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_real_time_near_stop_near_by_parameters.go
@@ -0,0 +1,399 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// NewBusAPIRealTimeNearStopNearByParams creates a new BusAPIRealTimeNearStopNearByParams 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 NewBusAPIRealTimeNearStopNearByParams() *BusAPIRealTimeNearStopNearByParams {
+ return &BusAPIRealTimeNearStopNearByParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewBusAPIRealTimeNearStopNearByParamsWithTimeout creates a new BusAPIRealTimeNearStopNearByParams object
+// with the ability to set a timeout on a request.
+func NewBusAPIRealTimeNearStopNearByParamsWithTimeout(timeout time.Duration) *BusAPIRealTimeNearStopNearByParams {
+ return &BusAPIRealTimeNearStopNearByParams{
+ timeout: timeout,
+ }
+}
+
+// NewBusAPIRealTimeNearStopNearByParamsWithContext creates a new BusAPIRealTimeNearStopNearByParams object
+// with the ability to set a context for a request.
+func NewBusAPIRealTimeNearStopNearByParamsWithContext(ctx context.Context) *BusAPIRealTimeNearStopNearByParams {
+ return &BusAPIRealTimeNearStopNearByParams{
+ Context: ctx,
+ }
+}
+
+// NewBusAPIRealTimeNearStopNearByParamsWithHTTPClient creates a new BusAPIRealTimeNearStopNearByParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewBusAPIRealTimeNearStopNearByParamsWithHTTPClient(client *http.Client) *BusAPIRealTimeNearStopNearByParams {
+ return &BusAPIRealTimeNearStopNearByParams{
+ HTTPClient: client,
+ }
+}
+
+/* BusAPIRealTimeNearStopNearByParams contains all the parameters to send to the API endpoint
+ for the bus Api real time near stop near by operation.
+
+ Typically these are written to a http.Request.
+*/
+type BusAPIRealTimeNearStopNearByParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarSpatialFilter.
+
+ 空間過濾(最大搜尋半徑為1000公尺)
+ */
+ DollarSpatialFilter string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
+ */
+ Health *string
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the bus Api real time near stop near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIRealTimeNearStopNearByParams) WithDefaults() *BusAPIRealTimeNearStopNearByParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the bus Api real time near stop near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIRealTimeNearStopNearByParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BusAPIRealTimeNearStopNearByParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithTimeout(timeout time.Duration) *BusAPIRealTimeNearStopNearByParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithContext(ctx context.Context) *BusAPIRealTimeNearStopNearByParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithHTTPClient(client *http.Client) *BusAPIRealTimeNearStopNearByParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithDollarFilter(dollarFilter *string) *BusAPIRealTimeNearStopNearByParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithDollarFormat(dollarFormat string) *BusAPIRealTimeNearStopNearByParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithDollarOrderby(dollarOrderby *string) *BusAPIRealTimeNearStopNearByParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithDollarSelect(dollarSelect *string) *BusAPIRealTimeNearStopNearByParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithDollarSkip(dollarSkip *string) *BusAPIRealTimeNearStopNearByParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarSpatialFilter adds the dollarSpatialFilter to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithDollarSpatialFilter(dollarSpatialFilter string) *BusAPIRealTimeNearStopNearByParams {
+ o.SetDollarSpatialFilter(dollarSpatialFilter)
+ return o
+}
+
+// SetDollarSpatialFilter adds the dollarSpatialFilter to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetDollarSpatialFilter(dollarSpatialFilter string) {
+ o.DollarSpatialFilter = dollarSpatialFilter
+}
+
+// WithDollarTop adds the dollarTop to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithDollarTop(dollarTop *int64) *BusAPIRealTimeNearStopNearByParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WithHealth adds the health to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) WithHealth(health *string) *BusAPIRealTimeNearStopNearByParams {
+ o.SetHealth(health)
+ return o
+}
+
+// SetHealth adds the health to the bus Api real time near stop near by params
+func (o *BusAPIRealTimeNearStopNearByParams) SetHealth(health *string) {
+ o.Health = health
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *BusAPIRealTimeNearStopNearByParams) 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
+ }
+ }
+ }
+
+ // query param $spatialFilter
+ qrDollarSpatialFilter := o.DollarSpatialFilter
+ qDollarSpatialFilter := qrDollarSpatialFilter
+ if qDollarSpatialFilter != "" {
+
+ if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
+ }
+ }
+ }
+
+ 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/advanced/bus_api_real_time_near_stop_near_by_responses.go b/bus/v2/client/advanced/bus_api_real_time_near_stop_near_by_responses.go
new file mode 100644
index 00000000..d1c9a3e7
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_real_time_near_stop_near_by_responses.go
@@ -0,0 +1,130 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// BusAPIRealTimeNearStopNearByReader is a Reader for the BusAPIRealTimeNearStopNearBy structure.
+type BusAPIRealTimeNearStopNearByReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *BusAPIRealTimeNearStopNearByReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewBusAPIRealTimeNearStopNearByOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 299:
+ result := NewBusAPIRealTimeNearStopNearByStatus299()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewBusAPIRealTimeNearStopNearByNotModified()
+ 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())
+ }
+}
+
+// NewBusAPIRealTimeNearStopNearByOK creates a BusAPIRealTimeNearStopNearByOK with default headers values
+func NewBusAPIRealTimeNearStopNearByOK() *BusAPIRealTimeNearStopNearByOK {
+ return &BusAPIRealTimeNearStopNearByOK{}
+}
+
+/* BusAPIRealTimeNearStopNearByOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type BusAPIRealTimeNearStopNearByOK struct {
+ Payload []*models.PTXServiceDTOBusSpecificationV2BusA2Data
+}
+
+func (o *BusAPIRealTimeNearStopNearByOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/NearBy][%d] busApiRealTimeNearStopNearByOK %+v", 200, o.Payload)
+}
+func (o *BusAPIRealTimeNearStopNearByOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA2Data {
+ return o.Payload
+}
+
+func (o *BusAPIRealTimeNearStopNearByOK) 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
+}
+
+// NewBusAPIRealTimeNearStopNearByStatus299 creates a BusAPIRealTimeNearStopNearByStatus299 with default headers values
+func NewBusAPIRealTimeNearStopNearByStatus299() *BusAPIRealTimeNearStopNearByStatus299 {
+ return &BusAPIRealTimeNearStopNearByStatus299{}
+}
+
+/* BusAPIRealTimeNearStopNearByStatus299 describes a response with status code 299, with default header values.
+
+加入參數'?health=true'即可查詢此API服務的健康狀態
+*/
+type BusAPIRealTimeNearStopNearByStatus299 struct {
+ Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth
+}
+
+func (o *BusAPIRealTimeNearStopNearByStatus299) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/NearBy][%d] busApiRealTimeNearStopNearByStatus299 %+v", 299, o.Payload)
+}
+func (o *BusAPIRealTimeNearStopNearByStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
+ return o.Payload
+}
+
+func (o *BusAPIRealTimeNearStopNearByStatus299) 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
+}
+
+// NewBusAPIRealTimeNearStopNearByNotModified creates a BusAPIRealTimeNearStopNearByNotModified with default headers values
+func NewBusAPIRealTimeNearStopNearByNotModified() *BusAPIRealTimeNearStopNearByNotModified {
+ return &BusAPIRealTimeNearStopNearByNotModified{}
+}
+
+/* BusAPIRealTimeNearStopNearByNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BusAPIRealTimeNearStopNearByNotModified struct {
+}
+
+func (o *BusAPIRealTimeNearStopNearByNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/NearBy][%d] busApiRealTimeNearStopNearByNotModified ", 304)
+}
+
+func (o *BusAPIRealTimeNearStopNearByNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/advanced/bus_api_route_near_by_parameters.go b/bus/v2/client/advanced/bus_api_route_near_by_parameters.go
new file mode 100644
index 00000000..c98c5f3e
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_route_near_by_parameters.go
@@ -0,0 +1,399 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// NewBusAPIRouteNearByParams creates a new BusAPIRouteNearByParams 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 NewBusAPIRouteNearByParams() *BusAPIRouteNearByParams {
+ return &BusAPIRouteNearByParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewBusAPIRouteNearByParamsWithTimeout creates a new BusAPIRouteNearByParams object
+// with the ability to set a timeout on a request.
+func NewBusAPIRouteNearByParamsWithTimeout(timeout time.Duration) *BusAPIRouteNearByParams {
+ return &BusAPIRouteNearByParams{
+ timeout: timeout,
+ }
+}
+
+// NewBusAPIRouteNearByParamsWithContext creates a new BusAPIRouteNearByParams object
+// with the ability to set a context for a request.
+func NewBusAPIRouteNearByParamsWithContext(ctx context.Context) *BusAPIRouteNearByParams {
+ return &BusAPIRouteNearByParams{
+ Context: ctx,
+ }
+}
+
+// NewBusAPIRouteNearByParamsWithHTTPClient creates a new BusAPIRouteNearByParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewBusAPIRouteNearByParamsWithHTTPClient(client *http.Client) *BusAPIRouteNearByParams {
+ return &BusAPIRouteNearByParams{
+ HTTPClient: client,
+ }
+}
+
+/* BusAPIRouteNearByParams contains all the parameters to send to the API endpoint
+ for the bus Api route near by operation.
+
+ Typically these are written to a http.Request.
+*/
+type BusAPIRouteNearByParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarSpatialFilter.
+
+ 空間過濾(最大搜尋半徑為1000公尺)
+ */
+ DollarSpatialFilter string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
+ */
+ Health *string
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the bus Api route near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIRouteNearByParams) WithDefaults() *BusAPIRouteNearByParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the bus Api route near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIRouteNearByParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BusAPIRouteNearByParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithTimeout(timeout time.Duration) *BusAPIRouteNearByParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithContext(ctx context.Context) *BusAPIRouteNearByParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithHTTPClient(client *http.Client) *BusAPIRouteNearByParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithDollarFilter(dollarFilter *string) *BusAPIRouteNearByParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithDollarFormat(dollarFormat string) *BusAPIRouteNearByParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithDollarOrderby(dollarOrderby *string) *BusAPIRouteNearByParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithDollarSelect(dollarSelect *string) *BusAPIRouteNearByParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithDollarSkip(dollarSkip *string) *BusAPIRouteNearByParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarSpatialFilter adds the dollarSpatialFilter to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithDollarSpatialFilter(dollarSpatialFilter string) *BusAPIRouteNearByParams {
+ o.SetDollarSpatialFilter(dollarSpatialFilter)
+ return o
+}
+
+// SetDollarSpatialFilter adds the dollarSpatialFilter to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetDollarSpatialFilter(dollarSpatialFilter string) {
+ o.DollarSpatialFilter = dollarSpatialFilter
+}
+
+// WithDollarTop adds the dollarTop to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithDollarTop(dollarTop *int64) *BusAPIRouteNearByParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WithHealth adds the health to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) WithHealth(health *string) *BusAPIRouteNearByParams {
+ o.SetHealth(health)
+ return o
+}
+
+// SetHealth adds the health to the bus Api route near by params
+func (o *BusAPIRouteNearByParams) SetHealth(health *string) {
+ o.Health = health
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *BusAPIRouteNearByParams) 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
+ }
+ }
+ }
+
+ // query param $spatialFilter
+ qrDollarSpatialFilter := o.DollarSpatialFilter
+ qDollarSpatialFilter := qrDollarSpatialFilter
+ if qDollarSpatialFilter != "" {
+
+ if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
+ }
+ }
+ }
+
+ 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/advanced/bus_api_route_near_by_responses.go b/bus/v2/client/advanced/bus_api_route_near_by_responses.go
new file mode 100644
index 00000000..133b04e6
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_route_near_by_responses.go
@@ -0,0 +1,130 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// BusAPIRouteNearByReader is a Reader for the BusAPIRouteNearBy structure.
+type BusAPIRouteNearByReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *BusAPIRouteNearByReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewBusAPIRouteNearByOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 299:
+ result := NewBusAPIRouteNearByStatus299()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewBusAPIRouteNearByNotModified()
+ 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())
+ }
+}
+
+// NewBusAPIRouteNearByOK creates a BusAPIRouteNearByOK with default headers values
+func NewBusAPIRouteNearByOK() *BusAPIRouteNearByOK {
+ return &BusAPIRouteNearByOK{}
+}
+
+/* BusAPIRouteNearByOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type BusAPIRouteNearByOK struct {
+ Payload []*models.PTXServiceDTOBusSpecificationV2BusRoute
+}
+
+func (o *BusAPIRouteNearByOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Route/NearBy][%d] busApiRouteNearByOK %+v", 200, o.Payload)
+}
+func (o *BusAPIRouteNearByOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusRoute {
+ return o.Payload
+}
+
+func (o *BusAPIRouteNearByOK) 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
+}
+
+// NewBusAPIRouteNearByStatus299 creates a BusAPIRouteNearByStatus299 with default headers values
+func NewBusAPIRouteNearByStatus299() *BusAPIRouteNearByStatus299 {
+ return &BusAPIRouteNearByStatus299{}
+}
+
+/* BusAPIRouteNearByStatus299 describes a response with status code 299, with default header values.
+
+加入參數'?health=true'即可查詢此API服務的健康狀態
+*/
+type BusAPIRouteNearByStatus299 struct {
+ Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth
+}
+
+func (o *BusAPIRouteNearByStatus299) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Route/NearBy][%d] busApiRouteNearByStatus299 %+v", 299, o.Payload)
+}
+func (o *BusAPIRouteNearByStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
+ return o.Payload
+}
+
+func (o *BusAPIRouteNearByStatus299) 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
+}
+
+// NewBusAPIRouteNearByNotModified creates a BusAPIRouteNearByNotModified with default headers values
+func NewBusAPIRouteNearByNotModified() *BusAPIRouteNearByNotModified {
+ return &BusAPIRouteNearByNotModified{}
+}
+
+/* BusAPIRouteNearByNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BusAPIRouteNearByNotModified struct {
+}
+
+func (o *BusAPIRouteNearByNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Route/NearBy][%d] busApiRouteNearByNotModified ", 304)
+}
+
+func (o *BusAPIRouteNearByNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/advanced/bus_api_station_near_by_parameters.go b/bus/v2/client/advanced/bus_api_station_near_by_parameters.go
new file mode 100644
index 00000000..a7b35d81
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_station_near_by_parameters.go
@@ -0,0 +1,399 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// NewBusAPIStationNearByParams creates a new BusAPIStationNearByParams 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 NewBusAPIStationNearByParams() *BusAPIStationNearByParams {
+ return &BusAPIStationNearByParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewBusAPIStationNearByParamsWithTimeout creates a new BusAPIStationNearByParams object
+// with the ability to set a timeout on a request.
+func NewBusAPIStationNearByParamsWithTimeout(timeout time.Duration) *BusAPIStationNearByParams {
+ return &BusAPIStationNearByParams{
+ timeout: timeout,
+ }
+}
+
+// NewBusAPIStationNearByParamsWithContext creates a new BusAPIStationNearByParams object
+// with the ability to set a context for a request.
+func NewBusAPIStationNearByParamsWithContext(ctx context.Context) *BusAPIStationNearByParams {
+ return &BusAPIStationNearByParams{
+ Context: ctx,
+ }
+}
+
+// NewBusAPIStationNearByParamsWithHTTPClient creates a new BusAPIStationNearByParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewBusAPIStationNearByParamsWithHTTPClient(client *http.Client) *BusAPIStationNearByParams {
+ return &BusAPIStationNearByParams{
+ HTTPClient: client,
+ }
+}
+
+/* BusAPIStationNearByParams contains all the parameters to send to the API endpoint
+ for the bus Api station near by operation.
+
+ Typically these are written to a http.Request.
+*/
+type BusAPIStationNearByParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarSpatialFilter.
+
+ 空間過濾(最大搜尋半徑為1000公尺)
+ */
+ DollarSpatialFilter string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
+ */
+ Health *string
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the bus Api station near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIStationNearByParams) WithDefaults() *BusAPIStationNearByParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the bus Api station near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIStationNearByParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BusAPIStationNearByParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithTimeout(timeout time.Duration) *BusAPIStationNearByParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithContext(ctx context.Context) *BusAPIStationNearByParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithHTTPClient(client *http.Client) *BusAPIStationNearByParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithDollarFilter(dollarFilter *string) *BusAPIStationNearByParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithDollarFormat(dollarFormat string) *BusAPIStationNearByParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithDollarOrderby(dollarOrderby *string) *BusAPIStationNearByParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithDollarSelect(dollarSelect *string) *BusAPIStationNearByParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithDollarSkip(dollarSkip *string) *BusAPIStationNearByParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarSpatialFilter adds the dollarSpatialFilter to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithDollarSpatialFilter(dollarSpatialFilter string) *BusAPIStationNearByParams {
+ o.SetDollarSpatialFilter(dollarSpatialFilter)
+ return o
+}
+
+// SetDollarSpatialFilter adds the dollarSpatialFilter to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetDollarSpatialFilter(dollarSpatialFilter string) {
+ o.DollarSpatialFilter = dollarSpatialFilter
+}
+
+// WithDollarTop adds the dollarTop to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithDollarTop(dollarTop *int64) *BusAPIStationNearByParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WithHealth adds the health to the bus Api station near by params
+func (o *BusAPIStationNearByParams) WithHealth(health *string) *BusAPIStationNearByParams {
+ o.SetHealth(health)
+ return o
+}
+
+// SetHealth adds the health to the bus Api station near by params
+func (o *BusAPIStationNearByParams) SetHealth(health *string) {
+ o.Health = health
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *BusAPIStationNearByParams) 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
+ }
+ }
+ }
+
+ // query param $spatialFilter
+ qrDollarSpatialFilter := o.DollarSpatialFilter
+ qDollarSpatialFilter := qrDollarSpatialFilter
+ if qDollarSpatialFilter != "" {
+
+ if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
+ }
+ }
+ }
+
+ 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/advanced/bus_api_station_near_by_responses.go b/bus/v2/client/advanced/bus_api_station_near_by_responses.go
new file mode 100644
index 00000000..e17ca51c
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_station_near_by_responses.go
@@ -0,0 +1,130 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// BusAPIStationNearByReader is a Reader for the BusAPIStationNearBy structure.
+type BusAPIStationNearByReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *BusAPIStationNearByReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewBusAPIStationNearByOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 299:
+ result := NewBusAPIStationNearByStatus299()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewBusAPIStationNearByNotModified()
+ 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())
+ }
+}
+
+// NewBusAPIStationNearByOK creates a BusAPIStationNearByOK with default headers values
+func NewBusAPIStationNearByOK() *BusAPIStationNearByOK {
+ return &BusAPIStationNearByOK{}
+}
+
+/* BusAPIStationNearByOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type BusAPIStationNearByOK struct {
+ Payload []*models.PTXServiceDTOBusSpecificationV2BusStation
+}
+
+func (o *BusAPIStationNearByOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Station/NearBy][%d] busApiStationNearByOK %+v", 200, o.Payload)
+}
+func (o *BusAPIStationNearByOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStation {
+ return o.Payload
+}
+
+func (o *BusAPIStationNearByOK) 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
+}
+
+// NewBusAPIStationNearByStatus299 creates a BusAPIStationNearByStatus299 with default headers values
+func NewBusAPIStationNearByStatus299() *BusAPIStationNearByStatus299 {
+ return &BusAPIStationNearByStatus299{}
+}
+
+/* BusAPIStationNearByStatus299 describes a response with status code 299, with default header values.
+
+加入參數'?health=true'即可查詢此API服務的健康狀態
+*/
+type BusAPIStationNearByStatus299 struct {
+ Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth
+}
+
+func (o *BusAPIStationNearByStatus299) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Station/NearBy][%d] busApiStationNearByStatus299 %+v", 299, o.Payload)
+}
+func (o *BusAPIStationNearByStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
+ return o.Payload
+}
+
+func (o *BusAPIStationNearByStatus299) 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
+}
+
+// NewBusAPIStationNearByNotModified creates a BusAPIStationNearByNotModified with default headers values
+func NewBusAPIStationNearByNotModified() *BusAPIStationNearByNotModified {
+ return &BusAPIStationNearByNotModified{}
+}
+
+/* BusAPIStationNearByNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BusAPIStationNearByNotModified struct {
+}
+
+func (o *BusAPIStationNearByNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Station/NearBy][%d] busApiStationNearByNotModified ", 304)
+}
+
+func (o *BusAPIStationNearByNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/advanced/bus_api_stop_near_by_parameters.go b/bus/v2/client/advanced/bus_api_stop_near_by_parameters.go
new file mode 100644
index 00000000..131fc258
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_stop_near_by_parameters.go
@@ -0,0 +1,399 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// NewBusAPIStopNearByParams creates a new BusAPIStopNearByParams 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 NewBusAPIStopNearByParams() *BusAPIStopNearByParams {
+ return &BusAPIStopNearByParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewBusAPIStopNearByParamsWithTimeout creates a new BusAPIStopNearByParams object
+// with the ability to set a timeout on a request.
+func NewBusAPIStopNearByParamsWithTimeout(timeout time.Duration) *BusAPIStopNearByParams {
+ return &BusAPIStopNearByParams{
+ timeout: timeout,
+ }
+}
+
+// NewBusAPIStopNearByParamsWithContext creates a new BusAPIStopNearByParams object
+// with the ability to set a context for a request.
+func NewBusAPIStopNearByParamsWithContext(ctx context.Context) *BusAPIStopNearByParams {
+ return &BusAPIStopNearByParams{
+ Context: ctx,
+ }
+}
+
+// NewBusAPIStopNearByParamsWithHTTPClient creates a new BusAPIStopNearByParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewBusAPIStopNearByParamsWithHTTPClient(client *http.Client) *BusAPIStopNearByParams {
+ return &BusAPIStopNearByParams{
+ HTTPClient: client,
+ }
+}
+
+/* BusAPIStopNearByParams contains all the parameters to send to the API endpoint
+ for the bus Api stop near by operation.
+
+ Typically these are written to a http.Request.
+*/
+type BusAPIStopNearByParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarSpatialFilter.
+
+ 空間過濾(最大搜尋半徑為1000公尺)
+ */
+ DollarSpatialFilter string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
+ */
+ Health *string
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the bus Api stop near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIStopNearByParams) WithDefaults() *BusAPIStopNearByParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the bus Api stop near by params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *BusAPIStopNearByParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := BusAPIStopNearByParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithTimeout(timeout time.Duration) *BusAPIStopNearByParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithContext(ctx context.Context) *BusAPIStopNearByParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithHTTPClient(client *http.Client) *BusAPIStopNearByParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithDollarFilter(dollarFilter *string) *BusAPIStopNearByParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithDollarFormat(dollarFormat string) *BusAPIStopNearByParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithDollarOrderby(dollarOrderby *string) *BusAPIStopNearByParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithDollarSelect(dollarSelect *string) *BusAPIStopNearByParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithDollarSkip(dollarSkip *string) *BusAPIStopNearByParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarSpatialFilter adds the dollarSpatialFilter to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithDollarSpatialFilter(dollarSpatialFilter string) *BusAPIStopNearByParams {
+ o.SetDollarSpatialFilter(dollarSpatialFilter)
+ return o
+}
+
+// SetDollarSpatialFilter adds the dollarSpatialFilter to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetDollarSpatialFilter(dollarSpatialFilter string) {
+ o.DollarSpatialFilter = dollarSpatialFilter
+}
+
+// WithDollarTop adds the dollarTop to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithDollarTop(dollarTop *int64) *BusAPIStopNearByParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WithHealth adds the health to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) WithHealth(health *string) *BusAPIStopNearByParams {
+ o.SetHealth(health)
+ return o
+}
+
+// SetHealth adds the health to the bus Api stop near by params
+func (o *BusAPIStopNearByParams) SetHealth(health *string) {
+ o.Health = health
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *BusAPIStopNearByParams) 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
+ }
+ }
+ }
+
+ // query param $spatialFilter
+ qrDollarSpatialFilter := o.DollarSpatialFilter
+ qDollarSpatialFilter := qrDollarSpatialFilter
+ if qDollarSpatialFilter != "" {
+
+ if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
+ }
+ }
+ }
+
+ 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/advanced/bus_api_stop_near_by_responses.go b/bus/v2/client/advanced/bus_api_stop_near_by_responses.go
new file mode 100644
index 00000000..39e3e5a4
--- /dev/null
+++ b/bus/v2/client/advanced/bus_api_stop_near_by_responses.go
@@ -0,0 +1,130 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package advanced
+
+// 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"
+)
+
+// BusAPIStopNearByReader is a Reader for the BusAPIStopNearBy structure.
+type BusAPIStopNearByReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *BusAPIStopNearByReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewBusAPIStopNearByOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 299:
+ result := NewBusAPIStopNearByStatus299()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewBusAPIStopNearByNotModified()
+ 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())
+ }
+}
+
+// NewBusAPIStopNearByOK creates a BusAPIStopNearByOK with default headers values
+func NewBusAPIStopNearByOK() *BusAPIStopNearByOK {
+ return &BusAPIStopNearByOK{}
+}
+
+/* BusAPIStopNearByOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type BusAPIStopNearByOK struct {
+ Payload []*models.PTXServiceDTOBusSpecificationV2BusStop
+}
+
+func (o *BusAPIStopNearByOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Stop/NearBy][%d] busApiStopNearByOK %+v", 200, o.Payload)
+}
+func (o *BusAPIStopNearByOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStop {
+ return o.Payload
+}
+
+func (o *BusAPIStopNearByOK) 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
+}
+
+// NewBusAPIStopNearByStatus299 creates a BusAPIStopNearByStatus299 with default headers values
+func NewBusAPIStopNearByStatus299() *BusAPIStopNearByStatus299 {
+ return &BusAPIStopNearByStatus299{}
+}
+
+/* BusAPIStopNearByStatus299 describes a response with status code 299, with default header values.
+
+加入參數'?health=true'即可查詢此API服務的健康狀態
+*/
+type BusAPIStopNearByStatus299 struct {
+ Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth
+}
+
+func (o *BusAPIStopNearByStatus299) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Stop/NearBy][%d] busApiStopNearByStatus299 %+v", 299, o.Payload)
+}
+func (o *BusAPIStopNearByStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
+ return o.Payload
+}
+
+func (o *BusAPIStopNearByStatus299) 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
+}
+
+// NewBusAPIStopNearByNotModified creates a BusAPIStopNearByNotModified with default headers values
+func NewBusAPIStopNearByNotModified() *BusAPIStopNearByNotModified {
+ return &BusAPIStopNearByNotModified{}
+}
+
+/* BusAPIStopNearByNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type BusAPIStopNearByNotModified struct {
+}
+
+func (o *BusAPIStopNearByNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Stop/NearBy][%d] busApiStopNearByNotModified ", 304)
+}
+
+func (o *BusAPIStopNearByNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_data_version_parameters.go b/bus/v2/client/city_bus/city_bus_api_data_version_parameters.go
index 8eebb7c3..af8dcd3c 100644
--- a/bus/v2/client/city_bus/city_bus_api_data_version_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_data_version_parameters.go
@@ -16,63 +16,64 @@ import (
"github.com/go-openapi/strfmt"
)
-// NewCityBusAPIDataVersionParams creates a new CityBusAPIDataVersionParams object
-// with the default values initialized.
+// NewCityBusAPIDataVersionParams creates a new CityBusAPIDataVersionParams 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 NewCityBusAPIDataVersionParams() *CityBusAPIDataVersionParams {
- var ()
return &CityBusAPIDataVersionParams{
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIDataVersionParamsWithTimeout creates a new CityBusAPIDataVersionParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIDataVersionParamsWithTimeout(timeout time.Duration) *CityBusAPIDataVersionParams {
- var ()
return &CityBusAPIDataVersionParams{
-
timeout: timeout,
}
}
// NewCityBusAPIDataVersionParamsWithContext creates a new CityBusAPIDataVersionParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIDataVersionParamsWithContext(ctx context.Context) *CityBusAPIDataVersionParams {
- var ()
return &CityBusAPIDataVersionParams{
-
Context: ctx,
}
}
// NewCityBusAPIDataVersionParamsWithHTTPClient creates a new CityBusAPIDataVersionParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIDataVersionParamsWithHTTPClient(client *http.Client) *CityBusAPIDataVersionParams {
- var ()
return &CityBusAPIDataVersionParams{
HTTPClient: client,
}
}
-/*CityBusAPIDataVersionParams contains all the parameters to send to the API endpoint
-for the city bus Api data version operation typically these are written to a http.Request
+/* CityBusAPIDataVersionParams contains all the parameters to send to the API endpoint
+ for the city bus Api data version operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIDataVersionParams struct {
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+ 指定來源格式
*/
DollarFormat string
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -81,6 +82,21 @@ type CityBusAPIDataVersionParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api data version params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDataVersionParams) WithDefaults() *CityBusAPIDataVersionParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api data version params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDataVersionParams) SetDefaults() {
+ // no default values defined for this parameter
+}
+
// WithTimeout adds the timeout to the city bus Api data version params
func (o *CityBusAPIDataVersionParams) WithTimeout(timeout time.Duration) *CityBusAPIDataVersionParams {
o.SetTimeout(timeout)
@@ -159,6 +175,7 @@ func (o *CityBusAPIDataVersionParams) WriteToRequest(r runtime.ClientRequest, re
qrDollarFormat := o.DollarFormat
qDollarFormat := qrDollarFormat
if qDollarFormat != "" {
+
if err := r.SetQueryParam("$format", qDollarFormat); err != nil {
return err
}
@@ -173,16 +190,17 @@ func (o *CityBusAPIDataVersionParams) WriteToRequest(r runtime.ClientRequest, re
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_data_version_responses.go b/bus/v2/client/city_bus/city_bus_api_data_version_responses.go
index 928a24d7..f1caf34a 100644
--- a/bus/v2/client/city_bus/city_bus_api_data_version_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_data_version_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIDataVersionReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIDataVersionNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIDataVersionOK() *CityBusAPIDataVersionOK {
return &CityBusAPIDataVersionOK{}
}
-/*CityBusAPIDataVersionOK handles this case with default header values.
+/* CityBusAPIDataVersionOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIDataVersionOK struct {
func (o *CityBusAPIDataVersionOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/DataVersion/City/{City}][%d] cityBusApiDataVersionOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIDataVersionOK) GetPayload() *models.PTXServiceDTOBusSpecificationV2BusVersion {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIDataVersionStatus299() *CityBusAPIDataVersionStatus299 {
return &CityBusAPIDataVersionStatus299{}
}
-/*CityBusAPIDataVersionStatus299 handles this case with default header values.
+/* CityBusAPIDataVersionStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIDataVersionStatus299 struct {
func (o *CityBusAPIDataVersionStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/DataVersion/City/{City}][%d] cityBusApiDataVersionStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIDataVersionStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIDataVersionStatus299) readResponse(response runtime.ClientRes
return nil
}
+
+// NewCityBusAPIDataVersionNotModified creates a CityBusAPIDataVersionNotModified with default headers values
+func NewCityBusAPIDataVersionNotModified() *CityBusAPIDataVersionNotModified {
+ return &CityBusAPIDataVersionNotModified{}
+}
+
+/* CityBusAPIDataVersionNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIDataVersionNotModified struct {
+}
+
+func (o *CityBusAPIDataVersionNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/DataVersion/City/{City}][%d] cityBusApiDataVersionNotModified ", 304)
+}
+
+func (o *CityBusAPIDataVersionNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_display_stop_of_route1_parameters.go b/bus/v2/client/city_bus/city_bus_api_display_stop_of_route1_parameters.go
index 6da04fb3..9ea5eb4c 100644
--- a/bus/v2/client/city_bus/city_bus_api_display_stop_of_route1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_display_stop_of_route1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIDisplayStopOfRoute1Params creates a new CityBusAPIDisplayStopOfRoute1Params object
-// with the default values initialized.
+// NewCityBusAPIDisplayStopOfRoute1Params creates a new CityBusAPIDisplayStopOfRoute1Params 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 NewCityBusAPIDisplayStopOfRoute1Params() *CityBusAPIDisplayStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIDisplayStopOfRoute1ParamsWithTimeout creates a new CityBusAPIDisplayStopOfRoute1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIDisplayStopOfRoute1ParamsWithTimeout(timeout time.Duration) *CityBusAPIDisplayStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIDisplayStopOfRoute1ParamsWithContext creates a new CityBusAPIDisplayStopOfRoute1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIDisplayStopOfRoute1ParamsWithContext(ctx context.Context) *CityBusAPIDisplayStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIDisplayStopOfRoute1ParamsWithHTTPClient creates a new CityBusAPIDisplayStopOfRoute1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIDisplayStopOfRoute1ParamsWithHTTPClient(client *http.Client) *CityBusAPIDisplayStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIDisplayStopOfRoute1Params contains all the parameters to send to the API endpoint
-for the city bus Api display stop of route 1 operation typically these are written to a http.Request
+/* CityBusAPIDisplayStopOfRoute1Params contains all the parameters to send to the API endpoint
+ for the city bus Api display stop of route 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIDisplayStopOfRoute1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIDisplayStopOfRoute1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api display stop of route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDisplayStopOfRoute1Params) WithDefaults() *CityBusAPIDisplayStopOfRoute1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api display stop of route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDisplayStopOfRoute1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIDisplayStopOfRoute1Params{
+ 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 display stop of route 1 params
func (o *CityBusAPIDisplayStopOfRoute1Params) WithTimeout(timeout time.Duration) *CityBusAPIDisplayStopOfRoute1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIDisplayStopOfRoute1Params) WriteToRequest(r runtime.ClientReq
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPIDisplayStopOfRoute1Params) WriteToRequest(r runtime.ClientReq
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPIDisplayStopOfRoute1Params) WriteToRequest(r runtime.ClientReq
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_display_stop_of_route1_responses.go b/bus/v2/client/city_bus/city_bus_api_display_stop_of_route1_responses.go
index 361e52f6..512cd04e 100644
--- a/bus/v2/client/city_bus/city_bus_api_display_stop_of_route1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_display_stop_of_route1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIDisplayStopOfRoute1Reader) ReadResponse(response runtime.Clie
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIDisplayStopOfRoute1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIDisplayStopOfRoute1OK() *CityBusAPIDisplayStopOfRoute1OK {
return &CityBusAPIDisplayStopOfRoute1OK{}
}
-/*CityBusAPIDisplayStopOfRoute1OK handles this case with default header values.
+/* CityBusAPIDisplayStopOfRoute1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIDisplayStopOfRoute1OK struct {
func (o *CityBusAPIDisplayStopOfRoute1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/DisplayStopOfRoute/City/{City}/{RouteName}][%d] cityBusApiDisplayStopOfRoute1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIDisplayStopOfRoute1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusDisplayStopOfRoute {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIDisplayStopOfRoute1Status299() *CityBusAPIDisplayStopOfRoute1S
return &CityBusAPIDisplayStopOfRoute1Status299{}
}
-/*CityBusAPIDisplayStopOfRoute1Status299 handles this case with default header values.
+/* CityBusAPIDisplayStopOfRoute1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIDisplayStopOfRoute1Status299 struct {
func (o *CityBusAPIDisplayStopOfRoute1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/DisplayStopOfRoute/City/{City}/{RouteName}][%d] cityBusApiDisplayStopOfRoute1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIDisplayStopOfRoute1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIDisplayStopOfRoute1Status299) readResponse(response runtime.C
return nil
}
+
+// NewCityBusAPIDisplayStopOfRoute1NotModified creates a CityBusAPIDisplayStopOfRoute1NotModified with default headers values
+func NewCityBusAPIDisplayStopOfRoute1NotModified() *CityBusAPIDisplayStopOfRoute1NotModified {
+ return &CityBusAPIDisplayStopOfRoute1NotModified{}
+}
+
+/* CityBusAPIDisplayStopOfRoute1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIDisplayStopOfRoute1NotModified struct {
+}
+
+func (o *CityBusAPIDisplayStopOfRoute1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/DisplayStopOfRoute/City/{City}/{RouteName}][%d] cityBusApiDisplayStopOfRoute1NotModified ", 304)
+}
+
+func (o *CityBusAPIDisplayStopOfRoute1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_display_stop_of_route_parameters.go b/bus/v2/client/city_bus/city_bus_api_display_stop_of_route_parameters.go
index 881d985b..82433d79 100644
--- a/bus/v2/client/city_bus/city_bus_api_display_stop_of_route_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_display_stop_of_route_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIDisplayStopOfRouteParams creates a new CityBusAPIDisplayStopOfRouteParams object
-// with the default values initialized.
+// NewCityBusAPIDisplayStopOfRouteParams creates a new CityBusAPIDisplayStopOfRouteParams 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 NewCityBusAPIDisplayStopOfRouteParams() *CityBusAPIDisplayStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIDisplayStopOfRouteParamsWithTimeout creates a new CityBusAPIDisplayStopOfRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIDisplayStopOfRouteParamsWithTimeout(timeout time.Duration) *CityBusAPIDisplayStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIDisplayStopOfRouteParamsWithContext creates a new CityBusAPIDisplayStopOfRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIDisplayStopOfRouteParamsWithContext(ctx context.Context) *CityBusAPIDisplayStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIDisplayStopOfRouteParamsWithHTTPClient creates a new CityBusAPIDisplayStopOfRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIDisplayStopOfRouteParamsWithHTTPClient(client *http.Client) *CityBusAPIDisplayStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIDisplayStopOfRouteParams contains all the parameters to send to the API endpoint
-for the city bus Api display stop of route operation typically these are written to a http.Request
+/* CityBusAPIDisplayStopOfRouteParams contains all the parameters to send to the API endpoint
+ for the city bus Api display stop of route operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIDisplayStopOfRouteParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIDisplayStopOfRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api display stop of route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDisplayStopOfRouteParams) WithDefaults() *CityBusAPIDisplayStopOfRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api display stop of route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDisplayStopOfRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIDisplayStopOfRouteParams{
+ 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 display stop of route params
func (o *CityBusAPIDisplayStopOfRouteParams) WithTimeout(timeout time.Duration) *CityBusAPIDisplayStopOfRouteParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIDisplayStopOfRouteParams) WriteToRequest(r runtime.ClientRequ
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIDisplayStopOfRouteParams) WriteToRequest(r runtime.ClientRequ
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIDisplayStopOfRouteParams) WriteToRequest(r runtime.ClientRequ
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_display_stop_of_route_responses.go b/bus/v2/client/city_bus/city_bus_api_display_stop_of_route_responses.go
index 3b8a5b03..21663255 100644
--- a/bus/v2/client/city_bus/city_bus_api_display_stop_of_route_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_display_stop_of_route_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIDisplayStopOfRouteReader) ReadResponse(response runtime.Clien
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIDisplayStopOfRouteNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIDisplayStopOfRouteOK() *CityBusAPIDisplayStopOfRouteOK {
return &CityBusAPIDisplayStopOfRouteOK{}
}
-/*CityBusAPIDisplayStopOfRouteOK handles this case with default header values.
+/* CityBusAPIDisplayStopOfRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIDisplayStopOfRouteOK struct {
func (o *CityBusAPIDisplayStopOfRouteOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/DisplayStopOfRoute/City/{City}][%d] cityBusApiDisplayStopOfRouteOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIDisplayStopOfRouteOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusDisplayStopOfRoute {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIDisplayStopOfRouteStatus299() *CityBusAPIDisplayStopOfRouteSta
return &CityBusAPIDisplayStopOfRouteStatus299{}
}
-/*CityBusAPIDisplayStopOfRouteStatus299 handles this case with default header values.
+/* CityBusAPIDisplayStopOfRouteStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIDisplayStopOfRouteStatus299 struct {
func (o *CityBusAPIDisplayStopOfRouteStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/DisplayStopOfRoute/City/{City}][%d] cityBusApiDisplayStopOfRouteStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIDisplayStopOfRouteStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIDisplayStopOfRouteStatus299) readResponse(response runtime.Cl
return nil
}
+
+// NewCityBusAPIDisplayStopOfRouteNotModified creates a CityBusAPIDisplayStopOfRouteNotModified with default headers values
+func NewCityBusAPIDisplayStopOfRouteNotModified() *CityBusAPIDisplayStopOfRouteNotModified {
+ return &CityBusAPIDisplayStopOfRouteNotModified{}
+}
+
+/* CityBusAPIDisplayStopOfRouteNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIDisplayStopOfRouteNotModified struct {
+}
+
+func (o *CityBusAPIDisplayStopOfRouteNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/DisplayStopOfRoute/City/{City}][%d] cityBusApiDisplayStopOfRouteNotModified ", 304)
+}
+
+func (o *CityBusAPIDisplayStopOfRouteNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival1_parameters.go b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival1_parameters.go
index e7120b61..91208bab 100644
--- a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIEstimatedTimeOfArrival1Params creates a new CityBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized.
+// NewCityBusAPIEstimatedTimeOfArrival1Params creates a new CityBusAPIEstimatedTimeOfArrival1Params 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 NewCityBusAPIEstimatedTimeOfArrival1Params() *CityBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrival1ParamsWithTimeout creates a new CityBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIEstimatedTimeOfArrival1ParamsWithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrival1ParamsWithContext creates a new CityBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIEstimatedTimeOfArrival1ParamsWithContext(ctx context.Context) *CityBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIEstimatedTimeOfArrival1ParamsWithHTTPClient creates a new CityBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIEstimatedTimeOfArrival1ParamsWithHTTPClient(client *http.Client) *CityBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIEstimatedTimeOfArrival1Params contains all the parameters to send to the API endpoint
-for the city bus Api estimated time of arrival 1 operation typically these are written to a http.Request
+/* CityBusAPIEstimatedTimeOfArrival1Params contains all the parameters to send to the API endpoint
+ for the city bus Api estimated time of arrival 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIEstimatedTimeOfArrival1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIEstimatedTimeOfArrival1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api estimated time of arrival 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrival1Params) WithDefaults() *CityBusAPIEstimatedTimeOfArrival1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api estimated time of arrival 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrival1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIEstimatedTimeOfArrival1Params{
+ 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 estimated time of arrival 1 params
func (o *CityBusAPIEstimatedTimeOfArrival1Params) WithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrival1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIEstimatedTimeOfArrival1Params) WriteToRequest(r runtime.Clien
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPIEstimatedTimeOfArrival1Params) WriteToRequest(r runtime.Clien
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPIEstimatedTimeOfArrival1Params) WriteToRequest(r runtime.Clien
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival1_responses.go b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival1_responses.go
index c2d98d02..9331211a 100644
--- a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIEstimatedTimeOfArrival1Reader) ReadResponse(response runtime.
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIEstimatedTimeOfArrival1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIEstimatedTimeOfArrival1OK() *CityBusAPIEstimatedTimeOfArrival1
return &CityBusAPIEstimatedTimeOfArrival1OK{}
}
-/*CityBusAPIEstimatedTimeOfArrival1OK handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrival1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIEstimatedTimeOfArrival1OK struct {
func (o *CityBusAPIEstimatedTimeOfArrival1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/City/{City}/{RouteName}][%d] cityBusApiEstimatedTimeOfArrival1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrival1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusN1EstimateTime {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIEstimatedTimeOfArrival1Status299() *CityBusAPIEstimatedTimeOfA
return &CityBusAPIEstimatedTimeOfArrival1Status299{}
}
-/*CityBusAPIEstimatedTimeOfArrival1Status299 handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrival1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIEstimatedTimeOfArrival1Status299 struct {
func (o *CityBusAPIEstimatedTimeOfArrival1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/City/{City}/{RouteName}][%d] cityBusApiEstimatedTimeOfArrival1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrival1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIEstimatedTimeOfArrival1Status299) readResponse(response runti
return nil
}
+
+// NewCityBusAPIEstimatedTimeOfArrival1NotModified creates a CityBusAPIEstimatedTimeOfArrival1NotModified with default headers values
+func NewCityBusAPIEstimatedTimeOfArrival1NotModified() *CityBusAPIEstimatedTimeOfArrival1NotModified {
+ return &CityBusAPIEstimatedTimeOfArrival1NotModified{}
+}
+
+/* CityBusAPIEstimatedTimeOfArrival1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIEstimatedTimeOfArrival1NotModified struct {
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrival1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/City/{City}/{RouteName}][%d] cityBusApiEstimatedTimeOfArrival1NotModified ", 304)
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrival1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_parameters.go b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_parameters.go
index 061cbf26..4238d440 100644
--- a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIEstimatedTimeOfArrivalParams creates a new CityBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized.
+// NewCityBusAPIEstimatedTimeOfArrivalParams creates a new CityBusAPIEstimatedTimeOfArrivalParams 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 NewCityBusAPIEstimatedTimeOfArrivalParams() *CityBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrivalParamsWithTimeout creates a new CityBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIEstimatedTimeOfArrivalParamsWithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrivalParamsWithContext creates a new CityBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIEstimatedTimeOfArrivalParamsWithContext(ctx context.Context) *CityBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIEstimatedTimeOfArrivalParamsWithHTTPClient creates a new CityBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIEstimatedTimeOfArrivalParamsWithHTTPClient(client *http.Client) *CityBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIEstimatedTimeOfArrivalParams contains all the parameters to send to the API endpoint
-for the city bus Api estimated time of arrival operation typically these are written to a http.Request
+/* CityBusAPIEstimatedTimeOfArrivalParams contains all the parameters to send to the API endpoint
+ for the city bus Api estimated time of arrival operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIEstimatedTimeOfArrivalParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIEstimatedTimeOfArrivalParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api estimated time of arrival params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrivalParams) WithDefaults() *CityBusAPIEstimatedTimeOfArrivalParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api estimated time of arrival params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrivalParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIEstimatedTimeOfArrivalParams{
+ 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 estimated time of arrival params
func (o *CityBusAPIEstimatedTimeOfArrivalParams) WithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrivalParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIEstimatedTimeOfArrivalParams) WriteToRequest(r runtime.Client
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIEstimatedTimeOfArrivalParams) WriteToRequest(r runtime.Client
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIEstimatedTimeOfArrivalParams) WriteToRequest(r runtime.Client
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_responses.go b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_responses.go
index 37a19e46..477c2d6d 100644
--- a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIEstimatedTimeOfArrivalReader) ReadResponse(response runtime.C
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIEstimatedTimeOfArrivalNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIEstimatedTimeOfArrivalOK() *CityBusAPIEstimatedTimeOfArrivalOK
return &CityBusAPIEstimatedTimeOfArrivalOK{}
}
-/*CityBusAPIEstimatedTimeOfArrivalOK handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrivalOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIEstimatedTimeOfArrivalOK struct {
func (o *CityBusAPIEstimatedTimeOfArrivalOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/City/{City}][%d] cityBusApiEstimatedTimeOfArrivalOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrivalOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusN1EstimateTime {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIEstimatedTimeOfArrivalStatus299() *CityBusAPIEstimatedTimeOfAr
return &CityBusAPIEstimatedTimeOfArrivalStatus299{}
}
-/*CityBusAPIEstimatedTimeOfArrivalStatus299 handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrivalStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIEstimatedTimeOfArrivalStatus299 struct {
func (o *CityBusAPIEstimatedTimeOfArrivalStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/City/{City}][%d] cityBusApiEstimatedTimeOfArrivalStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrivalStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIEstimatedTimeOfArrivalStatus299) readResponse(response runtim
return nil
}
+
+// NewCityBusAPIEstimatedTimeOfArrivalNotModified creates a CityBusAPIEstimatedTimeOfArrivalNotModified with default headers values
+func NewCityBusAPIEstimatedTimeOfArrivalNotModified() *CityBusAPIEstimatedTimeOfArrivalNotModified {
+ return &CityBusAPIEstimatedTimeOfArrivalNotModified{}
+}
+
+/* CityBusAPIEstimatedTimeOfArrivalNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIEstimatedTimeOfArrivalNotModified struct {
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrivalNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/City/{City}][%d] cityBusApiEstimatedTimeOfArrivalNotModified ", 304)
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrivalNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_1_parameters.go b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_1_parameters.go
index 57710675..bf04adef 100644
--- a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIEstimatedTimeOfArrivalUDP1Params creates a new CityBusAPIEstimatedTimeOfArrivalUDP1Params object
-// with the default values initialized.
+// NewCityBusAPIEstimatedTimeOfArrivalUDP1Params creates a new CityBusAPIEstimatedTimeOfArrivalUDP1Params 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 NewCityBusAPIEstimatedTimeOfArrivalUDP1Params() *CityBusAPIEstimatedTimeOfArrivalUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithTimeout creates a new CityBusAPIEstimatedTimeOfArrivalUDP1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrivalUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithContext creates a new CityBusAPIEstimatedTimeOfArrivalUDP1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithContext(ctx context.Context) *CityBusAPIEstimatedTimeOfArrivalUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalUDP1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithHTTPClient creates a new CityBusAPIEstimatedTimeOfArrivalUDP1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithHTTPClient(client *http.Client) *CityBusAPIEstimatedTimeOfArrivalUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalUDP1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIEstimatedTimeOfArrivalUDP1Params contains all the parameters to send to the API endpoint
-for the city bus Api estimated time of arrival UDP 1 operation typically these are written to a http.Request
+/* CityBusAPIEstimatedTimeOfArrivalUDP1Params contains all the parameters to send to the API endpoint
+ for the city bus Api estimated time of arrival UDP 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIEstimatedTimeOfArrivalUDP1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIEstimatedTimeOfArrivalUDP1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api estimated time of arrival UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrivalUDP1Params) WithDefaults() *CityBusAPIEstimatedTimeOfArrivalUDP1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api estimated time of arrival UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrivalUDP1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIEstimatedTimeOfArrivalUDP1Params{
+ 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 estimated time of arrival UDP 1 params
func (o *CityBusAPIEstimatedTimeOfArrivalUDP1Params) WithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrivalUDP1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIEstimatedTimeOfArrivalUDP1Params) WriteToRequest(r runtime.Cl
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPIEstimatedTimeOfArrivalUDP1Params) WriteToRequest(r runtime.Cl
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPIEstimatedTimeOfArrivalUDP1Params) WriteToRequest(r runtime.Cl
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_1_responses.go b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_1_responses.go
index 1c9a6f69..14e50ca4 100644
--- a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIEstimatedTimeOfArrivalUDP1Reader) ReadResponse(response runti
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIEstimatedTimeOfArrivalUdp1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIEstimatedTimeOfArrivalUdp1OK() *CityBusAPIEstimatedTimeOfArriv
return &CityBusAPIEstimatedTimeOfArrivalUdp1OK{}
}
-/*CityBusAPIEstimatedTimeOfArrivalUdp1OK handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrivalUdp1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIEstimatedTimeOfArrivalUdp1OK struct {
func (o *CityBusAPIEstimatedTimeOfArrivalUdp1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/City/{City}/{RouteName}][%d] cityBusApiEstimatedTimeOfArrivalUdp1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrivalUdp1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusN1EstimateTime {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIEstimatedTimeOfArrivalUdp1Status299() *CityBusAPIEstimatedTime
return &CityBusAPIEstimatedTimeOfArrivalUdp1Status299{}
}
-/*CityBusAPIEstimatedTimeOfArrivalUdp1Status299 handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrivalUdp1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIEstimatedTimeOfArrivalUdp1Status299 struct {
func (o *CityBusAPIEstimatedTimeOfArrivalUdp1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/City/{City}/{RouteName}][%d] cityBusApiEstimatedTimeOfArrivalUdp1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrivalUdp1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIEstimatedTimeOfArrivalUdp1Status299) readResponse(response ru
return nil
}
+
+// NewCityBusAPIEstimatedTimeOfArrivalUdp1NotModified creates a CityBusAPIEstimatedTimeOfArrivalUdp1NotModified with default headers values
+func NewCityBusAPIEstimatedTimeOfArrivalUdp1NotModified() *CityBusAPIEstimatedTimeOfArrivalUdp1NotModified {
+ return &CityBusAPIEstimatedTimeOfArrivalUdp1NotModified{}
+}
+
+/* CityBusAPIEstimatedTimeOfArrivalUdp1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIEstimatedTimeOfArrivalUdp1NotModified struct {
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrivalUdp1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/City/{City}/{RouteName}][%d] cityBusApiEstimatedTimeOfArrivalUdp1NotModified ", 304)
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrivalUdp1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_parameters.go b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_parameters.go
index 80988855..d8039346 100644
--- a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIEstimatedTimeOfArrivalUDPParams creates a new CityBusAPIEstimatedTimeOfArrivalUDPParams object
-// with the default values initialized.
+// NewCityBusAPIEstimatedTimeOfArrivalUDPParams creates a new CityBusAPIEstimatedTimeOfArrivalUDPParams 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 NewCityBusAPIEstimatedTimeOfArrivalUDPParams() *CityBusAPIEstimatedTimeOfArrivalUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrivalUDPParamsWithTimeout creates a new CityBusAPIEstimatedTimeOfArrivalUDPParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIEstimatedTimeOfArrivalUDPParamsWithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrivalUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrivalUDPParamsWithContext creates a new CityBusAPIEstimatedTimeOfArrivalUDPParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIEstimatedTimeOfArrivalUDPParamsWithContext(ctx context.Context) *CityBusAPIEstimatedTimeOfArrivalUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalUDPParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIEstimatedTimeOfArrivalUDPParamsWithHTTPClient creates a new CityBusAPIEstimatedTimeOfArrivalUDPParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIEstimatedTimeOfArrivalUDPParamsWithHTTPClient(client *http.Client) *CityBusAPIEstimatedTimeOfArrivalUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrivalUDPParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIEstimatedTimeOfArrivalUDPParams contains all the parameters to send to the API endpoint
-for the city bus Api estimated time of arrival UDP operation typically these are written to a http.Request
+/* CityBusAPIEstimatedTimeOfArrivalUDPParams contains all the parameters to send to the API endpoint
+ for the city bus Api estimated time of arrival UDP operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIEstimatedTimeOfArrivalUDPParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIEstimatedTimeOfArrivalUDPParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api estimated time of arrival UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrivalUDPParams) WithDefaults() *CityBusAPIEstimatedTimeOfArrivalUDPParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api estimated time of arrival UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrivalUDPParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIEstimatedTimeOfArrivalUDPParams{
+ 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 estimated time of arrival UDP params
func (o *CityBusAPIEstimatedTimeOfArrivalUDPParams) WithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrivalUDPParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIEstimatedTimeOfArrivalUDPParams) WriteToRequest(r runtime.Cli
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIEstimatedTimeOfArrivalUDPParams) WriteToRequest(r runtime.Cli
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIEstimatedTimeOfArrivalUDPParams) WriteToRequest(r runtime.Cli
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_responses.go b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_responses.go
index ee43b421..0c2812c9 100644
--- a/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_estimated_time_of_arrival_udp_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIEstimatedTimeOfArrivalUDPReader) ReadResponse(response runtim
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIEstimatedTimeOfArrivalUDPNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIEstimatedTimeOfArrivalUDPOK() *CityBusAPIEstimatedTimeOfArriva
return &CityBusAPIEstimatedTimeOfArrivalUDPOK{}
}
-/*CityBusAPIEstimatedTimeOfArrivalUDPOK handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrivalUDPOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIEstimatedTimeOfArrivalUDPOK struct {
func (o *CityBusAPIEstimatedTimeOfArrivalUDPOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/City/{City}][%d] cityBusApiEstimatedTimeOfArrivalUdpOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrivalUDPOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusN1EstimateTime {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIEstimatedTimeOfArrivalUDPStatus299() *CityBusAPIEstimatedTimeO
return &CityBusAPIEstimatedTimeOfArrivalUDPStatus299{}
}
-/*CityBusAPIEstimatedTimeOfArrivalUDPStatus299 handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrivalUDPStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIEstimatedTimeOfArrivalUDPStatus299 struct {
func (o *CityBusAPIEstimatedTimeOfArrivalUDPStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/City/{City}][%d] cityBusApiEstimatedTimeOfArrivalUdpStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrivalUDPStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIEstimatedTimeOfArrivalUDPStatus299) readResponse(response run
return nil
}
+
+// NewCityBusAPIEstimatedTimeOfArrivalUDPNotModified creates a CityBusAPIEstimatedTimeOfArrivalUDPNotModified with default headers values
+func NewCityBusAPIEstimatedTimeOfArrivalUDPNotModified() *CityBusAPIEstimatedTimeOfArrivalUDPNotModified {
+ return &CityBusAPIEstimatedTimeOfArrivalUDPNotModified{}
+}
+
+/* CityBusAPIEstimatedTimeOfArrivalUDPNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIEstimatedTimeOfArrivalUDPNotModified struct {
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrivalUDPNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/City/{City}][%d] cityBusApiEstimatedTimeOfArrivalUdpNotModified ", 304)
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrivalUDPNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_first_last_trip_info1_parameters.go b/bus/v2/client/city_bus/city_bus_api_first_last_trip_info1_parameters.go
index 3a9ffdd6..059c6dd2 100644
--- a/bus/v2/client/city_bus/city_bus_api_first_last_trip_info1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_first_last_trip_info1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIFirstLastTripInfo1Params creates a new CityBusAPIFirstLastTripInfo1Params object
-// with the default values initialized.
+// NewCityBusAPIFirstLastTripInfo1Params creates a new CityBusAPIFirstLastTripInfo1Params 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 NewCityBusAPIFirstLastTripInfo1Params() *CityBusAPIFirstLastTripInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfo1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIFirstLastTripInfo1ParamsWithTimeout creates a new CityBusAPIFirstLastTripInfo1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIFirstLastTripInfo1ParamsWithTimeout(timeout time.Duration) *CityBusAPIFirstLastTripInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfo1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIFirstLastTripInfo1ParamsWithContext creates a new CityBusAPIFirstLastTripInfo1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIFirstLastTripInfo1ParamsWithContext(ctx context.Context) *CityBusAPIFirstLastTripInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfo1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIFirstLastTripInfo1ParamsWithHTTPClient creates a new CityBusAPIFirstLastTripInfo1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIFirstLastTripInfo1ParamsWithHTTPClient(client *http.Client) *CityBusAPIFirstLastTripInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfo1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIFirstLastTripInfo1Params contains all the parameters to send to the API endpoint
-for the city bus Api first last trip info 1 operation typically these are written to a http.Request
+/* CityBusAPIFirstLastTripInfo1Params contains all the parameters to send to the API endpoint
+ for the city bus Api first last trip info 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIFirstLastTripInfo1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIFirstLastTripInfo1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api first last trip info 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIFirstLastTripInfo1Params) WithDefaults() *CityBusAPIFirstLastTripInfo1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api first last trip info 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIFirstLastTripInfo1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIFirstLastTripInfo1Params{
+ 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 first last trip info 1 params
func (o *CityBusAPIFirstLastTripInfo1Params) WithTimeout(timeout time.Duration) *CityBusAPIFirstLastTripInfo1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIFirstLastTripInfo1Params) WriteToRequest(r runtime.ClientRequ
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPIFirstLastTripInfo1Params) WriteToRequest(r runtime.ClientRequ
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPIFirstLastTripInfo1Params) WriteToRequest(r runtime.ClientRequ
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_first_last_trip_info1_responses.go b/bus/v2/client/city_bus/city_bus_api_first_last_trip_info1_responses.go
index 312d7f5b..1702fdc3 100644
--- a/bus/v2/client/city_bus/city_bus_api_first_last_trip_info1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_first_last_trip_info1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIFirstLastTripInfo1Reader) ReadResponse(response runtime.Clien
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIFirstLastTripInfo1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIFirstLastTripInfo1OK() *CityBusAPIFirstLastTripInfo1OK {
return &CityBusAPIFirstLastTripInfo1OK{}
}
-/*CityBusAPIFirstLastTripInfo1OK handles this case with default header values.
+/* CityBusAPIFirstLastTripInfo1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIFirstLastTripInfo1OK struct {
func (o *CityBusAPIFirstLastTripInfo1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/FirstLastTripInfo/City/{City}/{RouteName}][%d] cityBusApiFirstLastTripInfo1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIFirstLastTripInfo1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusFirstLastTripInfo {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIFirstLastTripInfo1Status299() *CityBusAPIFirstLastTripInfo1Sta
return &CityBusAPIFirstLastTripInfo1Status299{}
}
-/*CityBusAPIFirstLastTripInfo1Status299 handles this case with default header values.
+/* CityBusAPIFirstLastTripInfo1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIFirstLastTripInfo1Status299 struct {
func (o *CityBusAPIFirstLastTripInfo1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/FirstLastTripInfo/City/{City}/{RouteName}][%d] cityBusApiFirstLastTripInfo1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIFirstLastTripInfo1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIFirstLastTripInfo1Status299) readResponse(response runtime.Cl
return nil
}
+
+// NewCityBusAPIFirstLastTripInfo1NotModified creates a CityBusAPIFirstLastTripInfo1NotModified with default headers values
+func NewCityBusAPIFirstLastTripInfo1NotModified() *CityBusAPIFirstLastTripInfo1NotModified {
+ return &CityBusAPIFirstLastTripInfo1NotModified{}
+}
+
+/* CityBusAPIFirstLastTripInfo1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIFirstLastTripInfo1NotModified struct {
+}
+
+func (o *CityBusAPIFirstLastTripInfo1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/FirstLastTripInfo/City/{City}/{RouteName}][%d] cityBusApiFirstLastTripInfo1NotModified ", 304)
+}
+
+func (o *CityBusAPIFirstLastTripInfo1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_first_last_trip_info_parameters.go b/bus/v2/client/city_bus/city_bus_api_first_last_trip_info_parameters.go
index 72c8b61b..4a74d97d 100644
--- a/bus/v2/client/city_bus/city_bus_api_first_last_trip_info_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_first_last_trip_info_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIFirstLastTripInfoParams creates a new CityBusAPIFirstLastTripInfoParams object
-// with the default values initialized.
+// NewCityBusAPIFirstLastTripInfoParams creates a new CityBusAPIFirstLastTripInfoParams 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 NewCityBusAPIFirstLastTripInfoParams() *CityBusAPIFirstLastTripInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfoParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIFirstLastTripInfoParamsWithTimeout creates a new CityBusAPIFirstLastTripInfoParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIFirstLastTripInfoParamsWithTimeout(timeout time.Duration) *CityBusAPIFirstLastTripInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfoParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIFirstLastTripInfoParamsWithContext creates a new CityBusAPIFirstLastTripInfoParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIFirstLastTripInfoParamsWithContext(ctx context.Context) *CityBusAPIFirstLastTripInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfoParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIFirstLastTripInfoParamsWithHTTPClient creates a new CityBusAPIFirstLastTripInfoParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIFirstLastTripInfoParamsWithHTTPClient(client *http.Client) *CityBusAPIFirstLastTripInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfoParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIFirstLastTripInfoParams contains all the parameters to send to the API endpoint
-for the city bus Api first last trip info operation typically these are written to a http.Request
+/* CityBusAPIFirstLastTripInfoParams contains all the parameters to send to the API endpoint
+ for the city bus Api first last trip info operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIFirstLastTripInfoParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIFirstLastTripInfoParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api first last trip info params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIFirstLastTripInfoParams) WithDefaults() *CityBusAPIFirstLastTripInfoParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api first last trip info params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIFirstLastTripInfoParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIFirstLastTripInfoParams{
+ 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 first last trip info params
func (o *CityBusAPIFirstLastTripInfoParams) WithTimeout(timeout time.Duration) *CityBusAPIFirstLastTripInfoParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIFirstLastTripInfoParams) WriteToRequest(r runtime.ClientReque
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIFirstLastTripInfoParams) WriteToRequest(r runtime.ClientReque
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIFirstLastTripInfoParams) WriteToRequest(r runtime.ClientReque
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_first_last_trip_info_responses.go b/bus/v2/client/city_bus/city_bus_api_first_last_trip_info_responses.go
index 4f503d31..b16c05e4 100644
--- a/bus/v2/client/city_bus/city_bus_api_first_last_trip_info_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_first_last_trip_info_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIFirstLastTripInfoReader) ReadResponse(response runtime.Client
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIFirstLastTripInfoNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIFirstLastTripInfoOK() *CityBusAPIFirstLastTripInfoOK {
return &CityBusAPIFirstLastTripInfoOK{}
}
-/*CityBusAPIFirstLastTripInfoOK handles this case with default header values.
+/* CityBusAPIFirstLastTripInfoOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIFirstLastTripInfoOK struct {
func (o *CityBusAPIFirstLastTripInfoOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/FirstLastTripInfo/City/{City}][%d] cityBusApiFirstLastTripInfoOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIFirstLastTripInfoOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusFirstLastTripInfo {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIFirstLastTripInfoStatus299() *CityBusAPIFirstLastTripInfoStatu
return &CityBusAPIFirstLastTripInfoStatus299{}
}
-/*CityBusAPIFirstLastTripInfoStatus299 handles this case with default header values.
+/* CityBusAPIFirstLastTripInfoStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIFirstLastTripInfoStatus299 struct {
func (o *CityBusAPIFirstLastTripInfoStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/FirstLastTripInfo/City/{City}][%d] cityBusApiFirstLastTripInfoStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIFirstLastTripInfoStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIFirstLastTripInfoStatus299) readResponse(response runtime.Cli
return nil
}
+
+// NewCityBusAPIFirstLastTripInfoNotModified creates a CityBusAPIFirstLastTripInfoNotModified with default headers values
+func NewCityBusAPIFirstLastTripInfoNotModified() *CityBusAPIFirstLastTripInfoNotModified {
+ return &CityBusAPIFirstLastTripInfoNotModified{}
+}
+
+/* CityBusAPIFirstLastTripInfoNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIFirstLastTripInfoNotModified struct {
+}
+
+func (o *CityBusAPIFirstLastTripInfoNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/FirstLastTripInfo/City/{City}][%d] cityBusApiFirstLastTripInfoNotModified ", 304)
+}
+
+func (o *CityBusAPIFirstLastTripInfoNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_news_parameters.go b/bus/v2/client/city_bus/city_bus_api_news_parameters.go
index 061f379a..95140d5b 100644
--- a/bus/v2/client/city_bus/city_bus_api_news_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_news_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPINewsParams creates a new CityBusAPINewsParams object
-// with the default values initialized.
+// NewCityBusAPINewsParams creates a new CityBusAPINewsParams 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 NewCityBusAPINewsParams() *CityBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPINewsParamsWithTimeout creates a new CityBusAPINewsParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPINewsParamsWithTimeout(timeout time.Duration) *CityBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPINewsParamsWithContext creates a new CityBusAPINewsParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPINewsParamsWithContext(ctx context.Context) *CityBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINewsParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPINewsParamsWithHTTPClient creates a new CityBusAPINewsParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPINewsParamsWithHTTPClient(client *http.Client) *CityBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINewsParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPINewsParams contains all the parameters to send to the API endpoint
-for the city bus Api news operation typically these are written to a http.Request
+/* CityBusAPINewsParams contains all the parameters to send to the API endpoint
+ for the city bus Api news operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPINewsParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPINewsParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPINewsParams) WithDefaults() *CityBusAPINewsParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPINewsParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPINewsParams{
+ 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 news params
func (o *CityBusAPINewsParams) WithTimeout(timeout time.Duration) *CityBusAPINewsParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_news_responses.go b/bus/v2/client/city_bus/city_bus_api_news_responses.go
index 7aba090c..7fa0135e 100644
--- a/bus/v2/client/city_bus/city_bus_api_news_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_news_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPINewsReader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPINewsNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPINewsOK() *CityBusAPINewsOK {
return &CityBusAPINewsOK{}
}
-/*CityBusAPINewsOK handles this case with default header values.
+/* CityBusAPINewsOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPINewsOK struct {
func (o *CityBusAPINewsOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/News/City/{City}][%d] cityBusApiNewsOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPINewsOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusNews {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPINewsStatus299() *CityBusAPINewsStatus299 {
return &CityBusAPINewsStatus299{}
}
-/*CityBusAPINewsStatus299 handles this case with default header values.
+/* CityBusAPINewsStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPINewsStatus299 struct {
func (o *CityBusAPINewsStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/News/City/{City}][%d] cityBusApiNewsStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPINewsStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPINewsStatus299) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewCityBusAPINewsNotModified creates a CityBusAPINewsNotModified with default headers values
+func NewCityBusAPINewsNotModified() *CityBusAPINewsNotModified {
+ return &CityBusAPINewsNotModified{}
+}
+
+/* CityBusAPINewsNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPINewsNotModified struct {
+}
+
+func (o *CityBusAPINewsNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/News/City/{City}][%d] cityBusApiNewsNotModified ", 304)
+}
+
+func (o *CityBusAPINewsNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_operator_parameters.go b/bus/v2/client/city_bus/city_bus_api_operator_parameters.go
index f0390505..6044657b 100644
--- a/bus/v2/client/city_bus/city_bus_api_operator_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_operator_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIOperatorParams creates a new CityBusAPIOperatorParams object
-// with the default values initialized.
+// NewCityBusAPIOperatorParams creates a new CityBusAPIOperatorParams 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 NewCityBusAPIOperatorParams() *CityBusAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIOperatorParamsWithTimeout creates a new CityBusAPIOperatorParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIOperatorParamsWithTimeout(timeout time.Duration) *CityBusAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIOperatorParamsWithContext creates a new CityBusAPIOperatorParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIOperatorParamsWithContext(ctx context.Context) *CityBusAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIOperatorParamsWithHTTPClient creates a new CityBusAPIOperatorParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIOperatorParamsWithHTTPClient(client *http.Client) *CityBusAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIOperatorParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIOperatorParams contains all the parameters to send to the API endpoint
-for the city bus Api operator operation typically these are written to a http.Request
+/* CityBusAPIOperatorParams contains all the parameters to send to the API endpoint
+ for the city bus Api operator operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIOperatorParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIOperatorParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api operator params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIOperatorParams) WithDefaults() *CityBusAPIOperatorParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api operator params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIOperatorParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIOperatorParams{
+ 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 operator params
func (o *CityBusAPIOperatorParams) WithTimeout(timeout time.Duration) *CityBusAPIOperatorParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIOperatorParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIOperatorParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIOperatorParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_operator_responses.go b/bus/v2/client/city_bus/city_bus_api_operator_responses.go
index c235f4f9..8293b515 100644
--- a/bus/v2/client/city_bus/city_bus_api_operator_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_operator_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIOperatorReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIOperatorNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIOperatorOK() *CityBusAPIOperatorOK {
return &CityBusAPIOperatorOK{}
}
-/*CityBusAPIOperatorOK handles this case with default header values.
+/* CityBusAPIOperatorOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIOperatorOK struct {
func (o *CityBusAPIOperatorOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Operator/City/{City}][%d] cityBusApiOperatorOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIOperatorOK) GetPayload() []*models.PTXServiceDTOSharedSpecificationV2BaseOperator {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIOperatorStatus299() *CityBusAPIOperatorStatus299 {
return &CityBusAPIOperatorStatus299{}
}
-/*CityBusAPIOperatorStatus299 handles this case with default header values.
+/* CityBusAPIOperatorStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIOperatorStatus299 struct {
func (o *CityBusAPIOperatorStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Operator/City/{City}][%d] cityBusApiOperatorStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIOperatorStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIOperatorStatus299) readResponse(response runtime.ClientRespon
return nil
}
+
+// NewCityBusAPIOperatorNotModified creates a CityBusAPIOperatorNotModified with default headers values
+func NewCityBusAPIOperatorNotModified() *CityBusAPIOperatorNotModified {
+ return &CityBusAPIOperatorNotModified{}
+}
+
+/* CityBusAPIOperatorNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIOperatorNotModified struct {
+}
+
+func (o *CityBusAPIOperatorNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Operator/City/{City}][%d] cityBusApiOperatorNotModified ", 304)
+}
+
+func (o *CityBusAPIOperatorNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency1_parameters.go b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency1_parameters.go
index d0a358d1..ef8f7e24 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency1_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeByFrequency1Params creates a new CityBusAPIRealTimeByFrequency1Params object
-// with the default values initialized.
+// NewCityBusAPIRealTimeByFrequency1Params creates a new CityBusAPIRealTimeByFrequency1Params 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 NewCityBusAPIRealTimeByFrequency1Params() *CityBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeByFrequency1ParamsWithTimeout creates a new CityBusAPIRealTimeByFrequency1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeByFrequency1ParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeByFrequency1ParamsWithContext creates a new CityBusAPIRealTimeByFrequency1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeByFrequency1ParamsWithContext(ctx context.Context) *CityBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeByFrequency1ParamsWithHTTPClient creates a new CityBusAPIRealTimeByFrequency1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeByFrequency1ParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeByFrequency1Params contains all the parameters to send to the API endpoint
-for the city bus Api real time by frequency 1 operation typically these are written to a http.Request
+/* CityBusAPIRealTimeByFrequency1Params contains all the parameters to send to the API endpoint
+ for the city bus Api real time by frequency 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeByFrequency1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -129,6 +127,32 @@ type CityBusAPIRealTimeByFrequency1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time by frequency 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequency1Params) WithDefaults() *CityBusAPIRealTimeByFrequency1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time by frequency 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequency1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeByFrequency1Params{
+ 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 real time by frequency 1 params
func (o *CityBusAPIRealTimeByFrequency1Params) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequency1Params {
o.SetTimeout(timeout)
@@ -284,22 +308,24 @@ func (o *CityBusAPIRealTimeByFrequency1Params) WriteToRequest(r runtime.ClientRe
// 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
}
@@ -309,80 +335,85 @@ func (o *CityBusAPIRealTimeByFrequency1Params) WriteToRequest(r runtime.ClientRe
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -399,16 +430,17 @@ func (o *CityBusAPIRealTimeByFrequency1Params) WriteToRequest(r runtime.ClientRe
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency1_responses.go b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency1_responses.go
index b6fdb2fd..5cf7d224 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeByFrequency1Reader) ReadResponse(response runtime.Cli
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeByFrequency1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeByFrequency1OK() *CityBusAPIRealTimeByFrequency1OK {
return &CityBusAPIRealTimeByFrequency1OK{}
}
-/*CityBusAPIRealTimeByFrequency1OK handles this case with default header values.
+/* CityBusAPIRealTimeByFrequency1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeByFrequency1OK struct {
func (o *CityBusAPIRealTimeByFrequency1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/City/{City}/{RouteName}][%d] cityBusApiRealTimeByFrequency1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequency1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA1Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRealTimeByFrequency1Status299() *CityBusAPIRealTimeByFrequency
return &CityBusAPIRealTimeByFrequency1Status299{}
}
-/*CityBusAPIRealTimeByFrequency1Status299 handles this case with default header values.
+/* CityBusAPIRealTimeByFrequency1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRealTimeByFrequency1Status299 struct {
func (o *CityBusAPIRealTimeByFrequency1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/City/{City}/{RouteName}][%d] cityBusApiRealTimeByFrequency1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequency1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRealTimeByFrequency1Status299) readResponse(response runtime.
return nil
}
+
+// NewCityBusAPIRealTimeByFrequency1NotModified creates a CityBusAPIRealTimeByFrequency1NotModified with default headers values
+func NewCityBusAPIRealTimeByFrequency1NotModified() *CityBusAPIRealTimeByFrequency1NotModified {
+ return &CityBusAPIRealTimeByFrequency1NotModified{}
+}
+
+/* CityBusAPIRealTimeByFrequency1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeByFrequency1NotModified struct {
+}
+
+func (o *CityBusAPIRealTimeByFrequency1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/City/{City}/{RouteName}][%d] cityBusApiRealTimeByFrequency1NotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeByFrequency1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_parameters.go b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_parameters.go
index 18a0ec98..1f0f853b 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeByFrequencyParams creates a new CityBusAPIRealTimeByFrequencyParams object
-// with the default values initialized.
+// NewCityBusAPIRealTimeByFrequencyParams creates a new CityBusAPIRealTimeByFrequencyParams 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 NewCityBusAPIRealTimeByFrequencyParams() *CityBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeByFrequencyParamsWithTimeout creates a new CityBusAPIRealTimeByFrequencyParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeByFrequencyParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeByFrequencyParamsWithContext creates a new CityBusAPIRealTimeByFrequencyParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeByFrequencyParamsWithContext(ctx context.Context) *CityBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeByFrequencyParamsWithHTTPClient creates a new CityBusAPIRealTimeByFrequencyParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeByFrequencyParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeByFrequencyParams contains all the parameters to send to the API endpoint
-for the city bus Api real time by frequency operation typically these are written to a http.Request
+/* CityBusAPIRealTimeByFrequencyParams contains all the parameters to send to the API endpoint
+ for the city bus Api real time by frequency operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeByFrequencyParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIRealTimeByFrequencyParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time by frequency params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequencyParams) WithDefaults() *CityBusAPIRealTimeByFrequencyParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time by frequency params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequencyParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeByFrequencyParams{
+ 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 real time by frequency params
func (o *CityBusAPIRealTimeByFrequencyParams) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequencyParams {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIRealTimeByFrequencyParams) WriteToRequest(r runtime.ClientReq
// 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
}
@@ -293,80 +318,85 @@ func (o *CityBusAPIRealTimeByFrequencyParams) WriteToRequest(r runtime.ClientReq
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIRealTimeByFrequencyParams) WriteToRequest(r runtime.ClientReq
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_responses.go b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_responses.go
index 3bcb5dce..89b54716 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeByFrequencyReader) ReadResponse(response runtime.Clie
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeByFrequencyNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeByFrequencyOK() *CityBusAPIRealTimeByFrequencyOK {
return &CityBusAPIRealTimeByFrequencyOK{}
}
-/*CityBusAPIRealTimeByFrequencyOK handles this case with default header values.
+/* CityBusAPIRealTimeByFrequencyOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeByFrequencyOK struct {
func (o *CityBusAPIRealTimeByFrequencyOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/City/{City}][%d] cityBusApiRealTimeByFrequencyOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequencyOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA1Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRealTimeByFrequencyStatus299() *CityBusAPIRealTimeByFrequencyS
return &CityBusAPIRealTimeByFrequencyStatus299{}
}
-/*CityBusAPIRealTimeByFrequencyStatus299 handles this case with default header values.
+/* CityBusAPIRealTimeByFrequencyStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRealTimeByFrequencyStatus299 struct {
func (o *CityBusAPIRealTimeByFrequencyStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/City/{City}][%d] cityBusApiRealTimeByFrequencyStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequencyStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRealTimeByFrequencyStatus299) readResponse(response runtime.C
return nil
}
+
+// NewCityBusAPIRealTimeByFrequencyNotModified creates a CityBusAPIRealTimeByFrequencyNotModified with default headers values
+func NewCityBusAPIRealTimeByFrequencyNotModified() *CityBusAPIRealTimeByFrequencyNotModified {
+ return &CityBusAPIRealTimeByFrequencyNotModified{}
+}
+
+/* CityBusAPIRealTimeByFrequencyNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeByFrequencyNotModified struct {
+}
+
+func (o *CityBusAPIRealTimeByFrequencyNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/City/{City}][%d] cityBusApiRealTimeByFrequencyNotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeByFrequencyNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_1_parameters.go b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_1_parameters.go
index e796c2f8..91dc217c 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_1_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeByFrequencyUDP1Params creates a new CityBusAPIRealTimeByFrequencyUDP1Params object
-// with the default values initialized.
+// NewCityBusAPIRealTimeByFrequencyUDP1Params creates a new CityBusAPIRealTimeByFrequencyUDP1Params 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 NewCityBusAPIRealTimeByFrequencyUDP1Params() *CityBusAPIRealTimeByFrequencyUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeByFrequencyUDP1ParamsWithTimeout creates a new CityBusAPIRealTimeByFrequencyUDP1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeByFrequencyUDP1ParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequencyUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeByFrequencyUDP1ParamsWithContext creates a new CityBusAPIRealTimeByFrequencyUDP1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeByFrequencyUDP1ParamsWithContext(ctx context.Context) *CityBusAPIRealTimeByFrequencyUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyUDP1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeByFrequencyUDP1ParamsWithHTTPClient creates a new CityBusAPIRealTimeByFrequencyUDP1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeByFrequencyUDP1ParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeByFrequencyUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyUDP1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeByFrequencyUDP1Params contains all the parameters to send to the API endpoint
-for the city bus Api real time by frequency UDP 1 operation typically these are written to a http.Request
+/* CityBusAPIRealTimeByFrequencyUDP1Params contains all the parameters to send to the API endpoint
+ for the city bus Api real time by frequency UDP 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeByFrequencyUDP1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -129,6 +127,32 @@ type CityBusAPIRealTimeByFrequencyUDP1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time by frequency UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequencyUDP1Params) WithDefaults() *CityBusAPIRealTimeByFrequencyUDP1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time by frequency UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequencyUDP1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeByFrequencyUDP1Params{
+ 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 real time by frequency UDP 1 params
func (o *CityBusAPIRealTimeByFrequencyUDP1Params) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequencyUDP1Params {
o.SetTimeout(timeout)
@@ -284,22 +308,24 @@ func (o *CityBusAPIRealTimeByFrequencyUDP1Params) WriteToRequest(r runtime.Clien
// 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
}
@@ -309,80 +335,85 @@ func (o *CityBusAPIRealTimeByFrequencyUDP1Params) WriteToRequest(r runtime.Clien
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -399,16 +430,17 @@ func (o *CityBusAPIRealTimeByFrequencyUDP1Params) WriteToRequest(r runtime.Clien
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_1_responses.go b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_1_responses.go
index 99c9c16a..f459c7cb 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeByFrequencyUDP1Reader) ReadResponse(response runtime.
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeByFrequencyUdp1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeByFrequencyUdp1OK() *CityBusAPIRealTimeByFrequencyUdp1
return &CityBusAPIRealTimeByFrequencyUdp1OK{}
}
-/*CityBusAPIRealTimeByFrequencyUdp1OK handles this case with default header values.
+/* CityBusAPIRealTimeByFrequencyUdp1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeByFrequencyUdp1OK struct {
func (o *CityBusAPIRealTimeByFrequencyUdp1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/City/{City}/{RouteName}][%d] cityBusApiRealTimeByFrequencyUdp1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequencyUdp1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA1Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRealTimeByFrequencyUdp1Status299() *CityBusAPIRealTimeByFreque
return &CityBusAPIRealTimeByFrequencyUdp1Status299{}
}
-/*CityBusAPIRealTimeByFrequencyUdp1Status299 handles this case with default header values.
+/* CityBusAPIRealTimeByFrequencyUdp1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRealTimeByFrequencyUdp1Status299 struct {
func (o *CityBusAPIRealTimeByFrequencyUdp1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/City/{City}/{RouteName}][%d] cityBusApiRealTimeByFrequencyUdp1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequencyUdp1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRealTimeByFrequencyUdp1Status299) readResponse(response runti
return nil
}
+
+// NewCityBusAPIRealTimeByFrequencyUdp1NotModified creates a CityBusAPIRealTimeByFrequencyUdp1NotModified with default headers values
+func NewCityBusAPIRealTimeByFrequencyUdp1NotModified() *CityBusAPIRealTimeByFrequencyUdp1NotModified {
+ return &CityBusAPIRealTimeByFrequencyUdp1NotModified{}
+}
+
+/* CityBusAPIRealTimeByFrequencyUdp1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeByFrequencyUdp1NotModified struct {
+}
+
+func (o *CityBusAPIRealTimeByFrequencyUdp1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/City/{City}/{RouteName}][%d] cityBusApiRealTimeByFrequencyUdp1NotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeByFrequencyUdp1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_parameters.go b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_parameters.go
index 35c34eda..d4050662 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeByFrequencyUDPParams creates a new CityBusAPIRealTimeByFrequencyUDPParams object
-// with the default values initialized.
+// NewCityBusAPIRealTimeByFrequencyUDPParams creates a new CityBusAPIRealTimeByFrequencyUDPParams 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 NewCityBusAPIRealTimeByFrequencyUDPParams() *CityBusAPIRealTimeByFrequencyUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeByFrequencyUDPParamsWithTimeout creates a new CityBusAPIRealTimeByFrequencyUDPParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeByFrequencyUDPParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequencyUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeByFrequencyUDPParamsWithContext creates a new CityBusAPIRealTimeByFrequencyUDPParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeByFrequencyUDPParamsWithContext(ctx context.Context) *CityBusAPIRealTimeByFrequencyUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyUDPParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeByFrequencyUDPParamsWithHTTPClient creates a new CityBusAPIRealTimeByFrequencyUDPParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeByFrequencyUDPParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeByFrequencyUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequencyUDPParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeByFrequencyUDPParams contains all the parameters to send to the API endpoint
-for the city bus Api real time by frequency UDP operation typically these are written to a http.Request
+/* CityBusAPIRealTimeByFrequencyUDPParams contains all the parameters to send to the API endpoint
+ for the city bus Api real time by frequency UDP operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeByFrequencyUDPParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIRealTimeByFrequencyUDPParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time by frequency UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequencyUDPParams) WithDefaults() *CityBusAPIRealTimeByFrequencyUDPParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time by frequency UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequencyUDPParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeByFrequencyUDPParams{
+ 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 real time by frequency UDP params
func (o *CityBusAPIRealTimeByFrequencyUDPParams) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequencyUDPParams {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIRealTimeByFrequencyUDPParams) WriteToRequest(r runtime.Client
// 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
}
@@ -293,80 +318,85 @@ func (o *CityBusAPIRealTimeByFrequencyUDPParams) WriteToRequest(r runtime.Client
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIRealTimeByFrequencyUDPParams) WriteToRequest(r runtime.Client
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_responses.go b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_responses.go
index 155c36bd..56762d83 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_by_frequency_udp_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeByFrequencyUDPReader) ReadResponse(response runtime.C
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeByFrequencyUDPNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeByFrequencyUDPOK() *CityBusAPIRealTimeByFrequencyUDPOK
return &CityBusAPIRealTimeByFrequencyUDPOK{}
}
-/*CityBusAPIRealTimeByFrequencyUDPOK handles this case with default header values.
+/* CityBusAPIRealTimeByFrequencyUDPOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeByFrequencyUDPOK struct {
func (o *CityBusAPIRealTimeByFrequencyUDPOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/City/{City}][%d] cityBusApiRealTimeByFrequencyUdpOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequencyUDPOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA1Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRealTimeByFrequencyUDPStatus299() *CityBusAPIRealTimeByFrequen
return &CityBusAPIRealTimeByFrequencyUDPStatus299{}
}
-/*CityBusAPIRealTimeByFrequencyUDPStatus299 handles this case with default header values.
+/* CityBusAPIRealTimeByFrequencyUDPStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRealTimeByFrequencyUDPStatus299 struct {
func (o *CityBusAPIRealTimeByFrequencyUDPStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/City/{City}][%d] cityBusApiRealTimeByFrequencyUdpStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequencyUDPStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRealTimeByFrequencyUDPStatus299) readResponse(response runtim
return nil
}
+
+// NewCityBusAPIRealTimeByFrequencyUDPNotModified creates a CityBusAPIRealTimeByFrequencyUDPNotModified with default headers values
+func NewCityBusAPIRealTimeByFrequencyUDPNotModified() *CityBusAPIRealTimeByFrequencyUDPNotModified {
+ return &CityBusAPIRealTimeByFrequencyUDPNotModified{}
+}
+
+/* CityBusAPIRealTimeByFrequencyUDPNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeByFrequencyUDPNotModified struct {
+}
+
+func (o *CityBusAPIRealTimeByFrequencyUDPNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/City/{City}][%d] cityBusApiRealTimeByFrequencyUdpNotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeByFrequencyUDPNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop1_parameters.go b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop1_parameters.go
index 4b828e23..f76d8391 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeNearStop1Params creates a new CityBusAPIRealTimeNearStop1Params object
-// with the default values initialized.
+// NewCityBusAPIRealTimeNearStop1Params creates a new CityBusAPIRealTimeNearStop1Params 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 NewCityBusAPIRealTimeNearStop1Params() *CityBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeNearStop1ParamsWithTimeout creates a new CityBusAPIRealTimeNearStop1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeNearStop1ParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeNearStop1ParamsWithContext creates a new CityBusAPIRealTimeNearStop1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeNearStop1ParamsWithContext(ctx context.Context) *CityBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeNearStop1ParamsWithHTTPClient creates a new CityBusAPIRealTimeNearStop1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeNearStop1ParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeNearStop1Params contains all the parameters to send to the API endpoint
-for the city bus Api real time near stop 1 operation typically these are written to a http.Request
+/* CityBusAPIRealTimeNearStop1Params contains all the parameters to send to the API endpoint
+ for the city bus Api real time near stop 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeNearStop1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIRealTimeNearStop1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time near stop 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStop1Params) WithDefaults() *CityBusAPIRealTimeNearStop1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time near stop 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStop1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeNearStop1Params{
+ 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 real time near stop 1 params
func (o *CityBusAPIRealTimeNearStop1Params) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStop1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIRealTimeNearStop1Params) WriteToRequest(r runtime.ClientReque
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPIRealTimeNearStop1Params) WriteToRequest(r runtime.ClientReque
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPIRealTimeNearStop1Params) WriteToRequest(r runtime.ClientReque
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop1_responses.go b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop1_responses.go
index fec479ad..7a6ca073 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeNearStop1Reader) ReadResponse(response runtime.Client
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeNearStop1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeNearStop1OK() *CityBusAPIRealTimeNearStop1OK {
return &CityBusAPIRealTimeNearStop1OK{}
}
-/*CityBusAPIRealTimeNearStop1OK handles this case with default header values.
+/* CityBusAPIRealTimeNearStop1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeNearStop1OK struct {
func (o *CityBusAPIRealTimeNearStop1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/City/{City}/{RouteName}][%d] cityBusApiRealTimeNearStop1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStop1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA2Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRealTimeNearStop1Status299() *CityBusAPIRealTimeNearStop1Statu
return &CityBusAPIRealTimeNearStop1Status299{}
}
-/*CityBusAPIRealTimeNearStop1Status299 handles this case with default header values.
+/* CityBusAPIRealTimeNearStop1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRealTimeNearStop1Status299 struct {
func (o *CityBusAPIRealTimeNearStop1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/City/{City}/{RouteName}][%d] cityBusApiRealTimeNearStop1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStop1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRealTimeNearStop1Status299) readResponse(response runtime.Cli
return nil
}
+
+// NewCityBusAPIRealTimeNearStop1NotModified creates a CityBusAPIRealTimeNearStop1NotModified with default headers values
+func NewCityBusAPIRealTimeNearStop1NotModified() *CityBusAPIRealTimeNearStop1NotModified {
+ return &CityBusAPIRealTimeNearStop1NotModified{}
+}
+
+/* CityBusAPIRealTimeNearStop1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeNearStop1NotModified struct {
+}
+
+func (o *CityBusAPIRealTimeNearStop1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/City/{City}/{RouteName}][%d] cityBusApiRealTimeNearStop1NotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeNearStop1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_parameters.go b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_parameters.go
index 2757e712..cb8adc90 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeNearStopParams creates a new CityBusAPIRealTimeNearStopParams object
-// with the default values initialized.
+// NewCityBusAPIRealTimeNearStopParams creates a new CityBusAPIRealTimeNearStopParams 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 NewCityBusAPIRealTimeNearStopParams() *CityBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeNearStopParamsWithTimeout creates a new CityBusAPIRealTimeNearStopParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeNearStopParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeNearStopParamsWithContext creates a new CityBusAPIRealTimeNearStopParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeNearStopParamsWithContext(ctx context.Context) *CityBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeNearStopParamsWithHTTPClient creates a new CityBusAPIRealTimeNearStopParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeNearStopParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeNearStopParams contains all the parameters to send to the API endpoint
-for the city bus Api real time near stop operation typically these are written to a http.Request
+/* CityBusAPIRealTimeNearStopParams contains all the parameters to send to the API endpoint
+ for the city bus Api real time near stop operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeNearStopParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIRealTimeNearStopParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time near stop params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStopParams) WithDefaults() *CityBusAPIRealTimeNearStopParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time near stop params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStopParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeNearStopParams{
+ 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 real time near stop params
func (o *CityBusAPIRealTimeNearStopParams) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStopParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIRealTimeNearStopParams) WriteToRequest(r runtime.ClientReques
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIRealTimeNearStopParams) WriteToRequest(r runtime.ClientReques
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIRealTimeNearStopParams) WriteToRequest(r runtime.ClientReques
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_responses.go b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_responses.go
index f878cb0f..f8711907 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeNearStopReader) ReadResponse(response runtime.ClientR
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeNearStopNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeNearStopOK() *CityBusAPIRealTimeNearStopOK {
return &CityBusAPIRealTimeNearStopOK{}
}
-/*CityBusAPIRealTimeNearStopOK handles this case with default header values.
+/* CityBusAPIRealTimeNearStopOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeNearStopOK struct {
func (o *CityBusAPIRealTimeNearStopOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/City/{City}][%d] cityBusApiRealTimeNearStopOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStopOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA2Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRealTimeNearStopStatus299() *CityBusAPIRealTimeNearStopStatus2
return &CityBusAPIRealTimeNearStopStatus299{}
}
-/*CityBusAPIRealTimeNearStopStatus299 handles this case with default header values.
+/* CityBusAPIRealTimeNearStopStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRealTimeNearStopStatus299 struct {
func (o *CityBusAPIRealTimeNearStopStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/City/{City}][%d] cityBusApiRealTimeNearStopStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStopStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRealTimeNearStopStatus299) readResponse(response runtime.Clie
return nil
}
+
+// NewCityBusAPIRealTimeNearStopNotModified creates a CityBusAPIRealTimeNearStopNotModified with default headers values
+func NewCityBusAPIRealTimeNearStopNotModified() *CityBusAPIRealTimeNearStopNotModified {
+ return &CityBusAPIRealTimeNearStopNotModified{}
+}
+
+/* CityBusAPIRealTimeNearStopNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeNearStopNotModified struct {
+}
+
+func (o *CityBusAPIRealTimeNearStopNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/City/{City}][%d] cityBusApiRealTimeNearStopNotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeNearStopNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_1_parameters.go b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_1_parameters.go
index 0e634504..18dea0aa 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeNearStopUDP1Params creates a new CityBusAPIRealTimeNearStopUDP1Params object
-// with the default values initialized.
+// NewCityBusAPIRealTimeNearStopUDP1Params creates a new CityBusAPIRealTimeNearStopUDP1Params 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 NewCityBusAPIRealTimeNearStopUDP1Params() *CityBusAPIRealTimeNearStopUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeNearStopUDP1ParamsWithTimeout creates a new CityBusAPIRealTimeNearStopUDP1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeNearStopUDP1ParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStopUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeNearStopUDP1ParamsWithContext creates a new CityBusAPIRealTimeNearStopUDP1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeNearStopUDP1ParamsWithContext(ctx context.Context) *CityBusAPIRealTimeNearStopUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopUDP1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeNearStopUDP1ParamsWithHTTPClient creates a new CityBusAPIRealTimeNearStopUDP1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeNearStopUDP1ParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeNearStopUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopUDP1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeNearStopUDP1Params contains all the parameters to send to the API endpoint
-for the city bus Api real time near stop UDP 1 operation typically these are written to a http.Request
+/* CityBusAPIRealTimeNearStopUDP1Params contains all the parameters to send to the API endpoint
+ for the city bus Api real time near stop UDP 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeNearStopUDP1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIRealTimeNearStopUDP1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time near stop UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStopUDP1Params) WithDefaults() *CityBusAPIRealTimeNearStopUDP1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time near stop UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStopUDP1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeNearStopUDP1Params{
+ 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 real time near stop UDP 1 params
func (o *CityBusAPIRealTimeNearStopUDP1Params) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStopUDP1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIRealTimeNearStopUDP1Params) WriteToRequest(r runtime.ClientRe
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPIRealTimeNearStopUDP1Params) WriteToRequest(r runtime.ClientRe
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPIRealTimeNearStopUDP1Params) WriteToRequest(r runtime.ClientRe
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_1_responses.go b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_1_responses.go
index 58b4cb3e..f00a50b1 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeNearStopUDP1Reader) ReadResponse(response runtime.Cli
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeNearStopUdp1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeNearStopUdp1OK() *CityBusAPIRealTimeNearStopUdp1OK {
return &CityBusAPIRealTimeNearStopUdp1OK{}
}
-/*CityBusAPIRealTimeNearStopUdp1OK handles this case with default header values.
+/* CityBusAPIRealTimeNearStopUdp1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeNearStopUdp1OK struct {
func (o *CityBusAPIRealTimeNearStopUdp1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/City/{City}/{RouteName}][%d] cityBusApiRealTimeNearStopUdp1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStopUdp1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA2Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRealTimeNearStopUdp1Status299() *CityBusAPIRealTimeNearStopUdp
return &CityBusAPIRealTimeNearStopUdp1Status299{}
}
-/*CityBusAPIRealTimeNearStopUdp1Status299 handles this case with default header values.
+/* CityBusAPIRealTimeNearStopUdp1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRealTimeNearStopUdp1Status299 struct {
func (o *CityBusAPIRealTimeNearStopUdp1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/City/{City}/{RouteName}][%d] cityBusApiRealTimeNearStopUdp1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStopUdp1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRealTimeNearStopUdp1Status299) readResponse(response runtime.
return nil
}
+
+// NewCityBusAPIRealTimeNearStopUdp1NotModified creates a CityBusAPIRealTimeNearStopUdp1NotModified with default headers values
+func NewCityBusAPIRealTimeNearStopUdp1NotModified() *CityBusAPIRealTimeNearStopUdp1NotModified {
+ return &CityBusAPIRealTimeNearStopUdp1NotModified{}
+}
+
+/* CityBusAPIRealTimeNearStopUdp1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeNearStopUdp1NotModified struct {
+}
+
+func (o *CityBusAPIRealTimeNearStopUdp1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/City/{City}/{RouteName}][%d] cityBusApiRealTimeNearStopUdp1NotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeNearStopUdp1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_parameters.go b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_parameters.go
index d13d35e9..4bdfeb84 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeNearStopUDPParams creates a new CityBusAPIRealTimeNearStopUDPParams object
-// with the default values initialized.
+// NewCityBusAPIRealTimeNearStopUDPParams creates a new CityBusAPIRealTimeNearStopUDPParams 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 NewCityBusAPIRealTimeNearStopUDPParams() *CityBusAPIRealTimeNearStopUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeNearStopUDPParamsWithTimeout creates a new CityBusAPIRealTimeNearStopUDPParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeNearStopUDPParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStopUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeNearStopUDPParamsWithContext creates a new CityBusAPIRealTimeNearStopUDPParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeNearStopUDPParamsWithContext(ctx context.Context) *CityBusAPIRealTimeNearStopUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopUDPParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeNearStopUDPParamsWithHTTPClient creates a new CityBusAPIRealTimeNearStopUDPParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeNearStopUDPParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeNearStopUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStopUDPParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeNearStopUDPParams contains all the parameters to send to the API endpoint
-for the city bus Api real time near stop UDP operation typically these are written to a http.Request
+/* CityBusAPIRealTimeNearStopUDPParams contains all the parameters to send to the API endpoint
+ for the city bus Api real time near stop UDP operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeNearStopUDPParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIRealTimeNearStopUDPParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time near stop UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStopUDPParams) WithDefaults() *CityBusAPIRealTimeNearStopUDPParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time near stop UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStopUDPParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeNearStopUDPParams{
+ 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 real time near stop UDP params
func (o *CityBusAPIRealTimeNearStopUDPParams) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStopUDPParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIRealTimeNearStopUDPParams) WriteToRequest(r runtime.ClientReq
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIRealTimeNearStopUDPParams) WriteToRequest(r runtime.ClientReq
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIRealTimeNearStopUDPParams) WriteToRequest(r runtime.ClientReq
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_responses.go b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_responses.go
index 50f6b944..f53224db 100644
--- a/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_real_time_near_stop_udp_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeNearStopUDPReader) ReadResponse(response runtime.Clie
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeNearStopUDPNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeNearStopUDPOK() *CityBusAPIRealTimeNearStopUDPOK {
return &CityBusAPIRealTimeNearStopUDPOK{}
}
-/*CityBusAPIRealTimeNearStopUDPOK handles this case with default header values.
+/* CityBusAPIRealTimeNearStopUDPOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeNearStopUDPOK struct {
func (o *CityBusAPIRealTimeNearStopUDPOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/City/{City}][%d] cityBusApiRealTimeNearStopUdpOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStopUDPOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA2Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRealTimeNearStopUDPStatus299() *CityBusAPIRealTimeNearStopUDPS
return &CityBusAPIRealTimeNearStopUDPStatus299{}
}
-/*CityBusAPIRealTimeNearStopUDPStatus299 handles this case with default header values.
+/* CityBusAPIRealTimeNearStopUDPStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRealTimeNearStopUDPStatus299 struct {
func (o *CityBusAPIRealTimeNearStopUDPStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/City/{City}][%d] cityBusApiRealTimeNearStopUdpStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStopUDPStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRealTimeNearStopUDPStatus299) readResponse(response runtime.C
return nil
}
+
+// NewCityBusAPIRealTimeNearStopUDPNotModified creates a CityBusAPIRealTimeNearStopUDPNotModified with default headers values
+func NewCityBusAPIRealTimeNearStopUDPNotModified() *CityBusAPIRealTimeNearStopUDPNotModified {
+ return &CityBusAPIRealTimeNearStopUDPNotModified{}
+}
+
+/* CityBusAPIRealTimeNearStopUDPNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeNearStopUDPNotModified struct {
+}
+
+func (o *CityBusAPIRealTimeNearStopUDPNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/City/{City}][%d] cityBusApiRealTimeNearStopUdpNotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeNearStopUDPNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_route1_parameters.go b/bus/v2/client/city_bus/city_bus_api_route1_parameters.go
index 01fa7418..72cb7ed6 100644
--- a/bus/v2/client/city_bus/city_bus_api_route1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_route1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRoute1Params creates a new CityBusAPIRoute1Params object
-// with the default values initialized.
+// NewCityBusAPIRoute1Params creates a new CityBusAPIRoute1Params 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 NewCityBusAPIRoute1Params() *CityBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRoute1ParamsWithTimeout creates a new CityBusAPIRoute1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRoute1ParamsWithTimeout(timeout time.Duration) *CityBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRoute1ParamsWithContext creates a new CityBusAPIRoute1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRoute1ParamsWithContext(ctx context.Context) *CityBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRoute1ParamsWithHTTPClient creates a new CityBusAPIRoute1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRoute1ParamsWithHTTPClient(client *http.Client) *CityBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRoute1Params contains all the parameters to send to the API endpoint
-for the city bus Api route 1 operation typically these are written to a http.Request
+/* CityBusAPIRoute1Params contains all the parameters to send to the API endpoint
+ for the city bus Api route 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRoute1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIRoute1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRoute1Params) WithDefaults() *CityBusAPIRoute1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRoute1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRoute1Params{
+ 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 route 1 params
func (o *CityBusAPIRoute1Params) WithTimeout(timeout time.Duration) *CityBusAPIRoute1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIRoute1Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPIRoute1Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPIRoute1Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_route1_responses.go b/bus/v2/client/city_bus/city_bus_api_route1_responses.go
index a3bd54ab..61f6a9e5 100644
--- a/bus/v2/client/city_bus/city_bus_api_route1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_route1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRoute1Reader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRoute1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRoute1OK() *CityBusAPIRoute1OK {
return &CityBusAPIRoute1OK{}
}
-/*CityBusAPIRoute1OK handles this case with default header values.
+/* CityBusAPIRoute1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRoute1OK struct {
func (o *CityBusAPIRoute1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Route/City/{City}/{RouteName}][%d] cityBusApiRoute1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRoute1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusRoute {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRoute1Status299() *CityBusAPIRoute1Status299 {
return &CityBusAPIRoute1Status299{}
}
-/*CityBusAPIRoute1Status299 handles this case with default header values.
+/* CityBusAPIRoute1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRoute1Status299 struct {
func (o *CityBusAPIRoute1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Route/City/{City}/{RouteName}][%d] cityBusApiRoute1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRoute1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRoute1Status299) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewCityBusAPIRoute1NotModified creates a CityBusAPIRoute1NotModified with default headers values
+func NewCityBusAPIRoute1NotModified() *CityBusAPIRoute1NotModified {
+ return &CityBusAPIRoute1NotModified{}
+}
+
+/* CityBusAPIRoute1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRoute1NotModified struct {
+}
+
+func (o *CityBusAPIRoute1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Route/City/{City}/{RouteName}][%d] cityBusApiRoute1NotModified ", 304)
+}
+
+func (o *CityBusAPIRoute1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_route_fare1_parameters.go b/bus/v2/client/city_bus/city_bus_api_route_fare1_parameters.go
index 75346157..a2de6848 100644
--- a/bus/v2/client/city_bus/city_bus_api_route_fare1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_route_fare1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRouteFare1Params creates a new CityBusAPIRouteFare1Params object
-// with the default values initialized.
+// NewCityBusAPIRouteFare1Params creates a new CityBusAPIRouteFare1Params 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 NewCityBusAPIRouteFare1Params() *CityBusAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRouteFare1ParamsWithTimeout creates a new CityBusAPIRouteFare1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRouteFare1ParamsWithTimeout(timeout time.Duration) *CityBusAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRouteFare1ParamsWithContext creates a new CityBusAPIRouteFare1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRouteFare1ParamsWithContext(ctx context.Context) *CityBusAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRouteFare1ParamsWithHTTPClient creates a new CityBusAPIRouteFare1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRouteFare1ParamsWithHTTPClient(client *http.Client) *CityBusAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRouteFare1Params contains all the parameters to send to the API endpoint
-for the city bus Api route fare 1 operation typically these are written to a http.Request
+/* CityBusAPIRouteFare1Params contains all the parameters to send to the API endpoint
+ for the city bus Api route fare 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRouteFare1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIRouteFare1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api route fare 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRouteFare1Params) WithDefaults() *CityBusAPIRouteFare1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api route fare 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRouteFare1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRouteFare1Params{
+ 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 route fare 1 params
func (o *CityBusAPIRouteFare1Params) WithTimeout(timeout time.Duration) *CityBusAPIRouteFare1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIRouteFare1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPIRouteFare1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPIRouteFare1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_route_fare1_responses.go b/bus/v2/client/city_bus/city_bus_api_route_fare1_responses.go
index 4bba2431..38a077e1 100644
--- a/bus/v2/client/city_bus/city_bus_api_route_fare1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_route_fare1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRouteFare1Reader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRouteFare1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRouteFare1OK() *CityBusAPIRouteFare1OK {
return &CityBusAPIRouteFare1OK{}
}
-/*CityBusAPIRouteFare1OK handles this case with default header values.
+/* CityBusAPIRouteFare1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRouteFare1OK struct {
func (o *CityBusAPIRouteFare1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RouteFare/City/{City}/{RouteName}][%d] cityBusApiRouteFare1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRouteFare1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusRouteFare {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRouteFare1Status299() *CityBusAPIRouteFare1Status299 {
return &CityBusAPIRouteFare1Status299{}
}
-/*CityBusAPIRouteFare1Status299 handles this case with default header values.
+/* CityBusAPIRouteFare1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRouteFare1Status299 struct {
func (o *CityBusAPIRouteFare1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RouteFare/City/{City}/{RouteName}][%d] cityBusApiRouteFare1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRouteFare1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRouteFare1Status299) readResponse(response runtime.ClientResp
return nil
}
+
+// NewCityBusAPIRouteFare1NotModified creates a CityBusAPIRouteFare1NotModified with default headers values
+func NewCityBusAPIRouteFare1NotModified() *CityBusAPIRouteFare1NotModified {
+ return &CityBusAPIRouteFare1NotModified{}
+}
+
+/* CityBusAPIRouteFare1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRouteFare1NotModified struct {
+}
+
+func (o *CityBusAPIRouteFare1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RouteFare/City/{City}/{RouteName}][%d] cityBusApiRouteFare1NotModified ", 304)
+}
+
+func (o *CityBusAPIRouteFare1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_route_fare_parameters.go b/bus/v2/client/city_bus/city_bus_api_route_fare_parameters.go
index f14feb2a..16adb113 100644
--- a/bus/v2/client/city_bus/city_bus_api_route_fare_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_route_fare_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRouteFareParams creates a new CityBusAPIRouteFareParams object
-// with the default values initialized.
+// NewCityBusAPIRouteFareParams creates a new CityBusAPIRouteFareParams 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 NewCityBusAPIRouteFareParams() *CityBusAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRouteFareParamsWithTimeout creates a new CityBusAPIRouteFareParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRouteFareParamsWithTimeout(timeout time.Duration) *CityBusAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRouteFareParamsWithContext creates a new CityBusAPIRouteFareParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRouteFareParamsWithContext(ctx context.Context) *CityBusAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRouteFareParamsWithHTTPClient creates a new CityBusAPIRouteFareParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRouteFareParamsWithHTTPClient(client *http.Client) *CityBusAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRouteFareParams contains all the parameters to send to the API endpoint
-for the city bus Api route fare operation typically these are written to a http.Request
+/* CityBusAPIRouteFareParams contains all the parameters to send to the API endpoint
+ for the city bus Api route fare operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRouteFareParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIRouteFareParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api route fare params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRouteFareParams) WithDefaults() *CityBusAPIRouteFareParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api route fare params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRouteFareParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRouteFareParams{
+ 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 route fare params
func (o *CityBusAPIRouteFareParams) WithTimeout(timeout time.Duration) *CityBusAPIRouteFareParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIRouteFareParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIRouteFareParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIRouteFareParams) WriteToRequest(r runtime.ClientRequest, reg
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_route_fare_responses.go b/bus/v2/client/city_bus/city_bus_api_route_fare_responses.go
index 691908f9..bbc2503d 100644
--- a/bus/v2/client/city_bus/city_bus_api_route_fare_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_route_fare_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRouteFareReader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRouteFareNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRouteFareOK() *CityBusAPIRouteFareOK {
return &CityBusAPIRouteFareOK{}
}
-/*CityBusAPIRouteFareOK handles this case with default header values.
+/* CityBusAPIRouteFareOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRouteFareOK struct {
func (o *CityBusAPIRouteFareOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RouteFare/City/{City}][%d] cityBusApiRouteFareOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRouteFareOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusRouteFare {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRouteFareStatus299() *CityBusAPIRouteFareStatus299 {
return &CityBusAPIRouteFareStatus299{}
}
-/*CityBusAPIRouteFareStatus299 handles this case with default header values.
+/* CityBusAPIRouteFareStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRouteFareStatus299 struct {
func (o *CityBusAPIRouteFareStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RouteFare/City/{City}][%d] cityBusApiRouteFareStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRouteFareStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRouteFareStatus299) readResponse(response runtime.ClientRespo
return nil
}
+
+// NewCityBusAPIRouteFareNotModified creates a CityBusAPIRouteFareNotModified with default headers values
+func NewCityBusAPIRouteFareNotModified() *CityBusAPIRouteFareNotModified {
+ return &CityBusAPIRouteFareNotModified{}
+}
+
+/* CityBusAPIRouteFareNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRouteFareNotModified struct {
+}
+
+func (o *CityBusAPIRouteFareNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RouteFare/City/{City}][%d] cityBusApiRouteFareNotModified ", 304)
+}
+
+func (o *CityBusAPIRouteFareNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_route_parameters.go b/bus/v2/client/city_bus/city_bus_api_route_parameters.go
index 150e7e48..2be963d0 100644
--- a/bus/v2/client/city_bus/city_bus_api_route_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_route_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRouteParams creates a new CityBusAPIRouteParams object
-// with the default values initialized.
+// NewCityBusAPIRouteParams creates a new CityBusAPIRouteParams 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 NewCityBusAPIRouteParams() *CityBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRouteParamsWithTimeout creates a new CityBusAPIRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRouteParamsWithTimeout(timeout time.Duration) *CityBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRouteParamsWithContext creates a new CityBusAPIRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRouteParamsWithContext(ctx context.Context) *CityBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRouteParamsWithHTTPClient creates a new CityBusAPIRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRouteParamsWithHTTPClient(client *http.Client) *CityBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRouteParams contains all the parameters to send to the API endpoint
-for the city bus Api route operation typically these are written to a http.Request
+/* CityBusAPIRouteParams contains all the parameters to send to the API endpoint
+ for the city bus Api route operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRouteParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRouteParams) WithDefaults() *CityBusAPIRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRouteParams{
+ 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 route params
func (o *CityBusAPIRouteParams) WithTimeout(timeout time.Duration) *CityBusAPIRouteParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIRouteParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIRouteParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIRouteParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_route_responses.go b/bus/v2/client/city_bus/city_bus_api_route_responses.go
index e7161ebe..87f6d92b 100644
--- a/bus/v2/client/city_bus/city_bus_api_route_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_route_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRouteReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRouteNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRouteOK() *CityBusAPIRouteOK {
return &CityBusAPIRouteOK{}
}
-/*CityBusAPIRouteOK handles this case with default header values.
+/* CityBusAPIRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRouteOK struct {
func (o *CityBusAPIRouteOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Route/City/{City}][%d] cityBusApiRouteOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRouteOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusRoute {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIRouteStatus299() *CityBusAPIRouteStatus299 {
return &CityBusAPIRouteStatus299{}
}
-/*CityBusAPIRouteStatus299 handles this case with default header values.
+/* CityBusAPIRouteStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIRouteStatus299 struct {
func (o *CityBusAPIRouteStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Route/City/{City}][%d] cityBusApiRouteStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRouteStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIRouteStatus299) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewCityBusAPIRouteNotModified creates a CityBusAPIRouteNotModified with default headers values
+func NewCityBusAPIRouteNotModified() *CityBusAPIRouteNotModified {
+ return &CityBusAPIRouteNotModified{}
+}
+
+/* CityBusAPIRouteNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRouteNotModified struct {
+}
+
+func (o *CityBusAPIRouteNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Route/City/{City}][%d] cityBusApiRouteNotModified ", 304)
+}
+
+func (o *CityBusAPIRouteNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_s2_s_travel_time_detail_parameters.go b/bus/v2/client/city_bus/city_bus_api_s2_s_travel_time_detail_parameters.go
new file mode 100644
index 00000000..5b1a87e1
--- /dev/null
+++ b/bus/v2/client/city_bus/city_bus_api_s2_s_travel_time_detail_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"
+)
+
+// NewCityBusAPIS2STravelTimeDetailParams creates a new CityBusAPIS2STravelTimeDetailParams 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 NewCityBusAPIS2STravelTimeDetailParams() *CityBusAPIS2STravelTimeDetailParams {
+ return &CityBusAPIS2STravelTimeDetailParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewCityBusAPIS2STravelTimeDetailParamsWithTimeout creates a new CityBusAPIS2STravelTimeDetailParams object
+// with the ability to set a timeout on a request.
+func NewCityBusAPIS2STravelTimeDetailParamsWithTimeout(timeout time.Duration) *CityBusAPIS2STravelTimeDetailParams {
+ return &CityBusAPIS2STravelTimeDetailParams{
+ timeout: timeout,
+ }
+}
+
+// NewCityBusAPIS2STravelTimeDetailParamsWithContext creates a new CityBusAPIS2STravelTimeDetailParams object
+// with the ability to set a context for a request.
+func NewCityBusAPIS2STravelTimeDetailParamsWithContext(ctx context.Context) *CityBusAPIS2STravelTimeDetailParams {
+ return &CityBusAPIS2STravelTimeDetailParams{
+ Context: ctx,
+ }
+}
+
+// NewCityBusAPIS2STravelTimeDetailParamsWithHTTPClient creates a new CityBusAPIS2STravelTimeDetailParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewCityBusAPIS2STravelTimeDetailParamsWithHTTPClient(client *http.Client) *CityBusAPIS2STravelTimeDetailParams {
+ return &CityBusAPIS2STravelTimeDetailParams{
+ HTTPClient: client,
+ }
+}
+
+/* CityBusAPIS2STravelTimeDetailParams contains all the parameters to send to the API endpoint
+ for the city bus Api s2 s travel time detail operation.
+
+ Typically these are written to a http.Request.
+*/
+type CityBusAPIS2STravelTimeDetailParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ /* City.
+
+ 欲查詢縣市
+ */
+ City string
+
+ /* RouteID.
+
+ 路線代碼
+ */
+ RouteID 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 s2 s travel time detail params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIS2STravelTimeDetailParams) WithDefaults() *CityBusAPIS2STravelTimeDetailParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api s2 s travel time detail params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIS2STravelTimeDetailParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIS2STravelTimeDetailParams{
+ 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 s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithTimeout(timeout time.Duration) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithContext(ctx context.Context) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithHTTPClient(client *http.Client) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithDollarFilter(dollarFilter *string) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithDollarFormat(dollarFormat string) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithDollarOrderby(dollarOrderby *string) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithDollarSelect(dollarSelect *string) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithDollarSkip(dollarSkip *string) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarTop adds the dollarTop to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithDollarTop(dollarTop *int64) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WithCity adds the city to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithCity(city string) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetCity(city)
+ return o
+}
+
+// SetCity adds the city to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetCity(city string) {
+ o.City = city
+}
+
+// WithRouteID adds the routeID to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithRouteID(routeID string) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetRouteID(routeID)
+ return o
+}
+
+// SetRouteID adds the routeId to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetRouteID(routeID string) {
+ o.RouteID = routeID
+}
+
+// WithHealth adds the health to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) WithHealth(health *string) *CityBusAPIS2STravelTimeDetailParams {
+ o.SetHealth(health)
+ return o
+}
+
+// SetHealth adds the health to the city bus Api s2 s travel time detail params
+func (o *CityBusAPIS2STravelTimeDetailParams) SetHealth(health *string) {
+ o.Health = health
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *CityBusAPIS2STravelTimeDetailParams) 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 RouteID
+ if err := r.SetPathParam("RouteID", o.RouteID); 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_s2_s_travel_time_detail_responses.go b/bus/v2/client/city_bus/city_bus_api_s2_s_travel_time_detail_responses.go
new file mode 100644
index 00000000..0a98b7e1
--- /dev/null
+++ b/bus/v2/client/city_bus/city_bus_api_s2_s_travel_time_detail_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"
+)
+
+// CityBusAPIS2STravelTimeDetailReader is a Reader for the CityBusAPIS2STravelTimeDetail structure.
+type CityBusAPIS2STravelTimeDetailReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *CityBusAPIS2STravelTimeDetailReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewCityBusAPIS2STravelTimeDetailOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 299:
+ result := NewCityBusAPIS2STravelTimeDetailStatus299()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewCityBusAPIS2STravelTimeDetailNotModified()
+ 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())
+ }
+}
+
+// NewCityBusAPIS2STravelTimeDetailOK creates a CityBusAPIS2STravelTimeDetailOK with default headers values
+func NewCityBusAPIS2STravelTimeDetailOK() *CityBusAPIS2STravelTimeDetailOK {
+ return &CityBusAPIS2STravelTimeDetailOK{}
+}
+
+/* CityBusAPIS2STravelTimeDetailOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type CityBusAPIS2STravelTimeDetailOK struct {
+ Payload []*models.PTXServiceDTOBusSpecificationV2BusS2STravelTime
+}
+
+func (o *CityBusAPIS2STravelTimeDetailOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/S2STravelTime/City/{City}/{RouteID}][%d] cityBusApiS2STravelTimeDetailOK %+v", 200, o.Payload)
+}
+func (o *CityBusAPIS2STravelTimeDetailOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusS2STravelTime {
+ return o.Payload
+}
+
+func (o *CityBusAPIS2STravelTimeDetailOK) 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
+}
+
+// NewCityBusAPIS2STravelTimeDetailStatus299 creates a CityBusAPIS2STravelTimeDetailStatus299 with default headers values
+func NewCityBusAPIS2STravelTimeDetailStatus299() *CityBusAPIS2STravelTimeDetailStatus299 {
+ return &CityBusAPIS2STravelTimeDetailStatus299{}
+}
+
+/* CityBusAPIS2STravelTimeDetailStatus299 describes a response with status code 299, with default header values.
+
+加入參數'?health=true'即可查詢此API服務的健康狀態
+*/
+type CityBusAPIS2STravelTimeDetailStatus299 struct {
+ Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth
+}
+
+func (o *CityBusAPIS2STravelTimeDetailStatus299) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/S2STravelTime/City/{City}/{RouteID}][%d] cityBusApiS2STravelTimeDetailStatus299 %+v", 299, o.Payload)
+}
+func (o *CityBusAPIS2STravelTimeDetailStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
+ return o.Payload
+}
+
+func (o *CityBusAPIS2STravelTimeDetailStatus299) 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
+}
+
+// NewCityBusAPIS2STravelTimeDetailNotModified creates a CityBusAPIS2STravelTimeDetailNotModified with default headers values
+func NewCityBusAPIS2STravelTimeDetailNotModified() *CityBusAPIS2STravelTimeDetailNotModified {
+ return &CityBusAPIS2STravelTimeDetailNotModified{}
+}
+
+/* CityBusAPIS2STravelTimeDetailNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIS2STravelTimeDetailNotModified struct {
+}
+
+func (o *CityBusAPIS2STravelTimeDetailNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/S2STravelTime/City/{City}/{RouteID}][%d] cityBusApiS2STravelTimeDetailNotModified ", 304)
+}
+
+func (o *CityBusAPIS2STravelTimeDetailNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_schedule1_parameters.go b/bus/v2/client/city_bus/city_bus_api_schedule1_parameters.go
index cf5cb38b..d993f3f1 100644
--- a/bus/v2/client/city_bus/city_bus_api_schedule1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_schedule1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPISchedule1Params creates a new CityBusAPISchedule1Params object
-// with the default values initialized.
+// NewCityBusAPISchedule1Params creates a new CityBusAPISchedule1Params 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 NewCityBusAPISchedule1Params() *CityBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPISchedule1ParamsWithTimeout creates a new CityBusAPISchedule1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPISchedule1ParamsWithTimeout(timeout time.Duration) *CityBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPISchedule1ParamsWithContext creates a new CityBusAPISchedule1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPISchedule1ParamsWithContext(ctx context.Context) *CityBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPISchedule1ParamsWithHTTPClient creates a new CityBusAPISchedule1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPISchedule1ParamsWithHTTPClient(client *http.Client) *CityBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPISchedule1Params contains all the parameters to send to the API endpoint
-for the city bus Api schedule 1 operation typically these are written to a http.Request
+/* CityBusAPISchedule1Params contains all the parameters to send to the API endpoint
+ for the city bus Api schedule 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPISchedule1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPISchedule1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api schedule 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPISchedule1Params) WithDefaults() *CityBusAPISchedule1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api schedule 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPISchedule1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPISchedule1Params{
+ 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 schedule 1 params
func (o *CityBusAPISchedule1Params) WithTimeout(timeout time.Duration) *CityBusAPISchedule1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPISchedule1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPISchedule1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPISchedule1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_schedule1_responses.go b/bus/v2/client/city_bus/city_bus_api_schedule1_responses.go
index ae241011..798f3616 100644
--- a/bus/v2/client/city_bus/city_bus_api_schedule1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_schedule1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPISchedule1Reader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPISchedule1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPISchedule1OK() *CityBusAPISchedule1OK {
return &CityBusAPISchedule1OK{}
}
-/*CityBusAPISchedule1OK handles this case with default header values.
+/* CityBusAPISchedule1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPISchedule1OK struct {
func (o *CityBusAPISchedule1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Schedule/City/{City}/{RouteName}][%d] cityBusApiSchedule1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPISchedule1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusSchedule {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPISchedule1Status299() *CityBusAPISchedule1Status299 {
return &CityBusAPISchedule1Status299{}
}
-/*CityBusAPISchedule1Status299 handles this case with default header values.
+/* CityBusAPISchedule1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPISchedule1Status299 struct {
func (o *CityBusAPISchedule1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Schedule/City/{City}/{RouteName}][%d] cityBusApiSchedule1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPISchedule1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPISchedule1Status299) readResponse(response runtime.ClientRespo
return nil
}
+
+// NewCityBusAPISchedule1NotModified creates a CityBusAPISchedule1NotModified with default headers values
+func NewCityBusAPISchedule1NotModified() *CityBusAPISchedule1NotModified {
+ return &CityBusAPISchedule1NotModified{}
+}
+
+/* CityBusAPISchedule1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPISchedule1NotModified struct {
+}
+
+func (o *CityBusAPISchedule1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Schedule/City/{City}/{RouteName}][%d] cityBusApiSchedule1NotModified ", 304)
+}
+
+func (o *CityBusAPISchedule1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_schedule_parameters.go b/bus/v2/client/city_bus/city_bus_api_schedule_parameters.go
index 783aef98..38bf81dd 100644
--- a/bus/v2/client/city_bus/city_bus_api_schedule_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_schedule_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIScheduleParams creates a new CityBusAPIScheduleParams object
-// with the default values initialized.
+// NewCityBusAPIScheduleParams creates a new CityBusAPIScheduleParams 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 NewCityBusAPIScheduleParams() *CityBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIScheduleParamsWithTimeout creates a new CityBusAPIScheduleParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIScheduleParamsWithTimeout(timeout time.Duration) *CityBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIScheduleParamsWithContext creates a new CityBusAPIScheduleParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIScheduleParamsWithContext(ctx context.Context) *CityBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIScheduleParamsWithHTTPClient creates a new CityBusAPIScheduleParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIScheduleParamsWithHTTPClient(client *http.Client) *CityBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIScheduleParams contains all the parameters to send to the API endpoint
-for the city bus Api schedule operation typically these are written to a http.Request
+/* CityBusAPIScheduleParams contains all the parameters to send to the API endpoint
+ for the city bus Api schedule operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIScheduleParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIScheduleParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api schedule params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIScheduleParams) WithDefaults() *CityBusAPIScheduleParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api schedule params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIScheduleParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIScheduleParams{
+ 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 schedule params
func (o *CityBusAPIScheduleParams) WithTimeout(timeout time.Duration) *CityBusAPIScheduleParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIScheduleParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIScheduleParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIScheduleParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_schedule_responses.go b/bus/v2/client/city_bus/city_bus_api_schedule_responses.go
index ed11e125..e2b536b0 100644
--- a/bus/v2/client/city_bus/city_bus_api_schedule_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_schedule_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIScheduleReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIScheduleNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIScheduleOK() *CityBusAPIScheduleOK {
return &CityBusAPIScheduleOK{}
}
-/*CityBusAPIScheduleOK handles this case with default header values.
+/* CityBusAPIScheduleOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIScheduleOK struct {
func (o *CityBusAPIScheduleOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Schedule/City/{City}][%d] cityBusApiScheduleOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIScheduleOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusSchedule {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIScheduleStatus299() *CityBusAPIScheduleStatus299 {
return &CityBusAPIScheduleStatus299{}
}
-/*CityBusAPIScheduleStatus299 handles this case with default header values.
+/* CityBusAPIScheduleStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIScheduleStatus299 struct {
func (o *CityBusAPIScheduleStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Schedule/City/{City}][%d] cityBusApiScheduleStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIScheduleStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIScheduleStatus299) readResponse(response runtime.ClientRespon
return nil
}
+
+// NewCityBusAPIScheduleNotModified creates a CityBusAPIScheduleNotModified with default headers values
+func NewCityBusAPIScheduleNotModified() *CityBusAPIScheduleNotModified {
+ return &CityBusAPIScheduleNotModified{}
+}
+
+/* CityBusAPIScheduleNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIScheduleNotModified struct {
+}
+
+func (o *CityBusAPIScheduleNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Schedule/City/{City}][%d] cityBusApiScheduleNotModified ", 304)
+}
+
+func (o *CityBusAPIScheduleNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_shape1_parameters.go b/bus/v2/client/city_bus/city_bus_api_shape1_parameters.go
index ac3ca460..b3c87ac5 100644
--- a/bus/v2/client/city_bus/city_bus_api_shape1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_shape1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIShape1Params creates a new CityBusAPIShape1Params object
-// with the default values initialized.
+// NewCityBusAPIShape1Params creates a new CityBusAPIShape1Params 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 NewCityBusAPIShape1Params() *CityBusAPIShape1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShape1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIShape1ParamsWithTimeout creates a new CityBusAPIShape1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIShape1ParamsWithTimeout(timeout time.Duration) *CityBusAPIShape1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShape1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIShape1ParamsWithContext creates a new CityBusAPIShape1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIShape1ParamsWithContext(ctx context.Context) *CityBusAPIShape1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShape1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIShape1ParamsWithHTTPClient creates a new CityBusAPIShape1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIShape1ParamsWithHTTPClient(client *http.Client) *CityBusAPIShape1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShape1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIShape1Params contains all the parameters to send to the API endpoint
-for the city bus Api shape 1 operation typically these are written to a http.Request
+/* CityBusAPIShape1Params contains all the parameters to send to the API endpoint
+ for the city bus Api shape 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIShape1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIShape1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api shape 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIShape1Params) WithDefaults() *CityBusAPIShape1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api shape 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIShape1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIShape1Params{
+ 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 shape 1 params
func (o *CityBusAPIShape1Params) WithTimeout(timeout time.Duration) *CityBusAPIShape1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIShape1Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPIShape1Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPIShape1Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_shape1_responses.go b/bus/v2/client/city_bus/city_bus_api_shape1_responses.go
index 05dc1366..87d86d05 100644
--- a/bus/v2/client/city_bus/city_bus_api_shape1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_shape1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIShape1Reader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIShape1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIShape1OK() *CityBusAPIShape1OK {
return &CityBusAPIShape1OK{}
}
-/*CityBusAPIShape1OK handles this case with default header values.
+/* CityBusAPIShape1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIShape1OK struct {
func (o *CityBusAPIShape1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Shape/City/{City}/{RouteName}][%d] cityBusApiShape1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIShape1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusShape {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIShape1Status299() *CityBusAPIShape1Status299 {
return &CityBusAPIShape1Status299{}
}
-/*CityBusAPIShape1Status299 handles this case with default header values.
+/* CityBusAPIShape1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIShape1Status299 struct {
func (o *CityBusAPIShape1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Shape/City/{City}/{RouteName}][%d] cityBusApiShape1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIShape1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIShape1Status299) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewCityBusAPIShape1NotModified creates a CityBusAPIShape1NotModified with default headers values
+func NewCityBusAPIShape1NotModified() *CityBusAPIShape1NotModified {
+ return &CityBusAPIShape1NotModified{}
+}
+
+/* CityBusAPIShape1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIShape1NotModified struct {
+}
+
+func (o *CityBusAPIShape1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Shape/City/{City}/{RouteName}][%d] cityBusApiShape1NotModified ", 304)
+}
+
+func (o *CityBusAPIShape1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_shape_parameters.go b/bus/v2/client/city_bus/city_bus_api_shape_parameters.go
index 6370cebd..b8ebaac3 100644
--- a/bus/v2/client/city_bus/city_bus_api_shape_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_shape_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIShapeParams creates a new CityBusAPIShapeParams object
-// with the default values initialized.
+// NewCityBusAPIShapeParams creates a new CityBusAPIShapeParams 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 NewCityBusAPIShapeParams() *CityBusAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIShapeParamsWithTimeout creates a new CityBusAPIShapeParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIShapeParamsWithTimeout(timeout time.Duration) *CityBusAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIShapeParamsWithContext creates a new CityBusAPIShapeParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIShapeParamsWithContext(ctx context.Context) *CityBusAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIShapeParamsWithHTTPClient creates a new CityBusAPIShapeParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIShapeParamsWithHTTPClient(client *http.Client) *CityBusAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShapeParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIShapeParams contains all the parameters to send to the API endpoint
-for the city bus Api shape operation typically these are written to a http.Request
+/* CityBusAPIShapeParams contains all the parameters to send to the API endpoint
+ for the city bus Api shape operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIShapeParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIShapeParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIShapeParams) WithDefaults() *CityBusAPIShapeParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIShapeParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIShapeParams{
+ 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 shape params
func (o *CityBusAPIShapeParams) WithTimeout(timeout time.Duration) *CityBusAPIShapeParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_shape_responses.go b/bus/v2/client/city_bus/city_bus_api_shape_responses.go
index 49bcc320..9d10976f 100644
--- a/bus/v2/client/city_bus/city_bus_api_shape_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_shape_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIShapeReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIShapeNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIShapeOK() *CityBusAPIShapeOK {
return &CityBusAPIShapeOK{}
}
-/*CityBusAPIShapeOK handles this case with default header values.
+/* CityBusAPIShapeOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIShapeOK struct {
func (o *CityBusAPIShapeOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Shape/City/{City}][%d] cityBusApiShapeOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIShapeOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusShape {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIShapeStatus299() *CityBusAPIShapeStatus299 {
return &CityBusAPIShapeStatus299{}
}
-/*CityBusAPIShapeStatus299 handles this case with default header values.
+/* CityBusAPIShapeStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIShapeStatus299 struct {
func (o *CityBusAPIShapeStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Shape/City/{City}][%d] cityBusApiShapeStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIShapeStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIShapeStatus299) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewCityBusAPIShapeNotModified creates a CityBusAPIShapeNotModified with default headers values
+func NewCityBusAPIShapeNotModified() *CityBusAPIShapeNotModified {
+ return &CityBusAPIShapeNotModified{}
+}
+
+/* CityBusAPIShapeNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIShapeNotModified struct {
+}
+
+func (o *CityBusAPIShapeNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Shape/City/{City}][%d] cityBusApiShapeNotModified ", 304)
+}
+
+func (o *CityBusAPIShapeNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_station_group_parameters.go b/bus/v2/client/city_bus/city_bus_api_station_group_parameters.go
index 8703821a..9042b469 100644
--- a/bus/v2/client/city_bus/city_bus_api_station_group_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_station_group_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIStationGroupParams creates a new CityBusAPIStationGroupParams object
-// with the default values initialized.
+// NewCityBusAPIStationGroupParams creates a new CityBusAPIStationGroupParams 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 NewCityBusAPIStationGroupParams() *CityBusAPIStationGroupParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStationGroupParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIStationGroupParamsWithTimeout creates a new CityBusAPIStationGroupParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIStationGroupParamsWithTimeout(timeout time.Duration) *CityBusAPIStationGroupParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStationGroupParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIStationGroupParamsWithContext creates a new CityBusAPIStationGroupParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIStationGroupParamsWithContext(ctx context.Context) *CityBusAPIStationGroupParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStationGroupParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIStationGroupParamsWithHTTPClient creates a new CityBusAPIStationGroupParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIStationGroupParamsWithHTTPClient(client *http.Client) *CityBusAPIStationGroupParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStationGroupParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIStationGroupParams contains all the parameters to send to the API endpoint
-for the city bus Api station group operation typically these are written to a http.Request
+/* CityBusAPIStationGroupParams contains all the parameters to send to the API endpoint
+ for the city bus Api station group operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIStationGroupParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIStationGroupParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api station group params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStationGroupParams) WithDefaults() *CityBusAPIStationGroupParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api station group params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStationGroupParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIStationGroupParams{
+ 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 station group params
func (o *CityBusAPIStationGroupParams) WithTimeout(timeout time.Duration) *CityBusAPIStationGroupParams {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIStationGroupParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -293,80 +318,85 @@ func (o *CityBusAPIStationGroupParams) WriteToRequest(r runtime.ClientRequest, r
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIStationGroupParams) WriteToRequest(r runtime.ClientRequest, r
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_station_group_responses.go b/bus/v2/client/city_bus/city_bus_api_station_group_responses.go
index 58613d82..e42a2a07 100644
--- a/bus/v2/client/city_bus/city_bus_api_station_group_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_station_group_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIStationGroupReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIStationGroupNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIStationGroupOK() *CityBusAPIStationGroupOK {
return &CityBusAPIStationGroupOK{}
}
-/*CityBusAPIStationGroupOK handles this case with default header values.
+/* CityBusAPIStationGroupOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIStationGroupOK struct {
func (o *CityBusAPIStationGroupOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StationGroup/City/{City}][%d] cityBusApiStationGroupOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIStationGroupOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStationGroup {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIStationGroupStatus299() *CityBusAPIStationGroupStatus299 {
return &CityBusAPIStationGroupStatus299{}
}
-/*CityBusAPIStationGroupStatus299 handles this case with default header values.
+/* CityBusAPIStationGroupStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIStationGroupStatus299 struct {
func (o *CityBusAPIStationGroupStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StationGroup/City/{City}][%d] cityBusApiStationGroupStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIStationGroupStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIStationGroupStatus299) readResponse(response runtime.ClientRe
return nil
}
+
+// NewCityBusAPIStationGroupNotModified creates a CityBusAPIStationGroupNotModified with default headers values
+func NewCityBusAPIStationGroupNotModified() *CityBusAPIStationGroupNotModified {
+ return &CityBusAPIStationGroupNotModified{}
+}
+
+/* CityBusAPIStationGroupNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIStationGroupNotModified struct {
+}
+
+func (o *CityBusAPIStationGroupNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/StationGroup/City/{City}][%d] cityBusApiStationGroupNotModified ", 304)
+}
+
+func (o *CityBusAPIStationGroupNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_station_parameters.go b/bus/v2/client/city_bus/city_bus_api_station_parameters.go
index 23935775..b1312e18 100644
--- a/bus/v2/client/city_bus/city_bus_api_station_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_station_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIStationParams creates a new CityBusAPIStationParams object
-// with the default values initialized.
+// NewCityBusAPIStationParams creates a new CityBusAPIStationParams 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 NewCityBusAPIStationParams() *CityBusAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIStationParamsWithTimeout creates a new CityBusAPIStationParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIStationParamsWithTimeout(timeout time.Duration) *CityBusAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIStationParamsWithContext creates a new CityBusAPIStationParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIStationParamsWithContext(ctx context.Context) *CityBusAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStationParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIStationParamsWithHTTPClient creates a new CityBusAPIStationParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIStationParamsWithHTTPClient(client *http.Client) *CityBusAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStationParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIStationParams contains all the parameters to send to the API endpoint
-for the city bus Api station operation typically these are written to a http.Request
+/* CityBusAPIStationParams contains all the parameters to send to the API endpoint
+ for the city bus Api station operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIStationParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIStationParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStationParams) WithDefaults() *CityBusAPIStationParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStationParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIStationParams{
+ 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 station params
func (o *CityBusAPIStationParams) WithTimeout(timeout time.Duration) *CityBusAPIStationParams {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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
}
@@ -293,80 +318,85 @@ func (o *CityBusAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_station_responses.go b/bus/v2/client/city_bus/city_bus_api_station_responses.go
index 7253ff05..cb818911 100644
--- a/bus/v2/client/city_bus/city_bus_api_station_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_station_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIStationReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIStationNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIStationOK() *CityBusAPIStationOK {
return &CityBusAPIStationOK{}
}
-/*CityBusAPIStationOK handles this case with default header values.
+/* CityBusAPIStationOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIStationOK struct {
func (o *CityBusAPIStationOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Station/City/{City}][%d] cityBusApiStationOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIStationOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStation {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIStationStatus299() *CityBusAPIStationStatus299 {
return &CityBusAPIStationStatus299{}
}
-/*CityBusAPIStationStatus299 handles this case with default header values.
+/* CityBusAPIStationStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIStationStatus299 struct {
func (o *CityBusAPIStationStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Station/City/{City}][%d] cityBusApiStationStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIStationStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIStationStatus299) readResponse(response runtime.ClientRespons
return nil
}
+
+// NewCityBusAPIStationNotModified creates a CityBusAPIStationNotModified with default headers values
+func NewCityBusAPIStationNotModified() *CityBusAPIStationNotModified {
+ return &CityBusAPIStationNotModified{}
+}
+
+/* CityBusAPIStationNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIStationNotModified struct {
+}
+
+func (o *CityBusAPIStationNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Station/City/{City}][%d] cityBusApiStationNotModified ", 304)
+}
+
+func (o *CityBusAPIStationNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_stop_of_route1_parameters.go b/bus/v2/client/city_bus/city_bus_api_stop_of_route1_parameters.go
index bbc1adfa..617e171e 100644
--- a/bus/v2/client/city_bus/city_bus_api_stop_of_route1_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_stop_of_route1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIStopOfRoute1Params creates a new CityBusAPIStopOfRoute1Params object
-// with the default values initialized.
+// NewCityBusAPIStopOfRoute1Params creates a new CityBusAPIStopOfRoute1Params 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 NewCityBusAPIStopOfRoute1Params() *CityBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIStopOfRoute1ParamsWithTimeout creates a new CityBusAPIStopOfRoute1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIStopOfRoute1ParamsWithTimeout(timeout time.Duration) *CityBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIStopOfRoute1ParamsWithContext creates a new CityBusAPIStopOfRoute1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIStopOfRoute1ParamsWithContext(ctx context.Context) *CityBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIStopOfRoute1ParamsWithHTTPClient creates a new CityBusAPIStopOfRoute1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIStopOfRoute1ParamsWithHTTPClient(client *http.Client) *CityBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIStopOfRoute1Params contains all the parameters to send to the API endpoint
-for the city bus Api stop of route 1 operation typically these are written to a http.Request
+/* CityBusAPIStopOfRoute1Params contains all the parameters to send to the API endpoint
+ for the city bus Api stop of route 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIStopOfRoute1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIStopOfRoute1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api stop of route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStopOfRoute1Params) WithDefaults() *CityBusAPIStopOfRoute1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api stop of route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStopOfRoute1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIStopOfRoute1Params{
+ 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 stop of route 1 params
func (o *CityBusAPIStopOfRoute1Params) WithTimeout(timeout time.Duration) *CityBusAPIStopOfRoute1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIStopOfRoute1Params) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -293,64 +318,68 @@ func (o *CityBusAPIStopOfRoute1Params) WriteToRequest(r runtime.ClientRequest, r
// 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
@@ -367,16 +396,17 @@ func (o *CityBusAPIStopOfRoute1Params) WriteToRequest(r runtime.ClientRequest, r
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_stop_of_route1_responses.go b/bus/v2/client/city_bus/city_bus_api_stop_of_route1_responses.go
index e94d854b..c8ce21f7 100644
--- a/bus/v2/client/city_bus/city_bus_api_stop_of_route1_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_stop_of_route1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIStopOfRoute1Reader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIStopOfRoute1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIStopOfRoute1OK() *CityBusAPIStopOfRoute1OK {
return &CityBusAPIStopOfRoute1OK{}
}
-/*CityBusAPIStopOfRoute1OK handles this case with default header values.
+/* CityBusAPIStopOfRoute1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIStopOfRoute1OK struct {
func (o *CityBusAPIStopOfRoute1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/City/{City}/{RouteName}][%d] cityBusApiStopOfRoute1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIStopOfRoute1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStopOfRoute {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIStopOfRoute1Status299() *CityBusAPIStopOfRoute1Status299 {
return &CityBusAPIStopOfRoute1Status299{}
}
-/*CityBusAPIStopOfRoute1Status299 handles this case with default header values.
+/* CityBusAPIStopOfRoute1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIStopOfRoute1Status299 struct {
func (o *CityBusAPIStopOfRoute1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/City/{City}/{RouteName}][%d] cityBusApiStopOfRoute1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIStopOfRoute1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIStopOfRoute1Status299) readResponse(response runtime.ClientRe
return nil
}
+
+// NewCityBusAPIStopOfRoute1NotModified creates a CityBusAPIStopOfRoute1NotModified with default headers values
+func NewCityBusAPIStopOfRoute1NotModified() *CityBusAPIStopOfRoute1NotModified {
+ return &CityBusAPIStopOfRoute1NotModified{}
+}
+
+/* CityBusAPIStopOfRoute1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIStopOfRoute1NotModified struct {
+}
+
+func (o *CityBusAPIStopOfRoute1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/City/{City}/{RouteName}][%d] cityBusApiStopOfRoute1NotModified ", 304)
+}
+
+func (o *CityBusAPIStopOfRoute1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_stop_of_route_parameters.go b/bus/v2/client/city_bus/city_bus_api_stop_of_route_parameters.go
index 91427497..4b08b1a1 100644
--- a/bus/v2/client/city_bus/city_bus_api_stop_of_route_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_stop_of_route_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIStopOfRouteParams creates a new CityBusAPIStopOfRouteParams object
-// with the default values initialized.
+// NewCityBusAPIStopOfRouteParams creates a new CityBusAPIStopOfRouteParams 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 NewCityBusAPIStopOfRouteParams() *CityBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIStopOfRouteParamsWithTimeout creates a new CityBusAPIStopOfRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIStopOfRouteParamsWithTimeout(timeout time.Duration) *CityBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIStopOfRouteParamsWithContext creates a new CityBusAPIStopOfRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIStopOfRouteParamsWithContext(ctx context.Context) *CityBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIStopOfRouteParamsWithHTTPClient creates a new CityBusAPIStopOfRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIStopOfRouteParamsWithHTTPClient(client *http.Client) *CityBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIStopOfRouteParams contains all the parameters to send to the API endpoint
-for the city bus Api stop of route operation typically these are written to a http.Request
+/* CityBusAPIStopOfRouteParams contains all the parameters to send to the API endpoint
+ for the city bus Api stop of route operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIStopOfRouteParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIStopOfRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api stop of route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStopOfRouteParams) WithDefaults() *CityBusAPIStopOfRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api stop of route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStopOfRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIStopOfRouteParams{
+ 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 stop of route params
func (o *CityBusAPIStopOfRouteParams) WithTimeout(timeout time.Duration) *CityBusAPIStopOfRouteParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIStopOfRouteParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIStopOfRouteParams) WriteToRequest(r runtime.ClientRequest, re
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIStopOfRouteParams) WriteToRequest(r runtime.ClientRequest, re
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_stop_of_route_responses.go b/bus/v2/client/city_bus/city_bus_api_stop_of_route_responses.go
index 1395c155..b6924ccd 100644
--- a/bus/v2/client/city_bus/city_bus_api_stop_of_route_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_stop_of_route_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIStopOfRouteReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIStopOfRouteNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIStopOfRouteOK() *CityBusAPIStopOfRouteOK {
return &CityBusAPIStopOfRouteOK{}
}
-/*CityBusAPIStopOfRouteOK handles this case with default header values.
+/* CityBusAPIStopOfRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIStopOfRouteOK struct {
func (o *CityBusAPIStopOfRouteOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/City/{City}][%d] cityBusApiStopOfRouteOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIStopOfRouteOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStopOfRoute {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIStopOfRouteStatus299() *CityBusAPIStopOfRouteStatus299 {
return &CityBusAPIStopOfRouteStatus299{}
}
-/*CityBusAPIStopOfRouteStatus299 handles this case with default header values.
+/* CityBusAPIStopOfRouteStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIStopOfRouteStatus299 struct {
func (o *CityBusAPIStopOfRouteStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/City/{City}][%d] cityBusApiStopOfRouteStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIStopOfRouteStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIStopOfRouteStatus299) readResponse(response runtime.ClientRes
return nil
}
+
+// NewCityBusAPIStopOfRouteNotModified creates a CityBusAPIStopOfRouteNotModified with default headers values
+func NewCityBusAPIStopOfRouteNotModified() *CityBusAPIStopOfRouteNotModified {
+ return &CityBusAPIStopOfRouteNotModified{}
+}
+
+/* CityBusAPIStopOfRouteNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIStopOfRouteNotModified struct {
+}
+
+func (o *CityBusAPIStopOfRouteNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/City/{City}][%d] cityBusApiStopOfRouteNotModified ", 304)
+}
+
+func (o *CityBusAPIStopOfRouteNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_stop_parameters.go b/bus/v2/client/city_bus/city_bus_api_stop_parameters.go
index 28996bfe..73a316aa 100644
--- a/bus/v2/client/city_bus/city_bus_api_stop_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_stop_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIStopParams creates a new CityBusAPIStopParams object
-// with the default values initialized.
+// NewCityBusAPIStopParams creates a new CityBusAPIStopParams 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 NewCityBusAPIStopParams() *CityBusAPIStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIStopParamsWithTimeout creates a new CityBusAPIStopParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIStopParamsWithTimeout(timeout time.Duration) *CityBusAPIStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIStopParamsWithContext creates a new CityBusAPIStopParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIStopParamsWithContext(ctx context.Context) *CityBusAPIStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIStopParamsWithHTTPClient creates a new CityBusAPIStopParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIStopParamsWithHTTPClient(client *http.Client) *CityBusAPIStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIStopParams contains all the parameters to send to the API endpoint
-for the city bus Api stop operation typically these are written to a http.Request
+/* CityBusAPIStopParams contains all the parameters to send to the API endpoint
+ for the city bus Api stop operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIStopParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIStopParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api stop params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStopParams) WithDefaults() *CityBusAPIStopParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api stop params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStopParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIStopParams{
+ 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 stop params
func (o *CityBusAPIStopParams) WithTimeout(timeout time.Duration) *CityBusAPIStopParams {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *CityBusAPIStopParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
@@ -293,80 +318,85 @@ func (o *CityBusAPIStopParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIStopParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_stop_responses.go b/bus/v2/client/city_bus/city_bus_api_stop_responses.go
index 55fc8233..461a41fc 100644
--- a/bus/v2/client/city_bus/city_bus_api_stop_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_stop_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIStopReader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIStopNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIStopOK() *CityBusAPIStopOK {
return &CityBusAPIStopOK{}
}
-/*CityBusAPIStopOK handles this case with default header values.
+/* CityBusAPIStopOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIStopOK struct {
func (o *CityBusAPIStopOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Stop/City/{City}][%d] cityBusApiStopOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIStopOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStop {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIStopStatus299() *CityBusAPIStopStatus299 {
return &CityBusAPIStopStatus299{}
}
-/*CityBusAPIStopStatus299 handles this case with default header values.
+/* CityBusAPIStopStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIStopStatus299 struct {
func (o *CityBusAPIStopStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Stop/City/{City}][%d] cityBusApiStopStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIStopStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIStopStatus299) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewCityBusAPIStopNotModified creates a CityBusAPIStopNotModified with default headers values
+func NewCityBusAPIStopNotModified() *CityBusAPIStopNotModified {
+ return &CityBusAPIStopNotModified{}
+}
+
+/* CityBusAPIStopNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIStopNotModified struct {
+}
+
+func (o *CityBusAPIStopNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Stop/City/{City}][%d] cityBusApiStopNotModified ", 304)
+}
+
+func (o *CityBusAPIStopNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_api_vehicle_parameters.go b/bus/v2/client/city_bus/city_bus_api_vehicle_parameters.go
index 73f2b9d5..5e3596f9 100644
--- a/bus/v2/client/city_bus/city_bus_api_vehicle_parameters.go
+++ b/bus/v2/client/city_bus/city_bus_api_vehicle_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIVehicleParams creates a new CityBusAPIVehicleParams object
-// with the default values initialized.
+// NewCityBusAPIVehicleParams creates a new CityBusAPIVehicleParams 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 NewCityBusAPIVehicleParams() *CityBusAPIVehicleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIVehicleParamsWithTimeout creates a new CityBusAPIVehicleParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIVehicleParamsWithTimeout(timeout time.Duration) *CityBusAPIVehicleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIVehicleParamsWithContext creates a new CityBusAPIVehicleParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIVehicleParamsWithContext(ctx context.Context) *CityBusAPIVehicleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIVehicleParamsWithHTTPClient creates a new CityBusAPIVehicleParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIVehicleParamsWithHTTPClient(client *http.Client) *CityBusAPIVehicleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIVehicleParams contains all the parameters to send to the API endpoint
-for the city bus Api vehicle operation typically these are written to a http.Request
+/* CityBusAPIVehicleParams contains all the parameters to send to the API endpoint
+ for the city bus Api vehicle operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIVehicleParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type CityBusAPIVehicleParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api vehicle params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIVehicleParams) WithDefaults() *CityBusAPIVehicleParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api vehicle params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIVehicleParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIVehicleParams{
+ 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 vehicle params
func (o *CityBusAPIVehicleParams) WithTimeout(timeout time.Duration) *CityBusAPIVehicleParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *CityBusAPIVehicleParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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
}
@@ -277,64 +301,68 @@ func (o *CityBusAPIVehicleParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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
@@ -346,16 +374,17 @@ func (o *CityBusAPIVehicleParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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 {
diff --git a/bus/v2/client/city_bus/city_bus_api_vehicle_responses.go b/bus/v2/client/city_bus/city_bus_api_vehicle_responses.go
index b1cd0b7d..559634a6 100644
--- a/bus/v2/client/city_bus/city_bus_api_vehicle_responses.go
+++ b/bus/v2/client/city_bus/city_bus_api_vehicle_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIVehicleReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIVehicleNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIVehicleOK() *CityBusAPIVehicleOK {
return &CityBusAPIVehicleOK{}
}
-/*CityBusAPIVehicleOK handles this case with default header values.
+/* CityBusAPIVehicleOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIVehicleOK struct {
func (o *CityBusAPIVehicleOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Vehicle/City/{City}][%d] cityBusApiVehicleOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIVehicleOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusVehicleInfo {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewCityBusAPIVehicleStatus299() *CityBusAPIVehicleStatus299 {
return &CityBusAPIVehicleStatus299{}
}
-/*CityBusAPIVehicleStatus299 handles this case with default header values.
+/* CityBusAPIVehicleStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type CityBusAPIVehicleStatus299 struct {
func (o *CityBusAPIVehicleStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Vehicle/City/{City}][%d] cityBusApiVehicleStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIVehicleStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *CityBusAPIVehicleStatus299) readResponse(response runtime.ClientRespons
return nil
}
+
+// NewCityBusAPIVehicleNotModified creates a CityBusAPIVehicleNotModified with default headers values
+func NewCityBusAPIVehicleNotModified() *CityBusAPIVehicleNotModified {
+ return &CityBusAPIVehicleNotModified{}
+}
+
+/* CityBusAPIVehicleNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIVehicleNotModified struct {
+}
+
+func (o *CityBusAPIVehicleNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Vehicle/City/{City}][%d] cityBusApiVehicleNotModified ", 304)
+}
+
+func (o *CityBusAPIVehicleNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/city_bus/city_bus_client.go b/bus/v2/client/city_bus/city_bus_client.go
index 18c2ad94..299884f9 100644
--- a/bus/v2/client/city_bus/city_bus_client.go
+++ b/bus/v2/client/city_bus/city_bus_client.go
@@ -73,6 +73,8 @@ type ClientService interface {
CityBusAPIRoute1(params *CityBusAPIRoute1Params) (*CityBusAPIRoute1OK, *CityBusAPIRoute1Status299, error)
+ CityBusAPIS2STravelTimeDetail(params *CityBusAPIS2STravelTimeDetailParams) (*CityBusAPIS2STravelTimeDetailOK, *CityBusAPIS2STravelTimeDetailStatus299, error)
+
CityBusAPISchedule(params *CityBusAPIScheduleParams) (*CityBusAPIScheduleOK, *CityBusAPIScheduleStatus299, error)
CityBusAPISchedule1(params *CityBusAPISchedule1Params) (*CityBusAPISchedule1OK, *CityBusAPISchedule1Status299, error)
@@ -965,6 +967,43 @@ func (a *Client) CityBusAPIRoute1(params *CityBusAPIRoute1Params) (*CityBusAPIRo
panic(msg)
}
+/*
+ CityBusAPIS2STravelTimeDetail 取得指定s 縣市 路線代碼 的市區公車站間旅行時間資料
+
+ 指定[縣市],[路線代碼]的市區公車站間旅行時間資料
+*/
+func (a *Client) CityBusAPIS2STravelTimeDetail(params *CityBusAPIS2STravelTimeDetailParams) (*CityBusAPIS2STravelTimeDetailOK, *CityBusAPIS2STravelTimeDetailStatus299, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewCityBusAPIS2STravelTimeDetailParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "CityBusApi_S2STravelTimeDetail",
+ Method: "GET",
+ PathPattern: "/v2/Bus/S2STravelTime/City/{City}/{RouteID}",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &CityBusAPIS2STravelTimeDetailReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, nil, err
+ }
+ switch value := result.(type) {
+ case *CityBusAPIS2STravelTimeDetailOK:
+ return value, nil, nil
+ case *CityBusAPIS2STravelTimeDetailStatus299:
+ 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)
+}
+
/*
CityBusAPISchedule 取得指定s 縣市 的市區公車路線班表資料
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_data_version_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_data_version_parameters.go
index b89a5a7f..2e33bc7a 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_data_version_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_data_version_parameters.go
@@ -16,58 +16,58 @@ import (
"github.com/go-openapi/strfmt"
)
-// NewInterCityBusAPIDataVersionParams creates a new InterCityBusAPIDataVersionParams object
-// with the default values initialized.
+// NewInterCityBusAPIDataVersionParams creates a new InterCityBusAPIDataVersionParams 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 NewInterCityBusAPIDataVersionParams() *InterCityBusAPIDataVersionParams {
- var ()
return &InterCityBusAPIDataVersionParams{
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIDataVersionParamsWithTimeout creates a new InterCityBusAPIDataVersionParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIDataVersionParamsWithTimeout(timeout time.Duration) *InterCityBusAPIDataVersionParams {
- var ()
return &InterCityBusAPIDataVersionParams{
-
timeout: timeout,
}
}
// NewInterCityBusAPIDataVersionParamsWithContext creates a new InterCityBusAPIDataVersionParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIDataVersionParamsWithContext(ctx context.Context) *InterCityBusAPIDataVersionParams {
- var ()
return &InterCityBusAPIDataVersionParams{
-
Context: ctx,
}
}
// NewInterCityBusAPIDataVersionParamsWithHTTPClient creates a new InterCityBusAPIDataVersionParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIDataVersionParamsWithHTTPClient(client *http.Client) *InterCityBusAPIDataVersionParams {
- var ()
return &InterCityBusAPIDataVersionParams{
HTTPClient: client,
}
}
-/*InterCityBusAPIDataVersionParams contains all the parameters to send to the API endpoint
-for the inter city bus Api data version operation typically these are written to a http.Request
+/* InterCityBusAPIDataVersionParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api data version operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIDataVersionParams struct {
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+ 指定來源格式
*/
DollarFormat string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -76,6 +76,21 @@ type InterCityBusAPIDataVersionParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api data version params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIDataVersionParams) WithDefaults() *InterCityBusAPIDataVersionParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api data version params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIDataVersionParams) SetDefaults() {
+ // no default values defined for this parameter
+}
+
// WithTimeout adds the timeout to the inter city bus Api data version params
func (o *InterCityBusAPIDataVersionParams) WithTimeout(timeout time.Duration) *InterCityBusAPIDataVersionParams {
o.SetTimeout(timeout)
@@ -143,6 +158,7 @@ func (o *InterCityBusAPIDataVersionParams) WriteToRequest(r runtime.ClientReques
qrDollarFormat := o.DollarFormat
qDollarFormat := qrDollarFormat
if qDollarFormat != "" {
+
if err := r.SetQueryParam("$format", qDollarFormat); err != nil {
return err
}
@@ -152,16 +168,17 @@ func (o *InterCityBusAPIDataVersionParams) WriteToRequest(r runtime.ClientReques
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_data_version_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_data_version_responses.go
index 6dddf21c..85c08cd6 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_data_version_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_data_version_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIDataVersionReader) ReadResponse(response runtime.ClientR
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIDataVersionNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIDataVersionOK() *InterCityBusAPIDataVersionOK {
return &InterCityBusAPIDataVersionOK{}
}
-/*InterCityBusAPIDataVersionOK handles this case with default header values.
+/* InterCityBusAPIDataVersionOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIDataVersionOK struct {
func (o *InterCityBusAPIDataVersionOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/DataVersion/InterCity][%d] interCityBusApiDataVersionOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIDataVersionOK) GetPayload() *models.PTXServiceDTOBusSpecificationV2BusVersion {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewInterCityBusAPIDataVersionStatus299() *InterCityBusAPIDataVersionStatus2
return &InterCityBusAPIDataVersionStatus299{}
}
-/*InterCityBusAPIDataVersionStatus299 handles this case with default header values.
+/* InterCityBusAPIDataVersionStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type InterCityBusAPIDataVersionStatus299 struct {
func (o *InterCityBusAPIDataVersionStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/DataVersion/InterCity][%d] interCityBusApiDataVersionStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIDataVersionStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *InterCityBusAPIDataVersionStatus299) readResponse(response runtime.Clie
return nil
}
+
+// NewInterCityBusAPIDataVersionNotModified creates a InterCityBusAPIDataVersionNotModified with default headers values
+func NewInterCityBusAPIDataVersionNotModified() *InterCityBusAPIDataVersionNotModified {
+ return &InterCityBusAPIDataVersionNotModified{}
+}
+
+/* InterCityBusAPIDataVersionNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIDataVersionNotModified struct {
+}
+
+func (o *InterCityBusAPIDataVersionNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/DataVersion/InterCity][%d] interCityBusApiDataVersionNotModified ", 304)
+}
+
+func (o *InterCityBusAPIDataVersionNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival1_parameters.go
index bfbac1a8..32a37c10 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival1_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIEstimatedTimeOfArrival1Params creates a new InterCityBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized.
+// NewInterCityBusAPIEstimatedTimeOfArrival1Params creates a new InterCityBusAPIEstimatedTimeOfArrival1Params 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 NewInterCityBusAPIEstimatedTimeOfArrival1Params() *InterCityBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrival1ParamsWithTimeout creates a new InterCityBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIEstimatedTimeOfArrival1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrival1ParamsWithContext creates a new InterCityBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIEstimatedTimeOfArrival1ParamsWithContext(ctx context.Context) *InterCityBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrival1ParamsWithHTTPClient creates a new InterCityBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIEstimatedTimeOfArrival1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIEstimatedTimeOfArrival1Params contains all the parameters to send to the API endpoint
-for the inter city bus Api estimated time of arrival 1 operation typically these are written to a http.Request
+/* InterCityBusAPIEstimatedTimeOfArrival1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api estimated time of arrival 1 operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIEstimatedTimeOfArrival1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteName
- 繁體中文路線名稱,如'9102'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'9102'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIEstimatedTimeOfArrival1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api estimated time of arrival 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIEstimatedTimeOfArrival1Params) WithDefaults() *InterCityBusAPIEstimatedTimeOfArrival1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api estimated time of arrival 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIEstimatedTimeOfArrival1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIEstimatedTimeOfArrival1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api estimated time of arrival 1 params
func (o *InterCityBusAPIEstimatedTimeOfArrival1Params) WithTimeout(timeout time.Duration) *InterCityBusAPIEstimatedTimeOfArrival1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIEstimatedTimeOfArrival1Params) WriteToRequest(r runtime.
// 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
}
@@ -277,64 +301,68 @@ func (o *InterCityBusAPIEstimatedTimeOfArrival1Params) WriteToRequest(r runtime.
// 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 RouteName
@@ -346,16 +374,17 @@ func (o *InterCityBusAPIEstimatedTimeOfArrival1Params) WriteToRequest(r runtime.
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival1_responses.go
index b50be8e9..c0b04c4d 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival1_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival1_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIEstimatedTimeOfArrival1Reader) ReadResponse(response run
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIEstimatedTimeOfArrival1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIEstimatedTimeOfArrival1OK() *InterCityBusAPIEstimatedTime
return &InterCityBusAPIEstimatedTimeOfArrival1OK{}
}
-/*InterCityBusAPIEstimatedTimeOfArrival1OK handles this case with default header values.
+/* InterCityBusAPIEstimatedTimeOfArrival1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIEstimatedTimeOfArrival1OK struct {
func (o *InterCityBusAPIEstimatedTimeOfArrival1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/InterCity/{RouteName}][%d] interCityBusApiEstimatedTimeOfArrival1OK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIEstimatedTimeOfArrival1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusN1EstimateTime {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIEstimatedTimeOfArrival1Status299() *InterCityBusAPIEstima
return &InterCityBusAPIEstimatedTimeOfArrival1Status299{}
}
-/*InterCityBusAPIEstimatedTimeOfArrival1Status299 handles this case with default header values.
+/* InterCityBusAPIEstimatedTimeOfArrival1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIEstimatedTimeOfArrival1Status299 struct {
func (o *InterCityBusAPIEstimatedTimeOfArrival1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/InterCity/{RouteName}][%d] interCityBusApiEstimatedTimeOfArrival1Status299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIEstimatedTimeOfArrival1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIEstimatedTimeOfArrival1Status299) readResponse(response
return nil
}
+
+// NewInterCityBusAPIEstimatedTimeOfArrival1NotModified creates a InterCityBusAPIEstimatedTimeOfArrival1NotModified with default headers values
+func NewInterCityBusAPIEstimatedTimeOfArrival1NotModified() *InterCityBusAPIEstimatedTimeOfArrival1NotModified {
+ return &InterCityBusAPIEstimatedTimeOfArrival1NotModified{}
+}
+
+/* InterCityBusAPIEstimatedTimeOfArrival1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIEstimatedTimeOfArrival1NotModified struct {
+}
+
+func (o *InterCityBusAPIEstimatedTimeOfArrival1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/InterCity/{RouteName}][%d] interCityBusApiEstimatedTimeOfArrival1NotModified ", 304)
+}
+
+func (o *InterCityBusAPIEstimatedTimeOfArrival1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_parameters.go
index 83a1ba03..4131a545 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIEstimatedTimeOfArrivalParams creates a new InterCityBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized.
+// NewInterCityBusAPIEstimatedTimeOfArrivalParams creates a new InterCityBusAPIEstimatedTimeOfArrivalParams 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 NewInterCityBusAPIEstimatedTimeOfArrivalParams() *InterCityBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrivalParamsWithTimeout creates a new InterCityBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIEstimatedTimeOfArrivalParamsWithTimeout(timeout time.Duration) *InterCityBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrivalParamsWithContext creates a new InterCityBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIEstimatedTimeOfArrivalParamsWithContext(ctx context.Context) *InterCityBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrivalParamsWithHTTPClient creates a new InterCityBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIEstimatedTimeOfArrivalParamsWithHTTPClient(client *http.Client) *InterCityBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIEstimatedTimeOfArrivalParams contains all the parameters to send to the API endpoint
-for the inter city bus Api estimated time of arrival operation typically these are written to a http.Request
+/* InterCityBusAPIEstimatedTimeOfArrivalParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api estimated time of arrival operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIEstimatedTimeOfArrivalParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPIEstimatedTimeOfArrivalParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api estimated time of arrival params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIEstimatedTimeOfArrivalParams) WithDefaults() *InterCityBusAPIEstimatedTimeOfArrivalParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api estimated time of arrival params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIEstimatedTimeOfArrivalParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIEstimatedTimeOfArrivalParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api estimated time of arrival params
func (o *InterCityBusAPIEstimatedTimeOfArrivalParams) WithTimeout(timeout time.Duration) *InterCityBusAPIEstimatedTimeOfArrivalParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalParams) WriteToRequest(r runtime.C
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalParams) WriteToRequest(r runtime.C
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_responses.go
index 365fb901..f97bf8dd 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalReader) ReadResponse(response runt
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIEstimatedTimeOfArrivalNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIEstimatedTimeOfArrivalOK() *InterCityBusAPIEstimatedTimeO
return &InterCityBusAPIEstimatedTimeOfArrivalOK{}
}
-/*InterCityBusAPIEstimatedTimeOfArrivalOK handles this case with default header values.
+/* InterCityBusAPIEstimatedTimeOfArrivalOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIEstimatedTimeOfArrivalOK struct {
func (o *InterCityBusAPIEstimatedTimeOfArrivalOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/InterCity][%d] interCityBusApiEstimatedTimeOfArrivalOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIEstimatedTimeOfArrivalOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusN1EstimateTime {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIEstimatedTimeOfArrivalStatus299() *InterCityBusAPIEstimat
return &InterCityBusAPIEstimatedTimeOfArrivalStatus299{}
}
-/*InterCityBusAPIEstimatedTimeOfArrivalStatus299 handles this case with default header values.
+/* InterCityBusAPIEstimatedTimeOfArrivalStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIEstimatedTimeOfArrivalStatus299 struct {
func (o *InterCityBusAPIEstimatedTimeOfArrivalStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/InterCity][%d] interCityBusApiEstimatedTimeOfArrivalStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIEstimatedTimeOfArrivalStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalStatus299) readResponse(response r
return nil
}
+
+// NewInterCityBusAPIEstimatedTimeOfArrivalNotModified creates a InterCityBusAPIEstimatedTimeOfArrivalNotModified with default headers values
+func NewInterCityBusAPIEstimatedTimeOfArrivalNotModified() *InterCityBusAPIEstimatedTimeOfArrivalNotModified {
+ return &InterCityBusAPIEstimatedTimeOfArrivalNotModified{}
+}
+
+/* InterCityBusAPIEstimatedTimeOfArrivalNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIEstimatedTimeOfArrivalNotModified struct {
+}
+
+func (o *InterCityBusAPIEstimatedTimeOfArrivalNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/InterCity][%d] interCityBusApiEstimatedTimeOfArrivalNotModified ", 304)
+}
+
+func (o *InterCityBusAPIEstimatedTimeOfArrivalNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_1_parameters.go
index 2e5f3dd8..4147714a 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_1_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIEstimatedTimeOfArrivalUDP1Params creates a new InterCityBusAPIEstimatedTimeOfArrivalUDP1Params object
-// with the default values initialized.
+// NewInterCityBusAPIEstimatedTimeOfArrivalUDP1Params creates a new InterCityBusAPIEstimatedTimeOfArrivalUDP1Params 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 NewInterCityBusAPIEstimatedTimeOfArrivalUDP1Params() *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithTimeout creates a new InterCityBusAPIEstimatedTimeOfArrivalUDP1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithContext creates a new InterCityBusAPIEstimatedTimeOfArrivalUDP1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithContext(ctx context.Context) *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalUDP1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithHTTPClient creates a new InterCityBusAPIEstimatedTimeOfArrivalUDP1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIEstimatedTimeOfArrivalUDP1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalUDP1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIEstimatedTimeOfArrivalUDP1Params contains all the parameters to send to the API endpoint
-for the inter city bus Api estimated time of arrival UDP 1 operation typically these are written to a http.Request
+/* InterCityBusAPIEstimatedTimeOfArrivalUDP1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api estimated time of arrival UDP 1 operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIEstimatedTimeOfArrivalUDP1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteName
- 繁體中文路線名稱,如'9102'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'9102'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIEstimatedTimeOfArrivalUDP1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api estimated time of arrival UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params) WithDefaults() *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api estimated time of arrival UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIEstimatedTimeOfArrivalUDP1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api estimated time of arrival UDP 1 params
func (o *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params) WithTimeout(timeout time.Duration) *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params) WriteToRequest(r runti
// 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
}
@@ -277,64 +301,68 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params) WriteToRequest(r runti
// 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 RouteName
@@ -346,16 +374,17 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalUDP1Params) WriteToRequest(r runti
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_1_responses.go
index 538667ff..13a3f92b 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_1_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_1_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalUDP1Reader) ReadResponse(response
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIEstimatedTimeOfArrivalUdp1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIEstimatedTimeOfArrivalUdp1OK() *InterCityBusAPIEstimatedT
return &InterCityBusAPIEstimatedTimeOfArrivalUdp1OK{}
}
-/*InterCityBusAPIEstimatedTimeOfArrivalUdp1OK handles this case with default header values.
+/* InterCityBusAPIEstimatedTimeOfArrivalUdp1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIEstimatedTimeOfArrivalUdp1OK struct {
func (o *InterCityBusAPIEstimatedTimeOfArrivalUdp1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/InterCity/{RouteName}][%d] interCityBusApiEstimatedTimeOfArrivalUdp1OK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIEstimatedTimeOfArrivalUdp1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusN1EstimateTime {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIEstimatedTimeOfArrivalUdp1Status299() *InterCityBusAPIEst
return &InterCityBusAPIEstimatedTimeOfArrivalUdp1Status299{}
}
-/*InterCityBusAPIEstimatedTimeOfArrivalUdp1Status299 handles this case with default header values.
+/* InterCityBusAPIEstimatedTimeOfArrivalUdp1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIEstimatedTimeOfArrivalUdp1Status299 struct {
func (o *InterCityBusAPIEstimatedTimeOfArrivalUdp1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/InterCity/{RouteName}][%d] interCityBusApiEstimatedTimeOfArrivalUdp1Status299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIEstimatedTimeOfArrivalUdp1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalUdp1Status299) readResponse(respon
return nil
}
+
+// NewInterCityBusAPIEstimatedTimeOfArrivalUdp1NotModified creates a InterCityBusAPIEstimatedTimeOfArrivalUdp1NotModified with default headers values
+func NewInterCityBusAPIEstimatedTimeOfArrivalUdp1NotModified() *InterCityBusAPIEstimatedTimeOfArrivalUdp1NotModified {
+ return &InterCityBusAPIEstimatedTimeOfArrivalUdp1NotModified{}
+}
+
+/* InterCityBusAPIEstimatedTimeOfArrivalUdp1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIEstimatedTimeOfArrivalUdp1NotModified struct {
+}
+
+func (o *InterCityBusAPIEstimatedTimeOfArrivalUdp1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/InterCity/{RouteName}][%d] interCityBusApiEstimatedTimeOfArrivalUdp1NotModified ", 304)
+}
+
+func (o *InterCityBusAPIEstimatedTimeOfArrivalUdp1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_parameters.go
index 380d6106..698f915b 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIEstimatedTimeOfArrivalUDPParams creates a new InterCityBusAPIEstimatedTimeOfArrivalUDPParams object
-// with the default values initialized.
+// NewInterCityBusAPIEstimatedTimeOfArrivalUDPParams creates a new InterCityBusAPIEstimatedTimeOfArrivalUDPParams 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 NewInterCityBusAPIEstimatedTimeOfArrivalUDPParams() *InterCityBusAPIEstimatedTimeOfArrivalUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrivalUDPParamsWithTimeout creates a new InterCityBusAPIEstimatedTimeOfArrivalUDPParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIEstimatedTimeOfArrivalUDPParamsWithTimeout(timeout time.Duration) *InterCityBusAPIEstimatedTimeOfArrivalUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrivalUDPParamsWithContext creates a new InterCityBusAPIEstimatedTimeOfArrivalUDPParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIEstimatedTimeOfArrivalUDPParamsWithContext(ctx context.Context) *InterCityBusAPIEstimatedTimeOfArrivalUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalUDPParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIEstimatedTimeOfArrivalUDPParamsWithHTTPClient creates a new InterCityBusAPIEstimatedTimeOfArrivalUDPParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIEstimatedTimeOfArrivalUDPParamsWithHTTPClient(client *http.Client) *InterCityBusAPIEstimatedTimeOfArrivalUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIEstimatedTimeOfArrivalUDPParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIEstimatedTimeOfArrivalUDPParams contains all the parameters to send to the API endpoint
-for the inter city bus Api estimated time of arrival UDP operation typically these are written to a http.Request
+/* InterCityBusAPIEstimatedTimeOfArrivalUDPParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api estimated time of arrival UDP operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIEstimatedTimeOfArrivalUDPParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPIEstimatedTimeOfArrivalUDPParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api estimated time of arrival UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPParams) WithDefaults() *InterCityBusAPIEstimatedTimeOfArrivalUDPParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api estimated time of arrival UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIEstimatedTimeOfArrivalUDPParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api estimated time of arrival UDP params
func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPParams) WithTimeout(timeout time.Duration) *InterCityBusAPIEstimatedTimeOfArrivalUDPParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPParams) WriteToRequest(r runtim
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPParams) WriteToRequest(r runtim
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_responses.go
index 911a96ce..48cea46d 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_estimated_time_of_arrival_udp_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPReader) ReadResponse(response r
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIEstimatedTimeOfArrivalUDPNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIEstimatedTimeOfArrivalUDPOK() *InterCityBusAPIEstimatedTi
return &InterCityBusAPIEstimatedTimeOfArrivalUDPOK{}
}
-/*InterCityBusAPIEstimatedTimeOfArrivalUDPOK handles this case with default header values.
+/* InterCityBusAPIEstimatedTimeOfArrivalUDPOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIEstimatedTimeOfArrivalUDPOK struct {
func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/InterCity][%d] interCityBusApiEstimatedTimeOfArrivalUdpOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusN1EstimateTime {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIEstimatedTimeOfArrivalUDPStatus299() *InterCityBusAPIEsti
return &InterCityBusAPIEstimatedTimeOfArrivalUDPStatus299{}
}
-/*InterCityBusAPIEstimatedTimeOfArrivalUDPStatus299 handles this case with default header values.
+/* InterCityBusAPIEstimatedTimeOfArrivalUDPStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIEstimatedTimeOfArrivalUDPStatus299 struct {
func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/InterCity][%d] interCityBusApiEstimatedTimeOfArrivalUdpStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPStatus299) readResponse(respons
return nil
}
+
+// NewInterCityBusAPIEstimatedTimeOfArrivalUDPNotModified creates a InterCityBusAPIEstimatedTimeOfArrivalUDPNotModified with default headers values
+func NewInterCityBusAPIEstimatedTimeOfArrivalUDPNotModified() *InterCityBusAPIEstimatedTimeOfArrivalUDPNotModified {
+ return &InterCityBusAPIEstimatedTimeOfArrivalUDPNotModified{}
+}
+
+/* InterCityBusAPIEstimatedTimeOfArrivalUDPNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIEstimatedTimeOfArrivalUDPNotModified struct {
+}
+
+func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/EstimatedTimeOfArrival/Streaming/InterCity][%d] interCityBusApiEstimatedTimeOfArrivalUdpNotModified ", 304)
+}
+
+func (o *InterCityBusAPIEstimatedTimeOfArrivalUDPNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_news_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_news_parameters.go
index 320b7091..22b9d921 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_news_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_news_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPINewsParams creates a new InterCityBusAPINewsParams object
-// with the default values initialized.
+// NewInterCityBusAPINewsParams creates a new InterCityBusAPINewsParams 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 NewInterCityBusAPINewsParams() *InterCityBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPINewsParamsWithTimeout creates a new InterCityBusAPINewsParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPINewsParamsWithTimeout(timeout time.Duration) *InterCityBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPINewsParamsWithContext creates a new InterCityBusAPINewsParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPINewsParamsWithContext(ctx context.Context) *InterCityBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPINewsParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPINewsParamsWithHTTPClient creates a new InterCityBusAPINewsParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPINewsParamsWithHTTPClient(client *http.Client) *InterCityBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPINewsParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPINewsParams contains all the parameters to send to the API endpoint
-for the inter city bus Api news operation typically these are written to a http.Request
+/* InterCityBusAPINewsParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api news operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPINewsParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPINewsParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPINewsParams) WithDefaults() *InterCityBusAPINewsParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPINewsParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPINewsParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api news params
func (o *InterCityBusAPINewsParams) WithTimeout(timeout time.Duration) *InterCityBusAPINewsParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_news_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_news_responses.go
index d0565e4e..43ed52a3 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_news_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_news_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPINewsReader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPINewsNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPINewsOK() *InterCityBusAPINewsOK {
return &InterCityBusAPINewsOK{}
}
-/*InterCityBusAPINewsOK handles this case with default header values.
+/* InterCityBusAPINewsOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPINewsOK struct {
func (o *InterCityBusAPINewsOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/News/InterCity][%d] interCityBusApiNewsOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPINewsOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusNews {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPINewsStatus299() *InterCityBusAPINewsStatus299 {
return &InterCityBusAPINewsStatus299{}
}
-/*InterCityBusAPINewsStatus299 handles this case with default header values.
+/* InterCityBusAPINewsStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPINewsStatus299 struct {
func (o *InterCityBusAPINewsStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/News/InterCity][%d] interCityBusApiNewsStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPINewsStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPINewsStatus299) readResponse(response runtime.ClientRespo
return nil
}
+
+// NewInterCityBusAPINewsNotModified creates a InterCityBusAPINewsNotModified with default headers values
+func NewInterCityBusAPINewsNotModified() *InterCityBusAPINewsNotModified {
+ return &InterCityBusAPINewsNotModified{}
+}
+
+/* InterCityBusAPINewsNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPINewsNotModified struct {
+}
+
+func (o *InterCityBusAPINewsNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/News/InterCity][%d] interCityBusApiNewsNotModified ", 304)
+}
+
+func (o *InterCityBusAPINewsNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_operator_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_operator_parameters.go
index bf15f8fa..c06f8fe1 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_operator_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_operator_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIOperatorParams creates a new InterCityBusAPIOperatorParams object
-// with the default values initialized.
+// NewInterCityBusAPIOperatorParams creates a new InterCityBusAPIOperatorParams 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 NewInterCityBusAPIOperatorParams() *InterCityBusAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIOperatorParamsWithTimeout creates a new InterCityBusAPIOperatorParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIOperatorParamsWithTimeout(timeout time.Duration) *InterCityBusAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIOperatorParamsWithContext creates a new InterCityBusAPIOperatorParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIOperatorParamsWithContext(ctx context.Context) *InterCityBusAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIOperatorParamsWithHTTPClient creates a new InterCityBusAPIOperatorParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIOperatorParamsWithHTTPClient(client *http.Client) *InterCityBusAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIOperatorParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIOperatorParams contains all the parameters to send to the API endpoint
-for the inter city bus Api operator operation typically these are written to a http.Request
+/* InterCityBusAPIOperatorParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api operator operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIOperatorParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPIOperatorParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api operator params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIOperatorParams) WithDefaults() *InterCityBusAPIOperatorParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api operator params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIOperatorParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIOperatorParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api operator params
func (o *InterCityBusAPIOperatorParams) WithTimeout(timeout time.Duration) *InterCityBusAPIOperatorParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPIOperatorParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPIOperatorParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_operator_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_operator_responses.go
index d1693134..0d8fbc24 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_operator_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_operator_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIOperatorReader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIOperatorNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIOperatorOK() *InterCityBusAPIOperatorOK {
return &InterCityBusAPIOperatorOK{}
}
-/*InterCityBusAPIOperatorOK handles this case with default header values.
+/* InterCityBusAPIOperatorOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIOperatorOK struct {
func (o *InterCityBusAPIOperatorOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Operator/InterCity][%d] interCityBusApiOperatorOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIOperatorOK) GetPayload() []*models.PTXServiceDTOSharedSpecificationV2BaseOperator {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIOperatorStatus299() *InterCityBusAPIOperatorStatus299 {
return &InterCityBusAPIOperatorStatus299{}
}
-/*InterCityBusAPIOperatorStatus299 handles this case with default header values.
+/* InterCityBusAPIOperatorStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIOperatorStatus299 struct {
func (o *InterCityBusAPIOperatorStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Operator/InterCity][%d] interCityBusApiOperatorStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIOperatorStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIOperatorStatus299) readResponse(response runtime.ClientR
return nil
}
+
+// NewInterCityBusAPIOperatorNotModified creates a InterCityBusAPIOperatorNotModified with default headers values
+func NewInterCityBusAPIOperatorNotModified() *InterCityBusAPIOperatorNotModified {
+ return &InterCityBusAPIOperatorNotModified{}
+}
+
+/* InterCityBusAPIOperatorNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIOperatorNotModified struct {
+}
+
+func (o *InterCityBusAPIOperatorNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Operator/InterCity][%d] interCityBusApiOperatorNotModified ", 304)
+}
+
+func (o *InterCityBusAPIOperatorNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency1_parameters.go
index 866a6b5e..fc1e68ed 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency1_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRealTimeByFrequency1Params creates a new InterCityBusAPIRealTimeByFrequency1Params object
-// with the default values initialized.
+// NewInterCityBusAPIRealTimeByFrequency1Params creates a new InterCityBusAPIRealTimeByFrequency1Params 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 NewInterCityBusAPIRealTimeByFrequency1Params() *InterCityBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRealTimeByFrequency1ParamsWithTimeout creates a new InterCityBusAPIRealTimeByFrequency1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRealTimeByFrequency1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRealTimeByFrequency1ParamsWithContext creates a new InterCityBusAPIRealTimeByFrequency1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRealTimeByFrequency1ParamsWithContext(ctx context.Context) *InterCityBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRealTimeByFrequency1ParamsWithHTTPClient creates a new InterCityBusAPIRealTimeByFrequency1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRealTimeByFrequency1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRealTimeByFrequency1Params contains all the parameters to send to the API endpoint
-for the inter city bus Api real time by frequency 1 operation typically these are written to a http.Request
+/* InterCityBusAPIRealTimeByFrequency1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api real time by frequency 1 operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRealTimeByFrequency1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteName
- 繁體中文路線名稱,如'9102'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'9102'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type InterCityBusAPIRealTimeByFrequency1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api real time by frequency 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeByFrequency1Params) WithDefaults() *InterCityBusAPIRealTimeByFrequency1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api real time by frequency 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeByFrequency1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRealTimeByFrequency1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api real time by frequency 1 params
func (o *InterCityBusAPIRealTimeByFrequency1Params) WithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeByFrequency1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *InterCityBusAPIRealTimeByFrequency1Params) WriteToRequest(r runtime.Cli
// 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
}
@@ -293,80 +318,85 @@ func (o *InterCityBusAPIRealTimeByFrequency1Params) WriteToRequest(r runtime.Cli
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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 RouteName
@@ -378,16 +408,17 @@ func (o *InterCityBusAPIRealTimeByFrequency1Params) WriteToRequest(r runtime.Cli
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency1_responses.go
index a25a22b3..bccf9f24 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency1_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency1_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRealTimeByFrequency1Reader) ReadResponse(response runtim
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRealTimeByFrequency1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRealTimeByFrequency1OK() *InterCityBusAPIRealTimeByFreque
return &InterCityBusAPIRealTimeByFrequency1OK{}
}
-/*InterCityBusAPIRealTimeByFrequency1OK handles this case with default header values.
+/* InterCityBusAPIRealTimeByFrequency1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRealTimeByFrequency1OK struct {
func (o *InterCityBusAPIRealTimeByFrequency1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/InterCity/{RouteName}][%d] interCityBusApiRealTimeByFrequency1OK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeByFrequency1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA1Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRealTimeByFrequency1Status299() *InterCityBusAPIRealTimeB
return &InterCityBusAPIRealTimeByFrequency1Status299{}
}
-/*InterCityBusAPIRealTimeByFrequency1Status299 handles this case with default header values.
+/* InterCityBusAPIRealTimeByFrequency1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRealTimeByFrequency1Status299 struct {
func (o *InterCityBusAPIRealTimeByFrequency1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/InterCity/{RouteName}][%d] interCityBusApiRealTimeByFrequency1Status299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeByFrequency1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRealTimeByFrequency1Status299) readResponse(response run
return nil
}
+
+// NewInterCityBusAPIRealTimeByFrequency1NotModified creates a InterCityBusAPIRealTimeByFrequency1NotModified with default headers values
+func NewInterCityBusAPIRealTimeByFrequency1NotModified() *InterCityBusAPIRealTimeByFrequency1NotModified {
+ return &InterCityBusAPIRealTimeByFrequency1NotModified{}
+}
+
+/* InterCityBusAPIRealTimeByFrequency1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRealTimeByFrequency1NotModified struct {
+}
+
+func (o *InterCityBusAPIRealTimeByFrequency1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/InterCity/{RouteName}][%d] interCityBusApiRealTimeByFrequency1NotModified ", 304)
+}
+
+func (o *InterCityBusAPIRealTimeByFrequency1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_parameters.go
index ed176124..4518fa07 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRealTimeByFrequencyParams creates a new InterCityBusAPIRealTimeByFrequencyParams object
-// with the default values initialized.
+// NewInterCityBusAPIRealTimeByFrequencyParams creates a new InterCityBusAPIRealTimeByFrequencyParams 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 NewInterCityBusAPIRealTimeByFrequencyParams() *InterCityBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRealTimeByFrequencyParamsWithTimeout creates a new InterCityBusAPIRealTimeByFrequencyParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRealTimeByFrequencyParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRealTimeByFrequencyParamsWithContext creates a new InterCityBusAPIRealTimeByFrequencyParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRealTimeByFrequencyParamsWithContext(ctx context.Context) *InterCityBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRealTimeByFrequencyParamsWithHTTPClient creates a new InterCityBusAPIRealTimeByFrequencyParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRealTimeByFrequencyParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRealTimeByFrequencyParams contains all the parameters to send to the API endpoint
-for the inter city bus Api real time by frequency operation typically these are written to a http.Request
+/* InterCityBusAPIRealTimeByFrequencyParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api real time by frequency operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRealTimeByFrequencyParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIRealTimeByFrequencyParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api real time by frequency params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeByFrequencyParams) WithDefaults() *InterCityBusAPIRealTimeByFrequencyParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api real time by frequency params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeByFrequencyParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRealTimeByFrequencyParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api real time by frequency params
func (o *InterCityBusAPIRealTimeByFrequencyParams) WithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeByFrequencyParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIRealTimeByFrequencyParams) WriteToRequest(r runtime.Clie
// 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
}
@@ -277,96 +301,102 @@ func (o *InterCityBusAPIRealTimeByFrequencyParams) WriteToRequest(r runtime.Clie
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_responses.go
index b725c261..fbb5b047 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRealTimeByFrequencyReader) ReadResponse(response runtime
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRealTimeByFrequencyNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRealTimeByFrequencyOK() *InterCityBusAPIRealTimeByFrequen
return &InterCityBusAPIRealTimeByFrequencyOK{}
}
-/*InterCityBusAPIRealTimeByFrequencyOK handles this case with default header values.
+/* InterCityBusAPIRealTimeByFrequencyOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRealTimeByFrequencyOK struct {
func (o *InterCityBusAPIRealTimeByFrequencyOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/InterCity][%d] interCityBusApiRealTimeByFrequencyOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeByFrequencyOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA1Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRealTimeByFrequencyStatus299() *InterCityBusAPIRealTimeBy
return &InterCityBusAPIRealTimeByFrequencyStatus299{}
}
-/*InterCityBusAPIRealTimeByFrequencyStatus299 handles this case with default header values.
+/* InterCityBusAPIRealTimeByFrequencyStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRealTimeByFrequencyStatus299 struct {
func (o *InterCityBusAPIRealTimeByFrequencyStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/InterCity][%d] interCityBusApiRealTimeByFrequencyStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeByFrequencyStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRealTimeByFrequencyStatus299) readResponse(response runt
return nil
}
+
+// NewInterCityBusAPIRealTimeByFrequencyNotModified creates a InterCityBusAPIRealTimeByFrequencyNotModified with default headers values
+func NewInterCityBusAPIRealTimeByFrequencyNotModified() *InterCityBusAPIRealTimeByFrequencyNotModified {
+ return &InterCityBusAPIRealTimeByFrequencyNotModified{}
+}
+
+/* InterCityBusAPIRealTimeByFrequencyNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRealTimeByFrequencyNotModified struct {
+}
+
+func (o *InterCityBusAPIRealTimeByFrequencyNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/InterCity][%d] interCityBusApiRealTimeByFrequencyNotModified ", 304)
+}
+
+func (o *InterCityBusAPIRealTimeByFrequencyNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_1_parameters.go
index e5c66a63..d131cd9a 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_1_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRealTimeByFrequencyUDP1Params creates a new InterCityBusAPIRealTimeByFrequencyUDP1Params object
-// with the default values initialized.
+// NewInterCityBusAPIRealTimeByFrequencyUDP1Params creates a new InterCityBusAPIRealTimeByFrequencyUDP1Params 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 NewInterCityBusAPIRealTimeByFrequencyUDP1Params() *InterCityBusAPIRealTimeByFrequencyUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRealTimeByFrequencyUDP1ParamsWithTimeout creates a new InterCityBusAPIRealTimeByFrequencyUDP1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRealTimeByFrequencyUDP1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeByFrequencyUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRealTimeByFrequencyUDP1ParamsWithContext creates a new InterCityBusAPIRealTimeByFrequencyUDP1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRealTimeByFrequencyUDP1ParamsWithContext(ctx context.Context) *InterCityBusAPIRealTimeByFrequencyUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyUDP1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRealTimeByFrequencyUDP1ParamsWithHTTPClient creates a new InterCityBusAPIRealTimeByFrequencyUDP1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRealTimeByFrequencyUDP1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRealTimeByFrequencyUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyUDP1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRealTimeByFrequencyUDP1Params contains all the parameters to send to the API endpoint
-for the inter city bus Api real time by frequency UDP 1 operation typically these are written to a http.Request
+/* InterCityBusAPIRealTimeByFrequencyUDP1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api real time by frequency UDP 1 operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRealTimeByFrequencyUDP1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteName
- 繁體中文路線名稱,如'9102'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'9102'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type InterCityBusAPIRealTimeByFrequencyUDP1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api real time by frequency UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeByFrequencyUDP1Params) WithDefaults() *InterCityBusAPIRealTimeByFrequencyUDP1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api real time by frequency UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeByFrequencyUDP1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRealTimeByFrequencyUDP1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api real time by frequency UDP 1 params
func (o *InterCityBusAPIRealTimeByFrequencyUDP1Params) WithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeByFrequencyUDP1Params {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *InterCityBusAPIRealTimeByFrequencyUDP1Params) WriteToRequest(r runtime.
// 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
}
@@ -293,80 +318,85 @@ func (o *InterCityBusAPIRealTimeByFrequencyUDP1Params) WriteToRequest(r runtime.
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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 RouteName
@@ -378,16 +408,17 @@ func (o *InterCityBusAPIRealTimeByFrequencyUDP1Params) WriteToRequest(r runtime.
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_1_responses.go
index 212b3fc6..323addbf 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_1_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_1_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRealTimeByFrequencyUDP1Reader) ReadResponse(response run
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRealTimeByFrequencyUdp1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRealTimeByFrequencyUdp1OK() *InterCityBusAPIRealTimeByFre
return &InterCityBusAPIRealTimeByFrequencyUdp1OK{}
}
-/*InterCityBusAPIRealTimeByFrequencyUdp1OK handles this case with default header values.
+/* InterCityBusAPIRealTimeByFrequencyUdp1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRealTimeByFrequencyUdp1OK struct {
func (o *InterCityBusAPIRealTimeByFrequencyUdp1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/InterCity/{RouteName}][%d] interCityBusApiRealTimeByFrequencyUdp1OK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeByFrequencyUdp1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA1Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRealTimeByFrequencyUdp1Status299() *InterCityBusAPIRealTi
return &InterCityBusAPIRealTimeByFrequencyUdp1Status299{}
}
-/*InterCityBusAPIRealTimeByFrequencyUdp1Status299 handles this case with default header values.
+/* InterCityBusAPIRealTimeByFrequencyUdp1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRealTimeByFrequencyUdp1Status299 struct {
func (o *InterCityBusAPIRealTimeByFrequencyUdp1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/InterCity/{RouteName}][%d] interCityBusApiRealTimeByFrequencyUdp1Status299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeByFrequencyUdp1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRealTimeByFrequencyUdp1Status299) readResponse(response
return nil
}
+
+// NewInterCityBusAPIRealTimeByFrequencyUdp1NotModified creates a InterCityBusAPIRealTimeByFrequencyUdp1NotModified with default headers values
+func NewInterCityBusAPIRealTimeByFrequencyUdp1NotModified() *InterCityBusAPIRealTimeByFrequencyUdp1NotModified {
+ return &InterCityBusAPIRealTimeByFrequencyUdp1NotModified{}
+}
+
+/* InterCityBusAPIRealTimeByFrequencyUdp1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRealTimeByFrequencyUdp1NotModified struct {
+}
+
+func (o *InterCityBusAPIRealTimeByFrequencyUdp1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/InterCity/{RouteName}][%d] interCityBusApiRealTimeByFrequencyUdp1NotModified ", 304)
+}
+
+func (o *InterCityBusAPIRealTimeByFrequencyUdp1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_parameters.go
index 2f560b24..b12af622 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRealTimeByFrequencyUDPParams creates a new InterCityBusAPIRealTimeByFrequencyUDPParams object
-// with the default values initialized.
+// NewInterCityBusAPIRealTimeByFrequencyUDPParams creates a new InterCityBusAPIRealTimeByFrequencyUDPParams 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 NewInterCityBusAPIRealTimeByFrequencyUDPParams() *InterCityBusAPIRealTimeByFrequencyUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRealTimeByFrequencyUDPParamsWithTimeout creates a new InterCityBusAPIRealTimeByFrequencyUDPParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRealTimeByFrequencyUDPParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeByFrequencyUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRealTimeByFrequencyUDPParamsWithContext creates a new InterCityBusAPIRealTimeByFrequencyUDPParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRealTimeByFrequencyUDPParamsWithContext(ctx context.Context) *InterCityBusAPIRealTimeByFrequencyUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyUDPParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRealTimeByFrequencyUDPParamsWithHTTPClient creates a new InterCityBusAPIRealTimeByFrequencyUDPParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRealTimeByFrequencyUDPParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRealTimeByFrequencyUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeByFrequencyUDPParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRealTimeByFrequencyUDPParams contains all the parameters to send to the API endpoint
-for the inter city bus Api real time by frequency UDP operation typically these are written to a http.Request
+/* InterCityBusAPIRealTimeByFrequencyUDPParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api real time by frequency UDP operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRealTimeByFrequencyUDPParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIRealTimeByFrequencyUDPParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api real time by frequency UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeByFrequencyUDPParams) WithDefaults() *InterCityBusAPIRealTimeByFrequencyUDPParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api real time by frequency UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeByFrequencyUDPParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRealTimeByFrequencyUDPParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api real time by frequency UDP params
func (o *InterCityBusAPIRealTimeByFrequencyUDPParams) WithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeByFrequencyUDPParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIRealTimeByFrequencyUDPParams) WriteToRequest(r runtime.C
// 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
}
@@ -277,96 +301,102 @@ func (o *InterCityBusAPIRealTimeByFrequencyUDPParams) WriteToRequest(r runtime.C
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_responses.go
index 1e4e8c58..2a272052 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_by_frequency_udp_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRealTimeByFrequencyUDPReader) ReadResponse(response runt
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRealTimeByFrequencyUDPNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRealTimeByFrequencyUDPOK() *InterCityBusAPIRealTimeByFreq
return &InterCityBusAPIRealTimeByFrequencyUDPOK{}
}
-/*InterCityBusAPIRealTimeByFrequencyUDPOK handles this case with default header values.
+/* InterCityBusAPIRealTimeByFrequencyUDPOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRealTimeByFrequencyUDPOK struct {
func (o *InterCityBusAPIRealTimeByFrequencyUDPOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/InterCity][%d] interCityBusApiRealTimeByFrequencyUdpOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeByFrequencyUDPOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA1Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRealTimeByFrequencyUDPStatus299() *InterCityBusAPIRealTim
return &InterCityBusAPIRealTimeByFrequencyUDPStatus299{}
}
-/*InterCityBusAPIRealTimeByFrequencyUDPStatus299 handles this case with default header values.
+/* InterCityBusAPIRealTimeByFrequencyUDPStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRealTimeByFrequencyUDPStatus299 struct {
func (o *InterCityBusAPIRealTimeByFrequencyUDPStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/InterCity][%d] interCityBusApiRealTimeByFrequencyUdpStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeByFrequencyUDPStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRealTimeByFrequencyUDPStatus299) readResponse(response r
return nil
}
+
+// NewInterCityBusAPIRealTimeByFrequencyUDPNotModified creates a InterCityBusAPIRealTimeByFrequencyUDPNotModified with default headers values
+func NewInterCityBusAPIRealTimeByFrequencyUDPNotModified() *InterCityBusAPIRealTimeByFrequencyUDPNotModified {
+ return &InterCityBusAPIRealTimeByFrequencyUDPNotModified{}
+}
+
+/* InterCityBusAPIRealTimeByFrequencyUDPNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRealTimeByFrequencyUDPNotModified struct {
+}
+
+func (o *InterCityBusAPIRealTimeByFrequencyUDPNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeByFrequency/Streaming/InterCity][%d] interCityBusApiRealTimeByFrequencyUdpNotModified ", 304)
+}
+
+func (o *InterCityBusAPIRealTimeByFrequencyUDPNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop1_parameters.go
index 063aeb8d..65aec9f4 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop1_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRealTimeNearStop1Params creates a new InterCityBusAPIRealTimeNearStop1Params object
-// with the default values initialized.
+// NewInterCityBusAPIRealTimeNearStop1Params creates a new InterCityBusAPIRealTimeNearStop1Params 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 NewInterCityBusAPIRealTimeNearStop1Params() *InterCityBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRealTimeNearStop1ParamsWithTimeout creates a new InterCityBusAPIRealTimeNearStop1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRealTimeNearStop1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRealTimeNearStop1ParamsWithContext creates a new InterCityBusAPIRealTimeNearStop1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRealTimeNearStop1ParamsWithContext(ctx context.Context) *InterCityBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRealTimeNearStop1ParamsWithHTTPClient creates a new InterCityBusAPIRealTimeNearStop1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRealTimeNearStop1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRealTimeNearStop1Params contains all the parameters to send to the API endpoint
-for the inter city bus Api real time near stop 1 operation typically these are written to a http.Request
+/* InterCityBusAPIRealTimeNearStop1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api real time near stop 1 operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRealTimeNearStop1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteName
- 繁體中文路線名稱,如'9102'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'9102'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIRealTimeNearStop1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api real time near stop 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeNearStop1Params) WithDefaults() *InterCityBusAPIRealTimeNearStop1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api real time near stop 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeNearStop1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRealTimeNearStop1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api real time near stop 1 params
func (o *InterCityBusAPIRealTimeNearStop1Params) WithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeNearStop1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIRealTimeNearStop1Params) WriteToRequest(r runtime.Client
// 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
}
@@ -277,64 +301,68 @@ func (o *InterCityBusAPIRealTimeNearStop1Params) WriteToRequest(r runtime.Client
// 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 RouteName
@@ -346,16 +374,17 @@ func (o *InterCityBusAPIRealTimeNearStop1Params) WriteToRequest(r runtime.Client
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop1_responses.go
index 9acb11c6..14064101 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop1_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop1_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRealTimeNearStop1Reader) ReadResponse(response runtime.C
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRealTimeNearStop1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRealTimeNearStop1OK() *InterCityBusAPIRealTimeNearStop1OK
return &InterCityBusAPIRealTimeNearStop1OK{}
}
-/*InterCityBusAPIRealTimeNearStop1OK handles this case with default header values.
+/* InterCityBusAPIRealTimeNearStop1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRealTimeNearStop1OK struct {
func (o *InterCityBusAPIRealTimeNearStop1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/InterCity/{RouteName}][%d] interCityBusApiRealTimeNearStop1OK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeNearStop1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA2Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRealTimeNearStop1Status299() *InterCityBusAPIRealTimeNear
return &InterCityBusAPIRealTimeNearStop1Status299{}
}
-/*InterCityBusAPIRealTimeNearStop1Status299 handles this case with default header values.
+/* InterCityBusAPIRealTimeNearStop1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRealTimeNearStop1Status299 struct {
func (o *InterCityBusAPIRealTimeNearStop1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/InterCity/{RouteName}][%d] interCityBusApiRealTimeNearStop1Status299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeNearStop1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRealTimeNearStop1Status299) readResponse(response runtim
return nil
}
+
+// NewInterCityBusAPIRealTimeNearStop1NotModified creates a InterCityBusAPIRealTimeNearStop1NotModified with default headers values
+func NewInterCityBusAPIRealTimeNearStop1NotModified() *InterCityBusAPIRealTimeNearStop1NotModified {
+ return &InterCityBusAPIRealTimeNearStop1NotModified{}
+}
+
+/* InterCityBusAPIRealTimeNearStop1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRealTimeNearStop1NotModified struct {
+}
+
+func (o *InterCityBusAPIRealTimeNearStop1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/InterCity/{RouteName}][%d] interCityBusApiRealTimeNearStop1NotModified ", 304)
+}
+
+func (o *InterCityBusAPIRealTimeNearStop1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_parameters.go
index ec7931be..bcbc204e 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRealTimeNearStopParams creates a new InterCityBusAPIRealTimeNearStopParams object
-// with the default values initialized.
+// NewInterCityBusAPIRealTimeNearStopParams creates a new InterCityBusAPIRealTimeNearStopParams 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 NewInterCityBusAPIRealTimeNearStopParams() *InterCityBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRealTimeNearStopParamsWithTimeout creates a new InterCityBusAPIRealTimeNearStopParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRealTimeNearStopParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRealTimeNearStopParamsWithContext creates a new InterCityBusAPIRealTimeNearStopParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRealTimeNearStopParamsWithContext(ctx context.Context) *InterCityBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRealTimeNearStopParamsWithHTTPClient creates a new InterCityBusAPIRealTimeNearStopParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRealTimeNearStopParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRealTimeNearStopParams contains all the parameters to send to the API endpoint
-for the inter city bus Api real time near stop operation typically these are written to a http.Request
+/* InterCityBusAPIRealTimeNearStopParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api real time near stop operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRealTimeNearStopParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPIRealTimeNearStopParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api real time near stop params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeNearStopParams) WithDefaults() *InterCityBusAPIRealTimeNearStopParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api real time near stop params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeNearStopParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRealTimeNearStopParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api real time near stop params
func (o *InterCityBusAPIRealTimeNearStopParams) WithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeNearStopParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPIRealTimeNearStopParams) WriteToRequest(r runtime.ClientR
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPIRealTimeNearStopParams) WriteToRequest(r runtime.ClientR
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_responses.go
index e311c232..385a3188 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRealTimeNearStopReader) ReadResponse(response runtime.Cl
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRealTimeNearStopNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRealTimeNearStopOK() *InterCityBusAPIRealTimeNearStopOK {
return &InterCityBusAPIRealTimeNearStopOK{}
}
-/*InterCityBusAPIRealTimeNearStopOK handles this case with default header values.
+/* InterCityBusAPIRealTimeNearStopOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRealTimeNearStopOK struct {
func (o *InterCityBusAPIRealTimeNearStopOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/InterCity][%d] interCityBusApiRealTimeNearStopOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeNearStopOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA2Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRealTimeNearStopStatus299() *InterCityBusAPIRealTimeNearS
return &InterCityBusAPIRealTimeNearStopStatus299{}
}
-/*InterCityBusAPIRealTimeNearStopStatus299 handles this case with default header values.
+/* InterCityBusAPIRealTimeNearStopStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRealTimeNearStopStatus299 struct {
func (o *InterCityBusAPIRealTimeNearStopStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/InterCity][%d] interCityBusApiRealTimeNearStopStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeNearStopStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRealTimeNearStopStatus299) readResponse(response runtime
return nil
}
+
+// NewInterCityBusAPIRealTimeNearStopNotModified creates a InterCityBusAPIRealTimeNearStopNotModified with default headers values
+func NewInterCityBusAPIRealTimeNearStopNotModified() *InterCityBusAPIRealTimeNearStopNotModified {
+ return &InterCityBusAPIRealTimeNearStopNotModified{}
+}
+
+/* InterCityBusAPIRealTimeNearStopNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRealTimeNearStopNotModified struct {
+}
+
+func (o *InterCityBusAPIRealTimeNearStopNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/InterCity][%d] interCityBusApiRealTimeNearStopNotModified ", 304)
+}
+
+func (o *InterCityBusAPIRealTimeNearStopNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_1_parameters.go
index c8f32f8c..a7dd0630 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_1_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRealTimeNearStopUDP1Params creates a new InterCityBusAPIRealTimeNearStopUDP1Params object
-// with the default values initialized.
+// NewInterCityBusAPIRealTimeNearStopUDP1Params creates a new InterCityBusAPIRealTimeNearStopUDP1Params 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 NewInterCityBusAPIRealTimeNearStopUDP1Params() *InterCityBusAPIRealTimeNearStopUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRealTimeNearStopUDP1ParamsWithTimeout creates a new InterCityBusAPIRealTimeNearStopUDP1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRealTimeNearStopUDP1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeNearStopUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopUDP1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRealTimeNearStopUDP1ParamsWithContext creates a new InterCityBusAPIRealTimeNearStopUDP1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRealTimeNearStopUDP1ParamsWithContext(ctx context.Context) *InterCityBusAPIRealTimeNearStopUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopUDP1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRealTimeNearStopUDP1ParamsWithHTTPClient creates a new InterCityBusAPIRealTimeNearStopUDP1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRealTimeNearStopUDP1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRealTimeNearStopUDP1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopUDP1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRealTimeNearStopUDP1Params contains all the parameters to send to the API endpoint
-for the inter city bus Api real time near stop UDP 1 operation typically these are written to a http.Request
+/* InterCityBusAPIRealTimeNearStopUDP1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api real time near stop UDP 1 operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRealTimeNearStopUDP1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteName
- 繁體中文路線名稱,如'9102'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'9102'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIRealTimeNearStopUDP1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api real time near stop UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeNearStopUDP1Params) WithDefaults() *InterCityBusAPIRealTimeNearStopUDP1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api real time near stop UDP 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeNearStopUDP1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRealTimeNearStopUDP1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api real time near stop UDP 1 params
func (o *InterCityBusAPIRealTimeNearStopUDP1Params) WithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeNearStopUDP1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIRealTimeNearStopUDP1Params) WriteToRequest(r runtime.Cli
// 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
}
@@ -277,64 +301,68 @@ func (o *InterCityBusAPIRealTimeNearStopUDP1Params) WriteToRequest(r runtime.Cli
// 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 RouteName
@@ -346,16 +374,17 @@ func (o *InterCityBusAPIRealTimeNearStopUDP1Params) WriteToRequest(r runtime.Cli
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_1_responses.go
index 533f4ea0..fb402118 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_1_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_1_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRealTimeNearStopUDP1Reader) ReadResponse(response runtim
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRealTimeNearStopUdp1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRealTimeNearStopUdp1OK() *InterCityBusAPIRealTimeNearStop
return &InterCityBusAPIRealTimeNearStopUdp1OK{}
}
-/*InterCityBusAPIRealTimeNearStopUdp1OK handles this case with default header values.
+/* InterCityBusAPIRealTimeNearStopUdp1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRealTimeNearStopUdp1OK struct {
func (o *InterCityBusAPIRealTimeNearStopUdp1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/InterCity/{RouteName}][%d] interCityBusApiRealTimeNearStopUdp1OK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeNearStopUdp1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA2Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRealTimeNearStopUdp1Status299() *InterCityBusAPIRealTimeN
return &InterCityBusAPIRealTimeNearStopUdp1Status299{}
}
-/*InterCityBusAPIRealTimeNearStopUdp1Status299 handles this case with default header values.
+/* InterCityBusAPIRealTimeNearStopUdp1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRealTimeNearStopUdp1Status299 struct {
func (o *InterCityBusAPIRealTimeNearStopUdp1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/InterCity/{RouteName}][%d] interCityBusApiRealTimeNearStopUdp1Status299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeNearStopUdp1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRealTimeNearStopUdp1Status299) readResponse(response run
return nil
}
+
+// NewInterCityBusAPIRealTimeNearStopUdp1NotModified creates a InterCityBusAPIRealTimeNearStopUdp1NotModified with default headers values
+func NewInterCityBusAPIRealTimeNearStopUdp1NotModified() *InterCityBusAPIRealTimeNearStopUdp1NotModified {
+ return &InterCityBusAPIRealTimeNearStopUdp1NotModified{}
+}
+
+/* InterCityBusAPIRealTimeNearStopUdp1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRealTimeNearStopUdp1NotModified struct {
+}
+
+func (o *InterCityBusAPIRealTimeNearStopUdp1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/InterCity/{RouteName}][%d] interCityBusApiRealTimeNearStopUdp1NotModified ", 304)
+}
+
+func (o *InterCityBusAPIRealTimeNearStopUdp1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_parameters.go
index 6d26b2d3..24eac842 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRealTimeNearStopUDPParams creates a new InterCityBusAPIRealTimeNearStopUDPParams object
-// with the default values initialized.
+// NewInterCityBusAPIRealTimeNearStopUDPParams creates a new InterCityBusAPIRealTimeNearStopUDPParams 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 NewInterCityBusAPIRealTimeNearStopUDPParams() *InterCityBusAPIRealTimeNearStopUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRealTimeNearStopUDPParamsWithTimeout creates a new InterCityBusAPIRealTimeNearStopUDPParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRealTimeNearStopUDPParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeNearStopUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopUDPParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRealTimeNearStopUDPParamsWithContext creates a new InterCityBusAPIRealTimeNearStopUDPParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRealTimeNearStopUDPParamsWithContext(ctx context.Context) *InterCityBusAPIRealTimeNearStopUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopUDPParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRealTimeNearStopUDPParamsWithHTTPClient creates a new InterCityBusAPIRealTimeNearStopUDPParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRealTimeNearStopUDPParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRealTimeNearStopUDPParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRealTimeNearStopUDPParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRealTimeNearStopUDPParams contains all the parameters to send to the API endpoint
-for the inter city bus Api real time near stop UDP operation typically these are written to a http.Request
+/* InterCityBusAPIRealTimeNearStopUDPParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api real time near stop UDP operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRealTimeNearStopUDPParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPIRealTimeNearStopUDPParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api real time near stop UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeNearStopUDPParams) WithDefaults() *InterCityBusAPIRealTimeNearStopUDPParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api real time near stop UDP params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRealTimeNearStopUDPParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRealTimeNearStopUDPParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api real time near stop UDP params
func (o *InterCityBusAPIRealTimeNearStopUDPParams) WithTimeout(timeout time.Duration) *InterCityBusAPIRealTimeNearStopUDPParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPIRealTimeNearStopUDPParams) WriteToRequest(r runtime.Clie
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPIRealTimeNearStopUDPParams) WriteToRequest(r runtime.Clie
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_responses.go
index a8d0df61..fe81b1a4 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_real_time_near_stop_udp_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRealTimeNearStopUDPReader) ReadResponse(response runtime
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRealTimeNearStopUDPNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRealTimeNearStopUDPOK() *InterCityBusAPIRealTimeNearStopU
return &InterCityBusAPIRealTimeNearStopUDPOK{}
}
-/*InterCityBusAPIRealTimeNearStopUDPOK handles this case with default header values.
+/* InterCityBusAPIRealTimeNearStopUDPOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRealTimeNearStopUDPOK struct {
func (o *InterCityBusAPIRealTimeNearStopUDPOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/InterCity][%d] interCityBusApiRealTimeNearStopUdpOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeNearStopUDPOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusA2Data {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRealTimeNearStopUDPStatus299() *InterCityBusAPIRealTimeNe
return &InterCityBusAPIRealTimeNearStopUDPStatus299{}
}
-/*InterCityBusAPIRealTimeNearStopUDPStatus299 handles this case with default header values.
+/* InterCityBusAPIRealTimeNearStopUDPStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRealTimeNearStopUDPStatus299 struct {
func (o *InterCityBusAPIRealTimeNearStopUDPStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/InterCity][%d] interCityBusApiRealTimeNearStopUdpStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRealTimeNearStopUDPStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRealTimeNearStopUDPStatus299) readResponse(response runt
return nil
}
+
+// NewInterCityBusAPIRealTimeNearStopUDPNotModified creates a InterCityBusAPIRealTimeNearStopUDPNotModified with default headers values
+func NewInterCityBusAPIRealTimeNearStopUDPNotModified() *InterCityBusAPIRealTimeNearStopUDPNotModified {
+ return &InterCityBusAPIRealTimeNearStopUDPNotModified{}
+}
+
+/* InterCityBusAPIRealTimeNearStopUDPNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRealTimeNearStopUDPNotModified struct {
+}
+
+func (o *InterCityBusAPIRealTimeNearStopUDPNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RealTimeNearStop/Streaming/InterCity][%d] interCityBusApiRealTimeNearStopUdpNotModified ", 304)
+}
+
+func (o *InterCityBusAPIRealTimeNearStopUDPNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_route1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_route1_parameters.go
index 42a06661..029bbb64 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_route1_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_route1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRoute1Params creates a new InterCityBusAPIRoute1Params object
-// with the default values initialized.
+// NewInterCityBusAPIRoute1Params creates a new InterCityBusAPIRoute1Params 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 NewInterCityBusAPIRoute1Params() *InterCityBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRoute1ParamsWithTimeout creates a new InterCityBusAPIRoute1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRoute1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRoute1ParamsWithContext creates a new InterCityBusAPIRoute1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRoute1ParamsWithContext(ctx context.Context) *InterCityBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRoute1ParamsWithHTTPClient creates a new InterCityBusAPIRoute1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRoute1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRoute1Params contains all the parameters to send to the API endpoint
-for the inter city bus Api route 1 operation typically these are written to a http.Request
+/* InterCityBusAPIRoute1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api route 1 operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRoute1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteName
- 繁體中文路線名稱,如'9102'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'9102'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIRoute1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRoute1Params) WithDefaults() *InterCityBusAPIRoute1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRoute1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRoute1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api route 1 params
func (o *InterCityBusAPIRoute1Params) WithTimeout(timeout time.Duration) *InterCityBusAPIRoute1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIRoute1Params) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -277,64 +301,68 @@ func (o *InterCityBusAPIRoute1Params) WriteToRequest(r runtime.ClientRequest, re
// 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 RouteName
@@ -346,16 +374,17 @@ func (o *InterCityBusAPIRoute1Params) WriteToRequest(r runtime.ClientRequest, re
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_route1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_route1_responses.go
index 8606e746..a178f0e3 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_route1_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_route1_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRoute1Reader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRoute1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRoute1OK() *InterCityBusAPIRoute1OK {
return &InterCityBusAPIRoute1OK{}
}
-/*InterCityBusAPIRoute1OK handles this case with default header values.
+/* InterCityBusAPIRoute1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRoute1OK struct {
func (o *InterCityBusAPIRoute1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Route/InterCity/{RouteName}][%d] interCityBusApiRoute1OK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRoute1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusRoute {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRoute1Status299() *InterCityBusAPIRoute1Status299 {
return &InterCityBusAPIRoute1Status299{}
}
-/*InterCityBusAPIRoute1Status299 handles this case with default header values.
+/* InterCityBusAPIRoute1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRoute1Status299 struct {
func (o *InterCityBusAPIRoute1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Route/InterCity/{RouteName}][%d] interCityBusApiRoute1Status299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRoute1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRoute1Status299) readResponse(response runtime.ClientRes
return nil
}
+
+// NewInterCityBusAPIRoute1NotModified creates a InterCityBusAPIRoute1NotModified with default headers values
+func NewInterCityBusAPIRoute1NotModified() *InterCityBusAPIRoute1NotModified {
+ return &InterCityBusAPIRoute1NotModified{}
+}
+
+/* InterCityBusAPIRoute1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRoute1NotModified struct {
+}
+
+func (o *InterCityBusAPIRoute1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Route/InterCity/{RouteName}][%d] interCityBusApiRoute1NotModified ", 304)
+}
+
+func (o *InterCityBusAPIRoute1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare1_parameters.go
index a60a9fb9..fcb00b98 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare1_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRouteFare1Params creates a new InterCityBusAPIRouteFare1Params object
-// with the default values initialized.
+// NewInterCityBusAPIRouteFare1Params creates a new InterCityBusAPIRouteFare1Params 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 NewInterCityBusAPIRouteFare1Params() *InterCityBusAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRouteFare1ParamsWithTimeout creates a new InterCityBusAPIRouteFare1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRouteFare1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRouteFare1ParamsWithContext creates a new InterCityBusAPIRouteFare1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRouteFare1ParamsWithContext(ctx context.Context) *InterCityBusAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRouteFare1ParamsWithHTTPClient creates a new InterCityBusAPIRouteFare1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRouteFare1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRouteFare1Params contains all the parameters to send to the API endpoint
-for the inter city bus Api route fare 1 operation typically these are written to a http.Request
+/* InterCityBusAPIRouteFare1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api route fare 1 operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRouteFare1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteName
- 繁體中文路線名稱,如'9102'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'9102'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIRouteFare1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api route fare 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRouteFare1Params) WithDefaults() *InterCityBusAPIRouteFare1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api route fare 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRouteFare1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRouteFare1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api route fare 1 params
func (o *InterCityBusAPIRouteFare1Params) WithTimeout(timeout time.Duration) *InterCityBusAPIRouteFare1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIRouteFare1Params) WriteToRequest(r runtime.ClientRequest
// 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
}
@@ -277,64 +301,68 @@ func (o *InterCityBusAPIRouteFare1Params) WriteToRequest(r runtime.ClientRequest
// 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 RouteName
@@ -346,16 +374,17 @@ func (o *InterCityBusAPIRouteFare1Params) WriteToRequest(r runtime.ClientRequest
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare1_responses.go
index 2acaf077..79a1a246 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare1_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare1_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRouteFare1Reader) ReadResponse(response runtime.ClientRe
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRouteFare1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRouteFare1OK() *InterCityBusAPIRouteFare1OK {
return &InterCityBusAPIRouteFare1OK{}
}
-/*InterCityBusAPIRouteFare1OK handles this case with default header values.
+/* InterCityBusAPIRouteFare1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRouteFare1OK struct {
func (o *InterCityBusAPIRouteFare1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RouteFare/InterCity/{RouteName}][%d] interCityBusApiRouteFare1OK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRouteFare1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusRouteFare {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRouteFare1Status299() *InterCityBusAPIRouteFare1Status299
return &InterCityBusAPIRouteFare1Status299{}
}
-/*InterCityBusAPIRouteFare1Status299 handles this case with default header values.
+/* InterCityBusAPIRouteFare1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRouteFare1Status299 struct {
func (o *InterCityBusAPIRouteFare1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RouteFare/InterCity/{RouteName}][%d] interCityBusApiRouteFare1Status299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRouteFare1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRouteFare1Status299) readResponse(response runtime.Clien
return nil
}
+
+// NewInterCityBusAPIRouteFare1NotModified creates a InterCityBusAPIRouteFare1NotModified with default headers values
+func NewInterCityBusAPIRouteFare1NotModified() *InterCityBusAPIRouteFare1NotModified {
+ return &InterCityBusAPIRouteFare1NotModified{}
+}
+
+/* InterCityBusAPIRouteFare1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRouteFare1NotModified struct {
+}
+
+func (o *InterCityBusAPIRouteFare1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RouteFare/InterCity/{RouteName}][%d] interCityBusApiRouteFare1NotModified ", 304)
+}
+
+func (o *InterCityBusAPIRouteFare1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare_parameters.go
index c5ac8706..778c4601 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRouteFareParams creates a new InterCityBusAPIRouteFareParams object
-// with the default values initialized.
+// NewInterCityBusAPIRouteFareParams creates a new InterCityBusAPIRouteFareParams 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 NewInterCityBusAPIRouteFareParams() *InterCityBusAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRouteFareParamsWithTimeout creates a new InterCityBusAPIRouteFareParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRouteFareParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRouteFareParamsWithContext creates a new InterCityBusAPIRouteFareParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRouteFareParamsWithContext(ctx context.Context) *InterCityBusAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRouteFareParamsWithHTTPClient creates a new InterCityBusAPIRouteFareParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRouteFareParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRouteFareParams contains all the parameters to send to the API endpoint
-for the inter city bus Api route fare operation typically these are written to a http.Request
+/* InterCityBusAPIRouteFareParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api route fare operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRouteFareParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPIRouteFareParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api route fare params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRouteFareParams) WithDefaults() *InterCityBusAPIRouteFareParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api route fare params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRouteFareParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRouteFareParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api route fare params
func (o *InterCityBusAPIRouteFareParams) WithTimeout(timeout time.Duration) *InterCityBusAPIRouteFareParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPIRouteFareParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPIRouteFareParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare_responses.go
index aab4147e..70fa093d 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_fare_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRouteFareReader) ReadResponse(response runtime.ClientRes
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRouteFareNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRouteFareOK() *InterCityBusAPIRouteFareOK {
return &InterCityBusAPIRouteFareOK{}
}
-/*InterCityBusAPIRouteFareOK handles this case with default header values.
+/* InterCityBusAPIRouteFareOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRouteFareOK struct {
func (o *InterCityBusAPIRouteFareOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RouteFare/InterCity][%d] interCityBusApiRouteFareOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRouteFareOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusRouteFare {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRouteFareStatus299() *InterCityBusAPIRouteFareStatus299 {
return &InterCityBusAPIRouteFareStatus299{}
}
-/*InterCityBusAPIRouteFareStatus299 handles this case with default header values.
+/* InterCityBusAPIRouteFareStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRouteFareStatus299 struct {
func (o *InterCityBusAPIRouteFareStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/RouteFare/InterCity][%d] interCityBusApiRouteFareStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRouteFareStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRouteFareStatus299) readResponse(response runtime.Client
return nil
}
+
+// NewInterCityBusAPIRouteFareNotModified creates a InterCityBusAPIRouteFareNotModified with default headers values
+func NewInterCityBusAPIRouteFareNotModified() *InterCityBusAPIRouteFareNotModified {
+ return &InterCityBusAPIRouteFareNotModified{}
+}
+
+/* InterCityBusAPIRouteFareNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRouteFareNotModified struct {
+}
+
+func (o *InterCityBusAPIRouteFareNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/RouteFare/InterCity][%d] interCityBusApiRouteFareNotModified ", 304)
+}
+
+func (o *InterCityBusAPIRouteFareNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_parameters.go
index c86673ff..6c6430fb 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIRouteParams creates a new InterCityBusAPIRouteParams object
-// with the default values initialized.
+// NewInterCityBusAPIRouteParams creates a new InterCityBusAPIRouteParams 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 NewInterCityBusAPIRouteParams() *InterCityBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIRouteParamsWithTimeout creates a new InterCityBusAPIRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIRouteParamsWithTimeout(timeout time.Duration) *InterCityBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIRouteParamsWithContext creates a new InterCityBusAPIRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIRouteParamsWithContext(ctx context.Context) *InterCityBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIRouteParamsWithHTTPClient creates a new InterCityBusAPIRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIRouteParamsWithHTTPClient(client *http.Client) *InterCityBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIRouteParams contains all the parameters to send to the API endpoint
-for the inter city bus Api route operation typically these are written to a http.Request
+/* InterCityBusAPIRouteParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api route operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIRouteParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPIRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRouteParams) WithDefaults() *InterCityBusAPIRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIRouteParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api route params
func (o *InterCityBusAPIRouteParams) WithTimeout(timeout time.Duration) *InterCityBusAPIRouteParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPIRouteParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPIRouteParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_responses.go
index 9d0fe037..45880774 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_route_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_route_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIRouteReader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIRouteNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIRouteOK() *InterCityBusAPIRouteOK {
return &InterCityBusAPIRouteOK{}
}
-/*InterCityBusAPIRouteOK handles this case with default header values.
+/* InterCityBusAPIRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIRouteOK struct {
func (o *InterCityBusAPIRouteOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Route/InterCity][%d] interCityBusApiRouteOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIRouteOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusRoute {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIRouteStatus299() *InterCityBusAPIRouteStatus299 {
return &InterCityBusAPIRouteStatus299{}
}
-/*InterCityBusAPIRouteStatus299 handles this case with default header values.
+/* InterCityBusAPIRouteStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIRouteStatus299 struct {
func (o *InterCityBusAPIRouteStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Route/InterCity][%d] interCityBusApiRouteStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIRouteStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIRouteStatus299) readResponse(response runtime.ClientResp
return nil
}
+
+// NewInterCityBusAPIRouteNotModified creates a InterCityBusAPIRouteNotModified with default headers values
+func NewInterCityBusAPIRouteNotModified() *InterCityBusAPIRouteNotModified {
+ return &InterCityBusAPIRouteNotModified{}
+}
+
+/* InterCityBusAPIRouteNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIRouteNotModified struct {
+}
+
+func (o *InterCityBusAPIRouteNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Route/InterCity][%d] interCityBusApiRouteNotModified ", 304)
+}
+
+func (o *InterCityBusAPIRouteNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_s2_s_travel_time_detail_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_s2_s_travel_time_detail_parameters.go
new file mode 100644
index 00000000..bd4e29ff
--- /dev/null
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_s2_s_travel_time_detail_parameters.go
@@ -0,0 +1,394 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package inter_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"
+)
+
+// NewInterCityBusAPIS2STravelTimeDetailParams creates a new InterCityBusAPIS2STravelTimeDetailParams 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 NewInterCityBusAPIS2STravelTimeDetailParams() *InterCityBusAPIS2STravelTimeDetailParams {
+ return &InterCityBusAPIS2STravelTimeDetailParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewInterCityBusAPIS2STravelTimeDetailParamsWithTimeout creates a new InterCityBusAPIS2STravelTimeDetailParams object
+// with the ability to set a timeout on a request.
+func NewInterCityBusAPIS2STravelTimeDetailParamsWithTimeout(timeout time.Duration) *InterCityBusAPIS2STravelTimeDetailParams {
+ return &InterCityBusAPIS2STravelTimeDetailParams{
+ timeout: timeout,
+ }
+}
+
+// NewInterCityBusAPIS2STravelTimeDetailParamsWithContext creates a new InterCityBusAPIS2STravelTimeDetailParams object
+// with the ability to set a context for a request.
+func NewInterCityBusAPIS2STravelTimeDetailParamsWithContext(ctx context.Context) *InterCityBusAPIS2STravelTimeDetailParams {
+ return &InterCityBusAPIS2STravelTimeDetailParams{
+ Context: ctx,
+ }
+}
+
+// NewInterCityBusAPIS2STravelTimeDetailParamsWithHTTPClient creates a new InterCityBusAPIS2STravelTimeDetailParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewInterCityBusAPIS2STravelTimeDetailParamsWithHTTPClient(client *http.Client) *InterCityBusAPIS2STravelTimeDetailParams {
+ return &InterCityBusAPIS2STravelTimeDetailParams{
+ HTTPClient: client,
+ }
+}
+
+/* InterCityBusAPIS2STravelTimeDetailParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api s2 s travel time detail operation.
+
+ Typically these are written to a http.Request.
+*/
+type InterCityBusAPIS2STravelTimeDetailParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ /* RouteID.
+
+ 路線代碼
+ */
+ RouteID string
+
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
+ */
+ Health *string
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the inter city bus Api s2 s travel time detail params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithDefaults() *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api s2 s travel time detail params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIS2STravelTimeDetailParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithTimeout(timeout time.Duration) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithContext(ctx context.Context) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithHTTPClient(client *http.Client) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithDollarFilter(dollarFilter *string) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithDollarFormat(dollarFormat string) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithDollarOrderby(dollarOrderby *string) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithDollarSelect(dollarSelect *string) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithDollarSkip(dollarSkip *string) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarTop adds the dollarTop to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithDollarTop(dollarTop *int64) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WithRouteID adds the routeID to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithRouteID(routeID string) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetRouteID(routeID)
+ return o
+}
+
+// SetRouteID adds the routeId to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetRouteID(routeID string) {
+ o.RouteID = routeID
+}
+
+// WithHealth adds the health to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) WithHealth(health *string) *InterCityBusAPIS2STravelTimeDetailParams {
+ o.SetHealth(health)
+ return o
+}
+
+// SetHealth adds the health to the inter city bus Api s2 s travel time detail params
+func (o *InterCityBusAPIS2STravelTimeDetailParams) SetHealth(health *string) {
+ o.Health = health
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *InterCityBusAPIS2STravelTimeDetailParams) 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 RouteID
+ if err := r.SetPathParam("RouteID", o.RouteID); 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/inter_city_bus/inter_city_bus_api_s2_s_travel_time_detail_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_s2_s_travel_time_detail_responses.go
new file mode 100644
index 00000000..383b44ab
--- /dev/null
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_s2_s_travel_time_detail_responses.go
@@ -0,0 +1,130 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package inter_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"
+)
+
+// InterCityBusAPIS2STravelTimeDetailReader is a Reader for the InterCityBusAPIS2STravelTimeDetail structure.
+type InterCityBusAPIS2STravelTimeDetailReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *InterCityBusAPIS2STravelTimeDetailReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewInterCityBusAPIS2STravelTimeDetailOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 299:
+ result := NewInterCityBusAPIS2STravelTimeDetailStatus299()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewInterCityBusAPIS2STravelTimeDetailNotModified()
+ 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())
+ }
+}
+
+// NewInterCityBusAPIS2STravelTimeDetailOK creates a InterCityBusAPIS2STravelTimeDetailOK with default headers values
+func NewInterCityBusAPIS2STravelTimeDetailOK() *InterCityBusAPIS2STravelTimeDetailOK {
+ return &InterCityBusAPIS2STravelTimeDetailOK{}
+}
+
+/* InterCityBusAPIS2STravelTimeDetailOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type InterCityBusAPIS2STravelTimeDetailOK struct {
+ Payload []*models.PTXServiceDTOBusSpecificationV2BusS2STravelTime
+}
+
+func (o *InterCityBusAPIS2STravelTimeDetailOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/S2STravelTime/InterCity/{RouteID}][%d] interCityBusApiS2STravelTimeDetailOK %+v", 200, o.Payload)
+}
+func (o *InterCityBusAPIS2STravelTimeDetailOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusS2STravelTime {
+ return o.Payload
+}
+
+func (o *InterCityBusAPIS2STravelTimeDetailOK) 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
+}
+
+// NewInterCityBusAPIS2STravelTimeDetailStatus299 creates a InterCityBusAPIS2STravelTimeDetailStatus299 with default headers values
+func NewInterCityBusAPIS2STravelTimeDetailStatus299() *InterCityBusAPIS2STravelTimeDetailStatus299 {
+ return &InterCityBusAPIS2STravelTimeDetailStatus299{}
+}
+
+/* InterCityBusAPIS2STravelTimeDetailStatus299 describes a response with status code 299, with default header values.
+
+加入參數'?health=true'即可查詢此API服務的健康狀態
+*/
+type InterCityBusAPIS2STravelTimeDetailStatus299 struct {
+ Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth
+}
+
+func (o *InterCityBusAPIS2STravelTimeDetailStatus299) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/S2STravelTime/InterCity/{RouteID}][%d] interCityBusApiS2STravelTimeDetailStatus299 %+v", 299, o.Payload)
+}
+func (o *InterCityBusAPIS2STravelTimeDetailStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
+ return o.Payload
+}
+
+func (o *InterCityBusAPIS2STravelTimeDetailStatus299) 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
+}
+
+// NewInterCityBusAPIS2STravelTimeDetailNotModified creates a InterCityBusAPIS2STravelTimeDetailNotModified with default headers values
+func NewInterCityBusAPIS2STravelTimeDetailNotModified() *InterCityBusAPIS2STravelTimeDetailNotModified {
+ return &InterCityBusAPIS2STravelTimeDetailNotModified{}
+}
+
+/* InterCityBusAPIS2STravelTimeDetailNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIS2STravelTimeDetailNotModified struct {
+}
+
+func (o *InterCityBusAPIS2STravelTimeDetailNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/S2STravelTime/InterCity/{RouteID}][%d] interCityBusApiS2STravelTimeDetailNotModified ", 304)
+}
+
+func (o *InterCityBusAPIS2STravelTimeDetailNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule1_parameters.go
index d0840ca5..31ba0fcb 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule1_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPISchedule1Params creates a new InterCityBusAPISchedule1Params object
-// with the default values initialized.
+// NewInterCityBusAPISchedule1Params creates a new InterCityBusAPISchedule1Params 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 NewInterCityBusAPISchedule1Params() *InterCityBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPISchedule1ParamsWithTimeout creates a new InterCityBusAPISchedule1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPISchedule1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPISchedule1ParamsWithContext creates a new InterCityBusAPISchedule1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPISchedule1ParamsWithContext(ctx context.Context) *InterCityBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPISchedule1ParamsWithHTTPClient creates a new InterCityBusAPISchedule1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPISchedule1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPISchedule1Params contains all the parameters to send to the API endpoint
-for the inter city bus Api schedule 1 operation typically these are written to a http.Request
+/* InterCityBusAPISchedule1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api schedule 1 operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPISchedule1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteName
- 繁體中文路線名稱,如'9102'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'9102'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPISchedule1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api schedule 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPISchedule1Params) WithDefaults() *InterCityBusAPISchedule1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api schedule 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPISchedule1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPISchedule1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api schedule 1 params
func (o *InterCityBusAPISchedule1Params) WithTimeout(timeout time.Duration) *InterCityBusAPISchedule1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPISchedule1Params) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -277,64 +301,68 @@ func (o *InterCityBusAPISchedule1Params) WriteToRequest(r runtime.ClientRequest,
// 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 RouteName
@@ -346,16 +374,17 @@ func (o *InterCityBusAPISchedule1Params) WriteToRequest(r runtime.ClientRequest,
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule1_responses.go
index 2a77e549..27d3615c 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule1_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule1_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPISchedule1Reader) ReadResponse(response runtime.ClientRes
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPISchedule1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPISchedule1OK() *InterCityBusAPISchedule1OK {
return &InterCityBusAPISchedule1OK{}
}
-/*InterCityBusAPISchedule1OK handles this case with default header values.
+/* InterCityBusAPISchedule1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPISchedule1OK struct {
func (o *InterCityBusAPISchedule1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Schedule/InterCity/{RouteName}][%d] interCityBusApiSchedule1OK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPISchedule1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusSchedule {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPISchedule1Status299() *InterCityBusAPISchedule1Status299 {
return &InterCityBusAPISchedule1Status299{}
}
-/*InterCityBusAPISchedule1Status299 handles this case with default header values.
+/* InterCityBusAPISchedule1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPISchedule1Status299 struct {
func (o *InterCityBusAPISchedule1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Schedule/InterCity/{RouteName}][%d] interCityBusApiSchedule1Status299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPISchedule1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPISchedule1Status299) readResponse(response runtime.Client
return nil
}
+
+// NewInterCityBusAPISchedule1NotModified creates a InterCityBusAPISchedule1NotModified with default headers values
+func NewInterCityBusAPISchedule1NotModified() *InterCityBusAPISchedule1NotModified {
+ return &InterCityBusAPISchedule1NotModified{}
+}
+
+/* InterCityBusAPISchedule1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPISchedule1NotModified struct {
+}
+
+func (o *InterCityBusAPISchedule1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Schedule/InterCity/{RouteName}][%d] interCityBusApiSchedule1NotModified ", 304)
+}
+
+func (o *InterCityBusAPISchedule1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule_parameters.go
index f1fbcea4..6bd7c160 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIScheduleParams creates a new InterCityBusAPIScheduleParams object
-// with the default values initialized.
+// NewInterCityBusAPIScheduleParams creates a new InterCityBusAPIScheduleParams 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 NewInterCityBusAPIScheduleParams() *InterCityBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIScheduleParamsWithTimeout creates a new InterCityBusAPIScheduleParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIScheduleParamsWithTimeout(timeout time.Duration) *InterCityBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIScheduleParamsWithContext creates a new InterCityBusAPIScheduleParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIScheduleParamsWithContext(ctx context.Context) *InterCityBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIScheduleParamsWithHTTPClient creates a new InterCityBusAPIScheduleParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIScheduleParamsWithHTTPClient(client *http.Client) *InterCityBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIScheduleParams contains all the parameters to send to the API endpoint
-for the inter city bus Api schedule operation typically these are written to a http.Request
+/* InterCityBusAPIScheduleParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api schedule operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIScheduleParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPIScheduleParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api schedule params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIScheduleParams) WithDefaults() *InterCityBusAPIScheduleParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api schedule params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIScheduleParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIScheduleParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api schedule params
func (o *InterCityBusAPIScheduleParams) WithTimeout(timeout time.Duration) *InterCityBusAPIScheduleParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPIScheduleParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPIScheduleParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule_responses.go
index ed4faa45..8e2dec99 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_schedule_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIScheduleReader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIScheduleNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIScheduleOK() *InterCityBusAPIScheduleOK {
return &InterCityBusAPIScheduleOK{}
}
-/*InterCityBusAPIScheduleOK handles this case with default header values.
+/* InterCityBusAPIScheduleOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIScheduleOK struct {
func (o *InterCityBusAPIScheduleOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Schedule/InterCity][%d] interCityBusApiScheduleOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIScheduleOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusSchedule {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIScheduleStatus299() *InterCityBusAPIScheduleStatus299 {
return &InterCityBusAPIScheduleStatus299{}
}
-/*InterCityBusAPIScheduleStatus299 handles this case with default header values.
+/* InterCityBusAPIScheduleStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIScheduleStatus299 struct {
func (o *InterCityBusAPIScheduleStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Schedule/InterCity][%d] interCityBusApiScheduleStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIScheduleStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIScheduleStatus299) readResponse(response runtime.ClientR
return nil
}
+
+// NewInterCityBusAPIScheduleNotModified creates a InterCityBusAPIScheduleNotModified with default headers values
+func NewInterCityBusAPIScheduleNotModified() *InterCityBusAPIScheduleNotModified {
+ return &InterCityBusAPIScheduleNotModified{}
+}
+
+/* InterCityBusAPIScheduleNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIScheduleNotModified struct {
+}
+
+func (o *InterCityBusAPIScheduleNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Schedule/InterCity][%d] interCityBusApiScheduleNotModified ", 304)
+}
+
+func (o *InterCityBusAPIScheduleNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_shape1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_shape1_parameters.go
new file mode 100644
index 00000000..73a9ac7c
--- /dev/null
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_shape1_parameters.go
@@ -0,0 +1,394 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package inter_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"
+)
+
+// NewInterCityBusAPIShape1Params creates a new InterCityBusAPIShape1Params 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 NewInterCityBusAPIShape1Params() *InterCityBusAPIShape1Params {
+ return &InterCityBusAPIShape1Params{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewInterCityBusAPIShape1ParamsWithTimeout creates a new InterCityBusAPIShape1Params object
+// with the ability to set a timeout on a request.
+func NewInterCityBusAPIShape1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPIShape1Params {
+ return &InterCityBusAPIShape1Params{
+ timeout: timeout,
+ }
+}
+
+// NewInterCityBusAPIShape1ParamsWithContext creates a new InterCityBusAPIShape1Params object
+// with the ability to set a context for a request.
+func NewInterCityBusAPIShape1ParamsWithContext(ctx context.Context) *InterCityBusAPIShape1Params {
+ return &InterCityBusAPIShape1Params{
+ Context: ctx,
+ }
+}
+
+// NewInterCityBusAPIShape1ParamsWithHTTPClient creates a new InterCityBusAPIShape1Params object
+// with the ability to set a custom HTTPClient for a request.
+func NewInterCityBusAPIShape1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPIShape1Params {
+ return &InterCityBusAPIShape1Params{
+ HTTPClient: client,
+ }
+}
+
+/* InterCityBusAPIShape1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api shape 1 operation.
+
+ Typically these are written to a http.Request.
+*/
+type InterCityBusAPIShape1Params struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ /* 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 inter city bus Api shape 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIShape1Params) WithDefaults() *InterCityBusAPIShape1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api shape 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIShape1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIShape1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithTimeout(timeout time.Duration) *InterCityBusAPIShape1Params {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithContext(ctx context.Context) *InterCityBusAPIShape1Params {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithHTTPClient(client *http.Client) *InterCityBusAPIShape1Params {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithDollarFilter(dollarFilter *string) *InterCityBusAPIShape1Params {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithDollarFormat(dollarFormat string) *InterCityBusAPIShape1Params {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithDollarOrderby(dollarOrderby *string) *InterCityBusAPIShape1Params {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithDollarSelect(dollarSelect *string) *InterCityBusAPIShape1Params {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithDollarSkip(dollarSkip *string) *InterCityBusAPIShape1Params {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarTop adds the dollarTop to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithDollarTop(dollarTop *int64) *InterCityBusAPIShape1Params {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WithRouteName adds the routeName to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithRouteName(routeName string) *InterCityBusAPIShape1Params {
+ o.SetRouteName(routeName)
+ return o
+}
+
+// SetRouteName adds the routeName to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetRouteName(routeName string) {
+ o.RouteName = routeName
+}
+
+// WithHealth adds the health to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) WithHealth(health *string) *InterCityBusAPIShape1Params {
+ o.SetHealth(health)
+ return o
+}
+
+// SetHealth adds the health to the inter city bus Api shape 1 params
+func (o *InterCityBusAPIShape1Params) SetHealth(health *string) {
+ o.Health = health
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *InterCityBusAPIShape1Params) 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 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/inter_city_bus/inter_city_bus_api_shape1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_shape1_responses.go
new file mode 100644
index 00000000..246349f3
--- /dev/null
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_shape1_responses.go
@@ -0,0 +1,130 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package inter_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"
+)
+
+// InterCityBusAPIShape1Reader is a Reader for the InterCityBusAPIShape1 structure.
+type InterCityBusAPIShape1Reader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *InterCityBusAPIShape1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewInterCityBusAPIShape1OK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 299:
+ result := NewInterCityBusAPIShape1Status299()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewInterCityBusAPIShape1NotModified()
+ 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())
+ }
+}
+
+// NewInterCityBusAPIShape1OK creates a InterCityBusAPIShape1OK with default headers values
+func NewInterCityBusAPIShape1OK() *InterCityBusAPIShape1OK {
+ return &InterCityBusAPIShape1OK{}
+}
+
+/* InterCityBusAPIShape1OK describes a response with status code 200, with default header values.
+
+Success
+*/
+type InterCityBusAPIShape1OK struct {
+ Payload []*models.PTXServiceDTOBusSpecificationV2BusShape
+}
+
+func (o *InterCityBusAPIShape1OK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Shape/InterCity/{RouteName}][%d] interCityBusApiShape1OK %+v", 200, o.Payload)
+}
+func (o *InterCityBusAPIShape1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusShape {
+ return o.Payload
+}
+
+func (o *InterCityBusAPIShape1OK) 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
+}
+
+// NewInterCityBusAPIShape1Status299 creates a InterCityBusAPIShape1Status299 with default headers values
+func NewInterCityBusAPIShape1Status299() *InterCityBusAPIShape1Status299 {
+ return &InterCityBusAPIShape1Status299{}
+}
+
+/* InterCityBusAPIShape1Status299 describes a response with status code 299, with default header values.
+
+加入參數'?health=true'即可查詢此API服務的健康狀態
+*/
+type InterCityBusAPIShape1Status299 struct {
+ Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth
+}
+
+func (o *InterCityBusAPIShape1Status299) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Shape/InterCity/{RouteName}][%d] interCityBusApiShape1Status299 %+v", 299, o.Payload)
+}
+func (o *InterCityBusAPIShape1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
+ return o.Payload
+}
+
+func (o *InterCityBusAPIShape1Status299) 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
+}
+
+// NewInterCityBusAPIShape1NotModified creates a InterCityBusAPIShape1NotModified with default headers values
+func NewInterCityBusAPIShape1NotModified() *InterCityBusAPIShape1NotModified {
+ return &InterCityBusAPIShape1NotModified{}
+}
+
+/* InterCityBusAPIShape1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIShape1NotModified struct {
+}
+
+func (o *InterCityBusAPIShape1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Shape/InterCity/{RouteName}][%d] interCityBusApiShape1NotModified ", 304)
+}
+
+func (o *InterCityBusAPIShape1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_shape_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_shape_parameters.go
new file mode 100644
index 00000000..159493ab
--- /dev/null
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_shape_parameters.go
@@ -0,0 +1,372 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package inter_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"
+)
+
+// NewInterCityBusAPIShapeParams creates a new InterCityBusAPIShapeParams 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 NewInterCityBusAPIShapeParams() *InterCityBusAPIShapeParams {
+ return &InterCityBusAPIShapeParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewInterCityBusAPIShapeParamsWithTimeout creates a new InterCityBusAPIShapeParams object
+// with the ability to set a timeout on a request.
+func NewInterCityBusAPIShapeParamsWithTimeout(timeout time.Duration) *InterCityBusAPIShapeParams {
+ return &InterCityBusAPIShapeParams{
+ timeout: timeout,
+ }
+}
+
+// NewInterCityBusAPIShapeParamsWithContext creates a new InterCityBusAPIShapeParams object
+// with the ability to set a context for a request.
+func NewInterCityBusAPIShapeParamsWithContext(ctx context.Context) *InterCityBusAPIShapeParams {
+ return &InterCityBusAPIShapeParams{
+ Context: ctx,
+ }
+}
+
+// NewInterCityBusAPIShapeParamsWithHTTPClient creates a new InterCityBusAPIShapeParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewInterCityBusAPIShapeParamsWithHTTPClient(client *http.Client) *InterCityBusAPIShapeParams {
+ return &InterCityBusAPIShapeParams{
+ HTTPClient: client,
+ }
+}
+
+/* InterCityBusAPIShapeParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api shape operation.
+
+ Typically these are written to a http.Request.
+*/
+type InterCityBusAPIShapeParams struct {
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
+ */
+ Health *string
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the inter city bus Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIShapeParams) WithDefaults() *InterCityBusAPIShapeParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIShapeParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIShapeParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) WithTimeout(timeout time.Duration) *InterCityBusAPIShapeParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) WithContext(ctx context.Context) *InterCityBusAPIShapeParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) WithHTTPClient(client *http.Client) *InterCityBusAPIShapeParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarFilter adds the dollarFilter to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) WithDollarFilter(dollarFilter *string) *InterCityBusAPIShapeParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) WithDollarFormat(dollarFormat string) *InterCityBusAPIShapeParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) WithDollarOrderby(dollarOrderby *string) *InterCityBusAPIShapeParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) WithDollarSelect(dollarSelect *string) *InterCityBusAPIShapeParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) WithDollarSkip(dollarSkip *string) *InterCityBusAPIShapeParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarTop adds the dollarTop to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) WithDollarTop(dollarTop *int64) *InterCityBusAPIShapeParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WithHealth adds the health to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) WithHealth(health *string) *InterCityBusAPIShapeParams {
+ o.SetHealth(health)
+ return o
+}
+
+// SetHealth adds the health to the inter city bus Api shape params
+func (o *InterCityBusAPIShapeParams) SetHealth(health *string) {
+ o.Health = health
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *InterCityBusAPIShapeParams) 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
+ }
+ }
+ }
+
+ 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/inter_city_bus/inter_city_bus_api_shape_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_shape_responses.go
new file mode 100644
index 00000000..d2ed1b15
--- /dev/null
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_shape_responses.go
@@ -0,0 +1,130 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package inter_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"
+)
+
+// InterCityBusAPIShapeReader is a Reader for the InterCityBusAPIShape structure.
+type InterCityBusAPIShapeReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *InterCityBusAPIShapeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewInterCityBusAPIShapeOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 299:
+ result := NewInterCityBusAPIShapeStatus299()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewInterCityBusAPIShapeNotModified()
+ 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())
+ }
+}
+
+// NewInterCityBusAPIShapeOK creates a InterCityBusAPIShapeOK with default headers values
+func NewInterCityBusAPIShapeOK() *InterCityBusAPIShapeOK {
+ return &InterCityBusAPIShapeOK{}
+}
+
+/* InterCityBusAPIShapeOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type InterCityBusAPIShapeOK struct {
+ Payload []*models.PTXServiceDTOBusSpecificationV2BusShape
+}
+
+func (o *InterCityBusAPIShapeOK) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Shape/InterCity][%d] interCityBusApiShapeOK %+v", 200, o.Payload)
+}
+func (o *InterCityBusAPIShapeOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusShape {
+ return o.Payload
+}
+
+func (o *InterCityBusAPIShapeOK) 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
+}
+
+// NewInterCityBusAPIShapeStatus299 creates a InterCityBusAPIShapeStatus299 with default headers values
+func NewInterCityBusAPIShapeStatus299() *InterCityBusAPIShapeStatus299 {
+ return &InterCityBusAPIShapeStatus299{}
+}
+
+/* InterCityBusAPIShapeStatus299 describes a response with status code 299, with default header values.
+
+加入參數'?health=true'即可查詢此API服務的健康狀態
+*/
+type InterCityBusAPIShapeStatus299 struct {
+ Payload *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth
+}
+
+func (o *InterCityBusAPIShapeStatus299) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Shape/InterCity][%d] interCityBusApiShapeStatus299 %+v", 299, o.Payload)
+}
+func (o *InterCityBusAPIShapeStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
+ return o.Payload
+}
+
+func (o *InterCityBusAPIShapeStatus299) 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
+}
+
+// NewInterCityBusAPIShapeNotModified creates a InterCityBusAPIShapeNotModified with default headers values
+func NewInterCityBusAPIShapeNotModified() *InterCityBusAPIShapeNotModified {
+ return &InterCityBusAPIShapeNotModified{}
+}
+
+/* InterCityBusAPIShapeNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIShapeNotModified struct {
+}
+
+func (o *InterCityBusAPIShapeNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Shape/InterCity][%d] interCityBusApiShapeNotModified ", 304)
+}
+
+func (o *InterCityBusAPIShapeNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_station_group_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_station_group_parameters.go
index 9f31b45c..7e545bcc 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_station_group_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_station_group_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIStationGroupParams creates a new InterCityBusAPIStationGroupParams object
-// with the default values initialized.
+// NewInterCityBusAPIStationGroupParams creates a new InterCityBusAPIStationGroupParams 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 NewInterCityBusAPIStationGroupParams() *InterCityBusAPIStationGroupParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStationGroupParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIStationGroupParamsWithTimeout creates a new InterCityBusAPIStationGroupParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIStationGroupParamsWithTimeout(timeout time.Duration) *InterCityBusAPIStationGroupParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStationGroupParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIStationGroupParamsWithContext creates a new InterCityBusAPIStationGroupParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIStationGroupParamsWithContext(ctx context.Context) *InterCityBusAPIStationGroupParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStationGroupParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIStationGroupParamsWithHTTPClient creates a new InterCityBusAPIStationGroupParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIStationGroupParamsWithHTTPClient(client *http.Client) *InterCityBusAPIStationGroupParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStationGroupParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIStationGroupParams contains all the parameters to send to the API endpoint
-for the inter city bus Api station group operation typically these are written to a http.Request
+/* InterCityBusAPIStationGroupParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api station group operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIStationGroupParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIStationGroupParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api station group params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIStationGroupParams) WithDefaults() *InterCityBusAPIStationGroupParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api station group params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIStationGroupParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIStationGroupParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api station group params
func (o *InterCityBusAPIStationGroupParams) WithTimeout(timeout time.Duration) *InterCityBusAPIStationGroupParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIStationGroupParams) WriteToRequest(r runtime.ClientReque
// 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
}
@@ -277,96 +301,102 @@ func (o *InterCityBusAPIStationGroupParams) WriteToRequest(r runtime.ClientReque
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_station_group_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_station_group_responses.go
index 61c9325e..15e0985a 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_station_group_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_station_group_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIStationGroupReader) ReadResponse(response runtime.Client
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIStationGroupNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIStationGroupOK() *InterCityBusAPIStationGroupOK {
return &InterCityBusAPIStationGroupOK{}
}
-/*InterCityBusAPIStationGroupOK handles this case with default header values.
+/* InterCityBusAPIStationGroupOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIStationGroupOK struct {
func (o *InterCityBusAPIStationGroupOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StationGroup/InterCity][%d] interCityBusApiStationGroupOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIStationGroupOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStationGroup {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIStationGroupStatus299() *InterCityBusAPIStationGroupStatu
return &InterCityBusAPIStationGroupStatus299{}
}
-/*InterCityBusAPIStationGroupStatus299 handles this case with default header values.
+/* InterCityBusAPIStationGroupStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIStationGroupStatus299 struct {
func (o *InterCityBusAPIStationGroupStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StationGroup/InterCity][%d] interCityBusApiStationGroupStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIStationGroupStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIStationGroupStatus299) readResponse(response runtime.Cli
return nil
}
+
+// NewInterCityBusAPIStationGroupNotModified creates a InterCityBusAPIStationGroupNotModified with default headers values
+func NewInterCityBusAPIStationGroupNotModified() *InterCityBusAPIStationGroupNotModified {
+ return &InterCityBusAPIStationGroupNotModified{}
+}
+
+/* InterCityBusAPIStationGroupNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIStationGroupNotModified struct {
+}
+
+func (o *InterCityBusAPIStationGroupNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/StationGroup/InterCity][%d] interCityBusApiStationGroupNotModified ", 304)
+}
+
+func (o *InterCityBusAPIStationGroupNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_station_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_station_parameters.go
index 7b90e8a3..b3d6225d 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_station_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_station_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIStationParams creates a new InterCityBusAPIStationParams object
-// with the default values initialized.
+// NewInterCityBusAPIStationParams creates a new InterCityBusAPIStationParams 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 NewInterCityBusAPIStationParams() *InterCityBusAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIStationParamsWithTimeout creates a new InterCityBusAPIStationParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIStationParamsWithTimeout(timeout time.Duration) *InterCityBusAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIStationParamsWithContext creates a new InterCityBusAPIStationParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIStationParamsWithContext(ctx context.Context) *InterCityBusAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStationParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIStationParamsWithHTTPClient creates a new InterCityBusAPIStationParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIStationParamsWithHTTPClient(client *http.Client) *InterCityBusAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStationParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIStationParams contains all the parameters to send to the API endpoint
-for the inter city bus Api station operation typically these are written to a http.Request
+/* InterCityBusAPIStationParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api station operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIStationParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIStationParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIStationParams) WithDefaults() *InterCityBusAPIStationParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIStationParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIStationParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api station params
func (o *InterCityBusAPIStationParams) WithTimeout(timeout time.Duration) *InterCityBusAPIStationParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIStationParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -277,96 +301,102 @@ func (o *InterCityBusAPIStationParams) WriteToRequest(r runtime.ClientRequest, r
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_station_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_station_responses.go
index 1ec10cb1..8ec161b1 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_station_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_station_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIStationReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIStationNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIStationOK() *InterCityBusAPIStationOK {
return &InterCityBusAPIStationOK{}
}
-/*InterCityBusAPIStationOK handles this case with default header values.
+/* InterCityBusAPIStationOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIStationOK struct {
func (o *InterCityBusAPIStationOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Station/InterCity][%d] interCityBusApiStationOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIStationOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStation {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIStationStatus299() *InterCityBusAPIStationStatus299 {
return &InterCityBusAPIStationStatus299{}
}
-/*InterCityBusAPIStationStatus299 handles this case with default header values.
+/* InterCityBusAPIStationStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIStationStatus299 struct {
func (o *InterCityBusAPIStationStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Station/InterCity][%d] interCityBusApiStationStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIStationStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIStationStatus299) readResponse(response runtime.ClientRe
return nil
}
+
+// NewInterCityBusAPIStationNotModified creates a InterCityBusAPIStationNotModified with default headers values
+func NewInterCityBusAPIStationNotModified() *InterCityBusAPIStationNotModified {
+ return &InterCityBusAPIStationNotModified{}
+}
+
+/* InterCityBusAPIStationNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIStationNotModified struct {
+}
+
+func (o *InterCityBusAPIStationNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Station/InterCity][%d] interCityBusApiStationNotModified ", 304)
+}
+
+func (o *InterCityBusAPIStationNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route1_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route1_parameters.go
index 50c297e5..56f2d906 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route1_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIStopOfRoute1Params creates a new InterCityBusAPIStopOfRoute1Params object
-// with the default values initialized.
+// NewInterCityBusAPIStopOfRoute1Params creates a new InterCityBusAPIStopOfRoute1Params 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 NewInterCityBusAPIStopOfRoute1Params() *InterCityBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIStopOfRoute1ParamsWithTimeout creates a new InterCityBusAPIStopOfRoute1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIStopOfRoute1ParamsWithTimeout(timeout time.Duration) *InterCityBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIStopOfRoute1ParamsWithContext creates a new InterCityBusAPIStopOfRoute1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIStopOfRoute1ParamsWithContext(ctx context.Context) *InterCityBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIStopOfRoute1ParamsWithHTTPClient creates a new InterCityBusAPIStopOfRoute1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIStopOfRoute1ParamsWithHTTPClient(client *http.Client) *InterCityBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIStopOfRoute1Params contains all the parameters to send to the API endpoint
-for the inter city bus Api stop of route 1 operation typically these are written to a http.Request
+/* InterCityBusAPIStopOfRoute1Params contains all the parameters to send to the API endpoint
+ for the inter city bus Api stop of route 1 operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIStopOfRoute1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteName
- 繁體中文路線名稱,如'9102'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'9102'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIStopOfRoute1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api stop of route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIStopOfRoute1Params) WithDefaults() *InterCityBusAPIStopOfRoute1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api stop of route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIStopOfRoute1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIStopOfRoute1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api stop of route 1 params
func (o *InterCityBusAPIStopOfRoute1Params) WithTimeout(timeout time.Duration) *InterCityBusAPIStopOfRoute1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIStopOfRoute1Params) WriteToRequest(r runtime.ClientReque
// 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
}
@@ -277,64 +301,68 @@ func (o *InterCityBusAPIStopOfRoute1Params) WriteToRequest(r runtime.ClientReque
// 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 RouteName
@@ -346,16 +374,17 @@ func (o *InterCityBusAPIStopOfRoute1Params) WriteToRequest(r runtime.ClientReque
// 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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route1_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route1_responses.go
index 0ea97e88..deb88501 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route1_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route1_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIStopOfRoute1Reader) ReadResponse(response runtime.Client
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIStopOfRoute1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIStopOfRoute1OK() *InterCityBusAPIStopOfRoute1OK {
return &InterCityBusAPIStopOfRoute1OK{}
}
-/*InterCityBusAPIStopOfRoute1OK handles this case with default header values.
+/* InterCityBusAPIStopOfRoute1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIStopOfRoute1OK struct {
func (o *InterCityBusAPIStopOfRoute1OK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/InterCity/{RouteName}][%d] interCityBusApiStopOfRoute1OK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIStopOfRoute1OK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStopOfRoute {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIStopOfRoute1Status299() *InterCityBusAPIStopOfRoute1Statu
return &InterCityBusAPIStopOfRoute1Status299{}
}
-/*InterCityBusAPIStopOfRoute1Status299 handles this case with default header values.
+/* InterCityBusAPIStopOfRoute1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIStopOfRoute1Status299 struct {
func (o *InterCityBusAPIStopOfRoute1Status299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/InterCity/{RouteName}][%d] interCityBusApiStopOfRoute1Status299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIStopOfRoute1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIStopOfRoute1Status299) readResponse(response runtime.Cli
return nil
}
+
+// NewInterCityBusAPIStopOfRoute1NotModified creates a InterCityBusAPIStopOfRoute1NotModified with default headers values
+func NewInterCityBusAPIStopOfRoute1NotModified() *InterCityBusAPIStopOfRoute1NotModified {
+ return &InterCityBusAPIStopOfRoute1NotModified{}
+}
+
+/* InterCityBusAPIStopOfRoute1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIStopOfRoute1NotModified struct {
+}
+
+func (o *InterCityBusAPIStopOfRoute1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/InterCity/{RouteName}][%d] interCityBusApiStopOfRoute1NotModified ", 304)
+}
+
+func (o *InterCityBusAPIStopOfRoute1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route_parameters.go
index f323d96f..0b94d3dd 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIStopOfRouteParams creates a new InterCityBusAPIStopOfRouteParams object
-// with the default values initialized.
+// NewInterCityBusAPIStopOfRouteParams creates a new InterCityBusAPIStopOfRouteParams 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 NewInterCityBusAPIStopOfRouteParams() *InterCityBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIStopOfRouteParamsWithTimeout creates a new InterCityBusAPIStopOfRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIStopOfRouteParamsWithTimeout(timeout time.Duration) *InterCityBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIStopOfRouteParamsWithContext creates a new InterCityBusAPIStopOfRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIStopOfRouteParamsWithContext(ctx context.Context) *InterCityBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIStopOfRouteParamsWithHTTPClient creates a new InterCityBusAPIStopOfRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIStopOfRouteParamsWithHTTPClient(client *http.Client) *InterCityBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIStopOfRouteParams contains all the parameters to send to the API endpoint
-for the inter city bus Api stop of route operation typically these are written to a http.Request
+/* InterCityBusAPIStopOfRouteParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api stop of route operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIStopOfRouteParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPIStopOfRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api stop of route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIStopOfRouteParams) WithDefaults() *InterCityBusAPIStopOfRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api stop of route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIStopOfRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIStopOfRouteParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api stop of route params
func (o *InterCityBusAPIStopOfRouteParams) WithTimeout(timeout time.Duration) *InterCityBusAPIStopOfRouteParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPIStopOfRouteParams) WriteToRequest(r runtime.ClientReques
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPIStopOfRouteParams) WriteToRequest(r runtime.ClientReques
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route_responses.go
index eea569b1..ecf47457 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_of_route_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIStopOfRouteReader) ReadResponse(response runtime.ClientR
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIStopOfRouteNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIStopOfRouteOK() *InterCityBusAPIStopOfRouteOK {
return &InterCityBusAPIStopOfRouteOK{}
}
-/*InterCityBusAPIStopOfRouteOK handles this case with default header values.
+/* InterCityBusAPIStopOfRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIStopOfRouteOK struct {
func (o *InterCityBusAPIStopOfRouteOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/InterCity][%d] interCityBusApiStopOfRouteOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIStopOfRouteOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStopOfRoute {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIStopOfRouteStatus299() *InterCityBusAPIStopOfRouteStatus2
return &InterCityBusAPIStopOfRouteStatus299{}
}
-/*InterCityBusAPIStopOfRouteStatus299 handles this case with default header values.
+/* InterCityBusAPIStopOfRouteStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIStopOfRouteStatus299 struct {
func (o *InterCityBusAPIStopOfRouteStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/InterCity][%d] interCityBusApiStopOfRouteStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIStopOfRouteStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIStopOfRouteStatus299) readResponse(response runtime.Clie
return nil
}
+
+// NewInterCityBusAPIStopOfRouteNotModified creates a InterCityBusAPIStopOfRouteNotModified with default headers values
+func NewInterCityBusAPIStopOfRouteNotModified() *InterCityBusAPIStopOfRouteNotModified {
+ return &InterCityBusAPIStopOfRouteNotModified{}
+}
+
+/* InterCityBusAPIStopOfRouteNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIStopOfRouteNotModified struct {
+}
+
+func (o *InterCityBusAPIStopOfRouteNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/StopOfRoute/InterCity][%d] interCityBusApiStopOfRouteNotModified ", 304)
+}
+
+func (o *InterCityBusAPIStopOfRouteNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_parameters.go
index cd514474..440032ec 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIStopParams creates a new InterCityBusAPIStopParams object
-// with the default values initialized.
+// NewInterCityBusAPIStopParams creates a new InterCityBusAPIStopParams 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 NewInterCityBusAPIStopParams() *InterCityBusAPIStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIStopParamsWithTimeout creates a new InterCityBusAPIStopParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIStopParamsWithTimeout(timeout time.Duration) *InterCityBusAPIStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIStopParamsWithContext creates a new InterCityBusAPIStopParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIStopParamsWithContext(ctx context.Context) *InterCityBusAPIStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIStopParamsWithHTTPClient creates a new InterCityBusAPIStopParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIStopParamsWithHTTPClient(client *http.Client) *InterCityBusAPIStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIStopParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIStopParams contains all the parameters to send to the API endpoint
-for the inter city bus Api stop operation typically these are written to a http.Request
+/* InterCityBusAPIStopParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api stop operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIStopParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -119,6 +115,32 @@ type InterCityBusAPIStopParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api stop params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIStopParams) WithDefaults() *InterCityBusAPIStopParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api stop params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIStopParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIStopParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api stop params
func (o *InterCityBusAPIStopParams) WithTimeout(timeout time.Duration) *InterCityBusAPIStopParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *InterCityBusAPIStopParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -277,96 +301,102 @@ func (o *InterCityBusAPIStopParams) WriteToRequest(r runtime.ClientRequest, reg
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_responses.go
index 4bd605d1..60afaff5 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_stop_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIStopReader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIStopNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIStopOK() *InterCityBusAPIStopOK {
return &InterCityBusAPIStopOK{}
}
-/*InterCityBusAPIStopOK handles this case with default header values.
+/* InterCityBusAPIStopOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIStopOK struct {
func (o *InterCityBusAPIStopOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Stop/InterCity][%d] interCityBusApiStopOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIStopOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusStop {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIStopStatus299() *InterCityBusAPIStopStatus299 {
return &InterCityBusAPIStopStatus299{}
}
-/*InterCityBusAPIStopStatus299 handles this case with default header values.
+/* InterCityBusAPIStopStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIStopStatus299 struct {
func (o *InterCityBusAPIStopStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Stop/InterCity][%d] interCityBusApiStopStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIStopStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIStopStatus299) readResponse(response runtime.ClientRespo
return nil
}
+
+// NewInterCityBusAPIStopNotModified creates a InterCityBusAPIStopNotModified with default headers values
+func NewInterCityBusAPIStopNotModified() *InterCityBusAPIStopNotModified {
+ return &InterCityBusAPIStopNotModified{}
+}
+
+/* InterCityBusAPIStopNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIStopNotModified struct {
+}
+
+func (o *InterCityBusAPIStopNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Stop/InterCity][%d] interCityBusApiStopNotModified ", 304)
+}
+
+func (o *InterCityBusAPIStopNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_vehicle_parameters.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_vehicle_parameters.go
index e6d700d4..7b1c99df 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_vehicle_parameters.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_vehicle_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewInterCityBusAPIVehicleParams creates a new InterCityBusAPIVehicleParams object
-// with the default values initialized.
+// NewInterCityBusAPIVehicleParams creates a new InterCityBusAPIVehicleParams 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 NewInterCityBusAPIVehicleParams() *InterCityBusAPIVehicleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIVehicleParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewInterCityBusAPIVehicleParamsWithTimeout creates a new InterCityBusAPIVehicleParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewInterCityBusAPIVehicleParamsWithTimeout(timeout time.Duration) *InterCityBusAPIVehicleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIVehicleParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewInterCityBusAPIVehicleParamsWithContext creates a new InterCityBusAPIVehicleParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewInterCityBusAPIVehicleParamsWithContext(ctx context.Context) *InterCityBusAPIVehicleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIVehicleParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewInterCityBusAPIVehicleParamsWithHTTPClient creates a new InterCityBusAPIVehicleParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewInterCityBusAPIVehicleParamsWithHTTPClient(client *http.Client) *InterCityBusAPIVehicleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &InterCityBusAPIVehicleParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*InterCityBusAPIVehicleParams contains all the parameters to send to the API endpoint
-for the inter city bus Api vehicle operation typically these are written to a http.Request
+/* InterCityBusAPIVehicleParams contains all the parameters to send to the API endpoint
+ for the inter city bus Api vehicle operation.
+
+ Typically these are written to a http.Request.
*/
type InterCityBusAPIVehicleParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -114,6 +109,32 @@ type InterCityBusAPIVehicleParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the inter city bus Api vehicle params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIVehicleParams) WithDefaults() *InterCityBusAPIVehicleParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the inter city bus Api vehicle params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *InterCityBusAPIVehicleParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := InterCityBusAPIVehicleParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the inter city bus Api vehicle params
func (o *InterCityBusAPIVehicleParams) WithTimeout(timeout time.Duration) *InterCityBusAPIVehicleParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *InterCityBusAPIVehicleParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -261,80 +284,85 @@ func (o *InterCityBusAPIVehicleParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
}
-
}
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 {
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_api_vehicle_responses.go b/bus/v2/client/inter_city_bus/inter_city_bus_api_vehicle_responses.go
index 3fbf138b..c04f7a93 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_api_vehicle_responses.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_api_vehicle_responses.go
@@ -35,7 +35,12 @@ func (o *InterCityBusAPIVehicleReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewInterCityBusAPIVehicleNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewInterCityBusAPIVehicleOK() *InterCityBusAPIVehicleOK {
return &InterCityBusAPIVehicleOK{}
}
-/*InterCityBusAPIVehicleOK handles this case with default header values.
+/* InterCityBusAPIVehicleOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type InterCityBusAPIVehicleOK struct {
func (o *InterCityBusAPIVehicleOK) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Vehicle/InterCity][%d] interCityBusApiVehicleOK %+v", 200, o.Payload)
}
-
func (o *InterCityBusAPIVehicleOK) GetPayload() []*models.PTXServiceDTOBusSpecificationV2BusVehicleInfo {
return o.Payload
}
@@ -77,7 +81,7 @@ func NewInterCityBusAPIVehicleStatus299() *InterCityBusAPIVehicleStatus299 {
return &InterCityBusAPIVehicleStatus299{}
}
-/*InterCityBusAPIVehicleStatus299 handles this case with default header values.
+/* InterCityBusAPIVehicleStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -88,7 +92,6 @@ type InterCityBusAPIVehicleStatus299 struct {
func (o *InterCityBusAPIVehicleStatus299) Error() string {
return fmt.Sprintf("[GET /v2/Bus/Vehicle/InterCity][%d] interCityBusApiVehicleStatus299 %+v", 299, o.Payload)
}
-
func (o *InterCityBusAPIVehicleStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -104,3 +107,24 @@ func (o *InterCityBusAPIVehicleStatus299) readResponse(response runtime.ClientRe
return nil
}
+
+// NewInterCityBusAPIVehicleNotModified creates a InterCityBusAPIVehicleNotModified with default headers values
+func NewInterCityBusAPIVehicleNotModified() *InterCityBusAPIVehicleNotModified {
+ return &InterCityBusAPIVehicleNotModified{}
+}
+
+/* InterCityBusAPIVehicleNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type InterCityBusAPIVehicleNotModified struct {
+}
+
+func (o *InterCityBusAPIVehicleNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Bus/Vehicle/InterCity][%d] interCityBusApiVehicleNotModified ", 304)
+}
+
+func (o *InterCityBusAPIVehicleNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v2/client/inter_city_bus/inter_city_bus_client.go b/bus/v2/client/inter_city_bus/inter_city_bus_client.go
index 25ff8e87..7bef8a46 100644
--- a/bus/v2/client/inter_city_bus/inter_city_bus_client.go
+++ b/bus/v2/client/inter_city_bus/inter_city_bus_client.go
@@ -65,10 +65,16 @@ type ClientService interface {
InterCityBusAPIRoute1(params *InterCityBusAPIRoute1Params) (*InterCityBusAPIRoute1OK, *InterCityBusAPIRoute1Status299, error)
+ InterCityBusAPIS2STravelTimeDetail(params *InterCityBusAPIS2STravelTimeDetailParams) (*InterCityBusAPIS2STravelTimeDetailOK, *InterCityBusAPIS2STravelTimeDetailStatus299, error)
+
InterCityBusAPISchedule(params *InterCityBusAPIScheduleParams) (*InterCityBusAPIScheduleOK, *InterCityBusAPIScheduleStatus299, error)
InterCityBusAPISchedule1(params *InterCityBusAPISchedule1Params) (*InterCityBusAPISchedule1OK, *InterCityBusAPISchedule1Status299, error)
+ InterCityBusAPIShape(params *InterCityBusAPIShapeParams) (*InterCityBusAPIShapeOK, *InterCityBusAPIShapeStatus299, error)
+
+ InterCityBusAPIShape1(params *InterCityBusAPIShape1Params) (*InterCityBusAPIShape1OK, *InterCityBusAPIShape1Status299, error)
+
InterCityBusAPIStation(params *InterCityBusAPIStationParams) (*InterCityBusAPIStationOK, *InterCityBusAPIStationStatus299, error)
InterCityBusAPIStationGroup(params *InterCityBusAPIStationGroupParams) (*InterCityBusAPIStationGroupOK, *InterCityBusAPIStationGroupStatus299, error)
@@ -805,6 +811,43 @@ func (a *Client) InterCityBusAPIRoute1(params *InterCityBusAPIRoute1Params) (*In
panic(msg)
}
+/*
+ InterCityBusAPIS2STravelTimeDetail 取得指定s 路線代碼 的公路客運站間旅行時間資料
+
+ 指定[路線代碼]的公路客運站間旅行時間資料
+*/
+func (a *Client) InterCityBusAPIS2STravelTimeDetail(params *InterCityBusAPIS2STravelTimeDetailParams) (*InterCityBusAPIS2STravelTimeDetailOK, *InterCityBusAPIS2STravelTimeDetailStatus299, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewInterCityBusAPIS2STravelTimeDetailParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "InterCityBusApi_S2STravelTimeDetail",
+ Method: "GET",
+ PathPattern: "/v2/Bus/S2STravelTime/InterCity/{RouteID}",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &InterCityBusAPIS2STravelTimeDetailReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, nil, err
+ }
+ switch value := result.(type) {
+ case *InterCityBusAPIS2STravelTimeDetailOK:
+ return value, nil, nil
+ case *InterCityBusAPIS2STravelTimeDetailStatus299:
+ 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 inter_city_bus: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
/*
InterCityBusAPISchedule 取得公路客運路線班表資料s
@@ -879,6 +922,80 @@ func (a *Client) InterCityBusAPISchedule1(params *InterCityBusAPISchedule1Params
panic(msg)
}
+/*
+ InterCityBusAPIShape 取得公路公車線型資料s
+
+ 公路客運之線型資料
+*/
+func (a *Client) InterCityBusAPIShape(params *InterCityBusAPIShapeParams) (*InterCityBusAPIShapeOK, *InterCityBusAPIShapeStatus299, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewInterCityBusAPIShapeParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "InterCityBusApi_Shape",
+ Method: "GET",
+ PathPattern: "/v2/Bus/Shape/InterCity",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &InterCityBusAPIShapeReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, nil, err
+ }
+ switch value := result.(type) {
+ case *InterCityBusAPIShapeOK:
+ return value, nil, nil
+ case *InterCityBusAPIShapeStatus299:
+ 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 inter_city_bus: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+/*
+ InterCityBusAPIShape1 取得指定s 路線名稱 的公路公車線型資料
+
+ 公路客運之線型資料
+*/
+func (a *Client) InterCityBusAPIShape1(params *InterCityBusAPIShape1Params) (*InterCityBusAPIShape1OK, *InterCityBusAPIShape1Status299, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewInterCityBusAPIShape1Params()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "InterCityBusApi_Shape_1",
+ Method: "GET",
+ PathPattern: "/v2/Bus/Shape/InterCity/{RouteName}",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &InterCityBusAPIShape1Reader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, nil, err
+ }
+ switch value := result.(type) {
+ case *InterCityBusAPIShape1OK:
+ return value, nil, nil
+ case *InterCityBusAPIShape1Status299:
+ 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 inter_city_bus: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
/*
InterCityBusAPIStation 取得公路客運站位資料s
diff --git a/bus/v2/client/m_o_t_c_transport_api_v2_client.go b/bus/v2/client/m_o_t_c_transport_api_v2_client.go
index 4a99aa1b..fbcfbdd4 100644
--- a/bus/v2/client/m_o_t_c_transport_api_v2_client.go
+++ b/bus/v2/client/m_o_t_c_transport_api_v2_client.go
@@ -10,6 +10,7 @@ import (
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
+ "github.com/minchao/go-ptx/bus/v2/client/advanced"
"github.com/minchao/go-ptx/bus/v2/client/city_bus"
"github.com/minchao/go-ptx/bus/v2/client/inter_city_bus"
)
@@ -56,6 +57,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *MOTCTransp
cli := new(MOTCTransportAPIV2)
cli.Transport = transport
+ cli.Advanced = advanced.New(transport, formats)
cli.CityBus = city_bus.New(transport, formats)
cli.InterCityBus = inter_city_bus.New(transport, formats)
return cli
@@ -102,6 +104,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
// MOTCTransportAPIV2 is a client for m o t c transport API v2
type MOTCTransportAPIV2 struct {
+ Advanced advanced.ClientService
+
CityBus city_bus.ClientService
InterCityBus inter_city_bus.ClientService
@@ -112,6 +116,7 @@ type MOTCTransportAPIV2 struct {
// SetTransport changes the transport on the client and all its subresources
func (c *MOTCTransportAPIV2) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
+ c.Advanced.SetTransport(transport)
c.CityBus.SetTransport(transport)
c.InterCityBus.SetTransport(transport)
}
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_a1_data.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_a1_data.go
index 6de17661..43c138b0 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_a1_data.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_a1_data.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -165,7 +167,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusA1Data) Validate(formats strfmt.Regis
}
func (m *PTXServiceDTOBusSpecificationV2BusA1Data) validateBusPosition(formats strfmt.Registry) error {
-
if swag.IsZero(m.BusPosition) { // not required
return nil
}
@@ -192,7 +193,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusA1Data) validatePlateNumb(formats str
}
func (m *PTXServiceDTOBusSpecificationV2BusA1Data) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -201,7 +201,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusA1Data) validateRouteName(formats str
}
func (m *PTXServiceDTOBusSpecificationV2BusA1Data) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -218,6 +217,43 @@ func (m *PTXServiceDTOBusSpecificationV2BusA1Data) validateUpdateTime(formats st
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus a1 data based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusA1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateBusPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ 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 len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusA1Data) contextValidateBusPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusA1Data) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusA1Data) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusA1Data) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_a2_data.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_a2_data.go
index a0bed1b2..41bdd7e9 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_a2_data.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_a2_data.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -211,7 +213,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusA2Data) validatePlateNumb(formats str
}
func (m *PTXServiceDTOBusSpecificationV2BusA2Data) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -220,7 +221,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusA2Data) validateRouteName(formats str
}
func (m *PTXServiceDTOBusSpecificationV2BusA2Data) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -229,7 +229,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusA2Data) validateStopName(formats strf
}
func (m *PTXServiceDTOBusSpecificationV2BusA2Data) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -246,6 +245,43 @@ func (m *PTXServiceDTOBusSpecificationV2BusA2Data) validateUpdateTime(formats st
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus a2 data based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusA2Data) 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.contextValidateStopName(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 *PTXServiceDTOBusSpecificationV2BusA2Data) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusA2Data) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusA2Data) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusA2Data) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_discount_periods.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_discount_periods.go
index 8dadb65a..8b5dfd88 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_discount_periods.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_discount_periods.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -30,7 +32,7 @@ type PTXServiceDTOBusSpecificationV2BusDiscountPeriods struct {
// 營運日型態
// Required: true
ServiceDay struct {
- PTXServiceDTOBusSpecificationV2ServiceDay
+ PTXServiceDTOBusSpecificationV2EmbeddedServiceDay
} `json:"ServiceDay"`
// String
@@ -85,6 +87,25 @@ func (m *PTXServiceDTOBusSpecificationV2BusDiscountPeriods) validateStartTime(fo
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus discount periods based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusDiscountPeriods) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusDiscountPeriods) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusDiscountPeriods) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_display_stop_of_route.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_display_stop_of_route.go
index 7f82f2db..49711d4f 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_display_stop_of_route.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_display_stop_of_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -50,7 +51,7 @@ type PTXServiceDTOBusSpecificationV2BusDisplayStopOfRoute struct {
//
// 所有經過站牌
// Required: true
- Stops []*PTXServiceDTOBusSpecificationV2Stop `json:"Stops"`
+ Stops []*PTXServiceDTOBusSpecificationV2EmbeddedStop `json:"Stops"`
// DateTime
//
@@ -165,6 +166,47 @@ func (m *PTXServiceDTOBusSpecificationV2BusDisplayStopOfRoute) validateVersionID
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus display stop of route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusDisplayStopOfRoute) 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.contextValidateStops(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusDisplayStopOfRoute) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusDisplayStopOfRoute) 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
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusDisplayStopOfRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_fare.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_fare.go
index aa483f5e..d45d4bd2 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_fare.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -77,7 +78,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusFare) Validate(formats strfmt.Registr
}
func (m *PTXServiceDTOBusSpecificationV2BusFare) validateDiscountPeriods(formats strfmt.Registry) error {
-
if swag.IsZero(m.DiscountPeriods) { // not required
return nil
}
@@ -128,6 +128,38 @@ func (m *PTXServiceDTOBusSpecificationV2BusFare) validateTicketType(formats strf
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus fare based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDiscountPeriods(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusFare) contextValidateDiscountPeriods(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.DiscountPeriods); i++ {
+
+ if m.DiscountPeriods[i] != nil {
+ if err := m.DiscountPeriods[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("DiscountPeriods" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_first_last_trip_info.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_first_last_trip_info.go
index 9ab58526..684617d7 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_first_last_trip_info.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_first_last_trip_info.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -253,6 +254,56 @@ func (m *PTXServiceDTOBusSpecificationV2BusFirstLastTripInfo) validateVersionID(
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus first last trip info based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusFirstLastTripInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFirstLastTrips(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ 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 len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusFirstLastTripInfo) contextValidateFirstLastTrips(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.FirstLastTrips); i++ {
+
+ if m.FirstLastTrips[i] != nil {
+ if err := m.FirstLastTrips[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("FirstLastTrips" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusFirstLastTripInfo) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusFirstLastTripInfo) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusFirstLastTripInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_first_last_trip_info_service_day.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_first_last_trip_info_service_day.go
index 7701a30f..862ec28c 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_first_last_trip_info_service_day.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_first_last_trip_info_service_day.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -181,6 +183,11 @@ func (m *PTXServiceDTOBusSpecificationV2BusFirstLastTripInfoServiceDay) validate
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v2 bus first last trip info service day based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusFirstLastTripInfoServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusFirstLastTripInfoServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_frequency.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_frequency.go
index 69ec5e61..13b35b86 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_frequency.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_frequency.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -43,7 +44,7 @@ type PTXServiceDTOBusSpecificationV2BusFrequency struct {
//
// 週內營運日
ServiceDay struct {
- PTXServiceDTOBusSpecificationV2ServiceDay
+ PTXServiceDTOBusSpecificationV2EmbeddedServiceDay
} `json:"ServiceDay,omitempty"`
// Array
@@ -120,7 +121,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateMinHeadwayMins(for
}
func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateServiceDay(formats strfmt.Registry) error {
-
if swag.IsZero(m.ServiceDay) { // not required
return nil
}
@@ -129,7 +129,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateServiceDay(formats
}
func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateSpecialDays(formats strfmt.Registry) error {
-
if swag.IsZero(m.SpecialDays) { // not required
return nil
}
@@ -162,6 +161,47 @@ func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateStartTime(formats
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus frequency based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusFrequency) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSpecialDays(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusFrequency) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusFrequency) contextValidateSpecialDays(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SpecialDays); i++ {
+
+ if m.SpecialDays[i] != nil {
+ if err := m.SpecialDays[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SpecialDays" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusFrequency) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_n1_estimate_time.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_n1_estimate_time.go
index 89793519..00837800 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_n1_estimate_time.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_n1_estimate_time.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -200,7 +201,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) validateDirection(for
}
func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) validateEstimates(formats strfmt.Registry) error {
-
if swag.IsZero(m.Estimates) { // not required
return nil
}
@@ -225,7 +225,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) validateEstimates(for
}
func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -234,7 +233,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) validateRouteName(for
}
func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -243,7 +241,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) validateStopName(form
}
func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -260,6 +257,65 @@ func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) validateUpdateTime(fo
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus n1 estimate time based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEstimates(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopName(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 *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) contextValidateEstimates(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Estimates); i++ {
+
+ if m.Estimates[i] != nil {
+ if err := m.Estimates[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Estimates" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusN1EstimateTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_news.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_news.go
index be280df2..ed7e8283 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_news.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_news.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -169,6 +171,11 @@ func (m *PTXServiceDTOBusSpecificationV2BusNews) validateUpdateTime(formats strf
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v2 bus news based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusNews) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusNews) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_route.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_route.go
index ff31b082..9716ce4a 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_route.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -83,7 +84,7 @@ type PTXServiceDTOBusSpecificationV2BusRoute struct {
//
// 營運業者
// Required: true
- Operators []*PTXServiceDTOBusSpecificationV2RouteOperator `json:"Operators"`
+ Operators []*PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator `json:"Operators"`
// String
//
@@ -283,7 +284,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusRoute) validateRouteUID(formats strfm
}
func (m *PTXServiceDTOBusSpecificationV2BusRoute) validateSubRoutes(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRoutes) { // not required
return nil
}
@@ -325,6 +325,69 @@ func (m *PTXServiceDTOBusSpecificationV2BusRoute) validateVersionID(formats strf
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperators(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSubRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusRoute) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Operators); i++ {
+
+ if m.Operators[i] != nil {
+ if err := m.Operators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Operators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusRoute) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusRoute) contextValidateSubRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SubRoutes); i++ {
+
+ if m.SubRoutes[i] != nil {
+ if err := m.SubRoutes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SubRoutes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_route_fare.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_route_fare.go
index b6b05a6c..c793bc90 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_route_fare.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_route_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -171,7 +172,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusRouteFare) validateRouteID(formats st
}
func (m *PTXServiceDTOBusSpecificationV2BusRouteFare) validateSectionFares(formats strfmt.Registry) error {
-
if swag.IsZero(m.SectionFares) { // not required
return nil
}
@@ -196,7 +196,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusRouteFare) validateSectionFares(forma
}
func (m *PTXServiceDTOBusSpecificationV2BusRouteFare) validateStageFares(formats strfmt.Registry) error {
-
if swag.IsZero(m.StageFares) { // not required
return nil
}
@@ -229,6 +228,60 @@ func (m *PTXServiceDTOBusSpecificationV2BusRouteFare) validateUpdateTime(formats
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus route fare based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusRouteFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateSectionFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStageFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusRouteFare) contextValidateSectionFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SectionFares); i++ {
+
+ if m.SectionFares[i] != nil {
+ if err := m.SectionFares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SectionFares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusRouteFare) contextValidateStageFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StageFares); i++ {
+
+ if m.StageFares[i] != nil {
+ if err := m.StageFares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StageFares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusRouteFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_s2_s_travel_time.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_s2_s_travel_time.go
new file mode 100644
index 00000000..92c61bbd
--- /dev/null
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_s2_s_travel_time.go
@@ -0,0 +1,233 @@
+// 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"
+)
+
+// PTXServiceDTOBusSpecificationV2BusS2STravelTime BusS2STravelTime
+//
+// 站間旅行時間資料型別
+//
+// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusS2STravelTime
+type PTXServiceDTOBusSpecificationV2BusS2STravelTime struct {
+
+ // integer
+ //
+ // 去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']
+ // Required: true
+ Direction *int32 `json:"Direction"`
+
+ // String
+ //
+ // 地區既用中之路線代碼(為原資料內碼)
+ // Required: true
+ RouteID *string `json:"RouteID"`
+
+ // String
+ //
+ // 路線唯一識別代碼,規則為 {業管機關簡碼} + {RouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢
+ // Required: true
+ RouteUID *string `json:"RouteUID"`
+
+ // String
+ //
+ // 地區既用中之附屬路線代碼(為原資料內碼)
+ // Required: true
+ SubRouteID *string `json:"SubRouteID"`
+
+ // String
+ //
+ // 附屬路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢
+ // Required: true
+ SubRouteUID *string `json:"SubRouteUID"`
+
+ // Array
+ //
+ // 旅行時間資訊
+ // Required: true
+ TravelTimes []*PTXServiceDTOBusSpecificationV2ServiceTime `json:"TravelTimes"`
+
+ // DateTime
+ //
+ // 資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
+ // Required: true
+ UpdateTime *string `json:"UpdateTime"`
+}
+
+// Validate validates this p t x service d t o bus specification v2 bus s2 s travel time
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateDirection(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateRouteID(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.validateSubRouteUID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateTravelTimes(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 *PTXServiceDTOBusSpecificationV2BusS2STravelTime) validateDirection(formats strfmt.Registry) error {
+
+ if err := validate.Required("Direction", "body", m.Direction); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) validateRouteID(formats strfmt.Registry) error {
+
+ if err := validate.Required("RouteID", "body", m.RouteID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) validateRouteUID(formats strfmt.Registry) error {
+
+ if err := validate.Required("RouteUID", "body", m.RouteUID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) validateSubRouteID(formats strfmt.Registry) error {
+
+ if err := validate.Required("SubRouteID", "body", m.SubRouteID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) validateSubRouteUID(formats strfmt.Registry) error {
+
+ if err := validate.Required("SubRouteUID", "body", m.SubRouteUID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) validateTravelTimes(formats strfmt.Registry) error {
+
+ if err := validate.Required("TravelTimes", "body", m.TravelTimes); err != nil {
+ return err
+ }
+
+ for i := 0; i < len(m.TravelTimes); i++ {
+ if swag.IsZero(m.TravelTimes[i]) { // not required
+ continue
+ }
+
+ if m.TravelTimes[i] != nil {
+ if err := m.TravelTimes[i].Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TravelTimes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) validateUpdateTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("UpdateTime", "body", m.UpdateTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validate this p t x service d t o bus specification v2 bus s2 s travel time based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTravelTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) contextValidateTravelTimes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TravelTimes); i++ {
+
+ if m.TravelTimes[i] != nil {
+ if err := m.TravelTimes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TravelTimes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOBusSpecificationV2BusS2STravelTime) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOBusSpecificationV2BusS2STravelTime
+ 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_schedule.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_schedule.go
index e47fafdc..5299ba46 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_schedule.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_schedule.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -164,7 +165,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusSchedule) validateDirection(formats s
}
func (m *PTXServiceDTOBusSpecificationV2BusSchedule) validateFrequencys(formats strfmt.Registry) error {
-
if swag.IsZero(m.Frequencys) { // not required
return nil
}
@@ -235,7 +235,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusSchedule) validateSubRouteUID(formats
}
func (m *PTXServiceDTOBusSpecificationV2BusSchedule) validateTimetables(formats strfmt.Registry) error {
-
if swag.IsZero(m.Timetables) { // not required
return nil
}
@@ -277,6 +276,78 @@ func (m *PTXServiceDTOBusSpecificationV2BusSchedule) validateVersionID(formats s
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus schedule based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusSchedule) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFrequencys(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ 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 *PTXServiceDTOBusSpecificationV2BusSchedule) contextValidateFrequencys(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Frequencys); i++ {
+
+ if m.Frequencys[i] != nil {
+ if err := m.Frequencys[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Frequencys" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusSchedule) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusSchedule) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusSchedule) 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 *PTXServiceDTOBusSpecificationV2BusSchedule) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_shape.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_shape.go
index 3dfdb387..6bfe988f 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_shape.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_shape.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -57,6 +59,22 @@ type PTXServiceDTOBusSpecificationV2BusShape struct {
// Required: true
RouteUID *string `json:"RouteUID"`
+ // String
+ //
+ // 附屬路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢
+ SubRouteID string `json:"SubRouteID,omitempty"`
+
+ // NameType
+ //
+ // 附屬路線名稱
+ SubRouteName struct {
+ PTXServiceDTOSharedSpecificationV2BaseNameType
+ } `json:"SubRouteName,omitempty"`
+
+ // String
+ // Required: true
+ SubRouteUID *string `json:"SubRouteUID"`
+
// DateTime
//
// 資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
@@ -65,7 +83,7 @@ type PTXServiceDTOBusSpecificationV2BusShape struct {
// Int32
//
- // 資料版本編號
+ // 資料版本編號(由於該服務資料不再版控,固定帶入版號0)
// Required: true
VersionID *int32 `json:"VersionID"`
}
@@ -98,6 +116,14 @@ func (m *PTXServiceDTOBusSpecificationV2BusShape) Validate(formats strfmt.Regist
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)
}
@@ -162,6 +188,23 @@ func (m *PTXServiceDTOBusSpecificationV2BusShape) validateRouteUID(formats strfm
return nil
}
+func (m *PTXServiceDTOBusSpecificationV2BusShape) validateSubRouteName(formats strfmt.Registry) error {
+ if swag.IsZero(m.SubRouteName) { // not required
+ return nil
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusShape) validateSubRouteUID(formats strfmt.Registry) error {
+
+ if err := validate.Required("SubRouteUID", "body", m.SubRouteUID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *PTXServiceDTOBusSpecificationV2BusShape) validateUpdateTime(formats strfmt.Registry) error {
if err := validate.Required("UpdateTime", "body", m.UpdateTime); err != nil {
@@ -180,6 +223,34 @@ func (m *PTXServiceDTOBusSpecificationV2BusShape) validateVersionID(formats strf
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus shape based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusShape) 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 len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusShape) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusShape) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusShape) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stage.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stage.go
index a848c0c0..cdaf53d3 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stage.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stage.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -54,6 +56,11 @@ func (m *PTXServiceDTOBusSpecificationV2BusStage) validateStopID(formats strfmt.
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v2 bus stage based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusStage) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusStage) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stage_fare.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stage_fare.go
index 333c28e5..a3ca33c2 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stage_fare.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stage_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -120,6 +121,56 @@ func (m *PTXServiceDTOBusSpecificationV2BusStageFare) validateOriginStage(format
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus stage fare based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusStageFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStage(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginStage(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStageFare) contextValidateDestinationStage(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStageFare) contextValidateFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Fares); i++ {
+
+ if m.Fares[i] != nil {
+ if err := m.Fares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Fares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStageFare) contextValidateOriginStage(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusStageFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_station.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_station.go
index a3d49883..36d6ac35 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_station.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_station.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -158,7 +159,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusStation) validateStationUID(formats s
}
func (m *PTXServiceDTOBusSpecificationV2BusStation) validateStops(formats strfmt.Registry) error {
-
if swag.IsZero(m.Stops) { // not required
return nil
}
@@ -200,6 +200,56 @@ func (m *PTXServiceDTOBusSpecificationV2BusStation) validateVersionID(formats st
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus station based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStops(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStation) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStation) contextValidateStationPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStation) 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
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_station_group.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_station_group.go
index 372c57c2..8afa09c1 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_station_group.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_station_group.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -140,6 +142,34 @@ func (m *PTXServiceDTOBusSpecificationV2BusStationGroup) validateVersionID(forma
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus station group based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusStationGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationGroupName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationGroupPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStationGroup) contextValidateStationGroupName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStationGroup) contextValidateStationGroupPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusStationGroup) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop.go
index 1102ab23..3af0c517 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -213,6 +215,34 @@ func (m *PTXServiceDTOBusSpecificationV2BusStop) validateVersionID(formats strfm
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus stop based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusStop) 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.contextValidateStopPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStop) contextValidateStopPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusStop) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_of_route.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_of_route.go
index a3828c3a..29a73d77 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_of_route.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_of_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -39,7 +40,7 @@ type PTXServiceDTOBusSpecificationV2BusStopOfRoute struct {
// Array
//
// 營運業者
- Operators []*PTXServiceDTOBusSpecificationV2RouteOperator `json:"Operators"`
+ Operators []*PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator `json:"Operators"`
// String
//
@@ -65,7 +66,7 @@ type PTXServiceDTOBusSpecificationV2BusStopOfRoute struct {
//
// 所有經過站牌
// Required: true
- Stops []*PTXServiceDTOBusSpecificationV2Stop `json:"Stops"`
+ Stops []*PTXServiceDTOBusSpecificationV2EmbeddedStop `json:"Stops"`
// String
//
@@ -151,7 +152,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusStopOfRoute) Validate(formats strfmt.
}
func (m *PTXServiceDTOBusSpecificationV2BusStopOfRoute) validateOperators(formats strfmt.Registry) error {
-
if swag.IsZero(m.Operators) { // not required
return nil
}
@@ -264,6 +264,78 @@ func (m *PTXServiceDTOBusSpecificationV2BusStopOfRoute) validateVersionID(format
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus stop of route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusStopOfRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperators(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 *PTXServiceDTOBusSpecificationV2BusStopOfRoute) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Operators); i++ {
+
+ if m.Operators[i] != nil {
+ if err := m.Operators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Operators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStopOfRoute) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusStopOfRoute) 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 *PTXServiceDTOBusSpecificationV2BusStopOfRoute) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusStopOfRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_time.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_time.go
index 7f68ebdb..3067aca5 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_time.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -142,6 +144,25 @@ func (m *PTXServiceDTOBusSpecificationV2BusStopTime) validateStopUID(formats str
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus stop time based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusStopTime) 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 *PTXServiceDTOBusSpecificationV2BusStopTime) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusStopTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_sub_route.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_sub_route.go
index ec8c4663..75a4fd9c 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_sub_route.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_sub_route.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -153,6 +155,25 @@ func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) validateSubRouteUID(formats
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus sub route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateSubRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) MarshalBinary() ([]byte, error) {
if m == 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 5adcc4a8..d23c147e 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
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -25,7 +26,7 @@ type PTXServiceDTOBusSpecificationV2BusTimetable struct {
//
// 週內營運日
ServiceDay struct {
- PTXServiceDTOBusSpecificationV2ServiceDay
+ PTXServiceDTOBusSpecificationV2EmbeddedServiceDay
} `json:"ServiceDay,omitempty"`
// Array
@@ -68,7 +69,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusTimetable) Validate(formats strfmt.Re
}
func (m *PTXServiceDTOBusSpecificationV2BusTimetable) validateServiceDay(formats strfmt.Registry) error {
-
if swag.IsZero(m.ServiceDay) { // not required
return nil
}
@@ -77,7 +77,6 @@ func (m *PTXServiceDTOBusSpecificationV2BusTimetable) validateServiceDay(formats
}
func (m *PTXServiceDTOBusSpecificationV2BusTimetable) validateSpecialDays(formats strfmt.Registry) error {
-
if swag.IsZero(m.SpecialDays) { // not required
return nil
}
@@ -126,6 +125,69 @@ func (m *PTXServiceDTOBusSpecificationV2BusTimetable) validateStopTimes(formats
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 bus timetable based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSpecialDays(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusTimetable) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusTimetable) contextValidateSpecialDays(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SpecialDays); i++ {
+
+ if m.SpecialDays[i] != nil {
+ if err := m.SpecialDays[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SpecialDays" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2BusTimetable) 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 *PTXServiceDTOBusSpecificationV2BusTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_vehicle_info.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_vehicle_info.go
index 48e5fe0a..7d3c0961 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_vehicle_info.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_vehicle_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -87,6 +89,11 @@ func (m *PTXServiceDTOBusSpecificationV2BusVehicleInfo) validateVehicleType(form
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v2 bus vehicle info based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusVehicleInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusVehicleInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_version.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_version.go
index 0803129b..837f18b6 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_version.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_version.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -87,6 +89,11 @@ func (m *PTXServiceDTOBusSpecificationV2BusVersion) validateVersionID(formats st
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v2 bus version based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2BusVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2BusVersion) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_date_period.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_date_period.go
index c23aecf3..c59c0652 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_date_period.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_date_period.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -31,6 +33,11 @@ func (m *PTXServiceDTOBusSpecificationV2DatePeriod) Validate(formats strfmt.Regi
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v2 date period based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2DatePeriod) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2DatePeriod) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_route_operator.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_embedded_route_operator.go
similarity index 53%
rename from bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_route_operator.go
rename to bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_embedded_route_operator.go
index bd61ba67..5c958901 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_route_operator.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_embedded_route_operator.go
@@ -6,18 +6,20 @@ package models
// 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"
)
-// PTXServiceDTOBusSpecificationV2RouteOperator RouteOperator
+// PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator RouteOperator
//
// 營運業者資訊
//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.RouteOperator
-type PTXServiceDTOBusSpecificationV2RouteOperator struct {
+// swagger:model PTX.Service.DTO.Bus.Specification.V2.Embedded.RouteOperator
+type PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator struct {
// String
//
@@ -46,8 +48,8 @@ type PTXServiceDTOBusSpecificationV2RouteOperator struct {
OperatorNo *string `json:"OperatorNo"`
}
-// Validate validates this p t x service d t o bus specification v2 route operator
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) Validate(formats strfmt.Registry) error {
+// Validate validates this p t x service d t o bus specification v2 embedded route operator
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateOperatorCode(formats); err != nil {
@@ -72,7 +74,7 @@ func (m *PTXServiceDTOBusSpecificationV2RouteOperator) Validate(formats strfmt.R
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorCode(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator) validateOperatorCode(formats strfmt.Registry) error {
if err := validate.Required("OperatorCode", "body", m.OperatorCode); err != nil {
return err
@@ -81,7 +83,7 @@ func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorCode(form
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorID(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator) validateOperatorID(formats strfmt.Registry) error {
if err := validate.Required("OperatorID", "body", m.OperatorID); err != nil {
return err
@@ -90,12 +92,12 @@ func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorID(format
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorName(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator) validateOperatorName(formats strfmt.Registry) error {
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorNo(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator) validateOperatorNo(formats strfmt.Registry) error {
if err := validate.Required("OperatorNo", "body", m.OperatorNo); err != nil {
return err
@@ -104,8 +106,27 @@ func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorNo(format
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 embedded route operator based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) MarshalBinary() ([]byte, error) {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -113,8 +134,8 @@ func (m *PTXServiceDTOBusSpecificationV2RouteOperator) MarshalBinary() ([]byte,
}
// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2RouteOperator
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOBusSpecificationV2EmbeddedRouteOperator
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_service_day.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_embedded_service_day.go
similarity index 56%
rename from tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_service_day.go
rename to bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_embedded_service_day.go
index dd271ba4..b7217fec 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_service_day.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_embedded_service_day.go
@@ -6,67 +6,71 @@ package models
// 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"
)
-// PTXServiceDTOBusSpecificationV2ServiceDay ServiceDay
+// PTXServiceDTOBusSpecificationV2EmbeddedServiceDay ServiceDay
+//
+// 週內營運日資料
//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.ServiceDay
-type PTXServiceDTOBusSpecificationV2ServiceDay struct {
+// swagger:model PTX.Service.DTO.Bus.Specification.V2.Embedded.ServiceDay
+type PTXServiceDTOBusSpecificationV2EmbeddedServiceDay struct {
// integer
//
- // [0:'否',1:'是']
+ // 星期五是否營運 : [0:'否',1:'是']
// Required: true
Friday *int32 `json:"Friday"`
// integer
//
- // [0:'否',1:'是']
+ // 星期一是否營運 : [0:'否',1:'是']
// Required: true
Monday *int32 `json:"Monday"`
// integer
//
- // [0:'否',1:'是']
+ // 國定假日營運與否 : [0:'否',1:'是']
NationalHolidays int32 `json:"NationalHolidays,omitempty"`
// integer
//
- // [0:'否',1:'是']
+ // 星期六是否營運 : [0:'否',1:'是']
// Required: true
Saturday *int32 `json:"Saturday"`
// integer
//
- // [0:'否',1:'是']
+ // 星期日是否營運 : [0:'否',1:'是']
// Required: true
Sunday *int32 `json:"Sunday"`
// integer
//
- // [0:'否',1:'是']
+ // 星期四是否營運 : [0:'否',1:'是']
// Required: true
Thursday *int32 `json:"Thursday"`
// integer
//
- // [0:'否',1:'是']
+ // 星期二是否營運 : [0:'否',1:'是']
// Required: true
Tuesday *int32 `json:"Tuesday"`
// integer
//
- // [0:'否',1:'是']
+ // 星期三是否營運 : [0:'否',1:'是']
// Required: true
Wednesday *int32 `json:"Wednesday"`
}
-// Validate validates this p t x service d t o bus specification v2 service day
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) Validate(formats strfmt.Registry) error {
+// Validate validates this p t x service d t o bus specification v2 embedded service day
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFriday(formats); err != nil {
@@ -103,7 +107,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) Validate(formats strfmt.Regi
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateFriday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) validateFriday(formats strfmt.Registry) error {
if err := validate.Required("Friday", "body", m.Friday); err != nil {
return err
@@ -112,7 +116,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateFriday(formats strfm
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateMonday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) validateMonday(formats strfmt.Registry) error {
if err := validate.Required("Monday", "body", m.Monday); err != nil {
return err
@@ -121,7 +125,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateMonday(formats strfm
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateSaturday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) validateSaturday(formats strfmt.Registry) error {
if err := validate.Required("Saturday", "body", m.Saturday); err != nil {
return err
@@ -130,7 +134,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateSaturday(formats str
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateSunday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) validateSunday(formats strfmt.Registry) error {
if err := validate.Required("Sunday", "body", m.Sunday); err != nil {
return err
@@ -139,7 +143,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateSunday(formats strfm
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateThursday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) validateThursday(formats strfmt.Registry) error {
if err := validate.Required("Thursday", "body", m.Thursday); err != nil {
return err
@@ -148,7 +152,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateThursday(formats str
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateTuesday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) validateTuesday(formats strfmt.Registry) error {
if err := validate.Required("Tuesday", "body", m.Tuesday); err != nil {
return err
@@ -157,7 +161,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateTuesday(formats strf
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateWednesday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) validateWednesday(formats strfmt.Registry) error {
if err := validate.Required("Wednesday", "body", m.Wednesday); err != nil {
return err
@@ -166,8 +170,13 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateWednesday(formats st
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v2 embedded service day based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) MarshalBinary() ([]byte, error) {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -175,8 +184,8 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) MarshalBinary() ([]byte, err
}
// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2ServiceDay
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedServiceDay) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOBusSpecificationV2EmbeddedServiceDay
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_stop.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_embedded_stop.go
similarity index 60%
rename from bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_stop.go
rename to bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_embedded_stop.go
index 4e79ce43..a721b913 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_stop.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_embedded_stop.go
@@ -6,18 +6,20 @@ package models
// 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"
)
-// PTXServiceDTOBusSpecificationV2Stop Stop
+// PTXServiceDTOBusSpecificationV2EmbeddedStop Stop
//
// 站牌代碼資料
//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.Stop
-type PTXServiceDTOBusSpecificationV2Stop struct {
+// swagger:model PTX.Service.DTO.Bus.Specification.V2.Embedded.Stop
+type PTXServiceDTOBusSpecificationV2EmbeddedStop struct {
// String
//
@@ -75,8 +77,8 @@ type PTXServiceDTOBusSpecificationV2Stop struct {
StopUID *string `json:"StopUID"`
}
-// Validate validates this p t x service d t o bus specification v2 stop
-func (m *PTXServiceDTOBusSpecificationV2Stop) Validate(formats strfmt.Registry) error {
+// Validate validates this p t x service d t o bus specification v2 embedded stop
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateStationGroupID(formats); err != nil {
@@ -109,7 +111,7 @@ func (m *PTXServiceDTOBusSpecificationV2Stop) Validate(formats strfmt.Registry)
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStationGroupID(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) validateStationGroupID(formats strfmt.Registry) error {
if err := validate.Required("StationGroupID", "body", m.StationGroupID); err != nil {
return err
@@ -118,7 +120,7 @@ func (m *PTXServiceDTOBusSpecificationV2Stop) validateStationGroupID(formats str
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopID(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) validateStopID(formats strfmt.Registry) error {
if err := validate.Required("StopID", "body", m.StopID); err != nil {
return err
@@ -127,17 +129,17 @@ func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopID(formats strfmt.Regi
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopName(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) validateStopName(formats strfmt.Registry) error {
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopPosition(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) validateStopPosition(formats strfmt.Registry) error {
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopSequence(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) validateStopSequence(formats strfmt.Registry) error {
if err := validate.Required("StopSequence", "body", m.StopSequence); err != nil {
return err
@@ -146,7 +148,7 @@ func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopSequence(formats strfm
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopUID(formats strfmt.Registry) error {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) validateStopUID(formats strfmt.Registry) error {
if err := validate.Required("StopUID", "body", m.StopUID); err != nil {
return err
@@ -155,8 +157,36 @@ func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopUID(formats strfmt.Reg
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 embedded stop based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) 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.contextValidateStopPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) contextValidateStopPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2Stop) MarshalBinary() ([]byte, error) {
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -164,8 +194,8 @@ func (m *PTXServiceDTOBusSpecificationV2Stop) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2Stop) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2Stop
+func (m *PTXServiceDTOBusSpecificationV2EmbeddedStop) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOBusSpecificationV2EmbeddedStop
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_first_last_trip.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_first_last_trip.go
index bd7f102f..c77b7445 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_first_last_trip.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_first_last_trip.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -85,6 +87,25 @@ func (m *PTXServiceDTOBusSpecificationV2FirstLastTrip) validateServiceDay(format
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 first last trip based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2FirstLastTrip) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2FirstLastTrip) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2FirstLastTrip) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_n1_estimate.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_n1_estimate.go
index d3990167..0437e745 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_n1_estimate.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_n1_estimate.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -37,6 +39,11 @@ func (m *PTXServiceDTOBusSpecificationV2N1Estimate) Validate(formats strfmt.Regi
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v2 n1 estimate based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2N1Estimate) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2N1Estimate) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare.go
index 1613ff1d..1b176c97 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -102,6 +103,60 @@ func (m *PTXServiceDTOBusSpecificationV2SectionFare) validateFares(formats strfm
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 section fare based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2SectionFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateBufferZones(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2SectionFare) contextValidateBufferZones(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.BufferZones); i++ {
+
+ if m.BufferZones[i] != nil {
+ if err := m.BufferZones[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("BufferZones" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2SectionFare) contextValidateFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Fares); i++ {
+
+ if m.Fares[i] != nil {
+ if err := m.Fares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Fares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2SectionFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_buffer_zone.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_buffer_zone.go
index a1abd424..abd20907 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_buffer_zone.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_buffer_zone.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -110,6 +112,34 @@ func (m *PTXServiceDTOBusSpecificationV2SectionFareBufferZone) validateSectionSe
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 section fare buffer zone based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2SectionFareBufferZone) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFareBufferZoneDestination(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFareBufferZoneOrigin(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2SectionFareBufferZone) contextValidateFareBufferZoneDestination(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2SectionFareBufferZone) contextValidateFareBufferZoneOrigin(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2SectionFareBufferZone) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_fare.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_fare.go
index 10ba1f4c..8b3d7d03 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_fare.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_fare.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -85,6 +87,11 @@ func (m *PTXServiceDTOBusSpecificationV2SectionFareFare) validateTicketType(form
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v2 section fare fare based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2SectionFareFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2SectionFareFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_stop.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_stop.go
index 795797f7..a58851fe 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_stop.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_section_fare_stop.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -66,6 +68,11 @@ func (m *PTXServiceDTOBusSpecificationV2SectionFareStop) validateStopName(format
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v2 section fare stop based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2SectionFareStop) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2SectionFareStop) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_service_time.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_service_time.go
new file mode 100644
index 00000000..a6f32bb5
--- /dev/null
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_service_time.go
@@ -0,0 +1,176 @@
+// 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"
+)
+
+// PTXServiceDTOBusSpecificationV2ServiceTime ServiceTime
+//
+// 行駛時間資料型別
+//
+// swagger:model PTX.Service.DTO.Bus.Specification.V2.ServiceTime
+type PTXServiceDTOBusSpecificationV2ServiceTime struct {
+
+ // Int32
+ //
+ // 結束時區(小時)
+ // Required: true
+ EndHour *int32 `json:"EndHour"`
+
+ // Array
+ //
+ // 站間行駛時間資訊
+ // Required: true
+ S2STimes []*PTXServiceDTOBusSpecificationV2TravelTime `json:"S2STimes"`
+
+ // Int32
+ //
+ // 起始時區(小時)
+ // Required: true
+ StartHour *int32 `json:"StartHour"`
+
+ // Int32
+ //
+ // 星期
+ // Required: true
+ Weekday *int32 `json:"Weekday"`
+}
+
+// Validate validates this p t x service d t o bus specification v2 service time
+func (m *PTXServiceDTOBusSpecificationV2ServiceTime) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateEndHour(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateS2STimes(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateStartHour(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateWeekday(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2ServiceTime) validateEndHour(formats strfmt.Registry) error {
+
+ if err := validate.Required("EndHour", "body", m.EndHour); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2ServiceTime) validateS2STimes(formats strfmt.Registry) error {
+
+ if err := validate.Required("S2STimes", "body", m.S2STimes); err != nil {
+ return err
+ }
+
+ for i := 0; i < len(m.S2STimes); i++ {
+ if swag.IsZero(m.S2STimes[i]) { // not required
+ continue
+ }
+
+ if m.S2STimes[i] != nil {
+ if err := m.S2STimes[i].Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("S2STimes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2ServiceTime) validateStartHour(formats strfmt.Registry) error {
+
+ if err := validate.Required("StartHour", "body", m.StartHour); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2ServiceTime) validateWeekday(formats strfmt.Registry) error {
+
+ if err := validate.Required("Weekday", "body", m.Weekday); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validate this p t x service d t o bus specification v2 service time based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2ServiceTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateS2STimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2ServiceTime) contextValidateS2STimes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.S2STimes); i++ {
+
+ if m.S2STimes[i] != nil {
+ if err := m.S2STimes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("S2STimes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTOBusSpecificationV2ServiceTime) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOBusSpecificationV2ServiceTime) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOBusSpecificationV2ServiceTime
+ 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_special_day.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_special_day.go
index 56d4062f..cc8e44a9 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_special_day.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_special_day.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -56,7 +58,6 @@ func (m *PTXServiceDTOBusSpecificationV2SpecialDay) Validate(formats strfmt.Regi
}
func (m *PTXServiceDTOBusSpecificationV2SpecialDay) validateDatePeriod(formats strfmt.Registry) error {
-
if swag.IsZero(m.DatePeriod) { // not required
return nil
}
@@ -64,6 +65,25 @@ func (m *PTXServiceDTOBusSpecificationV2SpecialDay) validateDatePeriod(formats s
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 special day based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2SpecialDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDatePeriod(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2SpecialDay) contextValidateDatePeriod(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2SpecialDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_station_stop.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_station_stop.go
index 526a8779..99a21322 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_station_stop.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_station_stop.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -140,6 +142,34 @@ func (m *PTXServiceDTOBusSpecificationV2StationStop) validateStopUID(formats str
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v2 station stop based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV2StationStop) 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.contextValidateStopName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2StationStop) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2StationStop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV2StationStop) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_travel_time.go b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_travel_time.go
new file mode 100644
index 00000000..e7c49afa
--- /dev/null
+++ b/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_travel_time.go
@@ -0,0 +1,149 @@
+// 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"
+)
+
+// PTXServiceDTOBusSpecificationV2TravelTime TravelTime
+//
+// swagger:model PTX.Service.DTO.Bus.Specification.V2.TravelTime
+type PTXServiceDTOBusSpecificationV2TravelTime struct {
+
+ // String
+ //
+ // 起始站位代碼
+ // Required: true
+ FromStationID *string `json:"FromStationID"`
+
+ // String
+ //
+ // 起始站牌代碼
+ // Required: true
+ FromStopID *string `json:"FromStopID"`
+
+ // Int32
+ //
+ // 站間預估行駛時間 [當RunTime值為-1時,代表該區間無提供旅行時間資料。]
+ // Required: true
+ RunTime *int32 `json:"RunTime"`
+
+ // String
+ //
+ // 終點站位代碼
+ // Required: true
+ ToStationID *string `json:"ToStationID"`
+
+ // String
+ //
+ // 終點站牌代碼
+ // Required: true
+ ToStopID *string `json:"ToStopID"`
+}
+
+// Validate validates this p t x service d t o bus specification v2 travel time
+func (m *PTXServiceDTOBusSpecificationV2TravelTime) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateFromStationID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateFromStopID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateRunTime(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateToStationID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateToStopID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2TravelTime) validateFromStationID(formats strfmt.Registry) error {
+
+ if err := validate.Required("FromStationID", "body", m.FromStationID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2TravelTime) validateFromStopID(formats strfmt.Registry) error {
+
+ if err := validate.Required("FromStopID", "body", m.FromStopID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2TravelTime) validateRunTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("RunTime", "body", m.RunTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2TravelTime) validateToStationID(formats strfmt.Registry) error {
+
+ if err := validate.Required("ToStationID", "body", m.ToStationID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV2TravelTime) validateToStopID(formats strfmt.Registry) error {
+
+ if err := validate.Required("ToStopID", "body", m.ToStopID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validates this p t x service d t o bus specification v2 travel time based on context it is used
+func (m *PTXServiceDTOBusSpecificationV2TravelTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTOBusSpecificationV2TravelTime) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOBusSpecificationV2TravelTime) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOBusSpecificationV2TravelTime
+ 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_shared_specification_v2_base_name_type.go b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
index ae2f0ea5..b757afa0 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -33,6 +35,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) Validate(formats strfmt
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base name type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go
index 84cf731f..cead550e 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -191,6 +193,25 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) validateUpdateTime(form
return nil
}
+// ContextValidate validate this p t x service d t o shared specification v2 base operator based on the context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
index 33cfe90a..02645203 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -34,6 +36,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BasePointType) Validate(formats strfm
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base point type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BasePointType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BasePointType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_display_health.go b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_display_health.go
index 181998f1..f9b0a44a 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_display_health.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_display_health.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -73,7 +75,6 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) Validate(formats s
}
func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) validateInbound(formats strfmt.Registry) error {
-
if swag.IsZero(m.Inbound) { // not required
return nil
}
@@ -82,7 +83,6 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) validateInbound(fo
}
func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) validateOutbound(formats strfmt.Registry) error {
-
if swag.IsZero(m.Outbound) { // not required
return nil
}
@@ -108,6 +108,34 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) validateServiceNam
return nil
}
+// ContextValidate validate this p t x service d t o shared specification v3 base display health based on the context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateInbound(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOutbound(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) contextValidateInbound(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) contextValidateOutbound(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_inbound.go b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_inbound.go
index a8272315..863e370b 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_inbound.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_inbound.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -73,6 +75,11 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseInbound) validateStatus(formats s
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v3 base inbound based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BaseInbound) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BaseInbound) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_outbound.go b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_outbound.go
index c5028d96..2e474918 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_outbound.go
+++ b/bus/v2/models/p_t_x_service_d_t_o_shared_specification_v3_base_outbound.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -73,6 +75,11 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseOutbound) validateStatus(formats
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v3 base outbound based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BaseOutbound) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BaseOutbound) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/client/city_bus/city_bus_api_alert_parameters.go b/bus/v3/client/city_bus/city_bus_api_alert_parameters.go
index d3fd42ef..4adf9b19 100644
--- a/bus/v3/client/city_bus/city_bus_api_alert_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_alert_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIAlertParams creates a new CityBusAPIAlertParams object
-// with the default values initialized.
+// NewCityBusAPIAlertParams creates a new CityBusAPIAlertParams 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 NewCityBusAPIAlertParams() *CityBusAPIAlertParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIAlertParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIAlertParamsWithTimeout creates a new CityBusAPIAlertParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIAlertParamsWithTimeout(timeout time.Duration) *CityBusAPIAlertParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIAlertParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIAlertParamsWithContext creates a new CityBusAPIAlertParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIAlertParamsWithContext(ctx context.Context) *CityBusAPIAlertParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIAlertParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIAlertParamsWithHTTPClient creates a new CityBusAPIAlertParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIAlertParamsWithHTTPClient(client *http.Client) *CityBusAPIAlertParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIAlertParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIAlertParams contains all the parameters to send to the API endpoint
-for the city bus Api alert operation typically these are written to a http.Request
+/* CityBusAPIAlertParams contains all the parameters to send to the API endpoint
+ for the city bus Api alert operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIAlertParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIAlertParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api alert params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIAlertParams) WithDefaults() *CityBusAPIAlertParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api alert params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIAlertParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIAlertParams{
+ 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 alert params
func (o *CityBusAPIAlertParams) WithTimeout(timeout time.Duration) *CityBusAPIAlertParams {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIAlertParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIAlertParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIAlertParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_alert_responses.go b/bus/v3/client/city_bus/city_bus_api_alert_responses.go
index 471a7282..9a621207 100644
--- a/bus/v3/client/city_bus/city_bus_api_alert_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_alert_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIAlertReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIAlertNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIAlertOK() *CityBusAPIAlertOK {
return &CityBusAPIAlertOK{}
}
-/*CityBusAPIAlertOK handles this case with default header values.
+/* CityBusAPIAlertOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIAlertOK struct {
func (o *CityBusAPIAlertOK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Alert/City/{City}][%d] cityBusApiAlertOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIAlertOK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3Alert {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIAlertStatus299() *CityBusAPIAlertStatus299 {
return &CityBusAPIAlertStatus299{}
}
-/*CityBusAPIAlertStatus299 handles this case with default header values.
+/* CityBusAPIAlertStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIAlertStatus299 struct {
func (o *CityBusAPIAlertStatus299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Alert/City/{City}][%d] cityBusApiAlertStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIAlertStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIAlertStatus299) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewCityBusAPIAlertNotModified creates a CityBusAPIAlertNotModified with default headers values
+func NewCityBusAPIAlertNotModified() *CityBusAPIAlertNotModified {
+ return &CityBusAPIAlertNotModified{}
+}
+
+/* CityBusAPIAlertNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIAlertNotModified struct {
+}
+
+func (o *CityBusAPIAlertNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/Alert/City/{City}][%d] cityBusApiAlertNotModified ", 304)
+}
+
+func (o *CityBusAPIAlertNotModified) 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/v3/client/city_bus/city_bus_api_daily_time_table_parameters.go
index 97f79fa5..f95dba5e 100644
--- a/bus/v3/client/city_bus/city_bus_api_daily_time_table_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_daily_time_table_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIDailyTimeTableParams creates a new CityBusAPIDailyTimeTableParams object
-// with the default values initialized.
+// NewCityBusAPIDailyTimeTableParams creates a new CityBusAPIDailyTimeTableParams 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 NewCityBusAPIDailyTimeTableParams() *CityBusAPIDailyTimeTableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDailyTimeTableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIDailyTimeTableParamsWithTimeout creates a new CityBusAPIDailyTimeTableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIDailyTimeTableParamsWithTimeout(timeout time.Duration) *CityBusAPIDailyTimeTableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDailyTimeTableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIDailyTimeTableParamsWithContext creates a new CityBusAPIDailyTimeTableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIDailyTimeTableParamsWithContext(ctx context.Context) *CityBusAPIDailyTimeTableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDailyTimeTableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIDailyTimeTableParamsWithHTTPClient creates a new CityBusAPIDailyTimeTableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIDailyTimeTableParamsWithHTTPClient(client *http.Client) *CityBusAPIDailyTimeTableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDailyTimeTableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIDailyTimeTableParams contains all the parameters to send to the API endpoint
-for the city bus Api daily time table operation typically these are written to a http.Request
+/* CityBusAPIDailyTimeTableParams contains all the parameters to send to the API endpoint
+ for the city bus Api daily time table operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIDailyTimeTableParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIDailyTimeTableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api daily time table params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDailyTimeTableParams) WithDefaults() *CityBusAPIDailyTimeTableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api daily time table params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDailyTimeTableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIDailyTimeTableParams{
+ 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 params
func (o *CityBusAPIDailyTimeTableParams) WithTimeout(timeout time.Duration) *CityBusAPIDailyTimeTableParams {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIDailyTimeTableParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIDailyTimeTableParams) WriteToRequest(r runtime.ClientRequest,
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIDailyTimeTableParams) WriteToRequest(r runtime.ClientRequest,
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_daily_time_table_responses.go b/bus/v3/client/city_bus/city_bus_api_daily_time_table_responses.go
index cf167b09..d55a2022 100644
--- a/bus/v3/client/city_bus/city_bus_api_daily_time_table_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_daily_time_table_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIDailyTimeTableReader) ReadResponse(response runtime.ClientRes
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIDailyTimeTableNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIDailyTimeTableOK() *CityBusAPIDailyTimeTableOK {
return &CityBusAPIDailyTimeTableOK{}
}
-/*CityBusAPIDailyTimeTableOK handles this case with default header values.
+/* CityBusAPIDailyTimeTableOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIDailyTimeTableOK struct {
func (o *CityBusAPIDailyTimeTableOK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTableOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIDailyTimeTableOK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3DailyTimeTable {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIDailyTimeTableStatus299() *CityBusAPIDailyTimeTableStatus299 {
return &CityBusAPIDailyTimeTableStatus299{}
}
-/*CityBusAPIDailyTimeTableStatus299 handles this case with default header values.
+/* CityBusAPIDailyTimeTableStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIDailyTimeTableStatus299 struct {
func (o *CityBusAPIDailyTimeTableStatus299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTableStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIDailyTimeTableStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIDailyTimeTableStatus299) readResponse(response runtime.Client
return nil
}
+
+// NewCityBusAPIDailyTimeTableNotModified creates a CityBusAPIDailyTimeTableNotModified with default headers values
+func NewCityBusAPIDailyTimeTableNotModified() *CityBusAPIDailyTimeTableNotModified {
+ return &CityBusAPIDailyTimeTableNotModified{}
+}
+
+/* CityBusAPIDailyTimeTableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIDailyTimeTableNotModified struct {
+}
+
+func (o *CityBusAPIDailyTimeTableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/DailyTimeTable/City/{City}][%d] cityBusApiDailyTimeTableNotModified ", 304)
+}
+
+func (o *CityBusAPIDailyTimeTableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_depot_parameters.go b/bus/v3/client/city_bus/city_bus_api_depot_parameters.go
index 645b86ff..310c902c 100644
--- a/bus/v3/client/city_bus/city_bus_api_depot_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_depot_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIDepotParams creates a new CityBusAPIDepotParams object
-// with the default values initialized.
+// NewCityBusAPIDepotParams creates a new CityBusAPIDepotParams 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 NewCityBusAPIDepotParams() *CityBusAPIDepotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDepotParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIDepotParamsWithTimeout creates a new CityBusAPIDepotParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIDepotParamsWithTimeout(timeout time.Duration) *CityBusAPIDepotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDepotParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIDepotParamsWithContext creates a new CityBusAPIDepotParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIDepotParamsWithContext(ctx context.Context) *CityBusAPIDepotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDepotParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIDepotParamsWithHTTPClient creates a new CityBusAPIDepotParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIDepotParamsWithHTTPClient(client *http.Client) *CityBusAPIDepotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDepotParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIDepotParams contains all the parameters to send to the API endpoint
-for the city bus Api depot operation typically these are written to a http.Request
+/* CityBusAPIDepotParams contains all the parameters to send to the API endpoint
+ for the city bus Api depot operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIDepotParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -129,6 +127,32 @@ type CityBusAPIDepotParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api depot params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDepotParams) WithDefaults() *CityBusAPIDepotParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api depot params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDepotParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIDepotParams{
+ 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 depot params
func (o *CityBusAPIDepotParams) WithTimeout(timeout time.Duration) *CityBusAPIDepotParams {
o.SetTimeout(timeout)
@@ -284,38 +308,41 @@ func (o *CityBusAPIDepotParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -325,80 +352,85 @@ func (o *CityBusAPIDepotParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -410,16 +442,17 @@ func (o *CityBusAPIDepotParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_depot_responses.go b/bus/v3/client/city_bus/city_bus_api_depot_responses.go
index 2d86adab..b36ce1fe 100644
--- a/bus/v3/client/city_bus/city_bus_api_depot_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_depot_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIDepotReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIDepotNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIDepotOK() *CityBusAPIDepotOK {
return &CityBusAPIDepotOK{}
}
-/*CityBusAPIDepotOK handles this case with default header values.
+/* CityBusAPIDepotOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIDepotOK struct {
func (o *CityBusAPIDepotOK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Depot/City/{City}][%d] cityBusApiDepotOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIDepotOK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Depot {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIDepotStatus299() *CityBusAPIDepotStatus299 {
return &CityBusAPIDepotStatus299{}
}
-/*CityBusAPIDepotStatus299 handles this case with default header values.
+/* CityBusAPIDepotStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIDepotStatus299 struct {
func (o *CityBusAPIDepotStatus299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Depot/City/{City}][%d] cityBusApiDepotStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIDepotStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIDepotStatus299) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewCityBusAPIDepotNotModified creates a CityBusAPIDepotNotModified with default headers values
+func NewCityBusAPIDepotNotModified() *CityBusAPIDepotNotModified {
+ return &CityBusAPIDepotNotModified{}
+}
+
+/* CityBusAPIDepotNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIDepotNotModified struct {
+}
+
+func (o *CityBusAPIDepotNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/Depot/City/{City}][%d] cityBusApiDepotNotModified ", 304)
+}
+
+func (o *CityBusAPIDepotNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_display_stop_of_route2_parameters.go b/bus/v3/client/city_bus/city_bus_api_display_stop_of_route2_parameters.go
index 15678ae7..67de164c 100644
--- a/bus/v3/client/city_bus/city_bus_api_display_stop_of_route2_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_display_stop_of_route2_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIDisplayStopOfRoute2Params creates a new CityBusAPIDisplayStopOfRoute2Params object
-// with the default values initialized.
+// NewCityBusAPIDisplayStopOfRoute2Params creates a new CityBusAPIDisplayStopOfRoute2Params 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 NewCityBusAPIDisplayStopOfRoute2Params() *CityBusAPIDisplayStopOfRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRoute2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIDisplayStopOfRoute2ParamsWithTimeout creates a new CityBusAPIDisplayStopOfRoute2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIDisplayStopOfRoute2ParamsWithTimeout(timeout time.Duration) *CityBusAPIDisplayStopOfRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRoute2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIDisplayStopOfRoute2ParamsWithContext creates a new CityBusAPIDisplayStopOfRoute2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIDisplayStopOfRoute2ParamsWithContext(ctx context.Context) *CityBusAPIDisplayStopOfRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRoute2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIDisplayStopOfRoute2ParamsWithHTTPClient creates a new CityBusAPIDisplayStopOfRoute2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIDisplayStopOfRoute2ParamsWithHTTPClient(client *http.Client) *CityBusAPIDisplayStopOfRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIDisplayStopOfRoute2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIDisplayStopOfRoute2Params contains all the parameters to send to the API endpoint
-for the city bus Api display stop of route 2 operation typically these are written to a http.Request
+/* CityBusAPIDisplayStopOfRoute2Params contains all the parameters to send to the API endpoint
+ for the city bus Api display stop of route 2 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIDisplayStopOfRoute2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIDisplayStopOfRoute2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api display stop of route 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDisplayStopOfRoute2Params) WithDefaults() *CityBusAPIDisplayStopOfRoute2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api display stop of route 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIDisplayStopOfRoute2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIDisplayStopOfRoute2Params{
+ 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 display stop of route 2 params
func (o *CityBusAPIDisplayStopOfRoute2Params) WithTimeout(timeout time.Duration) *CityBusAPIDisplayStopOfRoute2Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIDisplayStopOfRoute2Params) WriteToRequest(r runtime.ClientReq
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIDisplayStopOfRoute2Params) WriteToRequest(r runtime.ClientReq
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIDisplayStopOfRoute2Params) WriteToRequest(r runtime.ClientReq
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_display_stop_of_route2_responses.go b/bus/v3/client/city_bus/city_bus_api_display_stop_of_route2_responses.go
index df408ae1..289493fc 100644
--- a/bus/v3/client/city_bus/city_bus_api_display_stop_of_route2_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_display_stop_of_route2_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIDisplayStopOfRoute2Reader) ReadResponse(response runtime.Clie
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIDisplayStopOfRoute2NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIDisplayStopOfRoute2OK() *CityBusAPIDisplayStopOfRoute2OK {
return &CityBusAPIDisplayStopOfRoute2OK{}
}
-/*CityBusAPIDisplayStopOfRoute2OK handles this case with default header values.
+/* CityBusAPIDisplayStopOfRoute2OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIDisplayStopOfRoute2OK struct {
func (o *CityBusAPIDisplayStopOfRoute2OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/DisplayStopOfRoute/City/{City}][%d] cityBusApiDisplayStopOfRoute2OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIDisplayStopOfRoute2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3DisplayStopOfRoute {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIDisplayStopOfRoute2Status299() *CityBusAPIDisplayStopOfRoute2S
return &CityBusAPIDisplayStopOfRoute2Status299{}
}
-/*CityBusAPIDisplayStopOfRoute2Status299 handles this case with default header values.
+/* CityBusAPIDisplayStopOfRoute2Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIDisplayStopOfRoute2Status299 struct {
func (o *CityBusAPIDisplayStopOfRoute2Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/DisplayStopOfRoute/City/{City}][%d] cityBusApiDisplayStopOfRoute2Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIDisplayStopOfRoute2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIDisplayStopOfRoute2Status299) readResponse(response runtime.C
return nil
}
+
+// NewCityBusAPIDisplayStopOfRoute2NotModified creates a CityBusAPIDisplayStopOfRoute2NotModified with default headers values
+func NewCityBusAPIDisplayStopOfRoute2NotModified() *CityBusAPIDisplayStopOfRoute2NotModified {
+ return &CityBusAPIDisplayStopOfRoute2NotModified{}
+}
+
+/* CityBusAPIDisplayStopOfRoute2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIDisplayStopOfRoute2NotModified struct {
+}
+
+func (o *CityBusAPIDisplayStopOfRoute2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/DisplayStopOfRoute/City/{City}][%d] cityBusApiDisplayStopOfRoute2NotModified ", 304)
+}
+
+func (o *CityBusAPIDisplayStopOfRoute2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival2_parameters.go b/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival2_parameters.go
index dc741519..6fa87461 100644
--- a/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival2_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival2_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIEstimatedTimeOfArrival2Params creates a new CityBusAPIEstimatedTimeOfArrival2Params object
-// with the default values initialized.
+// NewCityBusAPIEstimatedTimeOfArrival2Params creates a new CityBusAPIEstimatedTimeOfArrival2Params 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 NewCityBusAPIEstimatedTimeOfArrival2Params() *CityBusAPIEstimatedTimeOfArrival2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrival2ParamsWithTimeout creates a new CityBusAPIEstimatedTimeOfArrival2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIEstimatedTimeOfArrival2ParamsWithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrival2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrival2ParamsWithContext creates a new CityBusAPIEstimatedTimeOfArrival2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIEstimatedTimeOfArrival2ParamsWithContext(ctx context.Context) *CityBusAPIEstimatedTimeOfArrival2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIEstimatedTimeOfArrival2ParamsWithHTTPClient creates a new CityBusAPIEstimatedTimeOfArrival2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIEstimatedTimeOfArrival2ParamsWithHTTPClient(client *http.Client) *CityBusAPIEstimatedTimeOfArrival2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIEstimatedTimeOfArrival2Params contains all the parameters to send to the API endpoint
-for the city bus Api estimated time of arrival 2 operation typically these are written to a http.Request
+/* CityBusAPIEstimatedTimeOfArrival2Params contains all the parameters to send to the API endpoint
+ for the city bus Api estimated time of arrival 2 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIEstimatedTimeOfArrival2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIEstimatedTimeOfArrival2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api estimated time of arrival 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrival2Params) WithDefaults() *CityBusAPIEstimatedTimeOfArrival2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api estimated time of arrival 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrival2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIEstimatedTimeOfArrival2Params{
+ 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 estimated time of arrival 2 params
func (o *CityBusAPIEstimatedTimeOfArrival2Params) WithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrival2Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIEstimatedTimeOfArrival2Params) WriteToRequest(r runtime.Clien
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIEstimatedTimeOfArrival2Params) WriteToRequest(r runtime.Clien
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIEstimatedTimeOfArrival2Params) WriteToRequest(r runtime.Clien
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival2_responses.go b/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival2_responses.go
index ff848659..40257a66 100644
--- a/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival2_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival2_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIEstimatedTimeOfArrival2Reader) ReadResponse(response runtime.
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIEstimatedTimeOfArrival2NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIEstimatedTimeOfArrival2OK() *CityBusAPIEstimatedTimeOfArrival2
return &CityBusAPIEstimatedTimeOfArrival2OK{}
}
-/*CityBusAPIEstimatedTimeOfArrival2OK handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrival2OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIEstimatedTimeOfArrival2OK struct {
func (o *CityBusAPIEstimatedTimeOfArrival2OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/EstimatedTimeOfArrival/City/{City}][%d] cityBusApiEstimatedTimeOfArrival2OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrival2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3N1Data {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIEstimatedTimeOfArrival2Status299() *CityBusAPIEstimatedTimeOfA
return &CityBusAPIEstimatedTimeOfArrival2Status299{}
}
-/*CityBusAPIEstimatedTimeOfArrival2Status299 handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrival2Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIEstimatedTimeOfArrival2Status299 struct {
func (o *CityBusAPIEstimatedTimeOfArrival2Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/EstimatedTimeOfArrival/City/{City}][%d] cityBusApiEstimatedTimeOfArrival2Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrival2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIEstimatedTimeOfArrival2Status299) readResponse(response runti
return nil
}
+
+// NewCityBusAPIEstimatedTimeOfArrival2NotModified creates a CityBusAPIEstimatedTimeOfArrival2NotModified with default headers values
+func NewCityBusAPIEstimatedTimeOfArrival2NotModified() *CityBusAPIEstimatedTimeOfArrival2NotModified {
+ return &CityBusAPIEstimatedTimeOfArrival2NotModified{}
+}
+
+/* CityBusAPIEstimatedTimeOfArrival2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIEstimatedTimeOfArrival2NotModified struct {
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrival2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/EstimatedTimeOfArrival/City/{City}][%d] cityBusApiEstimatedTimeOfArrival2NotModified ", 304)
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrival2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival3_parameters.go b/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival3_parameters.go
index d5404c97..7d544b5e 100644
--- a/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival3_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival3_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIEstimatedTimeOfArrival3Params creates a new CityBusAPIEstimatedTimeOfArrival3Params object
-// with the default values initialized.
+// NewCityBusAPIEstimatedTimeOfArrival3Params creates a new CityBusAPIEstimatedTimeOfArrival3Params 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 NewCityBusAPIEstimatedTimeOfArrival3Params() *CityBusAPIEstimatedTimeOfArrival3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival3Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrival3ParamsWithTimeout creates a new CityBusAPIEstimatedTimeOfArrival3Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIEstimatedTimeOfArrival3ParamsWithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrival3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival3Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIEstimatedTimeOfArrival3ParamsWithContext creates a new CityBusAPIEstimatedTimeOfArrival3Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIEstimatedTimeOfArrival3ParamsWithContext(ctx context.Context) *CityBusAPIEstimatedTimeOfArrival3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival3Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIEstimatedTimeOfArrival3ParamsWithHTTPClient creates a new CityBusAPIEstimatedTimeOfArrival3Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIEstimatedTimeOfArrival3ParamsWithHTTPClient(client *http.Client) *CityBusAPIEstimatedTimeOfArrival3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIEstimatedTimeOfArrival3Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIEstimatedTimeOfArrival3Params contains all the parameters to send to the API endpoint
-for the city bus Api estimated time of arrival 3 operation typically these are written to a http.Request
+/* CityBusAPIEstimatedTimeOfArrival3Params contains all the parameters to send to the API endpoint
+ for the city bus Api estimated time of arrival 3 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIEstimatedTimeOfArrival3Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -129,6 +127,32 @@ type CityBusAPIEstimatedTimeOfArrival3Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api estimated time of arrival 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrival3Params) WithDefaults() *CityBusAPIEstimatedTimeOfArrival3Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api estimated time of arrival 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIEstimatedTimeOfArrival3Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIEstimatedTimeOfArrival3Params{
+ 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 estimated time of arrival 3 params
func (o *CityBusAPIEstimatedTimeOfArrival3Params) WithTimeout(timeout time.Duration) *CityBusAPIEstimatedTimeOfArrival3Params {
o.SetTimeout(timeout)
@@ -284,38 +308,41 @@ func (o *CityBusAPIEstimatedTimeOfArrival3Params) WriteToRequest(r runtime.Clien
// 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
}
@@ -325,64 +352,68 @@ func (o *CityBusAPIEstimatedTimeOfArrival3Params) WriteToRequest(r runtime.Clien
// 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
@@ -399,16 +430,17 @@ func (o *CityBusAPIEstimatedTimeOfArrival3Params) WriteToRequest(r runtime.Clien
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival3_responses.go b/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival3_responses.go
index b58733d0..e74b7a02 100644
--- a/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival3_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_estimated_time_of_arrival3_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIEstimatedTimeOfArrival3Reader) ReadResponse(response runtime.
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIEstimatedTimeOfArrival3NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIEstimatedTimeOfArrival3OK() *CityBusAPIEstimatedTimeOfArrival3
return &CityBusAPIEstimatedTimeOfArrival3OK{}
}
-/*CityBusAPIEstimatedTimeOfArrival3OK handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrival3OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIEstimatedTimeOfArrival3OK struct {
func (o *CityBusAPIEstimatedTimeOfArrival3OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/EstimatedTimeOfArrival/City/{City}/{RouteName}][%d] cityBusApiEstimatedTimeOfArrival3OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrival3OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3N1Data {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIEstimatedTimeOfArrival3Status299() *CityBusAPIEstimatedTimeOfA
return &CityBusAPIEstimatedTimeOfArrival3Status299{}
}
-/*CityBusAPIEstimatedTimeOfArrival3Status299 handles this case with default header values.
+/* CityBusAPIEstimatedTimeOfArrival3Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIEstimatedTimeOfArrival3Status299 struct {
func (o *CityBusAPIEstimatedTimeOfArrival3Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/EstimatedTimeOfArrival/City/{City}/{RouteName}][%d] cityBusApiEstimatedTimeOfArrival3Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIEstimatedTimeOfArrival3Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIEstimatedTimeOfArrival3Status299) readResponse(response runti
return nil
}
+
+// NewCityBusAPIEstimatedTimeOfArrival3NotModified creates a CityBusAPIEstimatedTimeOfArrival3NotModified with default headers values
+func NewCityBusAPIEstimatedTimeOfArrival3NotModified() *CityBusAPIEstimatedTimeOfArrival3NotModified {
+ return &CityBusAPIEstimatedTimeOfArrival3NotModified{}
+}
+
+/* CityBusAPIEstimatedTimeOfArrival3NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIEstimatedTimeOfArrival3NotModified struct {
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrival3NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/EstimatedTimeOfArrival/City/{City}/{RouteName}][%d] cityBusApiEstimatedTimeOfArrival3NotModified ", 304)
+}
+
+func (o *CityBusAPIEstimatedTimeOfArrival3NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_first_last_trip_info2_parameters.go b/bus/v3/client/city_bus/city_bus_api_first_last_trip_info2_parameters.go
index c51e09aa..a41d9f6f 100644
--- a/bus/v3/client/city_bus/city_bus_api_first_last_trip_info2_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_first_last_trip_info2_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIFirstLastTripInfo2Params creates a new CityBusAPIFirstLastTripInfo2Params object
-// with the default values initialized.
+// NewCityBusAPIFirstLastTripInfo2Params creates a new CityBusAPIFirstLastTripInfo2Params 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 NewCityBusAPIFirstLastTripInfo2Params() *CityBusAPIFirstLastTripInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfo2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIFirstLastTripInfo2ParamsWithTimeout creates a new CityBusAPIFirstLastTripInfo2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIFirstLastTripInfo2ParamsWithTimeout(timeout time.Duration) *CityBusAPIFirstLastTripInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfo2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIFirstLastTripInfo2ParamsWithContext creates a new CityBusAPIFirstLastTripInfo2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIFirstLastTripInfo2ParamsWithContext(ctx context.Context) *CityBusAPIFirstLastTripInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfo2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIFirstLastTripInfo2ParamsWithHTTPClient creates a new CityBusAPIFirstLastTripInfo2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIFirstLastTripInfo2ParamsWithHTTPClient(client *http.Client) *CityBusAPIFirstLastTripInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIFirstLastTripInfo2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIFirstLastTripInfo2Params contains all the parameters to send to the API endpoint
-for the city bus Api first last trip info 2 operation typically these are written to a http.Request
+/* CityBusAPIFirstLastTripInfo2Params contains all the parameters to send to the API endpoint
+ for the city bus Api first last trip info 2 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIFirstLastTripInfo2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIFirstLastTripInfo2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api first last trip info 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIFirstLastTripInfo2Params) WithDefaults() *CityBusAPIFirstLastTripInfo2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api first last trip info 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIFirstLastTripInfo2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIFirstLastTripInfo2Params{
+ 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 first last trip info 2 params
func (o *CityBusAPIFirstLastTripInfo2Params) WithTimeout(timeout time.Duration) *CityBusAPIFirstLastTripInfo2Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIFirstLastTripInfo2Params) WriteToRequest(r runtime.ClientRequ
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIFirstLastTripInfo2Params) WriteToRequest(r runtime.ClientRequ
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIFirstLastTripInfo2Params) WriteToRequest(r runtime.ClientRequ
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_first_last_trip_info2_responses.go b/bus/v3/client/city_bus/city_bus_api_first_last_trip_info2_responses.go
index fa19aded..c6d92484 100644
--- a/bus/v3/client/city_bus/city_bus_api_first_last_trip_info2_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_first_last_trip_info2_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIFirstLastTripInfo2Reader) ReadResponse(response runtime.Clien
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIFirstLastTripInfo2NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIFirstLastTripInfo2OK() *CityBusAPIFirstLastTripInfo2OK {
return &CityBusAPIFirstLastTripInfo2OK{}
}
-/*CityBusAPIFirstLastTripInfo2OK handles this case with default header values.
+/* CityBusAPIFirstLastTripInfo2OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIFirstLastTripInfo2OK struct {
func (o *CityBusAPIFirstLastTripInfo2OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/FirstLastTripInfo/City/{City}][%d] cityBusApiFirstLastTripInfo2OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIFirstLastTripInfo2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3FirstLastTripInfo {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIFirstLastTripInfo2Status299() *CityBusAPIFirstLastTripInfo2Sta
return &CityBusAPIFirstLastTripInfo2Status299{}
}
-/*CityBusAPIFirstLastTripInfo2Status299 handles this case with default header values.
+/* CityBusAPIFirstLastTripInfo2Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIFirstLastTripInfo2Status299 struct {
func (o *CityBusAPIFirstLastTripInfo2Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/FirstLastTripInfo/City/{City}][%d] cityBusApiFirstLastTripInfo2Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIFirstLastTripInfo2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIFirstLastTripInfo2Status299) readResponse(response runtime.Cl
return nil
}
+
+// NewCityBusAPIFirstLastTripInfo2NotModified creates a CityBusAPIFirstLastTripInfo2NotModified with default headers values
+func NewCityBusAPIFirstLastTripInfo2NotModified() *CityBusAPIFirstLastTripInfo2NotModified {
+ return &CityBusAPIFirstLastTripInfo2NotModified{}
+}
+
+/* CityBusAPIFirstLastTripInfo2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIFirstLastTripInfo2NotModified struct {
+}
+
+func (o *CityBusAPIFirstLastTripInfo2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/FirstLastTripInfo/City/{City}][%d] cityBusApiFirstLastTripInfo2NotModified ", 304)
+}
+
+func (o *CityBusAPIFirstLastTripInfo2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_network_parameters.go b/bus/v3/client/city_bus/city_bus_api_network_parameters.go
index 3848a9e7..959e377d 100644
--- a/bus/v3/client/city_bus/city_bus_api_network_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_network_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPINetworkParams creates a new CityBusAPINetworkParams object
-// with the default values initialized.
+// NewCityBusAPINetworkParams creates a new CityBusAPINetworkParams 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 NewCityBusAPINetworkParams() *CityBusAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINetworkParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPINetworkParamsWithTimeout creates a new CityBusAPINetworkParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPINetworkParamsWithTimeout(timeout time.Duration) *CityBusAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINetworkParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPINetworkParamsWithContext creates a new CityBusAPINetworkParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPINetworkParamsWithContext(ctx context.Context) *CityBusAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINetworkParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPINetworkParamsWithHTTPClient creates a new CityBusAPINetworkParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPINetworkParamsWithHTTPClient(client *http.Client) *CityBusAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINetworkParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPINetworkParams contains all the parameters to send to the API endpoint
-for the city bus Api network operation typically these are written to a http.Request
+/* CityBusAPINetworkParams contains all the parameters to send to the API endpoint
+ for the city bus Api network operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPINetworkParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPINetworkParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api network params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPINetworkParams) WithDefaults() *CityBusAPINetworkParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api network params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPINetworkParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPINetworkParams{
+ 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 network params
func (o *CityBusAPINetworkParams) WithTimeout(timeout time.Duration) *CityBusAPINetworkParams {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPINetworkParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPINetworkParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPINetworkParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_network_responses.go b/bus/v3/client/city_bus/city_bus_api_network_responses.go
index 686ad31c..bdde56af 100644
--- a/bus/v3/client/city_bus/city_bus_api_network_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_network_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPINetworkReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPINetworkNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPINetworkOK() *CityBusAPINetworkOK {
return &CityBusAPINetworkOK{}
}
-/*CityBusAPINetworkOK handles this case with default header values.
+/* CityBusAPINetworkOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPINetworkOK struct {
func (o *CityBusAPINetworkOK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Network/City/{City}][%d] cityBusApiNetworkOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPINetworkOK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Network {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPINetworkStatus299() *CityBusAPINetworkStatus299 {
return &CityBusAPINetworkStatus299{}
}
-/*CityBusAPINetworkStatus299 handles this case with default header values.
+/* CityBusAPINetworkStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPINetworkStatus299 struct {
func (o *CityBusAPINetworkStatus299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Network/City/{City}][%d] cityBusApiNetworkStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPINetworkStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPINetworkStatus299) readResponse(response runtime.ClientRespons
return nil
}
+
+// NewCityBusAPINetworkNotModified creates a CityBusAPINetworkNotModified with default headers values
+func NewCityBusAPINetworkNotModified() *CityBusAPINetworkNotModified {
+ return &CityBusAPINetworkNotModified{}
+}
+
+/* CityBusAPINetworkNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPINetworkNotModified struct {
+}
+
+func (o *CityBusAPINetworkNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/Network/City/{City}][%d] cityBusApiNetworkNotModified ", 304)
+}
+
+func (o *CityBusAPINetworkNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_news1_parameters.go b/bus/v3/client/city_bus/city_bus_api_news1_parameters.go
index ec84dc5b..67bb3a9b 100644
--- a/bus/v3/client/city_bus/city_bus_api_news1_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_news1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPINews1Params creates a new CityBusAPINews1Params object
-// with the default values initialized.
+// NewCityBusAPINews1Params creates a new CityBusAPINews1Params 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 NewCityBusAPINews1Params() *CityBusAPINews1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINews1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPINews1ParamsWithTimeout creates a new CityBusAPINews1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPINews1ParamsWithTimeout(timeout time.Duration) *CityBusAPINews1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINews1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPINews1ParamsWithContext creates a new CityBusAPINews1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPINews1ParamsWithContext(ctx context.Context) *CityBusAPINews1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINews1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPINews1ParamsWithHTTPClient creates a new CityBusAPINews1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPINews1ParamsWithHTTPClient(client *http.Client) *CityBusAPINews1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPINews1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPINews1Params contains all the parameters to send to the API endpoint
-for the city bus Api news 1 operation typically these are written to a http.Request
+/* CityBusAPINews1Params contains all the parameters to send to the API endpoint
+ for the city bus Api news 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPINews1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPINews1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api news 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPINews1Params) WithDefaults() *CityBusAPINews1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api news 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPINews1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPINews1Params{
+ 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 news 1 params
func (o *CityBusAPINews1Params) WithTimeout(timeout time.Duration) *CityBusAPINews1Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPINews1Params) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPINews1Params) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPINews1Params) WriteToRequest(r runtime.ClientRequest, reg strf
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_news1_responses.go b/bus/v3/client/city_bus/city_bus_api_news1_responses.go
index 214e1f14..93180709 100644
--- a/bus/v3/client/city_bus/city_bus_api_news1_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_news1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPINews1Reader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPINews1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPINews1OK() *CityBusAPINews1OK {
return &CityBusAPINews1OK{}
}
-/*CityBusAPINews1OK handles this case with default header values.
+/* CityBusAPINews1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPINews1OK struct {
func (o *CityBusAPINews1OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/News/City/{City}][%d] cityBusApiNews1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPINews1OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3News {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPINews1Status299() *CityBusAPINews1Status299 {
return &CityBusAPINews1Status299{}
}
-/*CityBusAPINews1Status299 handles this case with default header values.
+/* CityBusAPINews1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPINews1Status299 struct {
func (o *CityBusAPINews1Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/News/City/{City}][%d] cityBusApiNews1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPINews1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPINews1Status299) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewCityBusAPINews1NotModified creates a CityBusAPINews1NotModified with default headers values
+func NewCityBusAPINews1NotModified() *CityBusAPINews1NotModified {
+ return &CityBusAPINews1NotModified{}
+}
+
+/* CityBusAPINews1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPINews1NotModified struct {
+}
+
+func (o *CityBusAPINews1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/News/City/{City}][%d] cityBusApiNews1NotModified ", 304)
+}
+
+func (o *CityBusAPINews1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_operator1_parameters.go b/bus/v3/client/city_bus/city_bus_api_operator1_parameters.go
index 2e6338cb..79b9acc7 100644
--- a/bus/v3/client/city_bus/city_bus_api_operator1_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_operator1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIOperator1Params creates a new CityBusAPIOperator1Params object
-// with the default values initialized.
+// NewCityBusAPIOperator1Params creates a new CityBusAPIOperator1Params 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 NewCityBusAPIOperator1Params() *CityBusAPIOperator1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIOperator1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIOperator1ParamsWithTimeout creates a new CityBusAPIOperator1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIOperator1ParamsWithTimeout(timeout time.Duration) *CityBusAPIOperator1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIOperator1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIOperator1ParamsWithContext creates a new CityBusAPIOperator1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIOperator1ParamsWithContext(ctx context.Context) *CityBusAPIOperator1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIOperator1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIOperator1ParamsWithHTTPClient creates a new CityBusAPIOperator1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIOperator1ParamsWithHTTPClient(client *http.Client) *CityBusAPIOperator1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIOperator1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIOperator1Params contains all the parameters to send to the API endpoint
-for the city bus Api operator 1 operation typically these are written to a http.Request
+/* CityBusAPIOperator1Params contains all the parameters to send to the API endpoint
+ for the city bus Api operator 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIOperator1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIOperator1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api operator 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIOperator1Params) WithDefaults() *CityBusAPIOperator1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api operator 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIOperator1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIOperator1Params{
+ 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 operator 1 params
func (o *CityBusAPIOperator1Params) WithTimeout(timeout time.Duration) *CityBusAPIOperator1Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIOperator1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIOperator1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIOperator1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_operator1_responses.go b/bus/v3/client/city_bus/city_bus_api_operator1_responses.go
index dc898d60..e5e7c288 100644
--- a/bus/v3/client/city_bus/city_bus_api_operator1_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_operator1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIOperator1Reader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIOperator1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIOperator1OK() *CityBusAPIOperator1OK {
return &CityBusAPIOperator1OK{}
}
-/*CityBusAPIOperator1OK handles this case with default header values.
+/* CityBusAPIOperator1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIOperator1OK struct {
func (o *CityBusAPIOperator1OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Operator/City/{City}][%d] cityBusApiOperator1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIOperator1OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Operator {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIOperator1Status299() *CityBusAPIOperator1Status299 {
return &CityBusAPIOperator1Status299{}
}
-/*CityBusAPIOperator1Status299 handles this case with default header values.
+/* CityBusAPIOperator1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIOperator1Status299 struct {
func (o *CityBusAPIOperator1Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Operator/City/{City}][%d] cityBusApiOperator1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIOperator1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIOperator1Status299) readResponse(response runtime.ClientRespo
return nil
}
+
+// NewCityBusAPIOperator1NotModified creates a CityBusAPIOperator1NotModified with default headers values
+func NewCityBusAPIOperator1NotModified() *CityBusAPIOperator1NotModified {
+ return &CityBusAPIOperator1NotModified{}
+}
+
+/* CityBusAPIOperator1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIOperator1NotModified struct {
+}
+
+func (o *CityBusAPIOperator1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/Operator/City/{City}][%d] cityBusApiOperator1NotModified ", 304)
+}
+
+func (o *CityBusAPIOperator1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency2_parameters.go b/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency2_parameters.go
index 87bfcaa4..d7db1cb1 100644
--- a/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency2_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency2_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeByFrequency2Params creates a new CityBusAPIRealTimeByFrequency2Params object
-// with the default values initialized.
+// NewCityBusAPIRealTimeByFrequency2Params creates a new CityBusAPIRealTimeByFrequency2Params 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 NewCityBusAPIRealTimeByFrequency2Params() *CityBusAPIRealTimeByFrequency2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeByFrequency2ParamsWithTimeout creates a new CityBusAPIRealTimeByFrequency2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeByFrequency2ParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequency2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeByFrequency2ParamsWithContext creates a new CityBusAPIRealTimeByFrequency2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeByFrequency2ParamsWithContext(ctx context.Context) *CityBusAPIRealTimeByFrequency2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeByFrequency2ParamsWithHTTPClient creates a new CityBusAPIRealTimeByFrequency2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeByFrequency2ParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeByFrequency2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeByFrequency2Params contains all the parameters to send to the API endpoint
-for the city bus Api real time by frequency 2 operation typically these are written to a http.Request
+/* CityBusAPIRealTimeByFrequency2Params contains all the parameters to send to the API endpoint
+ for the city bus Api real time by frequency 2 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeByFrequency2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -129,6 +127,32 @@ type CityBusAPIRealTimeByFrequency2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time by frequency 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequency2Params) WithDefaults() *CityBusAPIRealTimeByFrequency2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time by frequency 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequency2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeByFrequency2Params{
+ 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 real time by frequency 2 params
func (o *CityBusAPIRealTimeByFrequency2Params) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequency2Params {
o.SetTimeout(timeout)
@@ -284,38 +308,41 @@ func (o *CityBusAPIRealTimeByFrequency2Params) WriteToRequest(r runtime.ClientRe
// 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
}
@@ -325,80 +352,85 @@ func (o *CityBusAPIRealTimeByFrequency2Params) WriteToRequest(r runtime.ClientRe
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -410,16 +442,17 @@ func (o *CityBusAPIRealTimeByFrequency2Params) WriteToRequest(r runtime.ClientRe
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency2_responses.go b/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency2_responses.go
index b0861808..824f6cdf 100644
--- a/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency2_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency2_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeByFrequency2Reader) ReadResponse(response runtime.Cli
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeByFrequency2NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeByFrequency2OK() *CityBusAPIRealTimeByFrequency2OK {
return &CityBusAPIRealTimeByFrequency2OK{}
}
-/*CityBusAPIRealTimeByFrequency2OK handles this case with default header values.
+/* CityBusAPIRealTimeByFrequency2OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeByFrequency2OK struct {
func (o *CityBusAPIRealTimeByFrequency2OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RealTimeByFrequency/City/{City}][%d] cityBusApiRealTimeByFrequency2OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequency2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3A1Data {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIRealTimeByFrequency2Status299() *CityBusAPIRealTimeByFrequency
return &CityBusAPIRealTimeByFrequency2Status299{}
}
-/*CityBusAPIRealTimeByFrequency2Status299 handles this case with default header values.
+/* CityBusAPIRealTimeByFrequency2Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIRealTimeByFrequency2Status299 struct {
func (o *CityBusAPIRealTimeByFrequency2Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RealTimeByFrequency/City/{City}][%d] cityBusApiRealTimeByFrequency2Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequency2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIRealTimeByFrequency2Status299) readResponse(response runtime.
return nil
}
+
+// NewCityBusAPIRealTimeByFrequency2NotModified creates a CityBusAPIRealTimeByFrequency2NotModified with default headers values
+func NewCityBusAPIRealTimeByFrequency2NotModified() *CityBusAPIRealTimeByFrequency2NotModified {
+ return &CityBusAPIRealTimeByFrequency2NotModified{}
+}
+
+/* CityBusAPIRealTimeByFrequency2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeByFrequency2NotModified struct {
+}
+
+func (o *CityBusAPIRealTimeByFrequency2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/RealTimeByFrequency/City/{City}][%d] cityBusApiRealTimeByFrequency2NotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeByFrequency2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency3_parameters.go b/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency3_parameters.go
index 31997627..8659180a 100644
--- a/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency3_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency3_parameters.go
@@ -17,115 +17,114 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeByFrequency3Params creates a new CityBusAPIRealTimeByFrequency3Params object
-// with the default values initialized.
+// NewCityBusAPIRealTimeByFrequency3Params creates a new CityBusAPIRealTimeByFrequency3Params 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 NewCityBusAPIRealTimeByFrequency3Params() *CityBusAPIRealTimeByFrequency3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency3Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeByFrequency3ParamsWithTimeout creates a new CityBusAPIRealTimeByFrequency3Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeByFrequency3ParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequency3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency3Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeByFrequency3ParamsWithContext creates a new CityBusAPIRealTimeByFrequency3Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeByFrequency3ParamsWithContext(ctx context.Context) *CityBusAPIRealTimeByFrequency3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency3Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeByFrequency3ParamsWithHTTPClient creates a new CityBusAPIRealTimeByFrequency3Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeByFrequency3ParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeByFrequency3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeByFrequency3Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeByFrequency3Params contains all the parameters to send to the API endpoint
-for the city bus Api real time by frequency 3 operation typically these are written to a http.Request
+/* CityBusAPIRealTimeByFrequency3Params contains all the parameters to send to the API endpoint
+ for the city bus Api real time by frequency 3 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeByFrequency3Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -134,6 +133,32 @@ type CityBusAPIRealTimeByFrequency3Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time by frequency 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequency3Params) WithDefaults() *CityBusAPIRealTimeByFrequency3Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time by frequency 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeByFrequency3Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeByFrequency3Params{
+ 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 real time by frequency 3 params
func (o *CityBusAPIRealTimeByFrequency3Params) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeByFrequency3Params {
o.SetTimeout(timeout)
@@ -300,38 +325,41 @@ func (o *CityBusAPIRealTimeByFrequency3Params) WriteToRequest(r runtime.ClientRe
// 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
}
@@ -341,80 +369,85 @@ func (o *CityBusAPIRealTimeByFrequency3Params) WriteToRequest(r runtime.ClientRe
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -431,16 +464,17 @@ func (o *CityBusAPIRealTimeByFrequency3Params) WriteToRequest(r runtime.ClientRe
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency3_responses.go b/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency3_responses.go
index e084cda1..2b6b3482 100644
--- a/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency3_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_real_time_by_frequency3_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeByFrequency3Reader) ReadResponse(response runtime.Cli
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeByFrequency3NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeByFrequency3OK() *CityBusAPIRealTimeByFrequency3OK {
return &CityBusAPIRealTimeByFrequency3OK{}
}
-/*CityBusAPIRealTimeByFrequency3OK handles this case with default header values.
+/* CityBusAPIRealTimeByFrequency3OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeByFrequency3OK struct {
func (o *CityBusAPIRealTimeByFrequency3OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RealTimeByFrequency/City/{City}/{RouteName}][%d] cityBusApiRealTimeByFrequency3OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequency3OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3A1Data {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIRealTimeByFrequency3Status299() *CityBusAPIRealTimeByFrequency
return &CityBusAPIRealTimeByFrequency3Status299{}
}
-/*CityBusAPIRealTimeByFrequency3Status299 handles this case with default header values.
+/* CityBusAPIRealTimeByFrequency3Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIRealTimeByFrequency3Status299 struct {
func (o *CityBusAPIRealTimeByFrequency3Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RealTimeByFrequency/City/{City}/{RouteName}][%d] cityBusApiRealTimeByFrequency3Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeByFrequency3Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIRealTimeByFrequency3Status299) readResponse(response runtime.
return nil
}
+
+// NewCityBusAPIRealTimeByFrequency3NotModified creates a CityBusAPIRealTimeByFrequency3NotModified with default headers values
+func NewCityBusAPIRealTimeByFrequency3NotModified() *CityBusAPIRealTimeByFrequency3NotModified {
+ return &CityBusAPIRealTimeByFrequency3NotModified{}
+}
+
+/* CityBusAPIRealTimeByFrequency3NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeByFrequency3NotModified struct {
+}
+
+func (o *CityBusAPIRealTimeByFrequency3NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/RealTimeByFrequency/City/{City}/{RouteName}][%d] cityBusApiRealTimeByFrequency3NotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeByFrequency3NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_real_time_near_stop2_parameters.go b/bus/v3/client/city_bus/city_bus_api_real_time_near_stop2_parameters.go
index c3f7b975..6bd96343 100644
--- a/bus/v3/client/city_bus/city_bus_api_real_time_near_stop2_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_real_time_near_stop2_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeNearStop2Params creates a new CityBusAPIRealTimeNearStop2Params object
-// with the default values initialized.
+// NewCityBusAPIRealTimeNearStop2Params creates a new CityBusAPIRealTimeNearStop2Params 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 NewCityBusAPIRealTimeNearStop2Params() *CityBusAPIRealTimeNearStop2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeNearStop2ParamsWithTimeout creates a new CityBusAPIRealTimeNearStop2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeNearStop2ParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStop2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeNearStop2ParamsWithContext creates a new CityBusAPIRealTimeNearStop2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeNearStop2ParamsWithContext(ctx context.Context) *CityBusAPIRealTimeNearStop2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeNearStop2ParamsWithHTTPClient creates a new CityBusAPIRealTimeNearStop2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeNearStop2ParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeNearStop2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeNearStop2Params contains all the parameters to send to the API endpoint
-for the city bus Api real time near stop 2 operation typically these are written to a http.Request
+/* CityBusAPIRealTimeNearStop2Params contains all the parameters to send to the API endpoint
+ for the city bus Api real time near stop 2 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeNearStop2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIRealTimeNearStop2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time near stop 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStop2Params) WithDefaults() *CityBusAPIRealTimeNearStop2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time near stop 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStop2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeNearStop2Params{
+ 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 real time near stop 2 params
func (o *CityBusAPIRealTimeNearStop2Params) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStop2Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIRealTimeNearStop2Params) WriteToRequest(r runtime.ClientReque
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIRealTimeNearStop2Params) WriteToRequest(r runtime.ClientReque
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIRealTimeNearStop2Params) WriteToRequest(r runtime.ClientReque
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_real_time_near_stop2_responses.go b/bus/v3/client/city_bus/city_bus_api_real_time_near_stop2_responses.go
index df879882..dfc572db 100644
--- a/bus/v3/client/city_bus/city_bus_api_real_time_near_stop2_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_real_time_near_stop2_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeNearStop2Reader) ReadResponse(response runtime.Client
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeNearStop2NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeNearStop2OK() *CityBusAPIRealTimeNearStop2OK {
return &CityBusAPIRealTimeNearStop2OK{}
}
-/*CityBusAPIRealTimeNearStop2OK handles this case with default header values.
+/* CityBusAPIRealTimeNearStop2OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeNearStop2OK struct {
func (o *CityBusAPIRealTimeNearStop2OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RealTimeNearStop/City/{City}][%d] cityBusApiRealTimeNearStop2OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStop2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3A2Data {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIRealTimeNearStop2Status299() *CityBusAPIRealTimeNearStop2Statu
return &CityBusAPIRealTimeNearStop2Status299{}
}
-/*CityBusAPIRealTimeNearStop2Status299 handles this case with default header values.
+/* CityBusAPIRealTimeNearStop2Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIRealTimeNearStop2Status299 struct {
func (o *CityBusAPIRealTimeNearStop2Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RealTimeNearStop/City/{City}][%d] cityBusApiRealTimeNearStop2Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStop2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIRealTimeNearStop2Status299) readResponse(response runtime.Cli
return nil
}
+
+// NewCityBusAPIRealTimeNearStop2NotModified creates a CityBusAPIRealTimeNearStop2NotModified with default headers values
+func NewCityBusAPIRealTimeNearStop2NotModified() *CityBusAPIRealTimeNearStop2NotModified {
+ return &CityBusAPIRealTimeNearStop2NotModified{}
+}
+
+/* CityBusAPIRealTimeNearStop2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeNearStop2NotModified struct {
+}
+
+func (o *CityBusAPIRealTimeNearStop2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/RealTimeNearStop/City/{City}][%d] cityBusApiRealTimeNearStop2NotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeNearStop2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_real_time_near_stop3_parameters.go b/bus/v3/client/city_bus/city_bus_api_real_time_near_stop3_parameters.go
index 495d443e..987dc715 100644
--- a/bus/v3/client/city_bus/city_bus_api_real_time_near_stop3_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_real_time_near_stop3_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRealTimeNearStop3Params creates a new CityBusAPIRealTimeNearStop3Params object
-// with the default values initialized.
+// NewCityBusAPIRealTimeNearStop3Params creates a new CityBusAPIRealTimeNearStop3Params 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 NewCityBusAPIRealTimeNearStop3Params() *CityBusAPIRealTimeNearStop3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop3Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRealTimeNearStop3ParamsWithTimeout creates a new CityBusAPIRealTimeNearStop3Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRealTimeNearStop3ParamsWithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStop3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop3Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRealTimeNearStop3ParamsWithContext creates a new CityBusAPIRealTimeNearStop3Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRealTimeNearStop3ParamsWithContext(ctx context.Context) *CityBusAPIRealTimeNearStop3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop3Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRealTimeNearStop3ParamsWithHTTPClient creates a new CityBusAPIRealTimeNearStop3Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRealTimeNearStop3ParamsWithHTTPClient(client *http.Client) *CityBusAPIRealTimeNearStop3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRealTimeNearStop3Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRealTimeNearStop3Params contains all the parameters to send to the API endpoint
-for the city bus Api real time near stop 3 operation typically these are written to a http.Request
+/* CityBusAPIRealTimeNearStop3Params contains all the parameters to send to the API endpoint
+ for the city bus Api real time near stop 3 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRealTimeNearStop3Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 欲查詢縣市
+ /* City.
+
+ 欲查詢縣市
*/
City string
- /*RouteName
- 繁體中文路線名稱,如'307'
+ /* RouteName.
+
+ 繁體中文路線名稱,如'307'
*/
RouteName string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -129,6 +127,32 @@ type CityBusAPIRealTimeNearStop3Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api real time near stop 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStop3Params) WithDefaults() *CityBusAPIRealTimeNearStop3Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api real time near stop 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRealTimeNearStop3Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRealTimeNearStop3Params{
+ 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 real time near stop 3 params
func (o *CityBusAPIRealTimeNearStop3Params) WithTimeout(timeout time.Duration) *CityBusAPIRealTimeNearStop3Params {
o.SetTimeout(timeout)
@@ -284,38 +308,41 @@ func (o *CityBusAPIRealTimeNearStop3Params) WriteToRequest(r runtime.ClientReque
// 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
}
@@ -325,64 +352,68 @@ func (o *CityBusAPIRealTimeNearStop3Params) WriteToRequest(r runtime.ClientReque
// 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
@@ -399,16 +430,17 @@ func (o *CityBusAPIRealTimeNearStop3Params) WriteToRequest(r runtime.ClientReque
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_real_time_near_stop3_responses.go b/bus/v3/client/city_bus/city_bus_api_real_time_near_stop3_responses.go
index 78f92361..15307b41 100644
--- a/bus/v3/client/city_bus/city_bus_api_real_time_near_stop3_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_real_time_near_stop3_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRealTimeNearStop3Reader) ReadResponse(response runtime.Client
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRealTimeNearStop3NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRealTimeNearStop3OK() *CityBusAPIRealTimeNearStop3OK {
return &CityBusAPIRealTimeNearStop3OK{}
}
-/*CityBusAPIRealTimeNearStop3OK handles this case with default header values.
+/* CityBusAPIRealTimeNearStop3OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRealTimeNearStop3OK struct {
func (o *CityBusAPIRealTimeNearStop3OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RealTimeNearStop/City/{City}/{RouteName}][%d] cityBusApiRealTimeNearStop3OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStop3OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3A2Data {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIRealTimeNearStop3Status299() *CityBusAPIRealTimeNearStop3Statu
return &CityBusAPIRealTimeNearStop3Status299{}
}
-/*CityBusAPIRealTimeNearStop3Status299 handles this case with default header values.
+/* CityBusAPIRealTimeNearStop3Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIRealTimeNearStop3Status299 struct {
func (o *CityBusAPIRealTimeNearStop3Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RealTimeNearStop/City/{City}/{RouteName}][%d] cityBusApiRealTimeNearStop3Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRealTimeNearStop3Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIRealTimeNearStop3Status299) readResponse(response runtime.Cli
return nil
}
+
+// NewCityBusAPIRealTimeNearStop3NotModified creates a CityBusAPIRealTimeNearStop3NotModified with default headers values
+func NewCityBusAPIRealTimeNearStop3NotModified() *CityBusAPIRealTimeNearStop3NotModified {
+ return &CityBusAPIRealTimeNearStop3NotModified{}
+}
+
+/* CityBusAPIRealTimeNearStop3NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRealTimeNearStop3NotModified struct {
+}
+
+func (o *CityBusAPIRealTimeNearStop3NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/RealTimeNearStop/City/{City}/{RouteName}][%d] cityBusApiRealTimeNearStop3NotModified ", 304)
+}
+
+func (o *CityBusAPIRealTimeNearStop3NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_route2_parameters.go b/bus/v3/client/city_bus/city_bus_api_route2_parameters.go
index cfbb991f..196481b9 100644
--- a/bus/v3/client/city_bus/city_bus_api_route2_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_route2_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRoute2Params creates a new CityBusAPIRoute2Params object
-// with the default values initialized.
+// NewCityBusAPIRoute2Params creates a new CityBusAPIRoute2Params 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 NewCityBusAPIRoute2Params() *CityBusAPIRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRoute2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRoute2ParamsWithTimeout creates a new CityBusAPIRoute2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRoute2ParamsWithTimeout(timeout time.Duration) *CityBusAPIRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRoute2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRoute2ParamsWithContext creates a new CityBusAPIRoute2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRoute2ParamsWithContext(ctx context.Context) *CityBusAPIRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRoute2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRoute2ParamsWithHTTPClient creates a new CityBusAPIRoute2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRoute2ParamsWithHTTPClient(client *http.Client) *CityBusAPIRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRoute2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRoute2Params contains all the parameters to send to the API endpoint
-for the city bus Api route 2 operation typically these are written to a http.Request
+/* CityBusAPIRoute2Params contains all the parameters to send to the API endpoint
+ for the city bus Api route 2 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRoute2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIRoute2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api route 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRoute2Params) WithDefaults() *CityBusAPIRoute2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api route 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRoute2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRoute2Params{
+ 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 route 2 params
func (o *CityBusAPIRoute2Params) WithTimeout(timeout time.Duration) *CityBusAPIRoute2Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIRoute2Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIRoute2Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIRoute2Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_route2_responses.go b/bus/v3/client/city_bus/city_bus_api_route2_responses.go
index ee9a71e9..960c36de 100644
--- a/bus/v3/client/city_bus/city_bus_api_route2_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_route2_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRoute2Reader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRoute2NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRoute2OK() *CityBusAPIRoute2OK {
return &CityBusAPIRoute2OK{}
}
-/*CityBusAPIRoute2OK handles this case with default header values.
+/* CityBusAPIRoute2OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRoute2OK struct {
func (o *CityBusAPIRoute2OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Route/City/{City}][%d] cityBusApiRoute2OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRoute2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Route {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIRoute2Status299() *CityBusAPIRoute2Status299 {
return &CityBusAPIRoute2Status299{}
}
-/*CityBusAPIRoute2Status299 handles this case with default header values.
+/* CityBusAPIRoute2Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIRoute2Status299 struct {
func (o *CityBusAPIRoute2Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Route/City/{City}][%d] cityBusApiRoute2Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRoute2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIRoute2Status299) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewCityBusAPIRoute2NotModified creates a CityBusAPIRoute2NotModified with default headers values
+func NewCityBusAPIRoute2NotModified() *CityBusAPIRoute2NotModified {
+ return &CityBusAPIRoute2NotModified{}
+}
+
+/* CityBusAPIRoute2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRoute2NotModified struct {
+}
+
+func (o *CityBusAPIRoute2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/Route/City/{City}][%d] cityBusApiRoute2NotModified ", 304)
+}
+
+func (o *CityBusAPIRoute2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_route_fare2_parameters.go b/bus/v3/client/city_bus/city_bus_api_route_fare2_parameters.go
index 760c3be0..9805bde0 100644
--- a/bus/v3/client/city_bus/city_bus_api_route_fare2_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_route_fare2_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRouteFare2Params creates a new CityBusAPIRouteFare2Params object
-// with the default values initialized.
+// NewCityBusAPIRouteFare2Params creates a new CityBusAPIRouteFare2Params 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 NewCityBusAPIRouteFare2Params() *CityBusAPIRouteFare2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFare2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRouteFare2ParamsWithTimeout creates a new CityBusAPIRouteFare2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRouteFare2ParamsWithTimeout(timeout time.Duration) *CityBusAPIRouteFare2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFare2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRouteFare2ParamsWithContext creates a new CityBusAPIRouteFare2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRouteFare2ParamsWithContext(ctx context.Context) *CityBusAPIRouteFare2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFare2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRouteFare2ParamsWithHTTPClient creates a new CityBusAPIRouteFare2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRouteFare2ParamsWithHTTPClient(client *http.Client) *CityBusAPIRouteFare2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteFare2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRouteFare2Params contains all the parameters to send to the API endpoint
-for the city bus Api route fare 2 operation typically these are written to a http.Request
+/* CityBusAPIRouteFare2Params contains all the parameters to send to the API endpoint
+ for the city bus Api route fare 2 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRouteFare2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIRouteFare2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api route fare 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRouteFare2Params) WithDefaults() *CityBusAPIRouteFare2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api route fare 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRouteFare2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRouteFare2Params{
+ 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 route fare 2 params
func (o *CityBusAPIRouteFare2Params) WithTimeout(timeout time.Duration) *CityBusAPIRouteFare2Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIRouteFare2Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIRouteFare2Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIRouteFare2Params) WriteToRequest(r runtime.ClientRequest, reg
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_route_fare2_responses.go b/bus/v3/client/city_bus/city_bus_api_route_fare2_responses.go
index bfbb3e39..70d42f60 100644
--- a/bus/v3/client/city_bus/city_bus_api_route_fare2_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_route_fare2_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRouteFare2Reader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRouteFare2NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRouteFare2OK() *CityBusAPIRouteFare2OK {
return &CityBusAPIRouteFare2OK{}
}
-/*CityBusAPIRouteFare2OK handles this case with default header values.
+/* CityBusAPIRouteFare2OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRouteFare2OK struct {
func (o *CityBusAPIRouteFare2OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RouteFare/City/{City}][%d] cityBusApiRouteFare2OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRouteFare2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3RouteFare {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIRouteFare2Status299() *CityBusAPIRouteFare2Status299 {
return &CityBusAPIRouteFare2Status299{}
}
-/*CityBusAPIRouteFare2Status299 handles this case with default header values.
+/* CityBusAPIRouteFare2Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIRouteFare2Status299 struct {
func (o *CityBusAPIRouteFare2Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RouteFare/City/{City}][%d] cityBusApiRouteFare2Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRouteFare2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIRouteFare2Status299) readResponse(response runtime.ClientResp
return nil
}
+
+// NewCityBusAPIRouteFare2NotModified creates a CityBusAPIRouteFare2NotModified with default headers values
+func NewCityBusAPIRouteFare2NotModified() *CityBusAPIRouteFare2NotModified {
+ return &CityBusAPIRouteFare2NotModified{}
+}
+
+/* CityBusAPIRouteFare2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRouteFare2NotModified struct {
+}
+
+func (o *CityBusAPIRouteFare2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/RouteFare/City/{City}][%d] cityBusApiRouteFare2NotModified ", 304)
+}
+
+func (o *CityBusAPIRouteFare2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_route_network_parameters.go b/bus/v3/client/city_bus/city_bus_api_route_network_parameters.go
index a43ab537..66e0fac3 100644
--- a/bus/v3/client/city_bus/city_bus_api_route_network_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_route_network_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIRouteNetworkParams creates a new CityBusAPIRouteNetworkParams object
-// with the default values initialized.
+// NewCityBusAPIRouteNetworkParams creates a new CityBusAPIRouteNetworkParams 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 NewCityBusAPIRouteNetworkParams() *CityBusAPIRouteNetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteNetworkParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIRouteNetworkParamsWithTimeout creates a new CityBusAPIRouteNetworkParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIRouteNetworkParamsWithTimeout(timeout time.Duration) *CityBusAPIRouteNetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteNetworkParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIRouteNetworkParamsWithContext creates a new CityBusAPIRouteNetworkParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIRouteNetworkParamsWithContext(ctx context.Context) *CityBusAPIRouteNetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteNetworkParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIRouteNetworkParamsWithHTTPClient creates a new CityBusAPIRouteNetworkParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIRouteNetworkParamsWithHTTPClient(client *http.Client) *CityBusAPIRouteNetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIRouteNetworkParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIRouteNetworkParams contains all the parameters to send to the API endpoint
-for the city bus Api route network operation typically these are written to a http.Request
+/* CityBusAPIRouteNetworkParams contains all the parameters to send to the API endpoint
+ for the city bus Api route network operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIRouteNetworkParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIRouteNetworkParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api route network params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRouteNetworkParams) WithDefaults() *CityBusAPIRouteNetworkParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api route network params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIRouteNetworkParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIRouteNetworkParams{
+ 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 route network params
func (o *CityBusAPIRouteNetworkParams) WithTimeout(timeout time.Duration) *CityBusAPIRouteNetworkParams {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIRouteNetworkParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIRouteNetworkParams) WriteToRequest(r runtime.ClientRequest, r
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIRouteNetworkParams) WriteToRequest(r runtime.ClientRequest, r
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_route_network_responses.go b/bus/v3/client/city_bus/city_bus_api_route_network_responses.go
index 7a86caf8..d7b5451e 100644
--- a/bus/v3/client/city_bus/city_bus_api_route_network_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_route_network_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIRouteNetworkReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIRouteNetworkNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIRouteNetworkOK() *CityBusAPIRouteNetworkOK {
return &CityBusAPIRouteNetworkOK{}
}
-/*CityBusAPIRouteNetworkOK handles this case with default header values.
+/* CityBusAPIRouteNetworkOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIRouteNetworkOK struct {
func (o *CityBusAPIRouteNetworkOK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RouteNetwork/City/{City}][%d] cityBusApiRouteNetworkOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIRouteNetworkOK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3RouteNetwork {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIRouteNetworkStatus299() *CityBusAPIRouteNetworkStatus299 {
return &CityBusAPIRouteNetworkStatus299{}
}
-/*CityBusAPIRouteNetworkStatus299 handles this case with default header values.
+/* CityBusAPIRouteNetworkStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIRouteNetworkStatus299 struct {
func (o *CityBusAPIRouteNetworkStatus299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/RouteNetwork/City/{City}][%d] cityBusApiRouteNetworkStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIRouteNetworkStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIRouteNetworkStatus299) readResponse(response runtime.ClientRe
return nil
}
+
+// NewCityBusAPIRouteNetworkNotModified creates a CityBusAPIRouteNetworkNotModified with default headers values
+func NewCityBusAPIRouteNetworkNotModified() *CityBusAPIRouteNetworkNotModified {
+ return &CityBusAPIRouteNetworkNotModified{}
+}
+
+/* CityBusAPIRouteNetworkNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIRouteNetworkNotModified struct {
+}
+
+func (o *CityBusAPIRouteNetworkNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/RouteNetwork/City/{City}][%d] cityBusApiRouteNetworkNotModified ", 304)
+}
+
+func (o *CityBusAPIRouteNetworkNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_s2_s_travel_time1_parameters.go b/bus/v3/client/city_bus/city_bus_api_s2_s_travel_time1_parameters.go
index fd129bf9..e5c1aae9 100644
--- a/bus/v3/client/city_bus/city_bus_api_s2_s_travel_time1_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_s2_s_travel_time1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIS2STravelTime1Params creates a new CityBusAPIS2STravelTime1Params object
-// with the default values initialized.
+// NewCityBusAPIS2STravelTime1Params creates a new CityBusAPIS2STravelTime1Params 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 NewCityBusAPIS2STravelTime1Params() *CityBusAPIS2STravelTime1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIS2STravelTime1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIS2STravelTime1ParamsWithTimeout creates a new CityBusAPIS2STravelTime1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIS2STravelTime1ParamsWithTimeout(timeout time.Duration) *CityBusAPIS2STravelTime1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIS2STravelTime1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIS2STravelTime1ParamsWithContext creates a new CityBusAPIS2STravelTime1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIS2STravelTime1ParamsWithContext(ctx context.Context) *CityBusAPIS2STravelTime1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIS2STravelTime1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIS2STravelTime1ParamsWithHTTPClient creates a new CityBusAPIS2STravelTime1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIS2STravelTime1ParamsWithHTTPClient(client *http.Client) *CityBusAPIS2STravelTime1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIS2STravelTime1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIS2STravelTime1Params contains all the parameters to send to the API endpoint
-for the city bus Api s2 s travel time 1 operation typically these are written to a http.Request
+/* CityBusAPIS2STravelTime1Params contains all the parameters to send to the API endpoint
+ for the city bus Api s2 s travel time 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIS2STravelTime1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIS2STravelTime1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api s2 s travel time 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIS2STravelTime1Params) WithDefaults() *CityBusAPIS2STravelTime1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api s2 s travel time 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIS2STravelTime1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIS2STravelTime1Params{
+ 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 s2 s travel time 1 params
func (o *CityBusAPIS2STravelTime1Params) WithTimeout(timeout time.Duration) *CityBusAPIS2STravelTime1Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIS2STravelTime1Params) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIS2STravelTime1Params) WriteToRequest(r runtime.ClientRequest,
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIS2STravelTime1Params) WriteToRequest(r runtime.ClientRequest,
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_s2_s_travel_time1_responses.go b/bus/v3/client/city_bus/city_bus_api_s2_s_travel_time1_responses.go
index 217e8b4c..036fb895 100644
--- a/bus/v3/client/city_bus/city_bus_api_s2_s_travel_time1_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_s2_s_travel_time1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIS2STravelTime1Reader) ReadResponse(response runtime.ClientRes
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIS2STravelTime1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIS2STravelTime1OK() *CityBusAPIS2STravelTime1OK {
return &CityBusAPIS2STravelTime1OK{}
}
-/*CityBusAPIS2STravelTime1OK handles this case with default header values.
+/* CityBusAPIS2STravelTime1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIS2STravelTime1OK struct {
func (o *CityBusAPIS2STravelTime1OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/S2STravelTime/City/{City}][%d] cityBusApiS2STravelTime1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIS2STravelTime1OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3S2STravelTime {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIS2STravelTime1Status299() *CityBusAPIS2STravelTime1Status299 {
return &CityBusAPIS2STravelTime1Status299{}
}
-/*CityBusAPIS2STravelTime1Status299 handles this case with default header values.
+/* CityBusAPIS2STravelTime1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIS2STravelTime1Status299 struct {
func (o *CityBusAPIS2STravelTime1Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/S2STravelTime/City/{City}][%d] cityBusApiS2STravelTime1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIS2STravelTime1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIS2STravelTime1Status299) readResponse(response runtime.Client
return nil
}
+
+// NewCityBusAPIS2STravelTime1NotModified creates a CityBusAPIS2STravelTime1NotModified with default headers values
+func NewCityBusAPIS2STravelTime1NotModified() *CityBusAPIS2STravelTime1NotModified {
+ return &CityBusAPIS2STravelTime1NotModified{}
+}
+
+/* CityBusAPIS2STravelTime1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIS2STravelTime1NotModified struct {
+}
+
+func (o *CityBusAPIS2STravelTime1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/S2STravelTime/City/{City}][%d] cityBusApiS2STravelTime1NotModified ", 304)
+}
+
+func (o *CityBusAPIS2STravelTime1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_schedule2_parameters.go b/bus/v3/client/city_bus/city_bus_api_schedule2_parameters.go
index b3d0edcb..18bbab7e 100644
--- a/bus/v3/client/city_bus/city_bus_api_schedule2_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_schedule2_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPISchedule2Params creates a new CityBusAPISchedule2Params object
-// with the default values initialized.
+// NewCityBusAPISchedule2Params creates a new CityBusAPISchedule2Params 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 NewCityBusAPISchedule2Params() *CityBusAPISchedule2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISchedule2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPISchedule2ParamsWithTimeout creates a new CityBusAPISchedule2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPISchedule2ParamsWithTimeout(timeout time.Duration) *CityBusAPISchedule2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISchedule2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPISchedule2ParamsWithContext creates a new CityBusAPISchedule2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPISchedule2ParamsWithContext(ctx context.Context) *CityBusAPISchedule2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISchedule2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPISchedule2ParamsWithHTTPClient creates a new CityBusAPISchedule2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPISchedule2ParamsWithHTTPClient(client *http.Client) *CityBusAPISchedule2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISchedule2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPISchedule2Params contains all the parameters to send to the API endpoint
-for the city bus Api schedule 2 operation typically these are written to a http.Request
+/* CityBusAPISchedule2Params contains all the parameters to send to the API endpoint
+ for the city bus Api schedule 2 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPISchedule2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPISchedule2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api schedule 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPISchedule2Params) WithDefaults() *CityBusAPISchedule2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api schedule 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPISchedule2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPISchedule2Params{
+ 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 schedule 2 params
func (o *CityBusAPISchedule2Params) WithTimeout(timeout time.Duration) *CityBusAPISchedule2Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPISchedule2Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPISchedule2Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPISchedule2Params) WriteToRequest(r runtime.ClientRequest, reg
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_schedule2_responses.go b/bus/v3/client/city_bus/city_bus_api_schedule2_responses.go
index 9f203205..7bc66313 100644
--- a/bus/v3/client/city_bus/city_bus_api_schedule2_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_schedule2_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPISchedule2Reader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPISchedule2NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPISchedule2OK() *CityBusAPISchedule2OK {
return &CityBusAPISchedule2OK{}
}
-/*CityBusAPISchedule2OK handles this case with default header values.
+/* CityBusAPISchedule2OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPISchedule2OK struct {
func (o *CityBusAPISchedule2OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Schedule/City/{City}][%d] cityBusApiSchedule2OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPISchedule2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusGWrapperPTXServiceDTOBusSpecificationV3Schedule {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPISchedule2Status299() *CityBusAPISchedule2Status299 {
return &CityBusAPISchedule2Status299{}
}
-/*CityBusAPISchedule2Status299 handles this case with default header values.
+/* CityBusAPISchedule2Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPISchedule2Status299 struct {
func (o *CityBusAPISchedule2Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Schedule/City/{City}][%d] cityBusApiSchedule2Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPISchedule2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPISchedule2Status299) readResponse(response runtime.ClientRespo
return nil
}
+
+// NewCityBusAPISchedule2NotModified creates a CityBusAPISchedule2NotModified with default headers values
+func NewCityBusAPISchedule2NotModified() *CityBusAPISchedule2NotModified {
+ return &CityBusAPISchedule2NotModified{}
+}
+
+/* CityBusAPISchedule2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPISchedule2NotModified struct {
+}
+
+func (o *CityBusAPISchedule2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/Schedule/City/{City}][%d] cityBusApiSchedule2NotModified ", 304)
+}
+
+func (o *CityBusAPISchedule2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_shape2_parameters.go b/bus/v3/client/city_bus/city_bus_api_shape2_parameters.go
index b355ac79..95143190 100644
--- a/bus/v3/client/city_bus/city_bus_api_shape2_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_shape2_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIShape2Params creates a new CityBusAPIShape2Params object
-// with the default values initialized.
+// NewCityBusAPIShape2Params creates a new CityBusAPIShape2Params 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 NewCityBusAPIShape2Params() *CityBusAPIShape2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShape2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIShape2ParamsWithTimeout creates a new CityBusAPIShape2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIShape2ParamsWithTimeout(timeout time.Duration) *CityBusAPIShape2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShape2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIShape2ParamsWithContext creates a new CityBusAPIShape2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIShape2ParamsWithContext(ctx context.Context) *CityBusAPIShape2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShape2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIShape2ParamsWithHTTPClient creates a new CityBusAPIShape2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIShape2ParamsWithHTTPClient(client *http.Client) *CityBusAPIShape2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIShape2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIShape2Params contains all the parameters to send to the API endpoint
-for the city bus Api shape 2 operation typically these are written to a http.Request
+/* CityBusAPIShape2Params contains all the parameters to send to the API endpoint
+ for the city bus Api shape 2 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIShape2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIShape2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api shape 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIShape2Params) WithDefaults() *CityBusAPIShape2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api shape 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIShape2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIShape2Params{
+ 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 shape 2 params
func (o *CityBusAPIShape2Params) WithTimeout(timeout time.Duration) *CityBusAPIShape2Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIShape2Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIShape2Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIShape2Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_shape2_responses.go b/bus/v3/client/city_bus/city_bus_api_shape2_responses.go
index dcef69ec..94ce66c4 100644
--- a/bus/v3/client/city_bus/city_bus_api_shape2_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_shape2_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIShape2Reader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIShape2NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIShape2OK() *CityBusAPIShape2OK {
return &CityBusAPIShape2OK{}
}
-/*CityBusAPIShape2OK handles this case with default header values.
+/* CityBusAPIShape2OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIShape2OK struct {
func (o *CityBusAPIShape2OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Shape/City/{City}][%d] cityBusApiShape2OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIShape2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Shape {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIShape2Status299() *CityBusAPIShape2Status299 {
return &CityBusAPIShape2Status299{}
}
-/*CityBusAPIShape2Status299 handles this case with default header values.
+/* CityBusAPIShape2Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIShape2Status299 struct {
func (o *CityBusAPIShape2Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Shape/City/{City}][%d] cityBusApiShape2Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIShape2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIShape2Status299) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewCityBusAPIShape2NotModified creates a CityBusAPIShape2NotModified with default headers values
+func NewCityBusAPIShape2NotModified() *CityBusAPIShape2NotModified {
+ return &CityBusAPIShape2NotModified{}
+}
+
+/* CityBusAPIShape2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIShape2NotModified struct {
+}
+
+func (o *CityBusAPIShape2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/Shape/City/{City}][%d] cityBusApiShape2NotModified ", 304)
+}
+
+func (o *CityBusAPIShape2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_station1_parameters.go b/bus/v3/client/city_bus/city_bus_api_station1_parameters.go
index 98a57236..91da3221 100644
--- a/bus/v3/client/city_bus/city_bus_api_station1_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_station1_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIStation1Params creates a new CityBusAPIStation1Params object
-// with the default values initialized.
+// NewCityBusAPIStation1Params creates a new CityBusAPIStation1Params 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 NewCityBusAPIStation1Params() *CityBusAPIStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStation1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIStation1ParamsWithTimeout creates a new CityBusAPIStation1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIStation1ParamsWithTimeout(timeout time.Duration) *CityBusAPIStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStation1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIStation1ParamsWithContext creates a new CityBusAPIStation1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIStation1ParamsWithContext(ctx context.Context) *CityBusAPIStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStation1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIStation1ParamsWithHTTPClient creates a new CityBusAPIStation1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIStation1ParamsWithHTTPClient(client *http.Client) *CityBusAPIStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStation1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIStation1Params contains all the parameters to send to the API endpoint
-for the city bus Api station 1 operation typically these are written to a http.Request
+/* CityBusAPIStation1Params contains all the parameters to send to the API endpoint
+ for the city bus Api station 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIStation1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -129,6 +127,32 @@ type CityBusAPIStation1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api station 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStation1Params) WithDefaults() *CityBusAPIStation1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api station 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStation1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIStation1Params{
+ 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 station 1 params
func (o *CityBusAPIStation1Params) WithTimeout(timeout time.Duration) *CityBusAPIStation1Params {
o.SetTimeout(timeout)
@@ -284,38 +308,41 @@ func (o *CityBusAPIStation1Params) WriteToRequest(r runtime.ClientRequest, reg s
// 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
}
@@ -325,80 +352,85 @@ func (o *CityBusAPIStation1Params) WriteToRequest(r runtime.ClientRequest, reg s
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -410,16 +442,17 @@ func (o *CityBusAPIStation1Params) WriteToRequest(r runtime.ClientRequest, reg s
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_station1_responses.go b/bus/v3/client/city_bus/city_bus_api_station1_responses.go
index 1453ff48..cd447cc7 100644
--- a/bus/v3/client/city_bus/city_bus_api_station1_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_station1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIStation1Reader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIStation1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIStation1OK() *CityBusAPIStation1OK {
return &CityBusAPIStation1OK{}
}
-/*CityBusAPIStation1OK handles this case with default header values.
+/* CityBusAPIStation1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIStation1OK struct {
func (o *CityBusAPIStation1OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Station/City/{City}][%d] cityBusApiStation1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIStation1OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Station {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIStation1Status299() *CityBusAPIStation1Status299 {
return &CityBusAPIStation1Status299{}
}
-/*CityBusAPIStation1Status299 handles this case with default header values.
+/* CityBusAPIStation1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIStation1Status299 struct {
func (o *CityBusAPIStation1Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Station/City/{City}][%d] cityBusApiStation1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIStation1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIStation1Status299) readResponse(response runtime.ClientRespon
return nil
}
+
+// NewCityBusAPIStation1NotModified creates a CityBusAPIStation1NotModified with default headers values
+func NewCityBusAPIStation1NotModified() *CityBusAPIStation1NotModified {
+ return &CityBusAPIStation1NotModified{}
+}
+
+/* CityBusAPIStation1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIStation1NotModified struct {
+}
+
+func (o *CityBusAPIStation1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/Station/City/{City}][%d] cityBusApiStation1NotModified ", 304)
+}
+
+func (o *CityBusAPIStation1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_stop1_parameters.go b/bus/v3/client/city_bus/city_bus_api_stop1_parameters.go
index f6a54fa5..054e9c8e 100644
--- a/bus/v3/client/city_bus/city_bus_api_stop1_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_stop1_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIStop1Params creates a new CityBusAPIStop1Params object
-// with the default values initialized.
+// NewCityBusAPIStop1Params creates a new CityBusAPIStop1Params 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 NewCityBusAPIStop1Params() *CityBusAPIStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStop1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIStop1ParamsWithTimeout creates a new CityBusAPIStop1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIStop1ParamsWithTimeout(timeout time.Duration) *CityBusAPIStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStop1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIStop1ParamsWithContext creates a new CityBusAPIStop1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIStop1ParamsWithContext(ctx context.Context) *CityBusAPIStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStop1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIStop1ParamsWithHTTPClient creates a new CityBusAPIStop1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIStop1ParamsWithHTTPClient(client *http.Client) *CityBusAPIStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStop1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIStop1Params contains all the parameters to send to the API endpoint
-for the city bus Api stop 1 operation typically these are written to a http.Request
+/* CityBusAPIStop1Params contains all the parameters to send to the API endpoint
+ for the city bus Api stop 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIStop1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -129,6 +127,32 @@ type CityBusAPIStop1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api stop 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStop1Params) WithDefaults() *CityBusAPIStop1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api stop 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStop1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIStop1Params{
+ 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 stop 1 params
func (o *CityBusAPIStop1Params) WithTimeout(timeout time.Duration) *CityBusAPIStop1Params {
o.SetTimeout(timeout)
@@ -284,38 +308,41 @@ func (o *CityBusAPIStop1Params) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -325,80 +352,85 @@ func (o *CityBusAPIStop1Params) WriteToRequest(r runtime.ClientRequest, reg strf
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
@@ -410,16 +442,17 @@ func (o *CityBusAPIStop1Params) WriteToRequest(r runtime.ClientRequest, reg strf
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_stop1_responses.go b/bus/v3/client/city_bus/city_bus_api_stop1_responses.go
index e59913a1..c8af8102 100644
--- a/bus/v3/client/city_bus/city_bus_api_stop1_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_stop1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIStop1Reader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIStop1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIStop1OK() *CityBusAPIStop1OK {
return &CityBusAPIStop1OK{}
}
-/*CityBusAPIStop1OK handles this case with default header values.
+/* CityBusAPIStop1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIStop1OK struct {
func (o *CityBusAPIStop1OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Stop/City/{City}][%d] cityBusApiStop1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIStop1OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Stop {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIStop1Status299() *CityBusAPIStop1Status299 {
return &CityBusAPIStop1Status299{}
}
-/*CityBusAPIStop1Status299 handles this case with default header values.
+/* CityBusAPIStop1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIStop1Status299 struct {
func (o *CityBusAPIStop1Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Stop/City/{City}][%d] cityBusApiStop1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIStop1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIStop1Status299) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewCityBusAPIStop1NotModified creates a CityBusAPIStop1NotModified with default headers values
+func NewCityBusAPIStop1NotModified() *CityBusAPIStop1NotModified {
+ return &CityBusAPIStop1NotModified{}
+}
+
+/* CityBusAPIStop1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIStop1NotModified struct {
+}
+
+func (o *CityBusAPIStop1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/Stop/City/{City}][%d] cityBusApiStop1NotModified ", 304)
+}
+
+func (o *CityBusAPIStop1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_stop_of_route2_parameters.go b/bus/v3/client/city_bus/city_bus_api_stop_of_route2_parameters.go
index 01c3079d..09ae1de1 100644
--- a/bus/v3/client/city_bus/city_bus_api_stop_of_route2_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_stop_of_route2_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIStopOfRoute2Params creates a new CityBusAPIStopOfRoute2Params object
-// with the default values initialized.
+// NewCityBusAPIStopOfRoute2Params creates a new CityBusAPIStopOfRoute2Params 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 NewCityBusAPIStopOfRoute2Params() *CityBusAPIStopOfRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRoute2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIStopOfRoute2ParamsWithTimeout creates a new CityBusAPIStopOfRoute2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIStopOfRoute2ParamsWithTimeout(timeout time.Duration) *CityBusAPIStopOfRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRoute2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIStopOfRoute2ParamsWithContext creates a new CityBusAPIStopOfRoute2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIStopOfRoute2ParamsWithContext(ctx context.Context) *CityBusAPIStopOfRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRoute2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIStopOfRoute2ParamsWithHTTPClient creates a new CityBusAPIStopOfRoute2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIStopOfRoute2ParamsWithHTTPClient(client *http.Client) *CityBusAPIStopOfRoute2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIStopOfRoute2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIStopOfRoute2Params contains all the parameters to send to the API endpoint
-for the city bus Api stop of route 2 operation typically these are written to a http.Request
+/* CityBusAPIStopOfRoute2Params contains all the parameters to send to the API endpoint
+ for the city bus Api stop of route 2 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIStopOfRoute2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIStopOfRoute2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api stop of route 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStopOfRoute2Params) WithDefaults() *CityBusAPIStopOfRoute2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api stop of route 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIStopOfRoute2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIStopOfRoute2Params{
+ 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 stop of route 2 params
func (o *CityBusAPIStopOfRoute2Params) WithTimeout(timeout time.Duration) *CityBusAPIStopOfRoute2Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIStopOfRoute2Params) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIStopOfRoute2Params) WriteToRequest(r runtime.ClientRequest, r
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIStopOfRoute2Params) WriteToRequest(r runtime.ClientRequest, r
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_stop_of_route2_responses.go b/bus/v3/client/city_bus/city_bus_api_stop_of_route2_responses.go
index 6b7a8f8f..eb21d208 100644
--- a/bus/v3/client/city_bus/city_bus_api_stop_of_route2_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_stop_of_route2_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIStopOfRoute2Reader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIStopOfRoute2NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIStopOfRoute2OK() *CityBusAPIStopOfRoute2OK {
return &CityBusAPIStopOfRoute2OK{}
}
-/*CityBusAPIStopOfRoute2OK handles this case with default header values.
+/* CityBusAPIStopOfRoute2OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIStopOfRoute2OK struct {
func (o *CityBusAPIStopOfRoute2OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/StopOfRoute/City/{City}][%d] cityBusApiStopOfRoute2OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIStopOfRoute2OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3StopOfRoute {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIStopOfRoute2Status299() *CityBusAPIStopOfRoute2Status299 {
return &CityBusAPIStopOfRoute2Status299{}
}
-/*CityBusAPIStopOfRoute2Status299 handles this case with default header values.
+/* CityBusAPIStopOfRoute2Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIStopOfRoute2Status299 struct {
func (o *CityBusAPIStopOfRoute2Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/StopOfRoute/City/{City}][%d] cityBusApiStopOfRoute2Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIStopOfRoute2Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIStopOfRoute2Status299) readResponse(response runtime.ClientRe
return nil
}
+
+// NewCityBusAPIStopOfRoute2NotModified creates a CityBusAPIStopOfRoute2NotModified with default headers values
+func NewCityBusAPIStopOfRoute2NotModified() *CityBusAPIStopOfRoute2NotModified {
+ return &CityBusAPIStopOfRoute2NotModified{}
+}
+
+/* CityBusAPIStopOfRoute2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIStopOfRoute2NotModified struct {
+}
+
+func (o *CityBusAPIStopOfRoute2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/StopOfRoute/City/{City}][%d] cityBusApiStopOfRoute2NotModified ", 304)
+}
+
+func (o *CityBusAPIStopOfRoute2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_sub_route_parameters.go b/bus/v3/client/city_bus/city_bus_api_sub_route_parameters.go
index 0ae0bab5..43f89284 100644
--- a/bus/v3/client/city_bus/city_bus_api_sub_route_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_sub_route_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPISubRouteParams creates a new CityBusAPISubRouteParams object
-// with the default values initialized.
+// NewCityBusAPISubRouteParams creates a new CityBusAPISubRouteParams 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 NewCityBusAPISubRouteParams() *CityBusAPISubRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISubRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPISubRouteParamsWithTimeout creates a new CityBusAPISubRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPISubRouteParamsWithTimeout(timeout time.Duration) *CityBusAPISubRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISubRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPISubRouteParamsWithContext creates a new CityBusAPISubRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPISubRouteParamsWithContext(ctx context.Context) *CityBusAPISubRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISubRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPISubRouteParamsWithHTTPClient creates a new CityBusAPISubRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPISubRouteParamsWithHTTPClient(client *http.Client) *CityBusAPISubRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPISubRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPISubRouteParams contains all the parameters to send to the API endpoint
-for the city bus Api sub route operation typically these are written to a http.Request
+/* CityBusAPISubRouteParams contains all the parameters to send to the API endpoint
+ for the city bus Api sub route operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPISubRouteParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPISubRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api sub route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPISubRouteParams) WithDefaults() *CityBusAPISubRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api sub route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPISubRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPISubRouteParams{
+ 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 sub route params
func (o *CityBusAPISubRouteParams) WithTimeout(timeout time.Duration) *CityBusAPISubRouteParams {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPISubRouteParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPISubRouteParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPISubRouteParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_sub_route_responses.go b/bus/v3/client/city_bus/city_bus_api_sub_route_responses.go
index 172a9e47..c94b13a9 100644
--- a/bus/v3/client/city_bus/city_bus_api_sub_route_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_sub_route_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPISubRouteReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPISubRouteNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPISubRouteOK() *CityBusAPISubRouteOK {
return &CityBusAPISubRouteOK{}
}
-/*CityBusAPISubRouteOK handles this case with default header values.
+/* CityBusAPISubRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPISubRouteOK struct {
func (o *CityBusAPISubRouteOK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/SubRoute/City/{City}][%d] cityBusApiSubRouteOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPISubRouteOK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3SubRoute {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPISubRouteStatus299() *CityBusAPISubRouteStatus299 {
return &CityBusAPISubRouteStatus299{}
}
-/*CityBusAPISubRouteStatus299 handles this case with default header values.
+/* CityBusAPISubRouteStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPISubRouteStatus299 struct {
func (o *CityBusAPISubRouteStatus299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/SubRoute/City/{City}][%d] cityBusApiSubRouteStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPISubRouteStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPISubRouteStatus299) readResponse(response runtime.ClientRespon
return nil
}
+
+// NewCityBusAPISubRouteNotModified creates a CityBusAPISubRouteNotModified with default headers values
+func NewCityBusAPISubRouteNotModified() *CityBusAPISubRouteNotModified {
+ return &CityBusAPISubRouteNotModified{}
+}
+
+/* CityBusAPISubRouteNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPISubRouteNotModified struct {
+}
+
+func (o *CityBusAPISubRouteNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/SubRoute/City/{City}][%d] cityBusApiSubRouteNotModified ", 304)
+}
+
+func (o *CityBusAPISubRouteNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_vehicle1_parameters.go b/bus/v3/client/city_bus/city_bus_api_vehicle1_parameters.go
index d70e5490..94db1fc0 100644
--- a/bus/v3/client/city_bus/city_bus_api_vehicle1_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_vehicle1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIVehicle1Params creates a new CityBusAPIVehicle1Params object
-// with the default values initialized.
+// NewCityBusAPIVehicle1Params creates a new CityBusAPIVehicle1Params 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 NewCityBusAPIVehicle1Params() *CityBusAPIVehicle1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicle1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIVehicle1ParamsWithTimeout creates a new CityBusAPIVehicle1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIVehicle1ParamsWithTimeout(timeout time.Duration) *CityBusAPIVehicle1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicle1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIVehicle1ParamsWithContext creates a new CityBusAPIVehicle1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIVehicle1ParamsWithContext(ctx context.Context) *CityBusAPIVehicle1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicle1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIVehicle1ParamsWithHTTPClient creates a new CityBusAPIVehicle1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIVehicle1ParamsWithHTTPClient(client *http.Client) *CityBusAPIVehicle1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicle1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIVehicle1Params contains all the parameters to send to the API endpoint
-for the city bus Api vehicle 1 operation typically these are written to a http.Request
+/* CityBusAPIVehicle1Params contains all the parameters to send to the API endpoint
+ for the city bus Api vehicle 1 operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIVehicle1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIVehicle1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api vehicle 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIVehicle1Params) WithDefaults() *CityBusAPIVehicle1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api vehicle 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIVehicle1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIVehicle1Params{
+ 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 vehicle 1 params
func (o *CityBusAPIVehicle1Params) WithTimeout(timeout time.Duration) *CityBusAPIVehicle1Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIVehicle1Params) WriteToRequest(r runtime.ClientRequest, reg s
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIVehicle1Params) WriteToRequest(r runtime.ClientRequest, reg s
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIVehicle1Params) WriteToRequest(r runtime.ClientRequest, reg s
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_vehicle1_responses.go b/bus/v3/client/city_bus/city_bus_api_vehicle1_responses.go
index f6ceab14..4e9f971c 100644
--- a/bus/v3/client/city_bus/city_bus_api_vehicle1_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_vehicle1_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIVehicle1Reader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIVehicle1NotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIVehicle1OK() *CityBusAPIVehicle1OK {
return &CityBusAPIVehicle1OK{}
}
-/*CityBusAPIVehicle1OK handles this case with default header values.
+/* CityBusAPIVehicle1OK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIVehicle1OK struct {
func (o *CityBusAPIVehicle1OK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Vehicle/City/{City}][%d] cityBusApiVehicle1OK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIVehicle1OK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Vehicle {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIVehicle1Status299() *CityBusAPIVehicle1Status299 {
return &CityBusAPIVehicle1Status299{}
}
-/*CityBusAPIVehicle1Status299 handles this case with default header values.
+/* CityBusAPIVehicle1Status299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIVehicle1Status299 struct {
func (o *CityBusAPIVehicle1Status299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/Vehicle/City/{City}][%d] cityBusApiVehicle1Status299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIVehicle1Status299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIVehicle1Status299) readResponse(response runtime.ClientRespon
return nil
}
+
+// NewCityBusAPIVehicle1NotModified creates a CityBusAPIVehicle1NotModified with default headers values
+func NewCityBusAPIVehicle1NotModified() *CityBusAPIVehicle1NotModified {
+ return &CityBusAPIVehicle1NotModified{}
+}
+
+/* CityBusAPIVehicle1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIVehicle1NotModified struct {
+}
+
+func (o *CityBusAPIVehicle1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/Vehicle/City/{City}][%d] cityBusApiVehicle1NotModified ", 304)
+}
+
+func (o *CityBusAPIVehicle1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_vehicle_depot_parameters.go b/bus/v3/client/city_bus/city_bus_api_vehicle_depot_parameters.go
index b8415635..9ba5a539 100644
--- a/bus/v3/client/city_bus/city_bus_api_vehicle_depot_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_vehicle_depot_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIVehicleDepotParams creates a new CityBusAPIVehicleDepotParams object
-// with the default values initialized.
+// NewCityBusAPIVehicleDepotParams creates a new CityBusAPIVehicleDepotParams 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 NewCityBusAPIVehicleDepotParams() *CityBusAPIVehicleDepotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleDepotParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIVehicleDepotParamsWithTimeout creates a new CityBusAPIVehicleDepotParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIVehicleDepotParamsWithTimeout(timeout time.Duration) *CityBusAPIVehicleDepotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleDepotParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIVehicleDepotParamsWithContext creates a new CityBusAPIVehicleDepotParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIVehicleDepotParamsWithContext(ctx context.Context) *CityBusAPIVehicleDepotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleDepotParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIVehicleDepotParamsWithHTTPClient creates a new CityBusAPIVehicleDepotParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIVehicleDepotParamsWithHTTPClient(client *http.Client) *CityBusAPIVehicleDepotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleDepotParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIVehicleDepotParams contains all the parameters to send to the API endpoint
-for the city bus Api vehicle depot operation typically these are written to a http.Request
+/* CityBusAPIVehicleDepotParams contains all the parameters to send to the API endpoint
+ for the city bus Api vehicle depot operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIVehicleDepotParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIVehicleDepotParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api vehicle depot params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIVehicleDepotParams) WithDefaults() *CityBusAPIVehicleDepotParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api vehicle depot params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIVehicleDepotParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIVehicleDepotParams{
+ 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 vehicle depot params
func (o *CityBusAPIVehicleDepotParams) WithTimeout(timeout time.Duration) *CityBusAPIVehicleDepotParams {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIVehicleDepotParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIVehicleDepotParams) WriteToRequest(r runtime.ClientRequest, r
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIVehicleDepotParams) WriteToRequest(r runtime.ClientRequest, r
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_vehicle_depot_responses.go b/bus/v3/client/city_bus/city_bus_api_vehicle_depot_responses.go
index f1a894c0..19fbf2c1 100644
--- a/bus/v3/client/city_bus/city_bus_api_vehicle_depot_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_vehicle_depot_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIVehicleDepotReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIVehicleDepotNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIVehicleDepotOK() *CityBusAPIVehicleDepotOK {
return &CityBusAPIVehicleDepotOK{}
}
-/*CityBusAPIVehicleDepotOK handles this case with default header values.
+/* CityBusAPIVehicleDepotOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIVehicleDepotOK struct {
func (o *CityBusAPIVehicleDepotOK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/VehicleDepot/City/{City}][%d] cityBusApiVehicleDepotOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIVehicleDepotOK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3VehicleDepot {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIVehicleDepotStatus299() *CityBusAPIVehicleDepotStatus299 {
return &CityBusAPIVehicleDepotStatus299{}
}
-/*CityBusAPIVehicleDepotStatus299 handles this case with default header values.
+/* CityBusAPIVehicleDepotStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIVehicleDepotStatus299 struct {
func (o *CityBusAPIVehicleDepotStatus299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/VehicleDepot/City/{City}][%d] cityBusApiVehicleDepotStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIVehicleDepotStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIVehicleDepotStatus299) readResponse(response runtime.ClientRe
return nil
}
+
+// NewCityBusAPIVehicleDepotNotModified creates a CityBusAPIVehicleDepotNotModified with default headers values
+func NewCityBusAPIVehicleDepotNotModified() *CityBusAPIVehicleDepotNotModified {
+ return &CityBusAPIVehicleDepotNotModified{}
+}
+
+/* CityBusAPIVehicleDepotNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIVehicleDepotNotModified struct {
+}
+
+func (o *CityBusAPIVehicleDepotNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/VehicleDepot/City/{City}][%d] cityBusApiVehicleDepotNotModified ", 304)
+}
+
+func (o *CityBusAPIVehicleDepotNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/client/city_bus/city_bus_api_vehicle_route_parameters.go b/bus/v3/client/city_bus/city_bus_api_vehicle_route_parameters.go
index fb4b7294..e7663910 100644
--- a/bus/v3/client/city_bus/city_bus_api_vehicle_route_parameters.go
+++ b/bus/v3/client/city_bus/city_bus_api_vehicle_route_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewCityBusAPIVehicleRouteParams creates a new CityBusAPIVehicleRouteParams object
-// with the default values initialized.
+// NewCityBusAPIVehicleRouteParams creates a new CityBusAPIVehicleRouteParams 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 NewCityBusAPIVehicleRouteParams() *CityBusAPIVehicleRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewCityBusAPIVehicleRouteParamsWithTimeout creates a new CityBusAPIVehicleRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewCityBusAPIVehicleRouteParamsWithTimeout(timeout time.Duration) *CityBusAPIVehicleRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewCityBusAPIVehicleRouteParamsWithContext creates a new CityBusAPIVehicleRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewCityBusAPIVehicleRouteParamsWithContext(ctx context.Context) *CityBusAPIVehicleRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewCityBusAPIVehicleRouteParamsWithHTTPClient creates a new CityBusAPIVehicleRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewCityBusAPIVehicleRouteParamsWithHTTPClient(client *http.Client) *CityBusAPIVehicleRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &CityBusAPIVehicleRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*CityBusAPIVehicleRouteParams contains all the parameters to send to the API endpoint
-for the city bus Api vehicle route operation typically these are written to a http.Request
+/* CityBusAPIVehicleRouteParams contains all the parameters to send to the API endpoint
+ for the city bus Api vehicle route operation.
+
+ Typically these are written to a http.Request.
*/
type CityBusAPIVehicleRouteParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市
+ /* City.
+
+ 縣市
*/
City string
- /*Health
- 加入參數'?health=true'即可查詢此API服務的健康狀態
+ /* Health.
+
+ 加入參數'?health=true'即可查詢此API服務的健康狀態
*/
Health *string
@@ -124,6 +121,32 @@ type CityBusAPIVehicleRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the city bus Api vehicle route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIVehicleRouteParams) WithDefaults() *CityBusAPIVehicleRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the city bus Api vehicle route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *CityBusAPIVehicleRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := CityBusAPIVehicleRouteParams{
+ 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 vehicle route params
func (o *CityBusAPIVehicleRouteParams) WithTimeout(timeout time.Duration) *CityBusAPIVehicleRouteParams {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *CityBusAPIVehicleRouteParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -309,64 +335,68 @@ func (o *CityBusAPIVehicleRouteParams) WriteToRequest(r runtime.ClientRequest, r
// 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
@@ -378,16 +408,17 @@ func (o *CityBusAPIVehicleRouteParams) WriteToRequest(r runtime.ClientRequest, r
// 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 {
diff --git a/bus/v3/client/city_bus/city_bus_api_vehicle_route_responses.go b/bus/v3/client/city_bus/city_bus_api_vehicle_route_responses.go
index f1607197..22408c04 100644
--- a/bus/v3/client/city_bus/city_bus_api_vehicle_route_responses.go
+++ b/bus/v3/client/city_bus/city_bus_api_vehicle_route_responses.go
@@ -35,7 +35,12 @@ func (o *CityBusAPIVehicleRouteReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewCityBusAPIVehicleRouteNotModified()
+ 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())
}
@@ -46,7 +51,7 @@ func NewCityBusAPIVehicleRouteOK() *CityBusAPIVehicleRouteOK {
return &CityBusAPIVehicleRouteOK{}
}
-/*CityBusAPIVehicleRouteOK handles this case with default header values.
+/* CityBusAPIVehicleRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -57,7 +62,6 @@ type CityBusAPIVehicleRouteOK struct {
func (o *CityBusAPIVehicleRouteOK) Error() string {
return fmt.Sprintf("[GET /v3/Bus/VehicleRoute/City/{City}][%d] cityBusApiVehicleRouteOK %+v", 200, o.Payload)
}
-
func (o *CityBusAPIVehicleRouteOK) GetPayload() *models.PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3VehicleRoute {
return o.Payload
}
@@ -79,7 +83,7 @@ func NewCityBusAPIVehicleRouteStatus299() *CityBusAPIVehicleRouteStatus299 {
return &CityBusAPIVehicleRouteStatus299{}
}
-/*CityBusAPIVehicleRouteStatus299 handles this case with default header values.
+/* CityBusAPIVehicleRouteStatus299 describes a response with status code 299, with default header values.
加入參數'?health=true'即可查詢此API服務的健康狀態
*/
@@ -90,7 +94,6 @@ type CityBusAPIVehicleRouteStatus299 struct {
func (o *CityBusAPIVehicleRouteStatus299) Error() string {
return fmt.Sprintf("[GET /v3/Bus/VehicleRoute/City/{City}][%d] cityBusApiVehicleRouteStatus299 %+v", 299, o.Payload)
}
-
func (o *CityBusAPIVehicleRouteStatus299) GetPayload() *models.PTXServiceDTOSharedSpecificationV3BaseDisplayHealth {
return o.Payload
}
@@ -106,3 +109,24 @@ func (o *CityBusAPIVehicleRouteStatus299) readResponse(response runtime.ClientRe
return nil
}
+
+// NewCityBusAPIVehicleRouteNotModified creates a CityBusAPIVehicleRouteNotModified with default headers values
+func NewCityBusAPIVehicleRouteNotModified() *CityBusAPIVehicleRouteNotModified {
+ return &CityBusAPIVehicleRouteNotModified{}
+}
+
+/* CityBusAPIVehicleRouteNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type CityBusAPIVehicleRouteNotModified struct {
+}
+
+func (o *CityBusAPIVehicleRouteNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Bus/VehicleRoute/City/{City}][%d] cityBusApiVehicleRouteNotModified ", 304)
+}
+
+func (o *CityBusAPIVehicleRouteNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_a1_data.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_a1_data.go
index 9b485e61..372408ae 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_a1_data.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_a1_data.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -283,7 +285,6 @@ func (m *PTXServiceDTOBusSpecificationV3A1Data) validateOperatorID(formats strfm
}
func (m *PTXServiceDTOBusSpecificationV3A1Data) validateOperatorName(formats strfmt.Registry) error {
-
if swag.IsZero(m.OperatorName) { // not required
return nil
}
@@ -319,7 +320,6 @@ func (m *PTXServiceDTOBusSpecificationV3A1Data) validateRouteID(formats strfmt.R
}
func (m *PTXServiceDTOBusSpecificationV3A1Data) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -337,7 +337,6 @@ func (m *PTXServiceDTOBusSpecificationV3A1Data) validateSpeed(formats strfmt.Reg
}
func (m *PTXServiceDTOBusSpecificationV3A1Data) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -354,6 +353,52 @@ func (m *PTXServiceDTOBusSpecificationV3A1Data) validateTransTime(formats strfmt
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 a1 data based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3A1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateBusPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ 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 len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3A1Data) contextValidateBusPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3A1Data) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3A1Data) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3A1Data) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3A1Data) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_a2_data.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_a2_data.go
index a77dceb7..d9a9bfdc 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_a2_data.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_a2_data.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -254,7 +256,6 @@ func (m *PTXServiceDTOBusSpecificationV3A2Data) validateOperatorID(formats strfm
}
func (m *PTXServiceDTOBusSpecificationV3A2Data) validateOperatorName(formats strfmt.Registry) error {
-
if swag.IsZero(m.OperatorName) { // not required
return nil
}
@@ -290,7 +291,6 @@ func (m *PTXServiceDTOBusSpecificationV3A2Data) validateRouteID(formats strfmt.R
}
func (m *PTXServiceDTOBusSpecificationV3A2Data) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -308,7 +308,6 @@ func (m *PTXServiceDTOBusSpecificationV3A2Data) validateStopID(formats strfmt.Re
}
func (m *PTXServiceDTOBusSpecificationV3A2Data) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -317,7 +316,6 @@ func (m *PTXServiceDTOBusSpecificationV3A2Data) validateStopName(formats strfmt.
}
func (m *PTXServiceDTOBusSpecificationV3A2Data) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -334,6 +332,52 @@ func (m *PTXServiceDTOBusSpecificationV3A2Data) validateTransTime(formats strfmt
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 a2 data based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3A2Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopName(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 *PTXServiceDTOBusSpecificationV3A2Data) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3A2Data) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3A2Data) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3A2Data) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3A2Data) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_alert.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_alert.go
index 88d20423..bad03b5b 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_alert.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_alert.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -104,6 +106,25 @@ func (m *PTXServiceDTOBusSpecificationV3Alert) validateScope(formats strfmt.Regi
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 alert based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3Alert) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateScope(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Alert) contextValidateScope(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3Alert) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_daily_time_table.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_daily_time_table.go
index c7bfaa2a..3d024dd5 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_daily_time_table.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_daily_time_table.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -208,7 +209,6 @@ func (m *PTXServiceDTOBusSpecificationV3DailyTimeTable) validateSubRouteID(forma
}
func (m *PTXServiceDTOBusSpecificationV3DailyTimeTable) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -217,7 +217,6 @@ func (m *PTXServiceDTOBusSpecificationV3DailyTimeTable) validateSubRouteName(for
}
func (m *PTXServiceDTOBusSpecificationV3DailyTimeTable) validateTimetables(formats strfmt.Registry) error {
-
if swag.IsZero(m.Timetables) { // not required
return nil
}
@@ -241,6 +240,56 @@ func (m *PTXServiceDTOBusSpecificationV3DailyTimeTable) validateTimetables(forma
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 daily time table based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3DailyTimeTable) 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 *PTXServiceDTOBusSpecificationV3DailyTimeTable) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3DailyTimeTable) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3DailyTimeTable) 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 *PTXServiceDTOBusSpecificationV3DailyTimeTable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_depot.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_depot.go
index d1ac07ad..db3492d0 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_depot.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_depot.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -138,6 +140,34 @@ func (m *PTXServiceDTOBusSpecificationV3Depot) validateDepotUID(formats strfmt.R
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 depot based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3Depot) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDepotName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateDepotPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Depot) contextValidateDepotName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Depot) contextValidateDepotPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3Depot) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route.go
index 9535a381..a4fd2f0d 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -139,6 +140,47 @@ func (m *PTXServiceDTOBusSpecificationV3DisplayStopOfRoute) validateStops(format
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 display stop of route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3DisplayStopOfRoute) 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.contextValidateStops(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3DisplayStopOfRoute) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3DisplayStopOfRoute) 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
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3DisplayStopOfRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route_stop.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route_stop.go
index 16a6e1b7..6ee718a8 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route_stop.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route_stop.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -121,6 +123,34 @@ func (m *PTXServiceDTOBusSpecificationV3DisplayStopOfRouteStop) validateStopUID(
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 display stop of route stop based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3DisplayStopOfRouteStop) 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.contextValidateStopPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3DisplayStopOfRouteStop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3DisplayStopOfRouteStop) contextValidateStopPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3DisplayStopOfRouteStop) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info.go
index e23a086e..3c3c012d 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -180,7 +181,6 @@ func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfo) validateRouteUID(form
}
func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfo) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -188,6 +188,56 @@ func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfo) validateSubRouteName(
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 first last trip info based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFirstLastTrips(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ 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 len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfo) contextValidateFirstLastTrips(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.FirstLastTrips); i++ {
+
+ if m.FirstLastTrips[i] != nil {
+ if err := m.FirstLastTrips[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("FirstLastTrips" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfo) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfo) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info_first_last_trip.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info_first_last_trip.go
index c43f7d7f..5f006665 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info_first_last_trip.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info_first_last_trip.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -83,6 +85,25 @@ func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfoFirstLastTrip) validate
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 first last trip info first last trip based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfoFirstLastTrip) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfoFirstLastTrip) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfoFirstLastTrip) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info_service_day.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info_service_day.go
index 455c6cd7..aa9f5359 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info_service_day.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info_service_day.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -178,6 +180,11 @@ func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfoServiceDay) validateWed
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 first last trip info service day based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfoServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3FirstLastTripInfoServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_n1_data.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_n1_data.go
index 1819ed90..b10e7768 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_n1_data.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_n1_data.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -182,7 +184,6 @@ func (m *PTXServiceDTOBusSpecificationV3N1Data) Validate(formats strfmt.Registry
}
func (m *PTXServiceDTOBusSpecificationV3N1Data) validateDestinationStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.DestinationStopName) { // not required
return nil
}
@@ -218,7 +219,6 @@ func (m *PTXServiceDTOBusSpecificationV3N1Data) validateRouteID(formats strfmt.R
}
func (m *PTXServiceDTOBusSpecificationV3N1Data) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -236,7 +236,6 @@ func (m *PTXServiceDTOBusSpecificationV3N1Data) validateStopID(formats strfmt.Re
}
func (m *PTXServiceDTOBusSpecificationV3N1Data) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -245,7 +244,6 @@ func (m *PTXServiceDTOBusSpecificationV3N1Data) validateStopName(formats strfmt.
}
func (m *PTXServiceDTOBusSpecificationV3N1Data) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -262,6 +260,52 @@ func (m *PTXServiceDTOBusSpecificationV3N1Data) validateTransTime(formats strfmt
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 n1 data based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3N1Data) 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.contextValidateStopName(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 *PTXServiceDTOBusSpecificationV3N1Data) contextValidateDestinationStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3N1Data) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3N1Data) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3N1Data) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3N1Data) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network.go
index 2d2a8e7d..0eba0e90 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -74,7 +75,6 @@ func (m *PTXServiceDTOBusSpecificationV3Network) Validate(formats strfmt.Registr
}
func (m *PTXServiceDTOBusSpecificationV3Network) validateLBSMapURLs(formats strfmt.Registry) error {
-
if swag.IsZero(m.LBSMapURLs) { // not required
return nil
}
@@ -117,6 +117,56 @@ func (m *PTXServiceDTOBusSpecificationV3Network) validateNetworkName(formats str
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 network based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3Network) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLBSMapURLs(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNetworkMapURL(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNetworkName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Network) contextValidateLBSMapURLs(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.LBSMapURLs); i++ {
+
+ if m.LBSMapURLs[i] != nil {
+ if err := m.LBSMapURLs[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("LBSMapURLs" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Network) contextValidateNetworkMapURL(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Network) contextValidateNetworkName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3Network) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network_l_b_s_map_url.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network_l_b_s_map_url.go
index 3cd3259e..60405cb6 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network_l_b_s_map_url.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network_l_b_s_map_url.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -54,7 +56,6 @@ func (m *PTXServiceDTOBusSpecificationV3NetworkLBSMapURL) Validate(formats strfm
}
func (m *PTXServiceDTOBusSpecificationV3NetworkLBSMapURL) validateLBSLocation(formats strfmt.Registry) error {
-
if swag.IsZero(m.LBSLocation) { // not required
return nil
}
@@ -62,6 +63,25 @@ func (m *PTXServiceDTOBusSpecificationV3NetworkLBSMapURL) validateLBSLocation(fo
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 network l b s map URL based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3NetworkLBSMapURL) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLBSLocation(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3NetworkLBSMapURL) contextValidateLBSLocation(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3NetworkLBSMapURL) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network_map_url.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network_map_url.go
index 7a6ca8fe..2f29e969 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network_map_url.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_network_map_url.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -64,6 +66,25 @@ func (m *PTXServiceDTOBusSpecificationV3NetworkMapURL) validateMapNameURL(format
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 network map URL based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3NetworkMapURL) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateMapNameURL(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3NetworkMapURL) contextValidateMapNameURL(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3NetworkMapURL) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_news.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_news.go
index 898e9019..41d65d1e 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_news.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_news.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -172,6 +174,11 @@ func (m *PTXServiceDTOBusSpecificationV3News) validateTitle(formats strfmt.Regis
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 news based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3News) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3News) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_operator.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_operator.go
index 73b746f7..df106050 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_operator.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_operator.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -170,6 +172,25 @@ func (m *PTXServiceDTOBusSpecificationV3Operator) validateOperatorURL(formats st
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 operator based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3Operator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Operator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3Operator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route.go
index eb3c8886..a9a82f95 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -242,7 +243,6 @@ func (m *PTXServiceDTOBusSpecificationV3Route) validateEndStop(formats strfmt.Re
}
func (m *PTXServiceDTOBusSpecificationV3Route) validateFareBufferZoneDescription(formats strfmt.Registry) error {
-
if swag.IsZero(m.FareBufferZoneDescription) { // not required
return nil
}
@@ -303,7 +303,6 @@ func (m *PTXServiceDTOBusSpecificationV3Route) validateRouteID(formats strfmt.Re
}
func (m *PTXServiceDTOBusSpecificationV3Route) validateRouteLongName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteLongName) { // not required
return nil
}
@@ -349,6 +348,119 @@ func (m *PTXServiceDTOBusSpecificationV3Route) validateTicketPriceDescription(fo
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3Route) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDepartureStopName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateDestinationStopName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateEndStop(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFareBufferZoneDescription(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOperators(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteLongName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateServiceType(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartStop(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTicketPriceDescription(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Route) contextValidateDepartureStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Route) contextValidateDestinationStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Route) contextValidateEndStop(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Route) contextValidateFareBufferZoneDescription(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Route) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Operators); i++ {
+
+ if m.Operators[i] != nil {
+ if err := m.Operators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Operators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Route) contextValidateRouteLongName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Route) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Route) contextValidateServiceType(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Route) contextValidateStartStop(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Route) contextValidateTicketPriceDescription(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3Route) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare.go
index a0bc47d7..c231b411 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -174,7 +175,6 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateIsFreeBus(formats str
}
func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateODFares(formats strfmt.Registry) error {
-
if swag.IsZero(m.ODFares) { // not required
return nil
}
@@ -208,7 +208,6 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateRouteID(formats strfm
}
func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -226,7 +225,6 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateRouteUID(formats strf
}
func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateSectionFares(formats strfmt.Registry) error {
-
if swag.IsZero(m.SectionFares) { // not required
return nil
}
@@ -251,7 +249,6 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateSectionFares(formats
}
func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateStageFares(formats strfmt.Registry) error {
-
if swag.IsZero(m.StageFares) { // not required
return nil
}
@@ -276,7 +273,6 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateStageFares(formats st
}
func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -284,6 +280,100 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFare) validateSubRouteName(formats
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route fare based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateODFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSectionFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStageFares(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 *PTXServiceDTOBusSpecificationV3RouteFare) contextValidateODFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.ODFares); i++ {
+
+ if m.ODFares[i] != nil {
+ if err := m.ODFares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ODFares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFare) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFare) contextValidateSectionFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SectionFares); i++ {
+
+ if m.SectionFares[i] != nil {
+ if err := m.SectionFares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SectionFares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFare) contextValidateStageFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StageFares); i++ {
+
+ if m.StageFares[i] != nil {
+ if err := m.StageFares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StageFares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFare) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare.go
index cb3a27f7..873c345f 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -118,6 +119,56 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareODFare) validateOriginStops(for
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route fare o d fare based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareODFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStops(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginStops(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareODFare) contextValidateDestinationStops(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareODFare) contextValidateFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Fares); i++ {
+
+ if m.Fares[i] != nil {
+ if err := m.Fares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Fares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareODFare) contextValidateOriginStops(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareODFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare_fare_o_d.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare_fare_o_d.go
index 15574792..6ab43bba 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare_fare_o_d.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare_fare_o_d.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -83,6 +85,11 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareODFareFareOD) validateTicketTyp
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 route fare o d fare fare o d based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareODFareFareOD) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareODFareFareOD) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare_o_d.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare_o_d.go
index 0d78ec42..123e46cc 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare_o_d.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_o_d_fare_o_d.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -63,7 +65,6 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareODFareOD) validateStopID(format
}
func (m *PTXServiceDTOBusSpecificationV3RouteFareODFareOD) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -80,6 +81,25 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareODFareOD) validateStopUID(forma
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route fare o d fare o d based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareODFareOD) 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 *PTXServiceDTOBusSpecificationV3RouteFareODFareOD) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareODFareOD) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare.go
index 97dbbb6a..6bebe5dc 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -100,6 +101,60 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFare) validateFares(form
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route fare section fare based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateBufferZones(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFare) contextValidateBufferZones(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.BufferZones); i++ {
+
+ if m.BufferZones[i] != nil {
+ if err := m.BufferZones[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("BufferZones" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFare) contextValidateFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Fares); i++ {
+
+ if m.Fares[i] != nil {
+ if err := m.Fares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Fares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_buffer_zone.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_buffer_zone.go
index e08efd0b..af6e4747 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_buffer_zone.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_buffer_zone.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -100,6 +102,34 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareBufferZone) validate
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route fare section fare buffer zone based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareBufferZone) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFareBufferZoneDestination(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFareBufferZoneOrigin(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareBufferZone) contextValidateFareBufferZoneDestination(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareBufferZone) contextValidateFareBufferZoneOrigin(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareBufferZone) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_fare_buffer_zone.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_fare_buffer_zone.go
index 5b399dec..3118c3f3 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_fare_buffer_zone.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_fare_buffer_zone.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -63,7 +65,6 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareFareBufferZone) vali
}
func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareFareBufferZone) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -80,6 +81,25 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareFareBufferZone) vali
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route fare section fare fare buffer zone based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareFareBufferZone) 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 *PTXServiceDTOBusSpecificationV3RouteFareSectionFareFareBufferZone) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareFareBufferZone) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_fare_section.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_fare_section.go
index 1daefca4..12b0cecc 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_fare_section.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_section_fare_fare_section.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -83,6 +85,11 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareFareSection) validat
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 route fare section fare fare section based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareFareSection) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareSectionFareFareSection) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare.go
index 1ad4cb0b..4f1e0eef 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -118,6 +119,56 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFare) validateOriginStage(
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route fare stage fare based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStage(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginStage(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFare) contextValidateDestinationStage(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFare) contextValidateFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Fares); i++ {
+
+ if m.Fares[i] != nil {
+ if err := m.Fares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Fares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFare) contextValidateOriginStage(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_discount_period.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_discount_period.go
index 2dc154b4..3bd6e3ae 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_discount_period.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_discount_period.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -77,6 +79,25 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareDiscountPeriod) valida
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route fare stage fare discount period based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareDiscountPeriod) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareDiscountPeriod) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareDiscountPeriod) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_fare_stage.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_fare_stage.go
index ecb9a108..b16ba806 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_fare_stage.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_fare_stage.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -64,7 +65,6 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareFareStage) Validate(fo
}
func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareFareStage) validateDiscountPeriods(formats strfmt.Registry) error {
-
if swag.IsZero(m.DiscountPeriods) { // not required
return nil
}
@@ -106,6 +106,38 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareFareStage) validateTic
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route fare stage fare fare stage based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareFareStage) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDiscountPeriods(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareFareStage) contextValidateDiscountPeriods(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.DiscountPeriods); i++ {
+
+ if m.DiscountPeriods[i] != nil {
+ if err := m.DiscountPeriods[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("DiscountPeriods" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareFareStage) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_service_day.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_service_day.go
index 76a899c7..0f49be29 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_service_day.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_service_day.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -198,6 +200,11 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareServiceDay) validateWe
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 route fare stage fare service day based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_stage.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_stage.go
index f84a0aa9..0a1da1dc 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_stage.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_fare_stage_fare_stage.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -49,7 +51,6 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareStage) Validate(format
}
func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareStage) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -66,6 +67,25 @@ func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareStage) validateStopUID
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route fare stage fare stage based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareStage) 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 *PTXServiceDTOBusSpecificationV3RouteFareStageFareStage) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteFareStageFareStage) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_network.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_network.go
index 6d119b31..4f26284a 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_network.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_network.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -120,6 +121,47 @@ func (m *PTXServiceDTOBusSpecificationV3RouteNetwork) validateSegments(formats s
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route network based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteNetwork) 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.contextValidateSegments(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteNetwork) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteNetwork) contextValidateSegments(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Segments); i++ {
+
+ if m.Segments[i] != nil {
+ if err := m.Segments[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Segments" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteNetwork) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_network_segment.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_network_segment.go
index 4b10a58f..9cc08c81 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_network_segment.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_network_segment.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -104,6 +106,11 @@ func (m *PTXServiceDTOBusSpecificationV3RouteNetworkSegment) validateToStopID(fo
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 route network segment based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteNetworkSegment) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteNetworkSegment) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_operator.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_operator.go
index 097d50ec..454c1249 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_operator.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_operator.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -104,6 +106,25 @@ func (m *PTXServiceDTOBusSpecificationV3RouteOperator) validateOperatorNo(format
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route operator based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteOperator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3RouteOperator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteOperator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_stop.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_stop.go
index d179f001..3a74c1b6 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_stop.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_route_stop.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -64,6 +66,25 @@ func (m *PTXServiceDTOBusSpecificationV3RouteStop) validateStopName(formats strf
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 route stop based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3RouteStop) 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 *PTXServiceDTOBusSpecificationV3RouteStop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3RouteStop) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time.go
index a89e880f..e9df3257 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -113,6 +114,38 @@ func (m *PTXServiceDTOBusSpecificationV3S2STravelTime) validateTravelTimes(forma
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 s2 s travel time based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3S2STravelTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTravelTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3S2STravelTime) contextValidateTravelTimes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TravelTimes); i++ {
+
+ if m.TravelTimes[i] != nil {
+ if err := m.TravelTimes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TravelTimes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3S2STravelTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time_travel_time.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time_travel_time.go
index 0d09a315..a6fb8035 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time_travel_time.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time_travel_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -142,6 +144,11 @@ func (m *PTXServiceDTOBusSpecificationV3S2STravelTimeTravelTime) validateToStopI
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 s2 s travel time travel time based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3S2STravelTimeTravelTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3S2STravelTimeTravelTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule.go
index b622ce8a..9b4b93af 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -194,7 +195,6 @@ func (m *PTXServiceDTOBusSpecificationV3Schedule) validateSubRouteID(formats str
}
func (m *PTXServiceDTOBusSpecificationV3Schedule) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -203,7 +203,6 @@ func (m *PTXServiceDTOBusSpecificationV3Schedule) validateSubRouteName(formats s
}
func (m *PTXServiceDTOBusSpecificationV3Schedule) validateTimetables(formats strfmt.Registry) error {
-
if swag.IsZero(m.Timetables) { // not required
return nil
}
@@ -227,6 +226,56 @@ func (m *PTXServiceDTOBusSpecificationV3Schedule) validateTimetables(formats str
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 schedule based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3Schedule) 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 *PTXServiceDTOBusSpecificationV3Schedule) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Schedule) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Schedule) 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 *PTXServiceDTOBusSpecificationV3Schedule) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_date_period.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_date_period.go
index 101e7a56..36d9e7b5 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_date_period.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_date_period.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -66,6 +68,11 @@ func (m *PTXServiceDTOBusSpecificationV3ScheduleDatePeriod) validateStartDate(fo
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 schedule date period based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3ScheduleDatePeriod) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3ScheduleDatePeriod) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_service_day.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_service_day.go
index f49070a3..21ad55e3 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_service_day.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_service_day.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -81,6 +83,11 @@ func (m *PTXServiceDTOBusSpecificationV3ScheduleServiceDay) Validate(formats str
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 schedule service day based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3ScheduleServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3ScheduleServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_special_day.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_special_day.go
index 8dfa3570..eb34d102 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_special_day.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_special_day.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -102,6 +104,25 @@ func (m *PTXServiceDTOBusSpecificationV3ScheduleSpecialDay) validateServiceStatu
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 schedule special day based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3ScheduleSpecialDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDatePeriod(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3ScheduleSpecialDay) contextValidateDatePeriod(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3ScheduleSpecialDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_stop_time.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_stop_time.go
index 23a95574..5e65293c 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_stop_time.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_stop_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -117,7 +119,6 @@ func (m *PTXServiceDTOBusSpecificationV3ScheduleStopTime) validateStopID(formats
}
func (m *PTXServiceDTOBusSpecificationV3ScheduleStopTime) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -143,6 +144,25 @@ func (m *PTXServiceDTOBusSpecificationV3ScheduleStopTime) validateStopUID(format
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 schedule stop time based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3ScheduleStopTime) 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 *PTXServiceDTOBusSpecificationV3ScheduleStopTime) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3ScheduleStopTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_time_table.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_time_table.go
index 3fced493..b6f6896e 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_time_table.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_schedule_time_table.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -127,6 +128,69 @@ func (m *PTXServiceDTOBusSpecificationV3ScheduleTimeTable) validateStopTimes(for
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 schedule time table based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3ScheduleTimeTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSpecialDays(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3ScheduleTimeTable) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3ScheduleTimeTable) contextValidateSpecialDays(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SpecialDays); i++ {
+
+ if m.SpecialDays[i] != nil {
+ if err := m.SpecialDays[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SpecialDays" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3ScheduleTimeTable) 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 *PTXServiceDTOBusSpecificationV3ScheduleTimeTable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope.go
index 1fb06828..b2f5a26c 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -68,7 +69,6 @@ func (m *PTXServiceDTOBusSpecificationV3Scope) Validate(formats strfmt.Registry)
}
func (m *PTXServiceDTOBusSpecificationV3Scope) validateRoutes(formats strfmt.Registry) error {
-
if swag.IsZero(m.Routes) { // not required
return nil
}
@@ -93,7 +93,6 @@ func (m *PTXServiceDTOBusSpecificationV3Scope) validateRoutes(formats strfmt.Reg
}
func (m *PTXServiceDTOBusSpecificationV3Scope) validateStops(formats strfmt.Registry) error {
-
if swag.IsZero(m.Stops) { // not required
return nil
}
@@ -118,7 +117,6 @@ func (m *PTXServiceDTOBusSpecificationV3Scope) validateStops(formats strfmt.Regi
}
func (m *PTXServiceDTOBusSpecificationV3Scope) validateSubRoutes(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRoutes) { // not required
return nil
}
@@ -143,7 +141,6 @@ func (m *PTXServiceDTOBusSpecificationV3Scope) validateSubRoutes(formats strfmt.
}
func (m *PTXServiceDTOBusSpecificationV3Scope) validateTripIDs(formats strfmt.Registry) error {
-
if swag.IsZero(m.TripIDs) { // not required
return nil
}
@@ -167,6 +164,104 @@ func (m *PTXServiceDTOBusSpecificationV3Scope) validateTripIDs(formats strfmt.Re
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 scope based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3Scope) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStops(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSubRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTripIDs(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Scope) contextValidateRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Routes); i++ {
+
+ if m.Routes[i] != nil {
+ if err := m.Routes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Routes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Scope) 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 *PTXServiceDTOBusSpecificationV3Scope) contextValidateSubRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SubRoutes); i++ {
+
+ if m.SubRoutes[i] != nil {
+ if err := m.SubRoutes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SubRoutes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Scope) contextValidateTripIDs(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TripIDs); i++ {
+
+ if m.TripIDs[i] != nil {
+ if err := m.TripIDs[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TripIDs" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3Scope) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_route.go
index cc75af94..77768009 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_route.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -46,7 +48,6 @@ func (m *PTXServiceDTOBusSpecificationV3ScopeRoute) Validate(formats strfmt.Regi
}
func (m *PTXServiceDTOBusSpecificationV3ScopeRoute) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -54,6 +55,25 @@ func (m *PTXServiceDTOBusSpecificationV3ScopeRoute) validateRouteName(formats st
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 scope route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3ScopeRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3ScopeRoute) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3ScopeRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_stop.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_stop.go
index 8627031b..256ca83f 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_stop.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_stop.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -46,7 +48,6 @@ func (m *PTXServiceDTOBusSpecificationV3ScopeStop) Validate(formats strfmt.Regis
}
func (m *PTXServiceDTOBusSpecificationV3ScopeStop) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -54,6 +55,25 @@ func (m *PTXServiceDTOBusSpecificationV3ScopeStop) validateStopName(formats strf
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 scope stop based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3ScopeStop) 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 *PTXServiceDTOBusSpecificationV3ScopeStop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3ScopeStop) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_sub_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_sub_route.go
index f9f7990a..78acd8da 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_sub_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_sub_route.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -46,7 +48,6 @@ func (m *PTXServiceDTOBusSpecificationV3ScopeSubRoute) Validate(formats strfmt.R
}
func (m *PTXServiceDTOBusSpecificationV3ScopeSubRoute) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -54,6 +55,25 @@ func (m *PTXServiceDTOBusSpecificationV3ScopeSubRoute) validateSubRouteName(form
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 scope sub route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3ScopeSubRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateSubRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3ScopeSubRoute) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3ScopeSubRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_trip.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_trip.go
index 255eca19..ad9cc4a0 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_trip.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_scope_trip.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -28,6 +30,11 @@ func (m *PTXServiceDTOBusSpecificationV3ScopeTrip) Validate(formats strfmt.Regis
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 scope trip based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3ScopeTrip) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3ScopeTrip) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_service_type.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_service_type.go
index 905fd3fd..590fef8b 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_service_type.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_service_type.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -275,6 +277,11 @@ func (m *PTXServiceDTOBusSpecificationV3ServiceType) validateIsTrunkBus(formats
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 service type based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3ServiceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3ServiceType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_shape.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_shape.go
index 78b15c22..04119b63 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_shape.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_shape.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -176,6 +178,34 @@ func (m *PTXServiceDTOBusSpecificationV3Shape) validateSubRouteUID(formats strfm
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 shape based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3Shape) 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 len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Shape) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Shape) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3Shape) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_station.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_station.go
index 9862af45..3e9497cb 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_station.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_station.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -120,6 +122,34 @@ func (m *PTXServiceDTOBusSpecificationV3Station) validateStationUID(formats strf
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 station based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3Station) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Station) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Station) contextValidateStationPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3Station) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop.go
index 90375dfa..2b9e3af1 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -145,6 +147,34 @@ func (m *PTXServiceDTOBusSpecificationV3Stop) validateStopUID(formats strfmt.Reg
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 stop based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3Stop) 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.contextValidateStopPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Stop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3Stop) contextValidateStopPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3Stop) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route.go
index b8fb1184..3361858c 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -122,7 +123,6 @@ func (m *PTXServiceDTOBusSpecificationV3StopOfRoute) validateDirection(formats s
}
func (m *PTXServiceDTOBusSpecificationV3StopOfRoute) validateOperators(formats strfmt.Registry) error {
-
if swag.IsZero(m.Operators) { // not required
return nil
}
@@ -195,7 +195,6 @@ func (m *PTXServiceDTOBusSpecificationV3StopOfRoute) validateStops(formats strfm
}
func (m *PTXServiceDTOBusSpecificationV3StopOfRoute) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -203,6 +202,78 @@ func (m *PTXServiceDTOBusSpecificationV3StopOfRoute) validateSubRouteName(format
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 stop of route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3StopOfRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperators(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 *PTXServiceDTOBusSpecificationV3StopOfRoute) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Operators); i++ {
+
+ if m.Operators[i] != nil {
+ if err := m.Operators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Operators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3StopOfRoute) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3StopOfRoute) 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 *PTXServiceDTOBusSpecificationV3StopOfRoute) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3StopOfRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route_operator.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route_operator.go
index 64d70bc6..ce4a3faf 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route_operator.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route_operator.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -104,6 +106,25 @@ func (m *PTXServiceDTOBusSpecificationV3StopOfRouteOperator) validateOperatorNo(
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 stop of route operator based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3StopOfRouteOperator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3StopOfRouteOperator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3StopOfRouteOperator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route_stop.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route_stop.go
index 31c22203..090b6bec 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route_stop.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_of_route_stop.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -148,6 +150,34 @@ func (m *PTXServiceDTOBusSpecificationV3StopOfRouteStop) validateStopUID(formats
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 stop of route stop based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3StopOfRouteStop) 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.contextValidateStopPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3StopOfRouteStop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3StopOfRouteStop) contextValidateStopPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3StopOfRouteStop) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_time.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_time.go
index 700f0d34..56e24dbc 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_time.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_stop_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -117,7 +119,6 @@ func (m *PTXServiceDTOBusSpecificationV3StopTime) validateStopID(formats strfmt.
}
func (m *PTXServiceDTOBusSpecificationV3StopTime) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -143,6 +144,25 @@ func (m *PTXServiceDTOBusSpecificationV3StopTime) validateStopUID(formats strfmt
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 stop time based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3StopTime) 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 *PTXServiceDTOBusSpecificationV3StopTime) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3StopTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route.go
index ff21d730..59e4870a 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -175,7 +176,6 @@ func (m *PTXServiceDTOBusSpecificationV3SubRoute) Validate(formats strfmt.Regist
}
func (m *PTXServiceDTOBusSpecificationV3SubRoute) validateDepartureStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.DepartureStopName) { // not required
return nil
}
@@ -184,7 +184,6 @@ func (m *PTXServiceDTOBusSpecificationV3SubRoute) validateDepartureStopName(form
}
func (m *PTXServiceDTOBusSpecificationV3SubRoute) validateDestinationStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.DestinationStopName) { // not required
return nil
}
@@ -202,7 +201,6 @@ func (m *PTXServiceDTOBusSpecificationV3SubRoute) validateDirection(formats strf
}
func (m *PTXServiceDTOBusSpecificationV3SubRoute) validateEndStop(formats strfmt.Registry) error {
-
if swag.IsZero(m.EndStop) { // not required
return nil
}
@@ -259,7 +257,6 @@ func (m *PTXServiceDTOBusSpecificationV3SubRoute) validateRouteUID(formats strfm
}
func (m *PTXServiceDTOBusSpecificationV3SubRoute) validateStartStop(formats strfmt.Registry) error {
-
if swag.IsZero(m.StartStop) { // not required
return nil
}
@@ -277,7 +274,6 @@ func (m *PTXServiceDTOBusSpecificationV3SubRoute) validateSubRouteID(formats str
}
func (m *PTXServiceDTOBusSpecificationV3SubRoute) validateSubRouteLongName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteLongName) { // not required
return nil
}
@@ -299,6 +295,101 @@ func (m *PTXServiceDTOBusSpecificationV3SubRoute) validateSubRouteUID(formats st
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 sub route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3SubRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDepartureStopName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateDestinationStopName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateEndStop(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOperators(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartStop(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSubRouteLongName(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 *PTXServiceDTOBusSpecificationV3SubRoute) contextValidateDepartureStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3SubRoute) contextValidateDestinationStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3SubRoute) contextValidateEndStop(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3SubRoute) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Operators); i++ {
+
+ if m.Operators[i] != nil {
+ if err := m.Operators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Operators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3SubRoute) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3SubRoute) contextValidateStartStop(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3SubRoute) contextValidateSubRouteLongName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3SubRoute) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3SubRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route_operator.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route_operator.go
index b2291ad6..7ee5c119 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route_operator.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route_operator.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -102,6 +104,25 @@ func (m *PTXServiceDTOBusSpecificationV3SubRouteOperator) validateOperatorNo(for
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 sub route operator based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3SubRouteOperator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3SubRouteOperator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3SubRouteOperator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route_stop.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route_stop.go
index b80492b5..639d668e 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route_stop.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_sub_route_stop.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -64,6 +66,25 @@ func (m *PTXServiceDTOBusSpecificationV3SubRouteStop) validateStopName(formats s
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 sub route stop based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3SubRouteStop) 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 *PTXServiceDTOBusSpecificationV3SubRouteStop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3SubRouteStop) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_time_table.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_time_table.go
index 3268c067..60156f4f 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_time_table.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_time_table.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -70,6 +71,38 @@ func (m *PTXServiceDTOBusSpecificationV3TimeTable) validateStopTimes(formats str
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 time table based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3TimeTable) 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 *PTXServiceDTOBusSpecificationV3TimeTable) 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 *PTXServiceDTOBusSpecificationV3TimeTable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle.go
index 4edfc365..256012c3 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -247,6 +249,11 @@ func (m *PTXServiceDTOBusSpecificationV3Vehicle) validateVehicleType(formats str
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 vehicle based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3Vehicle) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3Vehicle) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot.go
index f5709cb3..5d9f57d2 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -101,6 +102,47 @@ func (m *PTXServiceDTOBusSpecificationV3VehicleDepot) validateVehicles(formats s
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 vehicle depot based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3VehicleDepot) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDepotName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateVehicles(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3VehicleDepot) contextValidateDepotName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3VehicleDepot) contextValidateVehicles(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Vehicles); i++ {
+
+ if m.Vehicles[i] != nil {
+ if err := m.Vehicles[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Vehicles" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3VehicleDepot) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot_vehicle.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot_vehicle.go
index 9407ca3e..414468ca 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot_vehicle.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot_vehicle.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -26,6 +28,11 @@ func (m *PTXServiceDTOBusSpecificationV3VehicleDepotVehicle) Validate(formats st
return nil
}
+// ContextValidate validates this p t x service d t o bus specification v3 vehicle depot vehicle based on context it is used
+func (m *PTXServiceDTOBusSpecificationV3VehicleDepotVehicle) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3VehicleDepotVehicle) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_route.go
index c1185cda..51cea8fc 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_vehicle_route.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -124,7 +126,6 @@ func (m *PTXServiceDTOBusSpecificationV3VehicleRoute) validateRouteUID(formats s
}
func (m *PTXServiceDTOBusSpecificationV3VehicleRoute) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -132,6 +133,34 @@ func (m *PTXServiceDTOBusSpecificationV3VehicleRoute) validateSubRouteName(forma
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 vehicle route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3VehicleRoute) 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 len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3VehicleRoute) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3VehicleRoute) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3VehicleRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_g_wrapper_p_t_x_service_d_t_o_bus_specification_v3_schedule.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_g_wrapper_p_t_x_service_d_t_o_bus_specification_v3_schedule.go
index 029f9ce1..9bb02324 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_g_wrapper_p_t_x_service_d_t_o_bus_specification_v3_schedule.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_g_wrapper_p_t_x_service_d_t_o_bus_specification_v3_schedule.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -199,6 +200,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusGWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus g wrapper p t x service d t o bus specification v3 schedule based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusGWrapperPTXServiceDTOBusSpecificationV3Schedule) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateSchedules(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusGWrapperPTXServiceDTOBusSpecificationV3Schedule) contextValidateSchedules(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Schedules); i++ {
+
+ if m.Schedules[i] != nil {
+ if err := m.Schedules[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Schedules" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusGWrapperPTXServiceDTOBusSpecificationV3Schedule) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_depot.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_depot.go
index 2728ad6f..d77173ff 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_depot.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_depot.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 depot based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Depot) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDepots(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Depot) contextValidateDepots(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Depots); i++ {
+
+ if m.Depots[i] != nil {
+ if err := m.Depots[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Depots" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Depot) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route.go
index 3c2cd4c7..53303f65 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_display_stop_of_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 display stop of route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3DisplayStopOfRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDisplayStopOfRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3DisplayStopOfRoute) contextValidateDisplayStopOfRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.DisplayStopOfRoutes); i++ {
+
+ if m.DisplayStopOfRoutes[i] != nil {
+ if err := m.DisplayStopOfRoutes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("DisplayStopOfRoutes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3DisplayStopOfRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info.go
index 4ee51135..bf1e60e6 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_first_last_trip_info.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 first last trip info based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3FirstLastTripInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFirstLastTripInfos(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3FirstLastTripInfo) contextValidateFirstLastTripInfos(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.FirstLastTripInfos); i++ {
+
+ if m.FirstLastTripInfos[i] != nil {
+ if err := m.FirstLastTripInfos[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("FirstLastTripInfos" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3FirstLastTripInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_network.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_network.go
index 8ec0014e..acb40067 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_network.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_network.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 network based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Network) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateNetworks(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Network) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Networks); i++ {
+
+ if m.Networks[i] != nil {
+ if err := m.Networks[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Networks" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Network) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_operator.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_operator.go
index bb1f4b56..e798e3e8 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_operator.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_operator.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 operator based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Operator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperators(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Operator) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Operators); i++ {
+
+ if m.Operators[i] != nil {
+ if err := m.Operators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Operators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Operator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route.go
index a8ac23f8..4defbfd9 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Route) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Route) contextValidateRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Routes); i++ {
+
+ if m.Routes[i] != nil {
+ if err := m.Routes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Routes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Route) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route_network.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route_network.go
index e4e97e31..3c2a3746 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route_network.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route_network.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 route network based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3RouteNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateRouteNetworks(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3RouteNetwork) contextValidateRouteNetworks(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.RouteNetworks); i++ {
+
+ if m.RouteNetworks[i] != nil {
+ if err := m.RouteNetworks[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("RouteNetworks" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3RouteNetwork) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time.go
index afe5d5b4..dedc1c6f 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_s2_s_travel_time.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 s2 s travel time based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3S2STravelTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateS2STravelTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3S2STravelTime) contextValidateS2STravelTimes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.S2STravelTimes); i++ {
+
+ if m.S2STravelTimes[i] != nil {
+ if err := m.S2STravelTimes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("S2STravelTimes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3S2STravelTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_shape.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_shape.go
index 0df8edd5..b54d169e 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_shape.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_shape.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 shape based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Shape) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateShapes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Shape) contextValidateShapes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Shapes); i++ {
+
+ if m.Shapes[i] != nil {
+ if err := m.Shapes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Shapes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Shape) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_station.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_station.go
index 8a711eb8..6acbca9d 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_station.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_station.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 station based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Station) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStations(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Station) contextValidateStations(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Stations); i++ {
+
+ if m.Stations[i] != nil {
+ if err := m.Stations[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Stations" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Station) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_stop.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_stop.go
index e15028a8..2e9f3f85 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_stop.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_stop.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 stop based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Stop) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStops(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Stop) 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
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Stop) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_stop_of_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_stop_of_route.go
index 9a35d164..5f2a527a 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_stop_of_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_stop_of_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 stop of route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3StopOfRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStopOfRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3StopOfRoute) contextValidateStopOfRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StopOfRoutes); i++ {
+
+ if m.StopOfRoutes[i] != nil {
+ if err := m.StopOfRoutes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StopOfRoutes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3StopOfRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_sub_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_sub_route.go
index 84915d5d..d1f0fd01 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_sub_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_sub_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 sub route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3SubRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateSubRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3SubRoute) contextValidateSubRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SubRoutes); i++ {
+
+ if m.SubRoutes[i] != nil {
+ if err := m.SubRoutes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SubRoutes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3SubRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle.go
index 3bd0acb4..44c99519 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 vehicle based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Vehicle) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateVehicles(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Vehicle) contextValidateVehicles(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Vehicles); i++ {
+
+ if m.Vehicles[i] != nil {
+ if err := m.Vehicles[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Vehicles" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3Vehicle) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot.go
index a9c1f0dd..051ec53b 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle_depot.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 vehicle depot based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3VehicleDepot) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateVehicleDepots(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3VehicleDepot) contextValidateVehicleDepots(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.VehicleDepots); i++ {
+
+ if m.VehicleDepots[i] != nil {
+ if err := m.VehicleDepots[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("VehicleDepots" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3VehicleDepot) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle_route.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle_route.go
index f60ae918..7ecc72e5 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle_route.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_v_wrapper_p_t_x_service_d_t_o_bus_specification_v3_vehicle_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -184,6 +185,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecif
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus v wrapper p t x service d t o bus specification v3 vehicle route based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3VehicleRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateVehicleRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3VehicleRoute) contextValidateVehicleRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.VehicleRoutes); i++ {
+
+ if m.VehicleRoutes[i] != nil {
+ if err := m.VehicleRoutes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("VehicleRoutes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusVWrapperPTXServiceDTOBusSpecificationV3VehicleRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_a1_data.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_a1_data.go
index b647a5f4..0567f957 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_a1_data.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_a1_data.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -165,6 +166,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecifi
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus wrapper p t x service d t o bus specification v3 a1 data based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3A1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateA1Datas(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3A1Data) contextValidateA1Datas(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.A1Datas); i++ {
+
+ if m.A1Datas[i] != nil {
+ if err := m.A1Datas[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("A1Datas" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3A1Data) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_a2_data.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_a2_data.go
index f34aa9d3..acd099ea 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_a2_data.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_a2_data.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -165,6 +166,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecifi
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus wrapper p t x service d t o bus specification v3 a2 data based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3A2Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateA2Datas(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3A2Data) contextValidateA2Datas(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.A2Datas); i++ {
+
+ if m.A2Datas[i] != nil {
+ if err := m.A2Datas[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("A2Datas" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3A2Data) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_alert.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_alert.go
index ee49ce1c..639662e8 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_alert.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_alert.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -165,6 +166,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecifi
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus wrapper p t x service d t o bus specification v3 alert based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3Alert) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAlerts(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3Alert) contextValidateAlerts(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Alerts); i++ {
+
+ if m.Alerts[i] != nil {
+ if err := m.Alerts[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Alerts" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3Alert) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_daily_time_table.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_daily_time_table.go
index e8fa9ee1..bfadcf97 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_daily_time_table.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_daily_time_table.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -165,6 +166,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecifi
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus wrapper p t x service d t o bus specification v3 daily time table based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3DailyTimeTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDailyTimeTables(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3DailyTimeTable) contextValidateDailyTimeTables(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.DailyTimeTables); i++ {
+
+ if m.DailyTimeTables[i] != nil {
+ if err := m.DailyTimeTables[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("DailyTimeTables" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3DailyTimeTable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_n1_data.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_n1_data.go
index c68eae7a..b2be9d6e 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_n1_data.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_n1_data.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -165,6 +166,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecifi
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus wrapper p t x service d t o bus specification v3 n1 data based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3N1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateN1Datas(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3N1Data) contextValidateN1Datas(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.N1Datas); i++ {
+
+ if m.N1Datas[i] != nil {
+ if err := m.N1Datas[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("N1Datas" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3N1Data) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_news.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_news.go
index 55aeb3a7..07c8de2e 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_news.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_news.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -165,6 +166,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecifi
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus wrapper p t x service d t o bus specification v3 news based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3News) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateNewses(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3News) contextValidateNewses(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Newses); i++ {
+
+ if m.Newses[i] != nil {
+ if err := m.Newses[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Newses" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3News) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route_fare.go b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route_fare.go
index 8c4f2929..8db25cb7 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route_fare.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_bus_specification_v3_wrapper_bus_wrapper_p_t_x_service_d_t_o_bus_specification_v3_route_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -165,6 +166,38 @@ func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecifi
return nil
}
+// ContextValidate validate this p t x service d t o bus specification v3 wrapper bus wrapper p t x service d t o bus specification v3 route fare based on the context it is used
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3RouteFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateRouteFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3RouteFare) contextValidateRouteFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.RouteFares); i++ {
+
+ if m.RouteFares[i] != nil {
+ if err := m.RouteFares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("RouteFares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOBusSpecificationV3WrapperBusWrapperPTXServiceDTOBusSpecificationV3RouteFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_display_health.go b/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_display_health.go
index 181998f1..f9b0a44a 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_display_health.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_display_health.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -73,7 +75,6 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) Validate(formats s
}
func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) validateInbound(formats strfmt.Registry) error {
-
if swag.IsZero(m.Inbound) { // not required
return nil
}
@@ -82,7 +83,6 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) validateInbound(fo
}
func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) validateOutbound(formats strfmt.Registry) error {
-
if swag.IsZero(m.Outbound) { // not required
return nil
}
@@ -108,6 +108,34 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) validateServiceNam
return nil
}
+// ContextValidate validate this p t x service d t o shared specification v3 base display health based on the context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateInbound(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOutbound(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) contextValidateInbound(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) contextValidateOutbound(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BaseDisplayHealth) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_inbound.go b/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_inbound.go
index a8272315..863e370b 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_inbound.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_inbound.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -73,6 +75,11 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseInbound) validateStatus(formats s
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v3 base inbound based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BaseInbound) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BaseInbound) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go b/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go
index adc99033..b449af50 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -31,6 +33,11 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseNameType) Validate(formats strfmt
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v3 base name type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BaseNameType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BaseNameType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_outbound.go b/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_outbound.go
index c5028d96..2e474918 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_outbound.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_outbound.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -73,6 +75,11 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseOutbound) validateStatus(formats
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v3 base outbound based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BaseOutbound) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BaseOutbound) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_point_type.go b/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_point_type.go
index 71ace8e7..1dbc03a9 100644
--- a/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_point_type.go
+++ b/bus/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_point_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -29,6 +31,11 @@ func (m *PTXServiceDTOSharedSpecificationV3BasePointType) Validate(formats strfm
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v3 base point type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BasePointType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BasePointType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/oas.air.v2.json b/oas.air.v2.json
index 282bb79a..d273477a 100644
--- a/oas.air.v2.json
+++ b/oas.air.v2.json
@@ -83,6 +83,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.Airport"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -241,6 +244,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.Airline"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -317,6 +323,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.FIDSDeparture"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -400,6 +409,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.FIDSDeparture"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -476,6 +488,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.FIDSArrival"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -559,6 +574,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.FIDSArrival"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -635,6 +653,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.FIDS"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -717,6 +738,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.FIDS"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -787,6 +811,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.Airport_FIDS"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -864,6 +891,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.Airport_FIDS"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -940,6 +970,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.METAR"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1023,6 +1056,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.METAR"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1092,6 +1128,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.GeneralFlightSchedule"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1161,6 +1200,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Air.Specification.V2.GeneralFlightSchedule"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1277,7 +1319,7 @@
},
"GeoHash": {
"title": "String",
- "description": "位置雜湊",
+ "description": "地理空間編碼",
"type": "string"
}
}
@@ -1334,7 +1376,7 @@
}
]
},
- "AirportAdrress": {
+ "AirportAddress": {
"title": "String",
"description": "機場地址",
"type": "string"
diff --git a/oas.basic.v2.json b/oas.basic.v2.json
index 3aa56d9f..9da5d2b9 100644
--- a/oas.basic.v2.json
+++ b/oas.basic.v2.json
@@ -76,6 +76,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.Authority"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -145,6 +148,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.Provider"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -214,6 +220,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.Operator"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -289,6 +298,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Basic.Model.V2.BasicWrapper[PTX.Service.DTO.Shared.Specification.V2.Base.News]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
diff --git a/oas.bike.v2.json b/oas.bike.v2.json
index ef9e8329..a5198d9a 100644
--- a/oas.bike.v2.json
+++ b/oas.bike.v2.json
@@ -44,17 +44,17 @@
"Tainan"
],
"x-enum": {
- "NewTaipei": "新北市",
+ "Taichung": "臺中市",
"Hsinchu": "新竹市",
- "Kaohsiung": "高雄市",
- "PingtungCounty": "屏東縣",
- "Taipei": "臺北市",
"MiaoliCounty": "苗栗縣",
"ChanghuaCounty": "彰化縣",
- "Taichung": "臺中市",
+ "NewTaipei": "新北市",
+ "PingtungCounty": "屏東縣",
"KinmenCounty": "金門縣",
- "Tainan": "臺南市",
- "Taoyuan": "桃園市"
+ "Taoyuan": "桃園市",
+ "Taipei": "臺北市",
+ "Kaohsiung": "高雄市",
+ "Tainan": "臺南市"
}
},
{
@@ -116,6 +116,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bike.Specification.V2.BikeStation"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -153,17 +156,17 @@
"Tainan"
],
"x-enum": {
- "KinmenCounty": "金門縣",
- "Tainan": "臺南市",
- "Taoyuan": "桃園市",
- "MiaoliCounty": "苗栗縣",
"Taichung": "臺中市",
- "Kaohsiung": "高雄市",
"Hsinchu": "新竹市",
+ "MiaoliCounty": "苗栗縣",
+ "ChanghuaCounty": "彰化縣",
"NewTaipei": "新北市",
"PingtungCounty": "屏東縣",
- "ChanghuaCounty": "彰化縣",
- "Taipei": "臺北市"
+ "KinmenCounty": "金門縣",
+ "Taoyuan": "桃園市",
+ "Taipei": "臺北市",
+ "Kaohsiung": "高雄市",
+ "Tainan": "臺南市"
}
},
{
@@ -219,6 +222,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bike.Specification.V2.BikeAvailability"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -265,28 +271,28 @@
"Tainan"
],
"x-enum": {
- "HualienCounty": "花蓮縣",
- "YunlinCounty": "雲林縣",
- "Kaohsiung": "高雄市",
+ "Taichung": "臺中市",
+ "Keelung": "基隆市",
"Hsinchu": "新竹市",
- "PenghuCounty": "澎湖縣",
+ "HsinchuCounty": "新竹縣",
"MiaoliCounty": "苗栗縣",
- "YilanCounty": "宜蘭縣",
- "Tainan": "臺南市",
- "Taipei": "臺北市",
- "PingtungCounty": "屏東縣",
+ "ChanghuaCounty": "彰化縣",
+ "NewTaipei": "新北市",
+ "NantouCounty": "南投縣",
+ "YunlinCounty": "雲林縣",
"ChiayiCounty": "嘉義縣",
+ "Chiayi": "嘉義市",
+ "PingtungCounty": "屏東縣",
+ "YilanCounty": "宜蘭縣",
+ "HualienCounty": "花蓮縣",
"TaitungCounty": "臺東縣",
- "Taichung": "臺中市",
- "Taoyuan": "桃園市",
"KinmenCounty": "金門縣",
- "Keelung": "基隆市",
- "ChanghuaCounty": "彰化縣",
- "Chiayi": "嘉義市",
- "NantouCounty": "南投縣",
- "NewTaipei": "新北市",
- "HsinchuCounty": "新竹縣",
- "LienchiangCounty": "連江縣"
+ "PenghuCounty": "澎湖縣",
+ "LienchiangCounty": "連江縣",
+ "Taoyuan": "桃園市",
+ "Taipei": "臺北市",
+ "Kaohsiung": "高雄市",
+ "Tainan": "臺南市"
}
},
{
@@ -342,6 +348,169 @@
"$ref": "#/definitions/PTX.Service.DTO.Bike.Specification.V2.BikeShape"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ }
+ }
+ }
+ },
+ "/v2/Bike/Station/NearBy": {
+ "get": {
+ "tags": [
+ "Advanced"
+ ],
+ "summary": "取得指定[位置,範圍]的全臺公共自行車租借站位資料",
+ "description": "取得指定[位置,範圍]的全臺公共自行車租借站位資料",
+ "operationId": "BikeApi_Station_AllCity_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公尺)",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "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.Bike.Specification.V2.BikeStation"
+ }
+ }
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ }
+ }
+ }
+ },
+ "/v2/Bike/Availability/NearBy": {
+ "get": {
+ "tags": [
+ "Advanced"
+ ],
+ "summary": "取得指定[位置,範圍]的全臺公共自行車即時車位資料",
+ "description": "取得指定[位置,範圍]的全臺公共自行車即時車位資料",
+ "operationId": "BikeApi_Availability_AllCity_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公尺)",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "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.Bike.Specification.V2.BikeAvailability"
+ }
+ }
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -597,6 +766,10 @@
{
"name": "Bike",
"description": "自行車"
+ },
+ {
+ "name": "Advanced",
+ "description": "進階"
}
]
}
diff --git a/oas.bus.v2.json b/oas.bus.v2.json
index f0114925..23801fb9 100644
--- a/oas.bus.v2.json
+++ b/oas.bus.v2.json
@@ -46,19 +46,19 @@
"PenghuCounty"
],
"x-enum": {
- "YilanCounty": "宜蘭縣",
- "NantouCounty": "南投縣",
- "PenghuCounty": "澎湖縣",
- "ChiayiCounty": "嘉義縣",
"HsinchuCounty": "新竹縣",
- "ChanghuaCounty": "彰化縣",
- "MiaoliCounty": "苗栗縣",
"HualienCounty": "花蓮縣",
"Chiayi": "嘉義市",
+ "NantouCounty": "南投縣",
+ "YilanCounty": "宜蘭縣",
+ "PingtungCounty": "屏東縣",
+ "TaitungCounty": "臺東縣",
"YunlinCounty": "雲林縣",
"Hsinchu": "新竹市",
- "TaitungCounty": "臺東縣",
- "PingtungCounty": "屏東縣"
+ "ChiayiCounty": "嘉義縣",
+ "ChanghuaCounty": "彰化縣",
+ "PenghuCounty": "澎湖縣",
+ "MiaoliCounty": "苗栗縣"
}
},
{
@@ -131,6 +131,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -175,19 +178,19 @@
"PenghuCounty"
],
"x-enum": {
- "YilanCounty": "宜蘭縣",
- "NantouCounty": "南投縣",
- "PenghuCounty": "澎湖縣",
- "ChiayiCounty": "嘉義縣",
"HsinchuCounty": "新竹縣",
- "ChanghuaCounty": "彰化縣",
- "MiaoliCounty": "苗栗縣",
"HualienCounty": "花蓮縣",
"Chiayi": "嘉義市",
+ "NantouCounty": "南投縣",
+ "YilanCounty": "宜蘭縣",
+ "PingtungCounty": "屏東縣",
+ "TaitungCounty": "臺東縣",
"YunlinCounty": "雲林縣",
"Hsinchu": "新竹市",
- "TaitungCounty": "臺東縣",
- "PingtungCounty": "屏東縣"
+ "ChiayiCounty": "嘉義縣",
+ "ChanghuaCounty": "彰化縣",
+ "PenghuCounty": "澎湖縣",
+ "MiaoliCounty": "苗栗縣"
}
},
{
@@ -267,6 +270,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -311,19 +317,19 @@
"PenghuCounty"
],
"x-enum": {
- "ChanghuaCounty": "彰化縣",
+ "MiaoliCounty": "苗栗縣",
"PingtungCounty": "屏東縣",
- "Chiayi": "嘉義市",
- "YilanCounty": "宜蘭縣",
- "TaitungCounty": "臺東縣",
"ChiayiCounty": "嘉義縣",
- "PenghuCounty": "澎湖縣",
+ "HsinchuCounty": "新竹縣",
"HualienCounty": "花蓮縣",
+ "YilanCounty": "宜蘭縣",
+ "PenghuCounty": "澎湖縣",
"YunlinCounty": "雲林縣",
- "Hsinchu": "新竹市",
- "MiaoliCounty": "苗栗縣",
+ "TaitungCounty": "臺東縣",
"NantouCounty": "南投縣",
- "HsinchuCounty": "新竹縣"
+ "Chiayi": "嘉義市",
+ "ChanghuaCounty": "彰化縣",
+ "Hsinchu": "新竹市"
}
},
{
@@ -390,6 +396,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -434,19 +443,19 @@
"PenghuCounty"
],
"x-enum": {
- "ChanghuaCounty": "彰化縣",
+ "MiaoliCounty": "苗栗縣",
"PingtungCounty": "屏東縣",
- "Chiayi": "嘉義市",
- "YilanCounty": "宜蘭縣",
- "TaitungCounty": "臺東縣",
"ChiayiCounty": "嘉義縣",
- "PenghuCounty": "澎湖縣",
+ "HsinchuCounty": "新竹縣",
"HualienCounty": "花蓮縣",
+ "YilanCounty": "宜蘭縣",
+ "PenghuCounty": "澎湖縣",
"YunlinCounty": "雲林縣",
- "Hsinchu": "新竹市",
- "MiaoliCounty": "苗栗縣",
+ "TaitungCounty": "臺東縣",
"NantouCounty": "南投縣",
- "HsinchuCounty": "新竹縣"
+ "Chiayi": "嘉義市",
+ "ChanghuaCounty": "彰化縣",
+ "Hsinchu": "新竹市"
}
},
{
@@ -520,6 +529,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -564,19 +576,19 @@
"PenghuCounty"
],
"x-enum": {
- "HsinchuCounty": "新竹縣",
"ChanghuaCounty": "彰化縣",
+ "Hsinchu": "新竹市",
+ "NantouCounty": "南投縣",
"TaitungCounty": "臺東縣",
+ "PenghuCounty": "澎湖縣",
"ChiayiCounty": "嘉義縣",
"MiaoliCounty": "苗栗縣",
- "NantouCounty": "南投縣",
- "YunlinCounty": "雲林縣",
+ "HualienCounty": "花蓮縣",
+ "HsinchuCounty": "新竹縣",
+ "YilanCounty": "宜蘭縣",
"Chiayi": "嘉義市",
"PingtungCounty": "屏東縣",
- "HualienCounty": "花蓮縣",
- "PenghuCounty": "澎湖縣",
- "Hsinchu": "新竹市",
- "YilanCounty": "宜蘭縣"
+ "YunlinCounty": "雲林縣"
}
},
{
@@ -643,6 +655,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -687,19 +702,19 @@
"PenghuCounty"
],
"x-enum": {
- "HsinchuCounty": "新竹縣",
"ChanghuaCounty": "彰化縣",
+ "Hsinchu": "新竹市",
+ "NantouCounty": "南投縣",
"TaitungCounty": "臺東縣",
+ "PenghuCounty": "澎湖縣",
"ChiayiCounty": "嘉義縣",
"MiaoliCounty": "苗栗縣",
- "NantouCounty": "南投縣",
- "YunlinCounty": "雲林縣",
+ "HualienCounty": "花蓮縣",
+ "HsinchuCounty": "新竹縣",
+ "YilanCounty": "宜蘭縣",
"Chiayi": "嘉義市",
"PingtungCounty": "屏東縣",
- "HualienCounty": "花蓮縣",
- "PenghuCounty": "澎湖縣",
- "Hsinchu": "新竹市",
- "YilanCounty": "宜蘭縣"
+ "YunlinCounty": "雲林縣"
}
},
{
@@ -773,6 +788,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -826,28 +844,28 @@
"LienchiangCounty"
],
"x-enum": {
- "Taoyuan": "桃園市",
- "YilanCounty": "宜蘭縣",
- "NantouCounty": "南投縣",
- "PenghuCounty": "澎湖縣",
- "ChanghuaCounty": "彰化縣",
"Chiayi": "嘉義市",
+ "LienchiangCounty": "連江縣",
"Kaohsiung": "高雄市",
- "HualienCounty": "花蓮縣",
- "KinmenCounty": "金門縣",
- "Taichung": "臺中市",
+ "Keelung": "基隆市",
"TaitungCounty": "臺東縣",
- "HsinchuCounty": "新竹縣",
- "PingtungCounty": "屏東縣",
- "Hsinchu": "新竹市",
- "ChiayiCounty": "嘉義縣",
"MiaoliCounty": "苗栗縣",
+ "Hsinchu": "新竹市",
+ "ChanghuaCounty": "彰化縣",
+ "YilanCounty": "宜蘭縣",
+ "YunlinCounty": "雲林縣",
+ "Taichung": "臺中市",
"NewTaipei": "新北市",
- "LienchiangCounty": "連江縣",
+ "KinmenCounty": "金門縣",
+ "Taipei": "臺北市",
+ "ChiayiCounty": "嘉義縣",
+ "HualienCounty": "花蓮縣",
+ "Taoyuan": "桃園市",
+ "PenghuCounty": "澎湖縣",
"Tainan": "臺南市",
- "YunlinCounty": "雲林縣",
- "Keelung": "基隆市",
- "Taipei": "臺北市"
+ "PingtungCounty": "屏東縣",
+ "HsinchuCounty": "新竹縣",
+ "NantouCounty": "南投縣"
}
},
{
@@ -920,6 +938,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -973,28 +994,28 @@
"LienchiangCounty"
],
"x-enum": {
- "Taoyuan": "桃園市",
- "YilanCounty": "宜蘭縣",
- "NantouCounty": "南投縣",
- "PenghuCounty": "澎湖縣",
- "ChanghuaCounty": "彰化縣",
"Chiayi": "嘉義市",
+ "LienchiangCounty": "連江縣",
"Kaohsiung": "高雄市",
- "HualienCounty": "花蓮縣",
- "KinmenCounty": "金門縣",
- "Taichung": "臺中市",
+ "Keelung": "基隆市",
"TaitungCounty": "臺東縣",
- "HsinchuCounty": "新竹縣",
- "PingtungCounty": "屏東縣",
- "Hsinchu": "新竹市",
- "ChiayiCounty": "嘉義縣",
"MiaoliCounty": "苗栗縣",
+ "Hsinchu": "新竹市",
+ "ChanghuaCounty": "彰化縣",
+ "YilanCounty": "宜蘭縣",
+ "YunlinCounty": "雲林縣",
+ "Taichung": "臺中市",
"NewTaipei": "新北市",
- "LienchiangCounty": "連江縣",
+ "KinmenCounty": "金門縣",
+ "Taipei": "臺北市",
+ "ChiayiCounty": "嘉義縣",
+ "HualienCounty": "花蓮縣",
+ "Taoyuan": "桃園市",
+ "PenghuCounty": "澎湖縣",
"Tainan": "臺南市",
- "YunlinCounty": "雲林縣",
- "Keelung": "基隆市",
- "Taipei": "臺北市"
+ "PingtungCounty": "屏東縣",
+ "HsinchuCounty": "新竹縣",
+ "NantouCounty": "南投縣"
}
},
{
@@ -1074,6 +1095,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1127,28 +1151,28 @@
"LienchiangCounty"
],
"x-enum": {
- "Keelung": "基隆市",
- "PingtungCounty": "屏東縣",
- "YilanCounty": "宜蘭縣",
- "Taipei": "臺北市",
- "ChanghuaCounty": "彰化縣",
- "NantouCounty": "南投縣",
+ "LienchiangCounty": "連江縣",
"PenghuCounty": "澎湖縣",
- "NewTaipei": "新北市",
- "HualienCounty": "花蓮縣",
+ "YunlinCounty": "雲林縣",
"HsinchuCounty": "新竹縣",
- "Kaohsiung": "高雄市",
- "LienchiangCounty": "連江縣",
- "Chiayi": "嘉義市",
+ "ChanghuaCounty": "彰化縣",
+ "Hsinchu": "新竹市",
+ "YilanCounty": "宜蘭縣",
"MiaoliCounty": "苗栗縣",
+ "Taoyuan": "桃園市",
+ "TaitungCounty": "臺東縣",
+ "PingtungCounty": "屏東縣",
+ "Taipei": "臺北市",
+ "HualienCounty": "花蓮縣",
+ "NantouCounty": "南投縣",
"Taichung": "臺中市",
- "KinmenCounty": "金門縣",
- "YunlinCounty": "雲林縣",
+ "NewTaipei": "新北市",
"ChiayiCounty": "嘉義縣",
- "TaitungCounty": "臺東縣",
- "Taoyuan": "桃園市",
- "Hsinchu": "新竹市",
- "Tainan": "臺南市"
+ "Chiayi": "嘉義市",
+ "Kaohsiung": "高雄市",
+ "Keelung": "基隆市",
+ "Tainan": "臺南市",
+ "KinmenCounty": "金門縣"
}
},
{
@@ -1215,6 +1239,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1268,28 +1295,28 @@
"LienchiangCounty"
],
"x-enum": {
- "Keelung": "基隆市",
- "PingtungCounty": "屏東縣",
- "YilanCounty": "宜蘭縣",
- "Taipei": "臺北市",
- "ChanghuaCounty": "彰化縣",
- "NantouCounty": "南投縣",
+ "LienchiangCounty": "連江縣",
"PenghuCounty": "澎湖縣",
- "NewTaipei": "新北市",
- "HualienCounty": "花蓮縣",
+ "YunlinCounty": "雲林縣",
"HsinchuCounty": "新竹縣",
- "Kaohsiung": "高雄市",
- "LienchiangCounty": "連江縣",
- "Chiayi": "嘉義市",
+ "ChanghuaCounty": "彰化縣",
+ "Hsinchu": "新竹市",
+ "YilanCounty": "宜蘭縣",
"MiaoliCounty": "苗栗縣",
+ "Taoyuan": "桃園市",
+ "TaitungCounty": "臺東縣",
+ "PingtungCounty": "屏東縣",
+ "Taipei": "臺北市",
+ "HualienCounty": "花蓮縣",
+ "NantouCounty": "南投縣",
"Taichung": "臺中市",
- "KinmenCounty": "金門縣",
- "YunlinCounty": "雲林縣",
+ "NewTaipei": "新北市",
"ChiayiCounty": "嘉義縣",
- "TaitungCounty": "臺東縣",
- "Taoyuan": "桃園市",
- "Hsinchu": "新竹市",
- "Tainan": "臺南市"
+ "Chiayi": "嘉義市",
+ "Kaohsiung": "高雄市",
+ "Keelung": "基隆市",
+ "Tainan": "臺南市",
+ "KinmenCounty": "金門縣"
}
},
{
@@ -1363,6 +1390,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1416,28 +1446,28 @@
"LienchiangCounty"
],
"x-enum": {
- "PenghuCounty": "澎湖縣",
+ "HsinchuCounty": "新竹縣",
+ "MiaoliCounty": "苗栗縣",
+ "LienchiangCounty": "連江縣",
+ "Taoyuan": "桃園市",
+ "ChanghuaCounty": "彰化縣",
+ "Kaohsiung": "高雄市",
"Taipei": "臺北市",
+ "Hsinchu": "新竹市",
+ "YilanCounty": "宜蘭縣",
+ "TaitungCounty": "臺東縣",
"YunlinCounty": "雲林縣",
- "ChiayiCounty": "嘉義縣",
- "Kaohsiung": "高雄市",
- "NantouCounty": "南投縣",
+ "Chiayi": "嘉義市",
+ "PenghuCounty": "澎湖縣",
"KinmenCounty": "金門縣",
- "PingtungCounty": "屏東縣",
"Taichung": "臺中市",
- "TaitungCounty": "臺東縣",
- "MiaoliCounty": "苗栗縣",
- "Chiayi": "嘉義市",
+ "Keelung": "基隆市",
"Tainan": "臺南市",
- "ChanghuaCounty": "彰化縣",
- "Taoyuan": "桃園市",
+ "HualienCounty": "花蓮縣",
"NewTaipei": "新北市",
- "YilanCounty": "宜蘭縣",
- "LienchiangCounty": "連江縣",
- "Hsinchu": "新竹市",
- "HsinchuCounty": "新竹縣",
- "HualienCounty": "花蓮縣",
- "Keelung": "基隆市"
+ "ChiayiCounty": "嘉義縣",
+ "NantouCounty": "南投縣",
+ "PingtungCounty": "屏東縣"
}
},
{
@@ -1504,6 +1534,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1557,28 +1590,28 @@
"LienchiangCounty"
],
"x-enum": {
- "PenghuCounty": "澎湖縣",
+ "HsinchuCounty": "新竹縣",
+ "MiaoliCounty": "苗栗縣",
+ "LienchiangCounty": "連江縣",
+ "Taoyuan": "桃園市",
+ "ChanghuaCounty": "彰化縣",
+ "Kaohsiung": "高雄市",
"Taipei": "臺北市",
+ "Hsinchu": "新竹市",
+ "YilanCounty": "宜蘭縣",
+ "TaitungCounty": "臺東縣",
"YunlinCounty": "雲林縣",
- "ChiayiCounty": "嘉義縣",
- "Kaohsiung": "高雄市",
- "NantouCounty": "南投縣",
+ "Chiayi": "嘉義市",
+ "PenghuCounty": "澎湖縣",
"KinmenCounty": "金門縣",
- "PingtungCounty": "屏東縣",
"Taichung": "臺中市",
- "TaitungCounty": "臺東縣",
- "MiaoliCounty": "苗栗縣",
- "Chiayi": "嘉義市",
+ "Keelung": "基隆市",
"Tainan": "臺南市",
- "ChanghuaCounty": "彰化縣",
- "Taoyuan": "桃園市",
- "NewTaipei": "新北市",
- "YilanCounty": "宜蘭縣",
- "LienchiangCounty": "連江縣",
- "Hsinchu": "新竹市",
- "HsinchuCounty": "新竹縣",
"HualienCounty": "花蓮縣",
- "Keelung": "基隆市"
+ "NewTaipei": "新北市",
+ "ChiayiCounty": "嘉義縣",
+ "NantouCounty": "南投縣",
+ "PingtungCounty": "屏東縣"
}
},
{
@@ -1652,6 +1685,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1707,28 +1743,28 @@
"LienchiangCounty"
],
"x-enum": {
- "YilanCounty": "宜蘭縣",
- "ChanghuaCounty": "彰化縣",
- "KinmenCounty": "金門縣",
+ "Tainan": "臺南市",
+ "Taoyuan": "桃園市",
+ "MiaoliCounty": "苗栗縣",
+ "HsinchuCounty": "新竹縣",
"HualienCounty": "花蓮縣",
- "PingtungCounty": "屏東縣",
- "Taichung": "臺中市",
+ "NantouCounty": "南投縣",
+ "Chiayi": "嘉義市",
"NewTaipei": "新北市",
- "Tainan": "臺南市",
- "Kaohsiung": "高雄市",
- "ChiayiCounty": "嘉義縣",
+ "ChanghuaCounty": "彰化縣",
"Keelung": "基隆市",
- "TaitungCounty": "臺東縣",
"YunlinCounty": "雲林縣",
- "Taoyuan": "桃園市",
- "Chiayi": "嘉義市",
- "NantouCounty": "南投縣",
- "HsinchuCounty": "新竹縣",
+ "YilanCounty": "宜蘭縣",
"PenghuCounty": "澎湖縣",
- "LienchiangCounty": "連江縣",
"Taipei": "臺北市",
+ "Taichung": "臺中市",
+ "ChiayiCounty": "嘉義縣",
+ "KinmenCounty": "金門縣",
+ "LienchiangCounty": "連江縣",
+ "PingtungCounty": "屏東縣",
"Hsinchu": "新竹市",
- "MiaoliCounty": "苗栗縣"
+ "TaitungCounty": "臺東縣",
+ "Kaohsiung": "高雄市"
}
},
{
@@ -1760,6 +1796,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusVersion"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1813,28 +1852,28 @@
"LienchiangCounty"
],
"x-enum": {
- "MiaoliCounty": "苗栗縣",
- "PingtungCounty": "屏東縣",
- "KinmenCounty": "金門縣",
- "PenghuCounty": "澎湖縣",
- "Keelung": "基隆市",
- "YunlinCounty": "雲林縣",
- "ChiayiCounty": "嘉義縣",
"HsinchuCounty": "新竹縣",
- "LienchiangCounty": "連江縣",
- "Hsinchu": "新竹市",
+ "YunlinCounty": "雲林縣",
"TaitungCounty": "臺東縣",
+ "KinmenCounty": "金門縣",
+ "HualienCounty": "花蓮縣",
+ "Kaohsiung": "高雄市",
+ "PingtungCounty": "屏東縣",
"NantouCounty": "南投縣",
- "YilanCounty": "宜蘭縣",
- "Taipei": "臺北市",
+ "Hsinchu": "新竹市",
+ "Taichung": "臺中市",
+ "ChiayiCounty": "嘉義縣",
"Tainan": "臺南市",
+ "YilanCounty": "宜蘭縣",
+ "Keelung": "基隆市",
+ "Taoyuan": "桃園市",
+ "MiaoliCounty": "苗栗縣",
"NewTaipei": "新北市",
- "Taichung": "臺中市",
- "Kaohsiung": "高雄市",
"ChanghuaCounty": "彰化縣",
- "HualienCounty": "花蓮縣",
- "Taoyuan": "桃園市",
- "Chiayi": "嘉義市"
+ "PenghuCounty": "澎湖縣",
+ "LienchiangCounty": "連江縣",
+ "Chiayi": "嘉義市",
+ "Taipei": "臺北市"
}
},
{
@@ -1901,6 +1940,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1954,28 +1996,28 @@
"LienchiangCounty"
],
"x-enum": {
- "NantouCounty": "南投縣",
+ "Keelung": "基隆市",
"Taipei": "臺北市",
- "Tainan": "臺南市",
+ "MiaoliCounty": "苗栗縣",
"NewTaipei": "新北市",
- "ChanghuaCounty": "彰化縣",
- "HualienCounty": "花蓮縣",
+ "Tainan": "臺南市",
+ "Taichung": "臺中市",
+ "KinmenCounty": "金門縣",
"Chiayi": "嘉義市",
- "YunlinCounty": "雲林縣",
- "HsinchuCounty": "新竹縣",
+ "YilanCounty": "宜蘭縣",
"Taoyuan": "桃園市",
- "ChiayiCounty": "嘉義縣",
- "MiaoliCounty": "苗栗縣",
- "KinmenCounty": "金門縣",
- "TaitungCounty": "臺東縣",
+ "HualienCounty": "花蓮縣",
+ "ChanghuaCounty": "彰化縣",
+ "YunlinCounty": "雲林縣",
"Hsinchu": "新竹市",
- "Taichung": "臺中市",
- "Keelung": "基隆市",
- "Kaohsiung": "高雄市",
- "LienchiangCounty": "連江縣",
+ "NantouCounty": "南投縣",
+ "ChiayiCounty": "嘉義縣",
"PenghuCounty": "澎湖縣",
+ "LienchiangCounty": "連江縣",
+ "TaitungCounty": "臺東縣",
"PingtungCounty": "屏東縣",
- "YilanCounty": "宜蘭縣"
+ "HsinchuCounty": "新竹縣",
+ "Kaohsiung": "高雄市"
}
},
{
@@ -2042,6 +2084,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2095,28 +2140,28 @@
"LienchiangCounty"
],
"x-enum": {
- "NantouCounty": "南投縣",
+ "Keelung": "基隆市",
"Taipei": "臺北市",
- "Tainan": "臺南市",
+ "MiaoliCounty": "苗栗縣",
"NewTaipei": "新北市",
- "ChanghuaCounty": "彰化縣",
- "HualienCounty": "花蓮縣",
+ "Tainan": "臺南市",
+ "Taichung": "臺中市",
+ "KinmenCounty": "金門縣",
"Chiayi": "嘉義市",
- "YunlinCounty": "雲林縣",
- "HsinchuCounty": "新竹縣",
+ "YilanCounty": "宜蘭縣",
"Taoyuan": "桃園市",
- "ChiayiCounty": "嘉義縣",
- "MiaoliCounty": "苗栗縣",
- "KinmenCounty": "金門縣",
- "TaitungCounty": "臺東縣",
+ "HualienCounty": "花蓮縣",
+ "ChanghuaCounty": "彰化縣",
+ "YunlinCounty": "雲林縣",
"Hsinchu": "新竹市",
- "Taichung": "臺中市",
- "Keelung": "基隆市",
- "Kaohsiung": "高雄市",
- "LienchiangCounty": "連江縣",
+ "NantouCounty": "南投縣",
+ "ChiayiCounty": "嘉義縣",
"PenghuCounty": "澎湖縣",
+ "LienchiangCounty": "連江縣",
+ "TaitungCounty": "臺東縣",
"PingtungCounty": "屏東縣",
- "YilanCounty": "宜蘭縣"
+ "HsinchuCounty": "新竹縣",
+ "Kaohsiung": "高雄市"
}
},
{
@@ -2190,6 +2235,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2243,28 +2291,28 @@
"Taipei"
],
"x-enum": {
- "Taipei": "臺北市",
+ "Keelung": "基隆市",
+ "Hsinchu": "新竹市",
+ "KinmenCounty": "金門縣",
+ "ChiayiCounty": "嘉義縣",
+ "Kaohsiung": "高雄市",
+ "NantouCounty": "南投縣",
+ "Taichung": "臺中市",
"PenghuCounty": "澎湖縣",
+ "Tainan": "臺南市",
+ "ChanghuaCounty": "彰化縣",
+ "Taoyuan": "桃園市",
+ "Taipei": "臺北市",
+ "MiaoliCounty": "苗栗縣",
+ "Chiayi": "嘉義市",
"YilanCounty": "宜蘭縣",
- "NantouCounty": "南投縣",
+ "HsinchuCounty": "新竹縣",
"YunlinCounty": "雲林縣",
"PingtungCounty": "屏東縣",
- "KinmenCounty": "金門縣",
- "Hsinchu": "新竹市",
- "TaitungCounty": "臺東縣",
- "Keelung": "基隆市",
- "ChanghuaCounty": "彰化縣",
- "HsinchuCounty": "新竹縣",
- "NewTaipei": "新北市",
"HualienCounty": "花蓮縣",
- "ChiayiCounty": "嘉義縣",
- "Chiayi": "嘉義市",
- "Tainan": "臺南市",
- "Taichung": "臺中市",
- "Taoyuan": "桃園市",
"LienchiangCounty": "連江縣",
- "MiaoliCounty": "苗栗縣",
- "Kaohsiung": "高雄市"
+ "NewTaipei": "新北市",
+ "TaitungCounty": "臺東縣"
}
},
{
@@ -2337,6 +2385,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2386,24 +2437,24 @@
"KinmenCounty"
],
"x-enum": {
+ "NantouCounty": "南投縣",
+ "HualienCounty": "花蓮縣",
+ "MiaoliCounty": "苗栗縣",
+ "Hsinchu": "新竹市",
"NewTaipei": "新北市",
+ "YilanCounty": "宜蘭縣",
+ "YunlinCounty": "雲林縣",
+ "Tainan": "臺南市",
"Chiayi": "嘉義市",
- "TaitungCounty": "臺東縣",
- "NantouCounty": "南投縣",
- "ChanghuaCounty": "彰化縣",
- "Taipei": "臺北市",
+ "Kaohsiung": "高雄市",
"ChiayiCounty": "嘉義縣",
+ "Taipei": "臺北市",
+ "ChanghuaCounty": "彰化縣",
+ "KinmenCounty": "金門縣",
"PenghuCounty": "澎湖縣",
"HsinchuCounty": "新竹縣",
- "Kaohsiung": "高雄市",
- "Hsinchu": "新竹市",
"PingtungCounty": "屏東縣",
- "KinmenCounty": "金門縣",
- "Tainan": "臺南市",
- "YunlinCounty": "雲林縣",
- "HualienCounty": "花蓮縣",
- "MiaoliCounty": "苗栗縣",
- "YilanCounty": "宜蘭縣"
+ "TaitungCounty": "臺東縣"
}
},
{
@@ -2476,6 +2527,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2510,8 +2564,8 @@
"NewTaipei"
],
"x-enum": {
- "Taipei": "臺北市",
"Tainan": "臺南市",
+ "Taipei": "臺北市",
"NewTaipei": "新北市"
}
},
@@ -2579,6 +2633,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2613,8 +2670,8 @@
"NewTaipei"
],
"x-enum": {
- "Taipei": "臺北市",
"Tainan": "臺南市",
+ "Taipei": "臺北市",
"NewTaipei": "新北市"
}
},
@@ -2689,6 +2746,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2742,28 +2802,28 @@
"LienchiangCounty"
],
"x-enum": {
+ "ChiayiCounty": "嘉義縣",
+ "HsinchuCounty": "新竹縣",
"NewTaipei": "新北市",
- "Keelung": "基隆市",
- "Hsinchu": "新竹市",
- "Chiayi": "嘉義市",
- "HualienCounty": "花蓮縣",
- "Taoyuan": "桃園市",
- "KinmenCounty": "金門縣",
- "PingtungCounty": "屏東縣",
- "Kaohsiung": "高雄市",
- "NantouCounty": "南投縣",
"Tainan": "臺南市",
- "ChanghuaCounty": "彰化縣",
- "Taipei": "臺北市",
- "TaitungCounty": "臺東縣",
+ "HualienCounty": "花蓮縣",
"MiaoliCounty": "苗栗縣",
+ "NantouCounty": "南投縣",
+ "Keelung": "基隆市",
"Taichung": "臺中市",
+ "Taipei": "臺北市",
+ "Taoyuan": "桃園市",
+ "Chiayi": "嘉義市",
+ "ChanghuaCounty": "彰化縣",
+ "PingtungCounty": "屏東縣",
"PenghuCounty": "澎湖縣",
- "HsinchuCounty": "新竹縣",
+ "Hsinchu": "新竹市",
+ "TaitungCounty": "臺東縣",
+ "KinmenCounty": "金門縣",
"YilanCounty": "宜蘭縣",
- "ChiayiCounty": "嘉義縣",
+ "YunlinCounty": "雲林縣",
"LienchiangCounty": "連江縣",
- "YunlinCounty": "雲林縣"
+ "Kaohsiung": "高雄市"
}
},
{
@@ -2830,6 +2890,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2883,28 +2946,28 @@
"LienchiangCounty"
],
"x-enum": {
+ "ChiayiCounty": "嘉義縣",
+ "HsinchuCounty": "新竹縣",
"NewTaipei": "新北市",
- "Keelung": "基隆市",
- "Hsinchu": "新竹市",
- "Chiayi": "嘉義市",
- "HualienCounty": "花蓮縣",
- "Taoyuan": "桃園市",
- "KinmenCounty": "金門縣",
- "PingtungCounty": "屏東縣",
- "Kaohsiung": "高雄市",
- "NantouCounty": "南投縣",
"Tainan": "臺南市",
- "ChanghuaCounty": "彰化縣",
- "Taipei": "臺北市",
- "TaitungCounty": "臺東縣",
+ "HualienCounty": "花蓮縣",
"MiaoliCounty": "苗栗縣",
+ "NantouCounty": "南投縣",
+ "Keelung": "基隆市",
"Taichung": "臺中市",
+ "Taipei": "臺北市",
+ "Taoyuan": "桃園市",
+ "Chiayi": "嘉義市",
+ "ChanghuaCounty": "彰化縣",
+ "PingtungCounty": "屏東縣",
"PenghuCounty": "澎湖縣",
- "HsinchuCounty": "新竹縣",
+ "Hsinchu": "新竹市",
+ "TaitungCounty": "臺東縣",
+ "KinmenCounty": "金門縣",
"YilanCounty": "宜蘭縣",
- "ChiayiCounty": "嘉義縣",
+ "YunlinCounty": "雲林縣",
"LienchiangCounty": "連江縣",
- "YunlinCounty": "雲林縣"
+ "Kaohsiung": "高雄市"
}
},
{
@@ -2978,6 +3041,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -3027,24 +3093,24 @@
"PenghuCounty"
],
"x-enum": {
+ "HsinchuCounty": "新竹縣",
+ "TaitungCounty": "臺東縣",
"NewTaipei": "新北市",
- "KinmenCounty": "金門縣",
- "Chiayi": "嘉義市",
"MiaoliCounty": "苗栗縣",
- "HualienCounty": "花蓮縣",
"Hsinchu": "新竹市",
- "TaitungCounty": "臺東縣",
+ "Taipei": "臺北市",
+ "Tainan": "臺南市",
+ "ChanghuaCounty": "彰化縣",
+ "Keelung": "基隆市",
"ChiayiCounty": "嘉義縣",
"YunlinCounty": "雲林縣",
- "Tainan": "臺南市",
+ "KinmenCounty": "金門縣",
+ "PingtungCounty": "屏東縣",
"YilanCounty": "宜蘭縣",
- "Keelung": "基隆市",
- "PenghuCounty": "澎湖縣",
+ "Chiayi": "嘉義市",
"NantouCounty": "南投縣",
- "PingtungCounty": "屏東縣",
- "HsinchuCounty": "新竹縣",
- "ChanghuaCounty": "彰化縣",
- "Taipei": "臺北市"
+ "HualienCounty": "花蓮縣",
+ "PenghuCounty": "澎湖縣"
}
},
{
@@ -3111,6 +3177,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -3160,24 +3229,24 @@
"PenghuCounty"
],
"x-enum": {
+ "HsinchuCounty": "新竹縣",
+ "TaitungCounty": "臺東縣",
"NewTaipei": "新北市",
- "KinmenCounty": "金門縣",
- "Chiayi": "嘉義市",
"MiaoliCounty": "苗栗縣",
- "HualienCounty": "花蓮縣",
"Hsinchu": "新竹市",
- "TaitungCounty": "臺東縣",
+ "Taipei": "臺北市",
+ "Tainan": "臺南市",
+ "ChanghuaCounty": "彰化縣",
+ "Keelung": "基隆市",
"ChiayiCounty": "嘉義縣",
"YunlinCounty": "雲林縣",
- "Tainan": "臺南市",
+ "KinmenCounty": "金門縣",
+ "PingtungCounty": "屏東縣",
"YilanCounty": "宜蘭縣",
- "Keelung": "基隆市",
- "PenghuCounty": "澎湖縣",
+ "Chiayi": "嘉義市",
"NantouCounty": "南投縣",
- "PingtungCounty": "屏東縣",
- "HsinchuCounty": "新竹縣",
- "ChanghuaCounty": "彰化縣",
- "Taipei": "臺北市"
+ "HualienCounty": "花蓮縣",
+ "PenghuCounty": "澎湖縣"
}
},
{
@@ -3251,6 +3320,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -3303,28 +3375,28 @@
"LienchiangCounty"
],
"x-enum": {
- "Chiayi": "嘉義市",
- "NewTaipei": "新北市",
- "ChiayiCounty": "嘉義縣",
- "ChanghuaCounty": "彰化縣",
- "NantouCounty": "南投縣",
+ "Hsinchu": "新竹市",
"PenghuCounty": "澎湖縣",
- "HsinchuCounty": "新竹縣",
- "HualienCounty": "花蓮縣",
- "MiaoliCounty": "苗栗縣",
"Kaohsiung": "高雄市",
- "Taipei": "臺北市",
- "KinmenCounty": "金門縣",
+ "TaitungCounty": "臺東縣",
"Tainan": "臺南市",
+ "HualienCounty": "花蓮縣",
+ "HsinchuCounty": "新竹縣",
"LienchiangCounty": "連江縣",
- "Taichung": "臺中市",
- "YunlinCounty": "雲林縣",
- "TaitungCounty": "臺東縣",
+ "NewTaipei": "新北市",
"PingtungCounty": "屏東縣",
- "YilanCounty": "宜蘭縣",
"Keelung": "基隆市",
+ "MiaoliCounty": "苗栗縣",
+ "Taichung": "臺中市",
"Taoyuan": "桃園市",
- "Hsinchu": "新竹市"
+ "ChiayiCounty": "嘉義縣",
+ "KinmenCounty": "金門縣",
+ "YilanCounty": "宜蘭縣",
+ "Chiayi": "嘉義市",
+ "Taipei": "臺北市",
+ "YunlinCounty": "雲林縣",
+ "ChanghuaCounty": "彰化縣",
+ "NantouCounty": "南投縣"
}
},
{
@@ -3391,6 +3463,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -3427,17 +3502,43 @@
"Tainan",
"Kaohsiung",
"Keelung",
- "KinmenCounty"
+ "KinmenCounty",
+ "Hsinchu",
+ "HsinchuCounty",
+ "MiaoliCounty",
+ "ChanghuaCounty",
+ "NantouCounty",
+ "YunlinCounty",
+ "ChiayiCounty",
+ "Chiayi",
+ "PingtungCounty",
+ "YilanCounty",
+ "HualienCounty",
+ "TaitungCounty",
+ "PenghuCounty"
],
"x-enum": {
- "Taichung": "臺中市",
- "KinmenCounty": "金門縣",
"Tainan": "臺南市",
- "Taoyuan": "桃園市",
+ "Hsinchu": "新竹市",
+ "Keelung": "基隆市",
+ "YilanCounty": "宜蘭縣",
+ "YunlinCounty": "雲林縣",
"Taipei": "臺北市",
+ "PingtungCounty": "屏東縣",
+ "KinmenCounty": "金門縣",
+ "Taichung": "臺中市",
+ "HualienCounty": "花蓮縣",
+ "PenghuCounty": "澎湖縣",
+ "ChiayiCounty": "嘉義縣",
+ "Chiayi": "嘉義市",
+ "ChanghuaCounty": "彰化縣",
+ "MiaoliCounty": "苗栗縣",
+ "Taoyuan": "桃園市",
+ "TaitungCounty": "臺東縣",
+ "NantouCounty": "南投縣",
+ "NewTaipei": "新北市",
"Kaohsiung": "高雄市",
- "Keelung": "基隆市",
- "NewTaipei": "新北市"
+ "HsinchuCounty": "新竹縣"
}
},
{
@@ -3504,6 +3605,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -3540,17 +3644,43 @@
"Tainan",
"Kaohsiung",
"Keelung",
- "KinmenCounty"
+ "KinmenCounty",
+ "Hsinchu",
+ "HsinchuCounty",
+ "MiaoliCounty",
+ "ChanghuaCounty",
+ "NantouCounty",
+ "YunlinCounty",
+ "ChiayiCounty",
+ "Chiayi",
+ "PingtungCounty",
+ "YilanCounty",
+ "HualienCounty",
+ "TaitungCounty",
+ "PenghuCounty"
],
"x-enum": {
- "Taichung": "臺中市",
- "KinmenCounty": "金門縣",
"Tainan": "臺南市",
- "Taoyuan": "桃園市",
+ "Hsinchu": "新竹市",
+ "Keelung": "基隆市",
+ "YilanCounty": "宜蘭縣",
+ "YunlinCounty": "雲林縣",
"Taipei": "臺北市",
+ "PingtungCounty": "屏東縣",
+ "KinmenCounty": "金門縣",
+ "Taichung": "臺中市",
+ "HualienCounty": "花蓮縣",
+ "PenghuCounty": "澎湖縣",
+ "ChiayiCounty": "嘉義縣",
+ "Chiayi": "嘉義市",
+ "ChanghuaCounty": "彰化縣",
+ "MiaoliCounty": "苗栗縣",
+ "Taoyuan": "桃園市",
+ "TaitungCounty": "臺東縣",
+ "NantouCounty": "南投縣",
+ "NewTaipei": "新北市",
"Kaohsiung": "高雄市",
- "Keelung": "基隆市",
- "NewTaipei": "新北市"
+ "HsinchuCounty": "新竹縣"
}
},
{
@@ -3624,6 +3754,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -3668,28 +3801,28 @@
"KinmenCounty"
],
"x-enum": {
- "Taichung": "臺中市",
+ "MiaoliCounty": "苗栗縣",
+ "YunlinCounty": "雲林縣",
+ "ChanghuaCounty": "彰化縣",
+ "Chiayi": "嘉義市",
"KinmenCounty": "金門縣",
- "LienchiangCounty": "連江縣",
- "Tainan": "臺南市",
+ "ChiayiCounty": "嘉義縣",
+ "Keelung": "基隆市",
"HualienCounty": "花蓮縣",
+ "PingtungCounty": "屏東縣",
+ "Tainan": "臺南市",
+ "Hsinchu": "新竹市",
+ "NewTaipei": "新北市",
+ "NantouCounty": "南投縣",
+ "Taoyuan": "桃園市",
"HsinchuCounty": "新竹縣",
- "YunlinCounty": "雲林縣",
"TaitungCounty": "臺東縣",
+ "Taipei": "臺北市",
"PenghuCounty": "澎湖縣",
- "MiaoliCounty": "苗栗縣",
- "Keelung": "基隆市",
- "NantouCounty": "南投縣",
- "Taoyuan": "桃園市",
- "ChiayiCounty": "嘉義縣",
- "PingtungCounty": "屏東縣",
- "Hsinchu": "新竹市",
- "ChanghuaCounty": "彰化縣",
"Kaohsiung": "高雄市",
- "Taipei": "臺北市",
- "Chiayi": "嘉義市",
- "YilanCounty": "宜蘭縣",
- "NewTaipei": "新北市"
+ "LienchiangCounty": "連江縣",
+ "Taichung": "臺中市",
+ "YilanCounty": "宜蘭縣"
}
},
{
@@ -3756,6 +3889,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -3800,28 +3936,28 @@
"KinmenCounty"
],
"x-enum": {
- "Taichung": "臺中市",
+ "MiaoliCounty": "苗栗縣",
+ "YunlinCounty": "雲林縣",
+ "ChanghuaCounty": "彰化縣",
+ "Chiayi": "嘉義市",
"KinmenCounty": "金門縣",
- "LienchiangCounty": "連江縣",
- "Tainan": "臺南市",
+ "ChiayiCounty": "嘉義縣",
+ "Keelung": "基隆市",
"HualienCounty": "花蓮縣",
+ "PingtungCounty": "屏東縣",
+ "Tainan": "臺南市",
+ "Hsinchu": "新竹市",
+ "NewTaipei": "新北市",
+ "NantouCounty": "南投縣",
+ "Taoyuan": "桃園市",
"HsinchuCounty": "新竹縣",
- "YunlinCounty": "雲林縣",
"TaitungCounty": "臺東縣",
+ "Taipei": "臺北市",
"PenghuCounty": "澎湖縣",
- "MiaoliCounty": "苗栗縣",
- "Keelung": "基隆市",
- "NantouCounty": "南投縣",
- "Taoyuan": "桃園市",
- "ChiayiCounty": "嘉義縣",
- "PingtungCounty": "屏東縣",
- "Hsinchu": "新竹市",
- "ChanghuaCounty": "彰化縣",
"Kaohsiung": "高雄市",
- "Taipei": "臺北市",
- "Chiayi": "嘉義市",
- "YilanCounty": "宜蘭縣",
- "NewTaipei": "新北市"
+ "LienchiangCounty": "連江縣",
+ "Taichung": "臺中市",
+ "YilanCounty": "宜蘭縣"
}
},
{
@@ -3895,6 +4031,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -3929,9 +4068,9 @@
"KinmenCounty"
],
"x-enum": {
- "Tainan": "臺南市",
+ "KinmenCounty": "金門縣",
"Keelung": "基隆市",
- "KinmenCounty": "金門縣"
+ "Tainan": "臺南市"
}
},
{
@@ -3998,6 +4137,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -4042,19 +4184,19 @@
"PenghuCounty"
],
"x-enum": {
- "Chiayi": "嘉義市",
- "MiaoliCounty": "苗栗縣",
- "PenghuCounty": "澎湖縣",
- "YilanCounty": "宜蘭縣",
"TaitungCounty": "臺東縣",
"HualienCounty": "花蓮縣",
- "Hsinchu": "新竹市",
- "YunlinCounty": "雲林縣",
"NantouCounty": "南投縣",
- "ChanghuaCounty": "彰化縣",
+ "PenghuCounty": "澎湖縣",
"HsinchuCounty": "新竹縣",
+ "ChanghuaCounty": "彰化縣",
"ChiayiCounty": "嘉義縣",
- "PingtungCounty": "屏東縣"
+ "Hsinchu": "新竹市",
+ "PingtungCounty": "屏東縣",
+ "Chiayi": "嘉義市",
+ "YunlinCounty": "雲林縣",
+ "YilanCounty": "宜蘭縣",
+ "MiaoliCounty": "苗栗縣"
}
},
{
@@ -4127,6 +4269,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -4226,6 +4371,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -4332,6 +4480,151 @@
}
}
},
+ "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/S2STravelTime/City/{City}/{RouteID}": {
+ "get": {
+ "tags": [
+ "CityBus"
+ ],
+ "summary": "取得指定[縣市],[路線代碼]的市區公車站間旅行時間資料",
+ "description": "指定[縣市],[路線代碼]的市區公車站間旅行時間資料",
+ "operationId": "CityBusApi_S2STravelTimeDetail",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "City",
+ "description": "欲查詢縣市",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "Hsinchu",
+ "HsinchuCounty",
+ "MiaoliCounty",
+ "ChanghuaCounty",
+ "NantouCounty",
+ "YunlinCounty",
+ "ChiayiCounty",
+ "Chiayi",
+ "PingtungCounty",
+ "YilanCounty",
+ "HualienCounty",
+ "TaitungCounty",
+ "PenghuCounty"
+ ],
+ "x-enum": {
+ "KinmenCounty": "金門縣",
+ "PenghuCounty": "澎湖縣",
+ "Hsinchu": "新竹市",
+ "HsinchuCounty": "新竹縣",
+ "NantouCounty": "南投縣",
+ "LienchiangCounty": "連江縣",
+ "YunlinCounty": "雲林縣",
+ "Kaohsiung": "高雄市",
+ "HualienCounty": "花蓮縣",
+ "Taoyuan": "桃園市",
+ "MiaoliCounty": "苗栗縣",
+ "ChiayiCounty": "嘉義縣",
+ "TaitungCounty": "臺東縣",
+ "Taipei": "臺北市",
+ "YilanCounty": "宜蘭縣",
+ "NewTaipei": "新北市",
+ "ChanghuaCounty": "彰化縣",
+ "Taichung": "臺中市",
+ "PingtungCounty": "屏東縣",
+ "Tainan": "臺南市",
+ "Chiayi": "嘉義市",
+ "Keelung": "基隆市"
+ }
+ },
+ {
+ "in": "path",
+ "name": "RouteID",
+ "description": "路線代碼",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "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": "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.BusS2STravelTime"
+ }
+ }
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -4424,6 +4717,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -4523,6 +4819,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -4609,6 +4908,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -4702,6 +5004,9 @@
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -4784,10 +5089,910 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusN1EstimateTime"
+ "$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"
+ }
+ }
+ }
+ }
+ },
+ "/v2/Bus/EstimatedTimeOfArrival/Streaming/InterCity/{RouteName}": {
+ "get": {
+ "tags": [
+ "InterCityBus"
+ ],
+ "summary": "取得指定[路線名稱]的公路客運預估到站資料(N1)[逐筆更新]",
+ "description": "### 公路客運之預估到站資料(N1) ###\r\n- 不保留[現在時間]超過[本平台資料更新時間]兩分鐘的資料\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))\r\n- N1僅於該路線上有任一車輛離站時,來源端才會重新計算並發佈,因此使用者需自行處理時間遞減機制,或以EstimateTime-(收到資料時間-SrcTrasTime)(秒)作為實際預估抵達時間。",
+ "operationId": "InterCityBusApi_EstimatedTimeOfArrival_UDP_1",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "RouteName",
+ "description": "繁體中文路線名稱,如'9102'",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "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": "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"
+ }
+ }
+ }
+ }
+ },
+ "/v2/Bus/RealTimeByFrequency/InterCity": {
+ "get": {
+ "tags": [
+ "InterCityBus"
+ ],
+ "summary": "取得公路客運的動態定時資料(A1)[批次更新]",
+ "description": "### 公路客運之定時資料(A1) ###\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
+ "operationId": "InterCityBusApi_RealTimeByFrequency",
+ "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": "空間過濾",
+ "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/RealTimeByFrequency/InterCity/{RouteName}": {
+ "get": {
+ "tags": [
+ "InterCityBus"
+ ],
+ "summary": "取得指定[路線名稱]的公路客運動態定時資料(A1)[批次更新]",
+ "description": "### 公路客運之定時資料(A1) ###\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
+ "operationId": "InterCityBusApi_RealTimeByFrequency_1",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "RouteName",
+ "description": "繁體中文路線名稱,如'9102'",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "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": "空間過濾",
+ "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/InterCity": {
+ "get": {
+ "tags": [
+ "InterCityBus"
+ ],
+ "summary": "取得公路客運的動態定點資料(A2)[批次更新]",
+ "description": "### 公路客運之定點資料(A2) ###\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
+ "operationId": "InterCityBusApi_RealTimeNearStop",
+ "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": "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/RealTimeNearStop/InterCity/{RouteName}": {
+ "get": {
+ "tags": [
+ "InterCityBus"
+ ],
+ "summary": "取得指定[路線名稱]的公路客運動態定點資料(A2)[批次更新]",
+ "description": "### 公路客運之定點資料(A2) ###\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
+ "operationId": "InterCityBusApi_RealTimeNearStop_1",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "RouteName",
+ "description": "繁體中文路線名稱,如'9102'",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "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": "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/InterCity": {
+ "get": {
+ "tags": [
+ "InterCityBus"
+ ],
+ "summary": "取得公路客運的預估到站資料(N1)[批次更新]",
+ "description": "###公路客運之預估到站資料(N1)###\r\n- 不保留[現在時間]超過[本平台資料更新時間]兩分鐘的資料\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
+ "operationId": "InterCityBusApi_EstimatedTimeOfArrival",
+ "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": "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"
+ }
+ }
+ }
+ }
+ },
+ "/v2/Bus/EstimatedTimeOfArrival/InterCity/{RouteName}": {
+ "get": {
+ "tags": [
+ "InterCityBus"
+ ],
+ "summary": "取得指定[路線名稱]的公路客運預估到站資料(N1)[批次更新]",
+ "description": "### 公路客運之預估到站資料(N1) ###\r\n- 不保留[現在時間]超過[本平台資料更新時間]兩分鐘的資料\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
+ "operationId": "InterCityBusApi_EstimatedTimeOfArrival_1",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "RouteName",
+ "description": "繁體中文路線名稱,如'9102'",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "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": "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"
+ }
+ }
+ }
+ }
+ },
+ "/v2/Bus/DataVersion/InterCity": {
+ "get": {
+ "tags": [
+ "InterCityBus"
+ ],
+ "summary": "取得公路客運目前資料的最新版本資訊",
+ "description": "版本詳細資訊",
+ "operationId": "InterCityBusApi_DataVersion",
+ "produces": [
+ "application/json",
+ "application/xml",
+ "text/plain",
+ "text/json"
+ ],
+ "parameters": [
+ {
+ "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": {
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusVersion"
+ }
+ },
+ "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/Operator/InterCity": {
+ "get": {
+ "tags": [
+ "InterCityBus"
+ ],
+ "summary": "取得公路客運的營運業者資料",
+ "description": "公路客運之營運業者資料",
+ "operationId": "InterCityBusApi_Operator",
+ "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": "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.Shared.Specification.V2.Base.Operator"
+ }
+ }
+ },
+ "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/Route/InterCity": {
+ "get": {
+ "tags": [
+ "InterCityBus"
+ ],
+ "summary": "取得公路客運路線資料",
+ "description": "公路客運之路線資料",
+ "operationId": "InterCityBusApi_Route",
+ "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": "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": {
@@ -4797,14 +6002,14 @@
}
}
},
- "/v2/Bus/EstimatedTimeOfArrival/Streaming/InterCity/{RouteName}": {
+ "/v2/Bus/Route/InterCity/{RouteName}": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得指定[路線名稱]的公路客運預估到站資料(N1)[逐筆更新]",
- "description": "### 公路客運之預估到站資料(N1) ###\r\n- 不保留[現在時間]超過[本平台資料更新時間]兩分鐘的資料\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))\r\n- N1僅於該路線上有任一車輛離站時,來源端才會重新計算並發佈,因此使用者需自行處理時間遞減機制,或以EstimateTime-(收到資料時間-SrcTrasTime)(秒)作為實際預估抵達時間。",
- "operationId": "InterCityBusApi_EstimatedTimeOfArrival_UDP_1",
+ "summary": "取得指定[路線名稱]的公路客運路線資料",
+ "description": "公路客運之路線資料",
+ "operationId": "InterCityBusApi_Route_1",
"produces": [
"application/json",
"application/xml"
@@ -4877,10 +6082,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusN1EstimateTime"
+ "$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": {
@@ -4890,14 +6098,14 @@
}
}
},
- "/v2/Bus/RealTimeByFrequency/InterCity": {
+ "/v2/Bus/Stop/InterCity": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得公路客運的動態定時資料(A1)[批次更新]",
- "description": "### 公路客運之定時資料(A1) ###\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
- "operationId": "InterCityBusApi_RealTimeByFrequency",
+ "summary": "取得公路客運站牌資料",
+ "description": "公路客運之站牌資料",
+ "operationId": "InterCityBusApi_Stop",
"produces": [
"application/json",
"application/xml"
@@ -4969,10 +6177,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusA1Data"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStop"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -4982,26 +6193,19 @@
}
}
},
- "/v2/Bus/RealTimeByFrequency/InterCity/{RouteName}": {
+ "/v2/Bus/Station/InterCity": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得指定[路線名稱]的公路客運動態定時資料(A1)[批次更新]",
- "description": "### 公路客運之定時資料(A1) ###\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
- "operationId": "InterCityBusApi_RealTimeByFrequency_1",
+ "summary": "取得公路客運站位資料",
+ "description": "公路客運之各站牌所屬的站位資料",
+ "operationId": "InterCityBusApi_Station",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
- {
- "in": "path",
- "name": "RouteName",
- "description": "繁體中文路線名稱,如'9102'",
- "required": true,
- "type": "string"
- },
{
"in": "query",
"name": "$select",
@@ -5068,10 +6272,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusA1Data"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStation"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -5081,14 +6288,14 @@
}
}
},
- "/v2/Bus/RealTimeNearStop/InterCity": {
+ "/v2/Bus/StopOfRoute/InterCity": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得公路客運的動態定點資料(A2)[批次更新]",
- "description": "### 公路客運之定點資料(A2) ###\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
- "operationId": "InterCityBusApi_RealTimeNearStop",
+ "summary": "取得公路客運路線與站牌資料",
+ "description": "公路客運之路線與站牌資料",
+ "operationId": "InterCityBusApi_StopOfRoute",
"produces": [
"application/json",
"application/xml"
@@ -5154,10 +6361,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusA2Data"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStopOfRoute"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -5167,14 +6377,14 @@
}
}
},
- "/v2/Bus/RealTimeNearStop/InterCity/{RouteName}": {
+ "/v2/Bus/StopOfRoute/InterCity/{RouteName}": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得指定[路線名稱]的公路客運動態定點資料(A2)[批次更新]",
- "description": "### 公路客運之定點資料(A2) ###\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
- "operationId": "InterCityBusApi_RealTimeNearStop_1",
+ "summary": "取得指定[路線名稱]的公路客運路線與站牌資料",
+ "description": "公路客運之路線與站牌資料",
+ "operationId": "InterCityBusApi_StopOfRoute_1",
"produces": [
"application/json",
"application/xml"
@@ -5247,10 +6457,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusA2Data"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStopOfRoute"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -5260,14 +6473,14 @@
}
}
},
- "/v2/Bus/EstimatedTimeOfArrival/InterCity": {
+ "/v2/Bus/Schedule/InterCity": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得公路客運的預估到站資料(N1)[批次更新]",
- "description": "###公路客運之預估到站資料(N1)###\r\n- 不保留[現在時間]超過[本平台資料更新時間]兩分鐘的資料\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
- "operationId": "InterCityBusApi_EstimatedTimeOfArrival",
+ "summary": "取得公路客運路線班表資料",
+ "description": "公路客運之預定班表及班距資料。公路及國道客運多採用【班表】式時刻表",
+ "operationId": "InterCityBusApi_Schedule",
"produces": [
"application/json",
"application/xml"
@@ -5333,10 +6546,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusN1EstimateTime"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusSchedule"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -5346,14 +6562,14 @@
}
}
},
- "/v2/Bus/EstimatedTimeOfArrival/InterCity/{RouteName}": {
+ "/v2/Bus/Schedule/InterCity/{RouteName}": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得指定[路線名稱]的公路客運預估到站資料(N1)[批次更新]",
- "description": "### 公路客運之預估到站資料(N1) ###\r\n- 不保留[現在時間]超過[本平台資料更新時間]兩分鐘的資料\r\n- [逐筆更新]與[批次更新]之差異請詳見資料使用葵花寶典([連結](https://ptxmotc.gitbooks.io/ptx-api-documentation/content/api-zi-liao-shi-yong-zhu-yi-shi-xiang/buslive.html))",
- "operationId": "InterCityBusApi_EstimatedTimeOfArrival_1",
+ "summary": "取得指定[路線名稱]的公路客運路線班表資料",
+ "description": "公路客運之預定班表及班距資料。公路及國道客運多採用【班表】式時刻表",
+ "operationId": "InterCityBusApi_Schedule_1",
"produces": [
"application/json",
"application/xml"
@@ -5426,62 +6642,12 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusN1EstimateTime"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusSchedule"
}
}
},
- "299": {
- "description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
- "schema": {
- "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V3.Base.DisplayHealth"
- }
- }
- }
- }
- },
- "/v2/Bus/DataVersion/InterCity": {
- "get": {
- "tags": [
- "InterCityBus"
- ],
- "summary": "取得公路客運目前資料的最新版本資訊",
- "description": "版本詳細資訊",
- "operationId": "InterCityBusApi_DataVersion",
- "produces": [
- "application/json",
- "application/xml",
- "text/plain",
- "text/json"
- ],
- "parameters": [
- {
- "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": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusVersion"
- }
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
},
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
@@ -5492,14 +6658,14 @@
}
}
},
- "/v2/Bus/Operator/InterCity": {
+ "/v2/Bus/News/InterCity": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得公路客運的營運業者資料",
- "description": "公路客運之營運業者資料",
- "operationId": "InterCityBusApi_Operator",
+ "summary": "取得公路客運之最新消息",
+ "description": "公路客運之最新消息",
+ "operationId": "InterCityBusApi_News",
"produces": [
"application/json",
"application/xml"
@@ -5565,10 +6731,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.Operator"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusNews"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -5578,14 +6747,14 @@
}
}
},
- "/v2/Bus/Route/InterCity": {
+ "/v2/Bus/Vehicle/InterCity": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得公路客運路線資料",
- "description": "公路客運之路線資料",
- "operationId": "InterCityBusApi_Route",
+ "summary": "取得公路客運之車輛資料",
+ "description": "公路客運之車輛資料",
+ "operationId": "InterCityBusApi_Vehicle",
"produces": [
"application/json",
"application/xml"
@@ -5651,10 +6820,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusRoute"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusVehicleInfo"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -5664,26 +6836,19 @@
}
}
},
- "/v2/Bus/Route/InterCity/{RouteName}": {
+ "/v2/Bus/RouteFare/InterCity": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得指定[路線名稱]的公路客運路線資料",
- "description": "公路客運之路線資料",
- "operationId": "InterCityBusApi_Route_1",
+ "summary": "取得公路客運之路線票價資料",
+ "description": "公路客運之路線票價資料",
+ "operationId": "InterCityBusApi_RouteFare",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
- {
- "in": "path",
- "name": "RouteName",
- "description": "繁體中文路線名稱,如'9102'",
- "required": true,
- "type": "string"
- },
{
"in": "query",
"name": "$select",
@@ -5744,10 +6909,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusRoute"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusRouteFare"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -5757,19 +6925,26 @@
}
}
},
- "/v2/Bus/Stop/InterCity": {
+ "/v2/Bus/RouteFare/InterCity/{RouteName}": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得公路客運站牌資料",
- "description": "公路客運之站牌資料",
- "operationId": "InterCityBusApi_Stop",
+ "summary": "取得指定[路線名稱]的公路客運路線票價資料",
+ "description": "公路客運之路線票價資料",
+ "operationId": "InterCityBusApi_RouteFare_1",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
+ {
+ "in": "path",
+ "name": "RouteName",
+ "description": "繁體中文路線名稱,如'9102'",
+ "required": true,
+ "type": "string"
+ },
{
"in": "query",
"name": "$select",
@@ -5801,12 +6976,6 @@
"description": "跳過前幾筆",
"type": "string"
},
- {
- "in": "query",
- "name": "$spatialFilter",
- "description": "空間過濾",
- "type": "string"
- },
{
"in": "query",
"name": "health",
@@ -5836,10 +7005,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStop"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusRouteFare"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -5849,14 +7021,14 @@
}
}
},
- "/v2/Bus/Station/InterCity": {
+ "/v2/Bus/StationGroup/InterCity": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得公路客運站位資料",
- "description": "公路客運之各站牌所屬的站位資料",
- "operationId": "InterCityBusApi_Station",
+ "summary": "取得公路客運組站位資料",
+ "description": "公路客運之各站牌所屬的組站位資料",
+ "operationId": "InterCityBusApi_StationGroup",
"produces": [
"application/json",
"application/xml"
@@ -5928,10 +7100,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStation"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStationGroup"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -5941,14 +7116,14 @@
}
}
},
- "/v2/Bus/StopOfRoute/InterCity": {
+ "/v2/Bus/Shape/InterCity": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得公路客運路線與站牌資料",
- "description": "公路客運之路線與站牌資料",
- "operationId": "InterCityBusApi_StopOfRoute",
+ "summary": "取得公路公車線型資料",
+ "description": "公路客運之線型資料",
+ "operationId": "InterCityBusApi_Shape",
"produces": [
"application/json",
"application/xml"
@@ -6014,10 +7189,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStopOfRoute"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusShape"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -6027,14 +7205,14 @@
}
}
},
- "/v2/Bus/StopOfRoute/InterCity/{RouteName}": {
+ "/v2/Bus/Shape/InterCity/{RouteName}": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得指定[路線名稱]的公路客運路線與站牌資料",
- "description": "公路客運之路線與站牌資料",
- "operationId": "InterCityBusApi_StopOfRoute_1",
+ "summary": "取得指定[路線名稱]的公路公車線型資料",
+ "description": "公路客運之線型資料",
+ "operationId": "InterCityBusApi_Shape_1",
"produces": [
"application/json",
"application/xml"
@@ -6043,7 +7221,7 @@
{
"in": "path",
"name": "RouteName",
- "description": "繁體中文路線名稱,如'9102'",
+ "description": "繁體中文路線名稱,如'307'",
"required": true,
"type": "string"
},
@@ -6107,10 +7285,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStopOfRoute"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusShape"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -6120,19 +7301,26 @@
}
}
},
- "/v2/Bus/Schedule/InterCity": {
+ "/v2/Bus/S2STravelTime/InterCity/{RouteID}": {
"get": {
"tags": [
"InterCityBus"
],
- "summary": "取得公路客運路線班表資料",
- "description": "公路客運之預定班表及班距資料。公路及國道客運多採用【班表】式時刻表",
- "operationId": "InterCityBusApi_Schedule",
+ "summary": "取得指定[路線代碼]的公路客運站間旅行時間資料",
+ "description": "指定[路線代碼]的公路客運站間旅行時間資料",
+ "operationId": "InterCityBusApi_S2STravelTimeDetail",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
+ {
+ "in": "path",
+ "name": "RouteID",
+ "description": "路線代碼",
+ "required": true,
+ "type": "string"
+ },
{
"in": "query",
"name": "$select",
@@ -6193,10 +7381,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusSchedule"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusS2STravelTime"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -6206,26 +7397,19 @@
}
}
},
- "/v2/Bus/Schedule/InterCity/{RouteName}": {
+ "/v2/Bus/Stop/NearBy": {
"get": {
"tags": [
- "InterCityBus"
+ "Advanced"
],
- "summary": "取得指定[路線名稱]的公路客運路線班表資料",
- "description": "公路客運之預定班表及班距資料。公路及國道客運多採用【班表】式時刻表",
- "operationId": "InterCityBusApi_Schedule_1",
+ "summary": "取得指定[位置,範圍]的全臺公車站牌資料",
+ "description": "取得指定[位置,範圍]的全臺公車站牌資料",
+ "operationId": "BusApi_Stop_NearBy",
"produces": [
"application/json",
"application/xml"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "RouteName",
- "description": "繁體中文路線名稱,如'9102'",
- "required": true,
- "type": "string"
- },
+ ],
+ "parameters": [
{
"in": "query",
"name": "$select",
@@ -6257,6 +7441,13 @@
"description": "跳過前幾筆",
"type": "string"
},
+ {
+ "in": "query",
+ "name": "$spatialFilter",
+ "description": "空間過濾(最大搜尋半徑為1000公尺)",
+ "required": true,
+ "type": "string"
+ },
{
"in": "query",
"name": "health",
@@ -6286,10 +7477,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusSchedule"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStop"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -6299,14 +7493,14 @@
}
}
},
- "/v2/Bus/News/InterCity": {
+ "/v2/Bus/Station/NearBy": {
"get": {
"tags": [
- "InterCityBus"
+ "Advanced"
],
- "summary": "取得公路客運之最新消息",
- "description": "公路客運之最新消息",
- "operationId": "InterCityBusApi_News",
+ "summary": "取得指定[位置,範圍]的全臺公車站位資料",
+ "description": "取得指定[位置,範圍]的全臺公車站位資料",
+ "operationId": "BusApi_Station_NearBy",
"produces": [
"application/json",
"application/xml"
@@ -6343,6 +7537,13 @@
"description": "跳過前幾筆",
"type": "string"
},
+ {
+ "in": "query",
+ "name": "$spatialFilter",
+ "description": "空間過濾(最大搜尋半徑為1000公尺)",
+ "required": true,
+ "type": "string"
+ },
{
"in": "query",
"name": "health",
@@ -6372,10 +7573,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusNews"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStation"
}
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -6385,14 +7589,14 @@
}
}
},
- "/v2/Bus/Vehicle/InterCity": {
+ "/v2/Bus/Route/NearBy": {
"get": {
"tags": [
- "InterCityBus"
+ "Advanced"
],
- "summary": "取得公路客運之車輛資料",
- "description": "公路客運之車輛資料",
- "operationId": "InterCityBusApi_Vehicle",
+ "summary": "取得指定[位置,範圍]的全臺公車路線資料",
+ "description": "取得指定[位置,範圍]的全臺公車路線資料",
+ "operationId": "BusApi_Route_NearBy",
"produces": [
"application/json",
"application/xml"
@@ -6429,6 +7633,13 @@
"description": "跳過前幾筆",
"type": "string"
},
+ {
+ "in": "query",
+ "name": "$spatialFilter",
+ "description": "空間過濾(最大搜尋半徑為1000公尺)",
+ "required": true,
+ "type": "string"
+ },
{
"in": "query",
"name": "health",
@@ -6458,10 +7669,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusVehicleInfo"
+ "$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": {
@@ -6471,14 +7685,14 @@
}
}
},
- "/v2/Bus/RouteFare/InterCity": {
+ "/v2/Bus/RealTimeByFrequency/NearBy": {
"get": {
"tags": [
- "InterCityBus"
+ "Advanced"
],
- "summary": "取得公路客運之路線票價資料",
- "description": "公路客運之路線票價資料",
- "operationId": "InterCityBusApi_RouteFare",
+ "summary": "取得指定[位置,範圍]的全臺公車動態定時資料(A1)",
+ "description": "取得指定[位置,範圍]的全臺公車動態定時資料(A1)",
+ "operationId": "BusApi_RealTimeByFrequency_NearBy",
"produces": [
"application/json",
"application/xml"
@@ -6515,6 +7729,13 @@
"description": "跳過前幾筆",
"type": "string"
},
+ {
+ "in": "query",
+ "name": "$spatialFilter",
+ "description": "空間過濾(最大搜尋半徑為1000公尺)",
+ "required": true,
+ "type": "string"
+ },
{
"in": "query",
"name": "health",
@@ -6544,10 +7765,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusRouteFare"
+ "$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": {
@@ -6557,26 +7781,19 @@
}
}
},
- "/v2/Bus/RouteFare/InterCity/{RouteName}": {
+ "/v2/Bus/RealTimeNearStop/NearBy": {
"get": {
"tags": [
- "InterCityBus"
+ "Advanced"
],
- "summary": "取得指定[路線名稱]的公路客運路線票價資料",
- "description": "公路客運之路線票價資料",
- "operationId": "InterCityBusApi_RouteFare_1",
+ "summary": "取得指定[位置,範圍]的全臺公車動態定點資料(A2)",
+ "description": "取得指定[位置,範圍]的全臺公車動態定點資料(A2)",
+ "operationId": "BusApi_RealTimeNearStop_NearBy",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
- {
- "in": "path",
- "name": "RouteName",
- "description": "繁體中文路線名稱,如'9102'",
- "required": true,
- "type": "string"
- },
{
"in": "query",
"name": "$select",
@@ -6608,6 +7825,13 @@
"description": "跳過前幾筆",
"type": "string"
},
+ {
+ "in": "query",
+ "name": "$spatialFilter",
+ "description": "空間過濾(最大搜尋半徑為1000公尺)",
+ "required": true,
+ "type": "string"
+ },
{
"in": "query",
"name": "health",
@@ -6637,10 +7861,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusRouteFare"
+ "$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": {
@@ -6650,14 +7877,14 @@
}
}
},
- "/v2/Bus/StationGroup/InterCity": {
+ "/v2/Bus/EstimatedTimeOfArrival/NearBy": {
"get": {
"tags": [
- "InterCityBus"
+ "Advanced"
],
- "summary": "取得公路客運組站位資料",
- "description": "公路客運之各站牌所屬的組站位資料",
- "operationId": "InterCityBusApi_StationGroup",
+ "summary": "取得指定[位置,範圍]的全臺公車預估到站資料(N1)",
+ "description": "取得指定[位置,範圍]的全臺公車預估到站資料(N1)",
+ "operationId": "BusApi_EstimatedTimeOfArrival_NearBy",
"produces": [
"application/json",
"application/xml"
@@ -6697,7 +7924,8 @@
{
"in": "query",
"name": "$spatialFilter",
- "description": "空間過濾",
+ "description": "空間過濾(最大搜尋半徑為1000公尺)",
+ "required": true,
"type": "string"
},
{
@@ -6729,10 +7957,13 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStationGroup"
+ "$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": {
@@ -7155,7 +8386,7 @@
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.Stop": {
+ "PTX.Service.DTO.Bus.Specification.V2.Embedded.Stop": {
"title": "Stop",
"description": "站牌代碼資料",
"required": [
@@ -7268,7 +8499,7 @@
"description": "所有經過站牌",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Stop"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Embedded.Stop"
}
},
"UpdateTime": {
@@ -7297,6 +8528,24 @@
],
"type": "object",
"properties": {
+ "DayBeforeNationalHoliday": {
+ "format": "int32",
+ "title": "integer",
+ "description": "國定假日前一日營運與否 : [0:'否',1:'是']",
+ "type": "integer"
+ },
+ "DayAfterNationalHoliday": {
+ "format": "int32",
+ "title": "integer",
+ "description": "國定假日後一日營運與否 : [0:'否',1:'是']",
+ "type": "integer"
+ },
+ "TyphoonDay": {
+ "format": "int32",
+ "title": "integer",
+ "description": "颱風停止上班上課期間營運與否 : [0:'否',1:'是']",
+ "type": "integer"
+ },
"Sunday": {
"format": "int32",
"title": "integer",
@@ -7344,24 +8593,6 @@
"title": "integer",
"description": "國定假日營運與否 : [0:'否',1:'是']",
"type": "integer"
- },
- "DayBeforeNationalHoliday": {
- "format": "int32",
- "title": "integer",
- "description": "國定假日前一日營運與否 : [0:'否',1:'是']",
- "type": "integer"
- },
- "DayAfterNationalHoliday": {
- "format": "int32",
- "title": "integer",
- "description": "國定假日後一日營運與否 : [0:'否',1:'是']",
- "type": "integer"
- },
- "TyphoonDay": {
- "format": "int32",
- "title": "integer",
- "description": "颱風停止上班上課期間營運與否 : [0:'否',1:'是']",
- "type": "integer"
}
}
},
@@ -7827,7 +9058,7 @@
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.RouteOperator": {
+ "PTX.Service.DTO.Bus.Specification.V2.Embedded.RouteOperator": {
"title": "RouteOperator",
"description": "營運業者資訊",
"required": [
@@ -7979,7 +9210,7 @@
"description": "營運業者",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.RouteOperator"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Embedded.RouteOperator"
}
},
"AuthorityID": {
@@ -8231,7 +9462,7 @@
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.ServiceDay": {
+ "PTX.Service.DTO.Bus.Specification.V2.Embedded.ServiceDay": {
"title": "ServiceDay",
"description": "週內營運日資料",
"required": [
@@ -8290,7 +9521,7 @@
"NationalHolidays": {
"format": "int32",
"title": "integer",
- "description": "國定假日是否營運 : [0:'否',1:'是']",
+ "description": "國定假日營運與否 : [0:'否',1:'是']",
"type": "integer"
}
}
@@ -8310,7 +9541,7 @@
"description": "營運日型態",
"allOf": [
{
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.ServiceDay"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Embedded.ServiceDay"
}
]
},
@@ -8493,6 +9724,139 @@
}
}
},
+ "PTX.Service.DTO.Bus.Specification.V2.TravelTime": {
+ "title": "TravelTime",
+ "required": [
+ "FromStationID",
+ "FromStopID",
+ "RunTime",
+ "ToStationID",
+ "ToStopID"
+ ],
+ "type": "object",
+ "properties": {
+ "FromStopID": {
+ "title": "String",
+ "description": "起始站牌代碼",
+ "type": "string"
+ },
+ "ToStopID": {
+ "title": "String",
+ "description": "終點站牌代碼",
+ "type": "string"
+ },
+ "FromStationID": {
+ "title": "String",
+ "description": "起始站位代碼",
+ "type": "string"
+ },
+ "ToStationID": {
+ "title": "String",
+ "description": "終點站位代碼",
+ "type": "string"
+ },
+ "RunTime": {
+ "format": "int32",
+ "title": "Int32",
+ "description": "站間預估行駛時間 [當RunTime值為-1時,代表該區間無提供旅行時間資料。]",
+ "type": "integer"
+ }
+ }
+ },
+ "PTX.Service.DTO.Bus.Specification.V2.ServiceTime": {
+ "title": "ServiceTime",
+ "description": "行駛時間資料型別",
+ "required": [
+ "EndHour",
+ "S2STimes",
+ "StartHour",
+ "Weekday"
+ ],
+ "type": "object",
+ "properties": {
+ "Weekday": {
+ "format": "int32",
+ "title": "Int32",
+ "description": "星期",
+ "type": "integer"
+ },
+ "StartHour": {
+ "format": "int32",
+ "title": "Int32",
+ "description": "起始時區(小時)",
+ "type": "integer"
+ },
+ "EndHour": {
+ "format": "int32",
+ "title": "Int32",
+ "description": "結束時區(小時)",
+ "type": "integer"
+ },
+ "S2STimes": {
+ "title": "Array",
+ "description": "站間行駛時間資訊",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.TravelTime"
+ }
+ }
+ }
+ },
+ "PTX.Service.DTO.Bus.Specification.V2.BusS2STravelTime": {
+ "title": "BusS2STravelTime",
+ "description": "站間旅行時間資料型別",
+ "required": [
+ "Direction",
+ "RouteID",
+ "RouteUID",
+ "SubRouteID",
+ "SubRouteUID",
+ "TravelTimes",
+ "UpdateTime"
+ ],
+ "type": "object",
+ "properties": {
+ "RouteUID": {
+ "title": "String",
+ "description": "路線唯一識別代碼,規則為 {業管機關簡碼} + {RouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢",
+ "type": "string"
+ },
+ "RouteID": {
+ "title": "String",
+ "description": "地區既用中之路線代碼(為原資料內碼)",
+ "type": "string"
+ },
+ "SubRouteUID": {
+ "title": "String",
+ "description": "附屬路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢",
+ "type": "string"
+ },
+ "SubRouteID": {
+ "title": "String",
+ "description": "地區既用中之附屬路線代碼(為原資料內碼)",
+ "type": "string"
+ },
+ "Direction": {
+ "format": "int32",
+ "title": "integer",
+ "description": "去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']",
+ "type": "integer"
+ },
+ "TravelTimes": {
+ "title": "Array",
+ "description": "旅行時間資訊",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.ServiceTime"
+ }
+ },
+ "UpdateTime": {
+ "title": "DateTime",
+ "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
+ "type": "string"
+ }
+ }
+ },
"PTX.Service.DTO.Bus.Specification.V2.DatePeriod": {
"title": "DatePeriod",
"type": "object",
@@ -8613,7 +9977,7 @@
"description": "週內營運日",
"allOf": [
{
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.ServiceDay"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Embedded.ServiceDay"
}
]
},
@@ -8673,7 +10037,7 @@
"description": "週內營運日",
"allOf": [
{
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.ServiceDay"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Embedded.ServiceDay"
}
]
},
@@ -8796,6 +10160,7 @@
"RouteID",
"RouteName",
"RouteUID",
+ "SubRouteUID",
"UpdateTime",
"VersionID"
],
@@ -8820,21 +10185,28 @@
}
]
},
- "Direction": {
- "format": "int32",
- "title": "integer",
- "description": "去返程,若無值則表示來源尚無區分去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']",
- "type": "integer"
+ "SubRouteUID": {
+ "title": "String",
+ "type": "string"
},
- "UpdateTime": {
- "title": "DateTime",
- "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
+ "SubRouteID": {
+ "title": "String",
+ "description": "附屬路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢",
"type": "string"
},
- "VersionID": {
+ "SubRouteName": {
+ "title": "NameType",
+ "description": "附屬路線名稱",
+ "allOf": [
+ {
+ "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType"
+ }
+ ]
+ },
+ "Direction": {
"format": "int32",
- "title": "Int32",
- "description": "資料版本編號",
+ "title": "integer",
+ "description": "去返程,若無值則表示來源尚無區分去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']",
"type": "integer"
},
"Geometry": {
@@ -8846,6 +10218,17 @@
"title": "String",
"description": "路線軌跡編碼(encoded polyline)",
"type": "string"
+ },
+ "UpdateTime": {
+ "title": "DateTime",
+ "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
+ "type": "string"
+ },
+ "VersionID": {
+ "format": "int32",
+ "title": "Int32",
+ "description": "資料版本編號(由於該服務資料不再版控,固定帶入版號0)",
+ "type": "integer"
}
}
},
@@ -9170,7 +10553,7 @@
"description": "營運業者",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.RouteOperator"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Embedded.RouteOperator"
}
},
"SubRouteUID": {
@@ -9213,7 +10596,7 @@
"description": "所有經過站牌",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Stop"
+ "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Embedded.Stop"
}
},
"UpdateTime": {
@@ -9294,6 +10677,10 @@
{
"name": "InterCityBus",
"description": "公路客運"
+ },
+ {
+ "name": "Advanced",
+ "description": "進階"
}
]
}
diff --git a/oas.bus.v3.json b/oas.bus.v3.json
index c84632d0..562057c7 100644
--- a/oas.bus.v3.json
+++ b/oas.bus.v3.json
@@ -106,6 +106,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.Network]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -216,6 +219,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.Stop]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -326,6 +332,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.Station]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -431,6 +440,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.Route]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -536,6 +548,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.SubRoute]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -640,6 +655,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.FirstLastTripInfo]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -750,6 +768,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.Depot]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -855,6 +876,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.StopOfRoute]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -959,6 +983,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.DisplayStopOfRoute]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1063,6 +1090,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusWrapper[PTX.Service.DTO.Bus.Specification.V3.RouteFare]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1167,6 +1197,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusGWrapper[PTX.Service.DTO.Bus.Specification.V3.Schedule]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1271,6 +1304,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusWrapper[PTX.Service.DTO.Bus.Specification.V3.DailyTimeTable]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1382,6 +1418,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusWrapper[PTX.Service.DTO.Bus.Specification.V3.A1Data]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1500,6 +1539,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusWrapper[PTX.Service.DTO.Bus.Specification.V3.A1Data]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1605,6 +1647,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusWrapper[PTX.Service.DTO.Bus.Specification.V3.A2Data]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1717,6 +1762,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusWrapper[PTX.Service.DTO.Bus.Specification.V3.A2Data]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1822,6 +1870,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusWrapper[PTX.Service.DTO.Bus.Specification.V3.N1Data]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -1934,6 +1985,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusWrapper[PTX.Service.DTO.Bus.Specification.V3.N1Data]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2039,6 +2093,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusWrapper[PTX.Service.DTO.Bus.Specification.V3.Alert]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2144,6 +2201,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusWrapper[PTX.Service.DTO.Bus.Specification.V3.News]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2248,6 +2308,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.Operator]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2352,6 +2415,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.Vehicle]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2456,6 +2522,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.VehicleDepot]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2560,6 +2629,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.VehicleRoute]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2664,6 +2736,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.Shape]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2768,6 +2843,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.RouteNetwork]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
@@ -2872,6 +2950,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V3.Wrapper.BusVWrapper[PTX.Service.DTO.Bus.Specification.V3.S2STravelTime]"
}
},
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ },
"299": {
"description": "加入參數'?health=true'即可查詢此API服務的健康狀態",
"schema": {
diff --git a/oas.rail.v2.json b/oas.rail.v2.json
index c8668787..5b7ead6f 100644
--- a/oas.rail.v2.json
+++ b/oas.rail.v2.json
@@ -76,6 +76,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.Operator"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -103,13 +106,15 @@
"TRTC",
"KRTC",
"TYMC",
- "TRTCMG"
+ "TRTCMG",
+ "TMRT"
],
"x-enum": {
+ "TYMC": "桃園捷運",
"KRTC": "高雄捷運",
- "TRTC": "臺北捷運",
"TRTCMG": "貓空纜車",
- "TYMC": "桃園捷運"
+ "TMRT": "臺中捷運",
+ "TRTC": "臺北捷運"
}
},
{
@@ -165,6 +170,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.Network"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -194,15 +202,17 @@
"TYMC",
"KLRT",
"NTDLRT",
- "TRTCMG"
+ "TRTCMG",
+ "TMRT"
],
"x-enum": {
- "KRTC": "高雄捷運",
- "TRTCMG": "貓空纜車",
- "KLRT": "高雄輕軌",
"TYMC": "桃園捷運",
"NTDLRT": "淡海輕軌",
- "TRTC": "臺北捷運"
+ "KLRT": "高雄輕軌",
+ "TRTC": "臺北捷運",
+ "TMRT": "臺中捷運",
+ "TRTCMG": "貓空纜車",
+ "KRTC": "高雄捷運"
}
},
{
@@ -258,6 +268,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.Line"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -287,15 +300,17 @@
"TYMC",
"KLRT",
"NTDLRT",
- "TRTCMG"
+ "TRTCMG",
+ "TMRT"
],
"x-enum": {
- "KRTC": "高雄捷運",
"TRTCMG": "貓空纜車",
+ "KRTC": "高雄捷運",
"TRTC": "臺北捷運",
- "TYMC": "桃園捷運",
"NTDLRT": "淡海輕軌",
- "KLRT": "高雄輕軌"
+ "TYMC": "桃園捷運",
+ "KLRT": "高雄輕軌",
+ "TMRT": "臺中捷運"
}
},
{
@@ -329,12 +344,6 @@
"description": "跳過前幾筆",
"type": "string"
},
- {
- "in": "query",
- "name": "$spatialFilter",
- "description": "空間過濾",
- "type": "string"
- },
{
"in": "query",
"name": "$format",
@@ -357,6 +366,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.Station"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -386,15 +398,17 @@
"TYMC",
"KLRT",
"NTDLRT",
- "TRTCMG"
+ "TRTCMG",
+ "TMRT"
],
"x-enum": {
- "NTDLRT": "淡海輕軌",
- "KRTC": "高雄捷運",
+ "TRTC": "臺北捷運",
+ "KLRT": "高雄輕軌",
"TRTCMG": "貓空纜車",
+ "NTDLRT": "淡海輕軌",
"TYMC": "桃園捷運",
- "TRTC": "臺北捷運",
- "KLRT": "高雄輕軌"
+ "TMRT": "臺中捷運",
+ "KRTC": "高雄捷運"
}
},
{
@@ -450,6 +464,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.StationOfLine"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -478,9 +495,9 @@
"KRTC"
],
"x-enum": {
- "TRTC": "臺北捷運",
+ "TYMC": "桃園捷運",
"KRTC": "高雄捷運",
- "TYMC": "桃園捷運"
+ "TRTC": "臺北捷運"
}
},
{
@@ -536,6 +553,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.LineTransfer"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -563,9 +583,9 @@
"TYMC"
],
"x-enum": {
- "TRTC": "臺北捷運",
"TYMC": "桃園捷運",
- "KRTC": "高雄捷運"
+ "KRTC": "高雄捷運",
+ "TRTC": "臺北捷運"
}
},
{
@@ -621,6 +641,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.StationFacility"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -648,14 +671,16 @@
"TRTC",
"KRTC",
"TYMC",
- "TRTCMG"
+ "TRTCMG",
+ "TMRT"
],
"x-enum": {
- "KRTC": "高雄捷運",
+ "TRTCMG": "貓空纜車",
+ "TMRT": "臺中捷運",
+ "TRTC": "臺北捷運",
"KLRT": "高雄輕軌",
"TYMC": "桃園捷運",
- "TRTC": "臺北捷運",
- "TRTCMG": "貓空纜車"
+ "KRTC": "高雄捷運"
}
},
{
@@ -717,6 +742,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.StationExit"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -744,13 +772,15 @@
"TRTC",
"KRTC",
"TYMC",
- "NTDLRT"
+ "NTDLRT",
+ "TMRT"
],
"x-enum": {
"TRTC": "臺北捷運",
- "KRTC": "高雄捷運",
+ "TMRT": "臺中捷運",
"NTDLRT": "淡海輕軌",
- "TYMC": "桃園捷運"
+ "TYMC": "桃園捷運",
+ "KRTC": "高雄捷運"
}
},
{
@@ -806,6 +836,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.Route"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -833,13 +866,15 @@
"TRTC",
"KRTC",
"TYMC",
- "NTDLRT"
+ "NTDLRT",
+ "TMRT"
],
"x-enum": {
- "KRTC": "高雄捷運",
"TRTC": "臺北捷運",
"TYMC": "桃園捷運",
- "NTDLRT": "淡海輕軌"
+ "NTDLRT": "淡海輕軌",
+ "TMRT": "臺中捷運",
+ "KRTC": "高雄捷運"
}
},
{
@@ -895,6 +930,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.StationOfRoute"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -922,12 +960,14 @@
"TRTC",
"KRTC",
"TYMC",
- "KLRT"
+ "KLRT",
+ "TMRT"
],
"x-enum": {
"TYMC": "桃園捷運",
- "KRTC": "高雄捷運",
"KLRT": "高雄輕軌",
+ "TMRT": "臺中捷運",
+ "KRTC": "高雄捷運",
"TRTC": "臺北捷運"
}
},
@@ -984,6 +1024,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.FirstLastTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1009,12 +1052,14 @@
"type": "string",
"enum": [
"TRTC",
- "TYMC"
+ "TYMC",
+ "TMRT"
],
"x-enum": {
- "KRTC": "高雄捷運",
+ "TMRT": "臺中捷運",
"TRTC": "臺北捷運",
- "TYMC": "桃園捷運"
+ "TYMC": "桃園捷運",
+ "KRTC": "高雄捷運"
}
},
{
@@ -1070,6 +1115,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.Frequency"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1100,10 +1148,10 @@
"KLRT"
],
"x-enum": {
- "KLRT": "高雄輕軌",
+ "KRTC": "高雄捷運",
"TYMC": "桃園捷運",
- "TRTC": "臺北捷運",
- "KRTC": "高雄捷運"
+ "KLRT": "高雄輕軌",
+ "TRTC": "臺北捷運"
}
},
{
@@ -1159,6 +1207,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.S2STravelTime"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1188,14 +1239,16 @@
"TYMC",
"KLRT",
"NTDLRT",
- "TRTCMG"
+ "TRTCMG",
+ "TMRT"
],
"x-enum": {
- "NTDLRT": "淡海輕軌",
- "KLRT": "高雄輕軌",
+ "TMRT": "臺中捷運",
"TRTCMG": "貓空纜車",
"KRTC": "高雄捷運",
+ "KLRT": "高雄輕軌",
"TYMC": "桃園捷運",
+ "NTDLRT": "淡海輕軌",
"TRTC": "臺北捷運"
}
},
@@ -1252,6 +1305,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.ODFare"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1279,9 +1335,9 @@
"KRTC"
],
"x-enum": {
- "KRTC": "高雄捷運",
+ "TYMC": "桃園捷運",
"TRTC": "臺北捷運",
- "TYMC": "桃園捷運"
+ "KRTC": "高雄捷運"
}
},
{
@@ -1337,6 +1393,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.LiveBoard"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1367,10 +1426,10 @@
"KLRT"
],
"x-enum": {
- "KRTC": "高雄捷運",
"TYMC": "桃園捷運",
+ "KLRT": "高雄輕軌",
"TRTC": "臺北捷運",
- "KLRT": "高雄輕軌"
+ "KRTC": "高雄捷運"
}
},
{
@@ -1426,6 +1485,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.StationTimeTable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1456,10 +1518,10 @@
"NTDLRT"
],
"x-enum": {
- "TRTC": "臺北捷運",
- "KRTC": "高雄捷運",
+ "NTDLRT": "淡海輕軌",
"TYMC": "桃園捷運",
- "NTDLRT": "淡海輕軌"
+ "KRTC": "高雄捷運",
+ "TRTC": "臺北捷運"
}
},
{
@@ -1515,6 +1577,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.MetroShape"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1544,9 +1609,9 @@
"KLRT"
],
"x-enum": {
- "KRTC": "高雄捷運",
"TYMC": "桃園捷運",
- "KLRT": "高雄輕軌"
+ "KLRT": "高雄輕軌",
+ "KRTC": "高雄捷運"
}
},
{
@@ -1608,6 +1673,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.MRTRealTimeWrapper[PTX.Service.DTO.Rail.Specification.V2.Metro.MRTNewsList.News]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1638,8 +1706,8 @@
],
"x-enum": {
"KLRT": "高雄輕軌",
- "KRTC": "高雄捷運",
- "TYMC": "桃園捷運"
+ "TYMC": "桃園捷運",
+ "KRTC": "高雄捷運"
}
},
{
@@ -1701,6 +1769,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.MRTRealTimeWrapper[PTX.Service.DTO.Rail.Specification.V2.Metro.Alert]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1749,12 +1820,6 @@
"description": "跳過前幾筆",
"type": "string"
},
- {
- "in": "query",
- "name": "$spatialFilter",
- "description": "空間過濾",
- "type": "string"
- },
{
"in": "query",
"name": "$format",
@@ -1777,6 +1842,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailStation"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1847,6 +1915,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailODFare"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1931,6 +2002,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailODFare"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2001,6 +2075,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailGeneralTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2078,6 +2155,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailGeneralTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2148,6 +2228,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailDailyTrainInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2225,6 +2308,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailDailyTrainInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2302,6 +2388,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailDailyTrainInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2386,6 +2475,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailDailyTrainInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2456,6 +2548,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailDailyTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2533,6 +2628,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailDailyTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2610,6 +2708,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailDailyTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2694,6 +2795,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailDailyTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2776,6 +2880,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailStationTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2867,6 +2974,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.RailODDailyTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2937,6 +3047,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.AlertInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3007,6 +3120,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.News"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3077,6 +3193,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.THSRShape"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3151,8 +3270,11 @@
"200": {
"description": "Success",
"schema": {
- "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRAvaliableSeatStatusOldWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.Old.AvailableSeat]"
+ "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRAvailableSeatStatusOldWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.Old.AvailableSeat]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3234,8 +3356,11 @@
"200": {
"description": "Success",
"schema": {
- "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRAvaliableSeatStatusOldWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.Old.AvailableSeat]"
+ "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRAvailableSeatStatusOldWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.Old.AvailableSeat]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3312,6 +3437,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.StationExit"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3386,8 +3514,11 @@
"200": {
"description": "Success",
"schema": {
- "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRAvaliableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.AvailableSeat]"
+ "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRAvailableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.AvailableSeat]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3469,8 +3600,11 @@
"200": {
"description": "Success",
"schema": {
- "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRAvaliableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.AvailableSeat]"
+ "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRAvailableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.AvailableSeat]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3552,8 +3686,11 @@
"200": {
"description": "Success",
"schema": {
- "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRODAvaliableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.OD.AvailableSeat]"
+ "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRODAvailableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.OD.AvailableSeat]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3649,8 +3786,11 @@
"200": {
"description": "Success",
"schema": {
- "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRODAvaliableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.OD.AvailableSeat]"
+ "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRODAvailableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.OD.AvailableSeat]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3753,8 +3893,11 @@
"200": {
"description": "Success",
"schema": {
- "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRODAvaliableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.OD.AvailableSeat]"
+ "$ref": "#/definitions/PTX.API.Rail.Model.V2THSRODAvailableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.OD.AvailableSeat]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3825,6 +3968,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.Network"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3873,12 +4019,6 @@
"description": "跳過前幾筆",
"type": "string"
},
- {
- "in": "query",
- "name": "$spatialFilter",
- "description": "空間過濾",
- "type": "string"
- },
{
"in": "query",
"name": "$format",
@@ -3901,6 +4041,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailStation"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -3971,6 +4114,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.Line"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4041,6 +4187,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.StationOfLine"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4111,6 +4260,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.TrainType"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4181,6 +4333,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.TRAShape"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4265,6 +4420,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailODFare"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4335,6 +4493,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailODFare"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4402,9 +4563,12 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.TimeInfo.RailGeneralTrainInfo"
+ "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailGeneralTrainInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4479,9 +4643,12 @@
"title": "Array",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.TimeInfo.RailGeneralTrainInfo"
+ "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailGeneralTrainInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4552,6 +4719,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailGeneralTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4629,6 +4799,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailGeneralTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4699,6 +4872,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailDailyTrainInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4776,6 +4952,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailDailyTrainInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4853,6 +5032,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailDailyTrainInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -4937,6 +5119,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailDailyTrainInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -5007,6 +5192,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailDailyTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -5084,6 +5272,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailDailyTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -5161,6 +5352,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailDailyTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -5245,6 +5439,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailDailyTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -5329,6 +5526,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailStationTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -5420,6 +5620,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailODDailyTimetable"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -5490,6 +5693,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailLiveBoard"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -5567,6 +5773,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailLiveBoard"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -5637,6 +5846,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.TRA.RailLiveTrainDelay"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -6201,8 +6413,8 @@
}
}
},
- "PTX.API.Rail.Model.V2THSRAvaliableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.AvailableSeat]": {
- "title": "AvaliableSeatStatus",
+ "PTX.API.Rail.Model.V2THSRAvailableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.AvailableSeat]": {
+ "title": "AvailableSeatStatus",
"required": [
"AvailableSeats"
],
@@ -6851,8 +7063,8 @@
}
}
},
- "PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.ServiceDays": {
- "title": "ServiceDays",
+ "PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.ServiceDay": {
+ "title": "ServiceDay",
"description": "服務日型態",
"required": [
"Friday",
@@ -6922,7 +7134,7 @@
"FirstTrainTime",
"LastTrainTime",
"LineID",
- "ServiceDays",
+ "ServiceDay",
"SrcUpdateTime",
"StationID",
"StationName",
@@ -6989,12 +7201,12 @@
"description": "末班車時刻",
"type": "string"
},
- "ServiceDays": {
- "title": "ServiceDays",
+ "ServiceDay": {
+ "title": "ServiceDay",
"description": "服務日型態",
"allOf": [
{
- "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.ServiceDays"
+ "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.ServiceDay"
}
]
},
@@ -7086,7 +7298,7 @@
"LineID",
"OperationTime",
"RouteID",
- "ServiceDays",
+ "ServiceDay",
"SrcUpdateTime",
"UpdateTime",
"VersionID"
@@ -7113,12 +7325,12 @@
"description": "車種(0:不分車種, 1:普通車, 2:直達車)",
"type": "integer"
},
- "ServiceDays": {
- "title": "ServiceDays",
+ "ServiceDay": {
+ "title": "ServiceDay",
"description": "服務日型態",
"allOf": [
{
- "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.ServiceDays"
+ "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.ServiceDay"
}
]
},
@@ -7168,8 +7380,6 @@
"Direction",
"PackageServiceFlag",
"TrainNo",
- "UpdateTime",
- "VersionID",
"WheelchairFlag"
],
"type": "object",
@@ -7287,17 +7497,6 @@
"$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType"
}
]
- },
- "UpdateTime": {
- "title": "DateTime",
- "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
- "type": "string"
- },
- "VersionID": {
- "format": "int32",
- "title": "Int32",
- "description": "資料版本編號",
- "type": "integer"
}
}
},
@@ -7637,6 +7836,150 @@
}
}
},
+ "PTX.Service.DTO.Rail.Specification.V2.TRA.RailGeneralTrainInfo": {
+ "title": "RailGeneralTrainInfo",
+ "description": "臺鐵車次定期資料型別",
+ "required": [
+ "BikeFlag",
+ "BreastFeedingFlag",
+ "DailyFlag",
+ "DiningFlag",
+ "Direction",
+ "PackageServiceFlag",
+ "TrainNo",
+ "UpdateTime",
+ "VersionID",
+ "WheelchairFlag"
+ ],
+ "type": "object",
+ "properties": {
+ "TrainNo": {
+ "title": "String",
+ "description": "車次代碼",
+ "type": "string"
+ },
+ "Direction": {
+ "format": "int32",
+ "title": "integer",
+ "description": "順逆行 : [0:'順行',1:'逆行']",
+ "type": "integer"
+ },
+ "StartingStationID": {
+ "title": "String",
+ "description": "列車起點車站代號",
+ "type": "string"
+ },
+ "StartingStationName": {
+ "title": "NameType",
+ "description": "列車起點車站名稱",
+ "allOf": [
+ {
+ "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType"
+ }
+ ]
+ },
+ "EndingStationID": {
+ "title": "String",
+ "description": "列車終點車站代號",
+ "type": "string"
+ },
+ "EndingStationName": {
+ "title": "NameType",
+ "description": "列車終點車站名稱",
+ "allOf": [
+ {
+ "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType"
+ }
+ ]
+ },
+ "TrainTypeID": {
+ "title": "String",
+ "description": "列車車種代碼",
+ "type": "string"
+ },
+ "TrainTypeCode": {
+ "title": "String",
+ "description": "列車車種簡碼",
+ "type": "string"
+ },
+ "TrainTypeName": {
+ "title": "NameType",
+ "description": "列車車種名稱",
+ "allOf": [
+ {
+ "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType"
+ }
+ ]
+ },
+ "TripLine": {
+ "format": "int32",
+ "title": "integer",
+ "description": "山海線類型 : [0:'不經山海線',1:'山線',2:'海線',3:'成追線']",
+ "type": "integer"
+ },
+ "OverNightStationID": {
+ "title": "String",
+ "description": "跨夜車站代碼",
+ "type": "string"
+ },
+ "WheelchairFlag": {
+ "format": "int32",
+ "title": "integer",
+ "description": "是否設身障旅客專用座位車 : [0:'否',1:'是']",
+ "type": "integer"
+ },
+ "PackageServiceFlag": {
+ "format": "int32",
+ "title": "integer",
+ "description": "是否提供行李服務 : [0:'否',1:'是']",
+ "type": "integer"
+ },
+ "DiningFlag": {
+ "format": "int32",
+ "title": "integer",
+ "description": "是否提供訂便當服務 : [0:'否',1:'是']",
+ "type": "integer"
+ },
+ "BikeFlag": {
+ "format": "int32",
+ "title": "integer",
+ "description": "是否人車同行班次(置於攜車袋之自行車各級列車均可乘車) : [0:'否',1:'是']",
+ "type": "integer"
+ },
+ "BreastFeedingFlag": {
+ "format": "int32",
+ "title": "integer",
+ "description": "是否設有哺(集)乳室車廂 : [0:'否',1:'是']",
+ "type": "integer"
+ },
+ "DailyFlag": {
+ "format": "int32",
+ "title": "integer",
+ "description": "是否為每日行駛 : [0:'否',1:'是']",
+ "type": "integer"
+ },
+ "Note": {
+ "title": "NameType",
+ "description": "附註說明",
+ "allOf": [
+ {
+ "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType"
+ }
+ ]
+ },
+ "UpdateTime": {
+ "title": "DateTime",
+ "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
+ "type": "string"
+ },
+ "VersionID": {
+ "format": "int32",
+ "title": "Int32",
+ "description": "資料版本編號",
+ "type": "integer"
+ }
+ }
+ },
"PTX.Service.DTO.Rail.Specification.V2.TRA.Line": {
"title": "Line",
"description": "路線基本資料",
@@ -8175,6 +8518,7 @@
"NetworkName",
"OperatorCode",
"OperatorName",
+ "SrcUpdateTime",
"UpdateTime",
"VersionID"
],
@@ -8221,6 +8565,11 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.NetworkSubClass.Line"
}
},
+ "SrcUpdateTime": {
+ "title": "DateTime",
+ "description": "來源端平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
+ "type": "string"
+ },
"UpdateTime": {
"title": "DateTime",
"description": "本平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
@@ -8609,8 +8958,8 @@
}
}
},
- "PTX.API.Rail.Model.V2THSRODAvaliableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.OD.AvailableSeat]": {
- "title": "AvaliableSeatStatus",
+ "PTX.API.Rail.Model.V2THSRODAvailableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.OD.AvailableSeat]": {
+ "title": "AvailableSeatStatus",
"required": [
"AvailableSeats"
],
@@ -9069,12 +9418,11 @@
"Direction",
"EndingStationID",
"EndingStationName",
- "SrcRecTime",
+ "SrcUpdateTime",
"StationID",
"StationName",
"StopStations",
- "TrainNo",
- "UpdateTime"
+ "TrainNo"
],
"type": "object",
"properties": {
@@ -9130,20 +9478,15 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.THSR.StopStation"
}
},
- "SrcRecTime": {
- "title": "DateTime",
- "description": "來源端平台接收時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
- "type": "string"
- },
- "UpdateTime": {
+ "SrcUpdateTime": {
"title": "DateTime",
- "description": "本平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
+ "description": "來源平台更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
"type": "string"
}
}
},
- "PTX.API.Rail.Model.V2THSRAvaliableSeatStatusOldWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.Old.AvailableSeat]": {
- "title": "V2THSRAvaliableSeatStatusWrapper",
+ "PTX.API.Rail.Model.V2THSRAvailableSeatStatusOldWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.Old.AvailableSeat]": {
+ "title": "AvailableSeatStatus",
"required": [
"AvailableSeats"
],
@@ -9339,10 +9682,10 @@
]
},
"TravelTime": {
- "format": "int32",
- "title": "Int32",
+ "format": "float",
+ "title": "Single",
"description": "營運路線運行時間",
- "type": "integer"
+ "type": "number"
},
"RouteLength": {
"format": "float",
@@ -9626,7 +9969,7 @@
}
}
},
- "PTX.Service.DTO.Shared.Specification.V2.Base.PointType": {
+ "PTX.Service.DTO.Rail.Specification.V2.PointType": {
"title": "PointType",
"description": "座標資料型別",
"type": "object",
@@ -9656,7 +9999,6 @@
"StationAddress",
"StationID",
"StationName",
- "StationPosition",
"StationUID",
"UpdateTime",
"VersionID"
@@ -9682,15 +10024,6 @@
}
]
},
- "StationPosition": {
- "title": "PointType",
- "description": "車站位置",
- "allOf": [
- {
- "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.PointType"
- }
- ]
- },
"StationAddress": {
"title": "String",
"description": "車站地址",
@@ -9726,6 +10059,35 @@
"title": "Int32",
"description": "資料版本編號",
"type": "integer"
+ },
+ "StationPosition": {
+ "title": "PointType",
+ "description": "車站位置",
+ "allOf": [
+ {
+ "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.PointType"
+ }
+ ]
+ },
+ "LocationCity": {
+ "title": "String",
+ "description": "車站位置所屬縣市",
+ "type": "string"
+ },
+ "LocationCityCode": {
+ "title": "String",
+ "description": "車站位置所屬縣市代碼",
+ "type": "string"
+ },
+ "LocationTown": {
+ "title": "String",
+ "description": "車站位置所屬鄉鎮",
+ "type": "string"
+ },
+ "LocationTownCode": {
+ "title": "String",
+ "description": "車站位置所屬鄉鎮代碼",
+ "type": "string"
}
}
},
@@ -9735,9 +10097,9 @@
"required": [
"OperatorID",
"StationAddress",
+ "StationCode",
"StationID",
"StationName",
- "StationPosition",
"StationUID",
"UpdateTime",
"VersionID"
@@ -9754,6 +10116,11 @@
"description": "車站代碼",
"type": "string"
},
+ "StationCode": {
+ "title": "String",
+ "description": "車站簡碼(訂票系統用)",
+ "type": "string"
+ },
"StationName": {
"title": "NameType",
"description": "車站名稱",
@@ -9763,15 +10130,6 @@
}
]
},
- "StationPosition": {
- "title": "PointType",
- "description": "車站位置",
- "allOf": [
- {
- "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.PointType"
- }
- ]
- },
"StationAddress": {
"title": "String",
"description": "車站地址",
@@ -9797,6 +10155,35 @@
"title": "Int32",
"description": "資料版本編號",
"type": "integer"
+ },
+ "StationPosition": {
+ "title": "PointType",
+ "description": "車站位置",
+ "allOf": [
+ {
+ "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.PointType"
+ }
+ ]
+ },
+ "LocationCity": {
+ "title": "String",
+ "description": "車站位置所屬縣市",
+ "type": "string"
+ },
+ "LocationCityCode": {
+ "title": "String",
+ "description": "車站位置所屬縣市代碼",
+ "type": "string"
+ },
+ "LocationTown": {
+ "title": "String",
+ "description": "車站位置所屬鄉鎮",
+ "type": "string"
+ },
+ "LocationTownCode": {
+ "title": "String",
+ "description": "車站位置所屬鄉鎮代碼",
+ "type": "string"
}
}
},
@@ -9809,7 +10196,6 @@
"StationAddress",
"StationID",
"StationName",
- "StationPosition",
"StationUID",
"UpdateTime",
"VersionID"
@@ -9835,15 +10221,6 @@
}
]
},
- "StationPosition": {
- "title": "PointType",
- "description": "車站座標",
- "allOf": [
- {
- "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.PointType"
- }
- ]
- },
"StationAddress": {
"title": "String",
"description": "車站地址",
@@ -9869,6 +10246,57 @@
"title": "Int32",
"description": "資料版本編號",
"type": "integer"
+ },
+ "StationPosition": {
+ "title": "PointType",
+ "description": "車站位置",
+ "allOf": [
+ {
+ "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.PointType"
+ }
+ ]
+ },
+ "LocationCity": {
+ "title": "String",
+ "description": "車站位置所屬縣市",
+ "type": "string"
+ },
+ "LocationCityCode": {
+ "title": "String",
+ "description": "車站位置所屬縣市代碼",
+ "type": "string"
+ },
+ "LocationTown": {
+ "title": "String",
+ "description": "車站位置所屬鄉鎮",
+ "type": "string"
+ },
+ "LocationTownCode": {
+ "title": "String",
+ "description": "車站位置所屬鄉鎮代碼",
+ "type": "string"
+ }
+ }
+ },
+ "PTX.Service.DTO.Shared.Specification.V2.Base.PointType": {
+ "title": "PointType",
+ "description": "座標資料型別",
+ "type": "object",
+ "properties": {
+ "PositionLat": {
+ "format": "double",
+ "description": "位置緯度(WGS84)",
+ "type": "number"
+ },
+ "PositionLon": {
+ "format": "double",
+ "description": "位置經度(WGS84)",
+ "type": "number"
+ },
+ "GeoHash": {
+ "title": "String",
+ "description": "地理空間編碼",
+ "type": "string"
}
}
},
@@ -10739,7 +11167,7 @@
"DestinationStaionID",
"DestinationStationName",
"LineID",
- "ServiceDays",
+ "ServiceDay",
"SrcUpdateTime",
"StationID",
"StationName",
@@ -10801,12 +11229,12 @@
"$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.Timetable"
}
},
- "ServiceDays": {
- "title": "ServiceDays",
+ "ServiceDay": {
+ "title": "ServiceDay",
"description": "服務日型態",
"allOf": [
{
- "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.ServiceDays"
+ "$ref": "#/definitions/PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.ServiceDay"
}
]
},
diff --git a/oas.rail.v3.json b/oas.rail.v3.json
index 70d20122..c4e50bfb 100644
--- a/oas.rail.v3.json
+++ b/oas.rail.v3.json
@@ -83,6 +83,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.Network.Network]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -165,6 +168,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.Station]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -241,6 +247,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.StationExit.StationExit]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -317,6 +326,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.StationFacility.StationFacility]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -393,6 +405,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.Line]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -469,6 +484,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.StationOfLine.StationOfLine]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -545,6 +563,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.TrainType]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -659,6 +680,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRAODFareWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.ODFare.ODFare]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -735,6 +759,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRAGeneralTrainWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.GeneralTrainTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -818,6 +845,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRAGeneralTrainWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.GeneralTrainTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -894,6 +924,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRAGeneralStationWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.GeneralStationTimetable.GeneralStationTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -977,6 +1010,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRAGeneralStationWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.GeneralStationTimetable.GeneralStationTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1053,6 +1089,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRASpecificWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.SpecificTrainTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1136,6 +1175,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRASpecificWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.SpecificTrainTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1212,6 +1254,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TraDailyTrainWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.DailyTrainTimeTable.TrainTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1295,6 +1340,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TraDailyTrainWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.DailyTrainTimeTable.TrainTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1378,6 +1426,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TraDailyTrainWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.DailyTrainTimeTable.TrainTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1475,6 +1526,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TraDailyTrainWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.DailyTrainTimeTable.TrainTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1572,6 +1626,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TraDailyTrainWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.DailyTrainTimeTable.TrainTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1648,6 +1705,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TraDailyStationWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.DailyStationTimeTable.StationTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1731,6 +1791,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TraDailyStationWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.DailyStationTimeTable.StationTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1814,6 +1877,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TraDailyStationWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.DailyStationTimeTable.StationTimetable]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1890,6 +1956,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRARealTimeWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.TRAStationLiveBoardList.StationLiveBoard]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1973,6 +2042,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRARealTimeWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.TRAStationLiveBoardList.StationLiveBoard]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2049,6 +2121,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRARealTimeWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.TRATrainLiveBoardList.TrainLiveBoard]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2132,6 +2207,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRARealTimeWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.TRATrainLiveBoardList.TrainLiveBoard]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2208,6 +2286,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.LineTransfer]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2284,6 +2365,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.StationTransfer.StationTransfer]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2360,6 +2444,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRARealTimeWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.TRANewsList.News]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2436,6 +2523,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRARealTimeWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.TRAAlertList.Alert]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2512,6 +2602,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.Shape]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2588,6 +2681,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.Operator]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2664,6 +2760,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Rail.Model.TRABaseWrapper[PTX.Service.DTO.Rail.Specification.V3.TRA.LineNetwork.LineNetwork]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
diff --git a/oas.ship.v3.json b/oas.ship.v3.json
index 95623762..39ddbf4a 100644
--- a/oas.ship.v3.json
+++ b/oas.ship.v3.json
@@ -82,6 +82,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Ship.Model.ShipWrapper[PTX.Service.DTO.Ship.Specification.V3.Port]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -157,6 +160,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Ship.Model.ShipWrapper[PTX.Service.DTO.Ship.Specification.V3.Operator]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -232,6 +238,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Ship.Model.ShipWrapper[PTX.Service.DTO.Ship.Specification.V3.Route]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -314,6 +323,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Ship.Model.ShipWrapper[PTX.Service.DTO.Ship.Specification.V3.Route]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -389,6 +401,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Ship.Model.ShipWrapper[PTX.Service.DTO.Ship.Specification.V3.RouteFare]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -471,6 +486,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Ship.Model.ShipWrapper[PTX.Service.DTO.Ship.Specification.V3.RouteFare]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -546,6 +564,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Ship.Model.ScheduleWrapper[PTX.Service.DTO.Ship.Specification.V3.GeneralSchedule]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -628,6 +649,9 @@
"schema": {
"$ref": "#/definitions/PTX.API.Ship.Model.ScheduleWrapper[PTX.Service.DTO.Ship.Specification.V3.GeneralSchedule]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -703,6 +727,87 @@
"schema": {
"$ref": "#/definitions/PTX.API.Ship.Model.ShipWrapper[PTX.Service.DTO.Shared.Specification.V3.Base.Authority]"
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
+ }
+ }
+ }
+ },
+ "/v3/Ship/LivePosition": {
+ "get": {
+ "tags": [
+ "Ship"
+ ],
+ "summary": "取得航運船舶即時位置資料",
+ "operationId": "ShipApi_LivePosition",
+ "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": "$count",
+ "description": "查詢數量",
+ "type": "boolean",
+ "enum": [
+ true,
+ false
+ ]
+ },
+ {
+ "in": "query",
+ "name": "$format",
+ "description": "指定來源格式",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "JSON",
+ "XML"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "schema": {
+ "$ref": "#/definitions/PTX.API.Ship.Model.ShipLiveWrapper[PTX.Service.DTO.Ship.Specification.V3.LivePosition]"
+ }
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -835,6 +940,152 @@
}
}
},
+ "PTX.Service.DTO.Ship.Specification.V3.PointType": {
+ "title": "PointType",
+ "required": [
+ "PositionLat",
+ "PositionLon"
+ ],
+ "type": "object",
+ "properties": {
+ "PositionLat": {
+ "format": "double",
+ "title": "Double",
+ "description": "位置緯度",
+ "type": "number"
+ },
+ "PositionLon": {
+ "format": "double",
+ "title": "Double",
+ "description": "位置經度",
+ "type": "number"
+ }
+ }
+ },
+ "PTX.Service.DTO.Ship.Specification.V3.LivePosition": {
+ "title": "LivePosition",
+ "required": [
+ "GPSTime",
+ "MMSI",
+ "NAVSTAT",
+ "VesselID",
+ "VesselPosition"
+ ],
+ "type": "object",
+ "properties": {
+ "VesselID": {
+ "title": "String",
+ "description": "船舶代碼",
+ "type": "string"
+ },
+ "MMSI": {
+ "title": "String",
+ "description": "AIS 船舶編號",
+ "type": "string"
+ },
+ "VesselName": {
+ "title": "NameType",
+ "description": "船舶名稱",
+ "allOf": [
+ {
+ "$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V3.Base.NameType"
+ }
+ ]
+ },
+ "VesselPosition": {
+ "title": "PointType",
+ "description": "船舶位置資訊",
+ "allOf": [
+ {
+ "$ref": "#/definitions/PTX.Service.DTO.Ship.Specification.V3.PointType"
+ }
+ ]
+ },
+ "NAVSTAT": {
+ "format": "int32",
+ "title": "integer",
+ "description": "航行狀態 : [0:'under way using engine',1:'at anchor',2:'not under command',3:'restricted maneuverability',4:'constrained by her draught',5:'moored',6:'aground',7:'engaged in fishing',8:'under way sailing',9:'reserved for future amendment of navigational status for ships carrying DG, HS, or MP, or IMO hazard or pollutant category C, high speed craft (HSC)',10:'reserved for future amendment of navigational status for ships carrying dangerous goods (DG), harmful substances (HS) or marine pollutants (MP), or IMO hazard or pollutant category A, wing in ground (WIG)',11:'power-driven vessel towing astern (regional use)',12:'power-driven vessel pushing ahead or towing alongside (regional use)',13:'reserved for future use',14:'AIS-SART (active), MOB-AIS, EPIRB-AIS',15:'undefined = default (also used by AIS-SART, MOB-AIS and EPIRB-AIS under test)']",
+ "type": "integer"
+ },
+ "SOG": {
+ "format": "float",
+ "title": "Single",
+ "description": "對地航速(Speed Over Ground,單位: knot(節,海里/小時)),精度至 1/10 knot",
+ "type": "number"
+ },
+ "COG": {
+ "format": "float",
+ "title": "Single",
+ "description": "對地航向(Course Over Ground,單位: degree(度,真北為零)),精度至 1/10 degree",
+ "type": "number"
+ },
+ "VesselType": {
+ "format": "int32",
+ "title": "integer",
+ "description": "船舶種類 : [0:'N/A',20:'WIG',30:'Vessel-Fishing',31:'not under command',32:'Vessel-Tow>200m,breadth>25m',33:'Vessel-Dredge,Underwater OP',34:'Vessel-Diving OP',35:'Vessel-Military OP',36:'Vessel-Sailing',37:'Vessel-Pleasure craft',40:'HSC',50:'Pilot vessel',51:'Search & rescue vessel',52:'Tug',53:'Port tender',54:'Anti-pollution vessel',55:'Law enforcement vessel',58:'Medical transport',59:'Resolution 18(Mob-83)',60:'Passenger ship',70:'Cargo ship',80:'Tanker',90:'Other',101:'Undefined']",
+ "type": "integer"
+ },
+ "GPSTime": {
+ "title": "DateTime",
+ "description": "GPS 記錄時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
+ "type": "string"
+ }
+ }
+ },
+ "PTX.API.Ship.Model.ShipLiveWrapper[PTX.Service.DTO.Ship.Specification.V3.LivePosition]": {
+ "title": "ShipLivePositionList",
+ "required": [
+ "AuthorityCode",
+ "LivePositions",
+ "SrcUpdateInterval",
+ "SrcUpdateTime",
+ "UpdateInterval",
+ "UpdateTime"
+ ],
+ "type": "object",
+ "properties": {
+ "UpdateTime": {
+ "title": "DateTime",
+ "description": "[平臺]資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
+ "type": "string"
+ },
+ "UpdateInterval": {
+ "format": "int32",
+ "title": "Int32",
+ "description": "[平臺]資料更新週期(秒)",
+ "type": "integer"
+ },
+ "SrcUpdateTime": {
+ "title": "DateTime",
+ "description": "[來源端平臺]資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
+ "type": "string"
+ },
+ "SrcUpdateInterval": {
+ "format": "int32",
+ "title": "Int32",
+ "description": "[來源端平臺]資料更新週期(秒)['-1: 不定期更新']",
+ "type": "integer"
+ },
+ "AuthorityCode": {
+ "title": "String",
+ "description": "業管機關簡碼",
+ "type": "string"
+ },
+ "Count": {
+ "format": "int64",
+ "description": "資料總筆數",
+ "type": "integer"
+ },
+ "LivePositions": {
+ "title": "Array",
+ "description": "資料(陣列)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PTX.Service.DTO.Ship.Specification.V3.LivePosition"
+ }
+ }
+ }
+ },
"PTX.Service.DTO.Ship.Specification.V3.Operator": {
"title": "Operator",
"type": "object",
@@ -945,26 +1196,17 @@
}
}
},
- "PTX.Service.DTO.Ship.Specification.V3.PointType": {
- "title": "PointType",
- "type": "object",
- "properties": {
- "PositionLat": {
- "format": "double",
- "title": "Double",
- "description": "位置緯度",
- "type": "number"
- },
- "PositionLon": {
- "format": "double",
- "title": "Double",
- "description": "位置經度",
- "type": "number"
- }
- }
- },
"PTX.Service.DTO.Ship.Specification.V3.Port": {
"title": "Port",
+ "required": [
+ "City",
+ "CityCode",
+ "Country",
+ "CountryCode",
+ "PortID",
+ "PortName",
+ "PortPosition"
+ ],
"type": "object",
"properties": {
"PortID": {
diff --git a/oas.tourism.v2.json b/oas.tourism.v2.json
index b0064c22..c7a44c29 100644
--- a/oas.tourism.v2.json
+++ b/oas.tourism.v2.json
@@ -83,6 +83,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.ScenicSpotTourismInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -130,28 +133,28 @@
"LienchiangCounty"
],
"x-enum": {
- "TaitungCounty": "臺東縣",
- "HsinchuCounty": "新竹縣",
- "PingtungCounty": "屏東縣",
- "Hsinchu": "新竹市",
- "YunlinCounty": "雲林縣",
- "Taipei": "臺北市",
- "NewTaipei": "新北市",
- "KinmenCounty": "金門縣",
- "Chiayi": "嘉義市",
- "PenghuCounty": "澎湖縣",
+ "NantouCounty": "南投縣",
+ "LienchiangCounty": "連江縣",
"MiaoliCounty": "苗栗縣",
"Taichung": "臺中市",
- "YilanCounty": "宜蘭縣",
- "ChiayiCounty": "嘉義縣",
- "Keelung": "基隆市",
- "Taoyuan": "桃園市",
"ChanghuaCounty": "彰化縣",
+ "PenghuCounty": "澎湖縣",
+ "KinmenCounty": "金門縣",
"Tainan": "臺南市",
- "HualienCounty": "花蓮縣",
"Kaohsiung": "高雄市",
- "NantouCounty": "南投縣",
- "LienchiangCounty": "連江縣"
+ "Taipei": "臺北市",
+ "PingtungCounty": "屏東縣",
+ "Taoyuan": "桃園市",
+ "Keelung": "基隆市",
+ "YunlinCounty": "雲林縣",
+ "TaitungCounty": "臺東縣",
+ "Chiayi": "嘉義市",
+ "Hsinchu": "新竹市",
+ "YilanCounty": "宜蘭縣",
+ "HualienCounty": "花蓮縣",
+ "HsinchuCounty": "新竹縣",
+ "NewTaipei": "新北市",
+ "ChiayiCounty": "嘉義縣"
}
},
{
@@ -213,6 +216,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.ScenicSpotTourismInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -289,6 +295,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.RestaurantTourismInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -337,28 +346,28 @@
"LienchiangCounty"
],
"x-enum": {
+ "YilanCounty": "宜蘭縣",
+ "Kaohsiung": "高雄市",
+ "HualienCounty": "花蓮縣",
+ "MiaoliCounty": "苗栗縣",
"TaitungCounty": "臺東縣",
"KinmenCounty": "金門縣",
- "HualienCounty": "花蓮縣",
+ "Tainan": "臺南市",
"ChiayiCounty": "嘉義縣",
+ "ChanghuaCounty": "彰化縣",
+ "NantouCounty": "南投縣",
+ "PenghuCounty": "澎湖縣",
+ "PingtungCounty": "屏東縣",
"Keelung": "基隆市",
- "Tainan": "臺南市",
+ "LienchiangCounty": "連江縣",
"Taichung": "臺中市",
- "YilanCounty": "宜蘭縣",
+ "NewTaipei": "新北市",
"Hsinchu": "新竹市",
- "YunlinCounty": "雲林縣",
- "Chiayi": "嘉義市",
- "NantouCounty": "南投縣",
"Taoyuan": "桃園市",
- "LienchiangCounty": "連江縣",
- "PenghuCounty": "澎湖縣",
- "PingtungCounty": "屏東縣",
- "Kaohsiung": "高雄市",
- "Taipei": "臺北市",
+ "Chiayi": "嘉義市",
"HsinchuCounty": "新竹縣",
- "MiaoliCounty": "苗栗縣",
- "NewTaipei": "新北市",
- "ChanghuaCounty": "彰化縣"
+ "YunlinCounty": "雲林縣",
+ "Taipei": "臺北市"
}
},
{
@@ -420,6 +429,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.RestaurantTourismInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -496,6 +508,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.HotelTourismInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -544,28 +559,28 @@
"LienchiangCounty"
],
"x-enum": {
- "Kaohsiung": "高雄市",
- "Keelung": "基隆市",
- "TaitungCounty": "臺東縣",
+ "MiaoliCounty": "苗栗縣",
+ "NantouCounty": "南投縣",
"HualienCounty": "花蓮縣",
- "Chiayi": "嘉義市",
- "Hsinchu": "新竹市",
- "ChanghuaCounty": "彰化縣",
"HsinchuCounty": "新竹縣",
"YilanCounty": "宜蘭縣",
+ "TaitungCounty": "臺東縣",
"Tainan": "臺南市",
+ "ChanghuaCounty": "彰化縣",
"Taipei": "臺北市",
+ "YunlinCounty": "雲林縣",
+ "Kaohsiung": "高雄市",
+ "Taoyuan": "桃園市",
"KinmenCounty": "金門縣",
- "PenghuCounty": "澎湖縣",
- "NewTaipei": "新北市",
+ "Chiayi": "嘉義市",
"PingtungCounty": "屏東縣",
- "NantouCounty": "南投縣",
"Taichung": "臺中市",
- "Taoyuan": "桃園市",
- "YunlinCounty": "雲林縣",
- "LienchiangCounty": "連江縣",
- "MiaoliCounty": "苗栗縣",
- "ChiayiCounty": "嘉義縣"
+ "PenghuCounty": "澎湖縣",
+ "Hsinchu": "新竹市",
+ "ChiayiCounty": "嘉義縣",
+ "Keelung": "基隆市",
+ "NewTaipei": "新北市",
+ "LienchiangCounty": "連江縣"
}
},
{
@@ -627,6 +642,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.HotelTourismInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -703,6 +721,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.ActivityTourismInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -751,28 +772,28 @@
"LienchiangCounty"
],
"x-enum": {
- "Kaohsiung": "高雄市",
- "Keelung": "基隆市",
- "TaitungCounty": "臺東縣",
+ "MiaoliCounty": "苗栗縣",
+ "NantouCounty": "南投縣",
"HualienCounty": "花蓮縣",
- "Chiayi": "嘉義市",
- "Hsinchu": "新竹市",
- "ChanghuaCounty": "彰化縣",
"HsinchuCounty": "新竹縣",
"YilanCounty": "宜蘭縣",
+ "TaitungCounty": "臺東縣",
"Tainan": "臺南市",
+ "ChanghuaCounty": "彰化縣",
"Taipei": "臺北市",
+ "YunlinCounty": "雲林縣",
+ "Kaohsiung": "高雄市",
+ "Taoyuan": "桃園市",
"KinmenCounty": "金門縣",
- "PenghuCounty": "澎湖縣",
- "NewTaipei": "新北市",
+ "Chiayi": "嘉義市",
"PingtungCounty": "屏東縣",
- "NantouCounty": "南投縣",
"Taichung": "臺中市",
- "Taoyuan": "桃園市",
- "YunlinCounty": "雲林縣",
- "LienchiangCounty": "連江縣",
- "MiaoliCounty": "苗栗縣",
- "ChiayiCounty": "嘉義縣"
+ "PenghuCounty": "澎湖縣",
+ "Hsinchu": "新竹市",
+ "ChiayiCounty": "嘉義縣",
+ "Keelung": "基隆市",
+ "NewTaipei": "新北市",
+ "LienchiangCounty": "連江縣"
}
},
{
@@ -834,6 +855,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.ActivityTourismInfo"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -882,12 +906,6 @@
"description": "跳過前幾筆",
"type": "string"
},
- {
- "in": "query",
- "name": "$spatialFilter",
- "description": "空間過濾",
- "type": "string"
- },
{
"in": "query",
"name": "$format",
@@ -965,12 +983,6 @@
"description": "跳過前幾筆",
"type": "string"
},
- {
- "in": "query",
- "name": "$spatialFilter",
- "description": "空間過濾",
- "type": "string"
- },
{
"in": "query",
"name": "$format",
@@ -1798,6 +1810,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.BusTaiwanTripShape"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1875,6 +1890,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.BusTaiwanTripShape"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -1945,6 +1963,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.BusTaiwanTripS2STravelTime"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2015,6 +2036,9 @@
"$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.BusTaiwanTripNews"
}
}
+ },
+ "304": {
+ "description": "服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content"
}
}
}
@@ -2922,8 +2946,9 @@
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.RouteOperator": {
+ "PTX.Service.DTO.Tourism.Specification.V2.RouteOperator": {
"title": "RouteOperator",
+ "description": "營運業者資訊",
"required": [
"OperatorCode",
"OperatorID",
@@ -2934,11 +2959,12 @@
"properties": {
"OperatorID": {
"title": "String",
+ "description": "營運業者代碼",
"type": "string"
},
"OperatorName": {
"title": "NameType",
- "description": "名稱資料型別",
+ "description": "營運業者名稱",
"allOf": [
{
"$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType"
@@ -2947,16 +2973,19 @@
},
"OperatorCode": {
"title": "String",
+ "description": "營運業者簡碼",
"type": "string"
},
"OperatorNo": {
"title": "String",
+ "description": "營運業者編號[交通部票證資料系統定義]",
"type": "string"
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.BusSubRoute": {
+ "PTX.Service.DTO.Tourism.Specification.V2.BusSubRoute": {
"title": "BusSubRoute",
+ "description": "附屬路線資料型別",
"required": [
"Direction",
"OperatorIDs",
@@ -2968,14 +2997,17 @@
"properties": {
"SubRouteUID": {
"title": "String",
+ "description": "附屬路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢",
"type": "string"
},
"SubRouteID": {
"title": "String",
+ "description": "地區既用中之附屬路線代碼(為原資料內碼)",
"type": "string"
},
"OperatorIDs": {
"title": "Array",
+ "description": "營運業者代碼",
"type": "array",
"items": {
"title": "String",
@@ -2984,7 +3016,7 @@
},
"SubRouteName": {
"title": "NameType",
- "description": "名稱資料型別",
+ "description": "附屬路線名稱",
"allOf": [
{
"$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType"
@@ -2993,32 +3025,38 @@
},
"Headsign": {
"title": "String",
+ "description": "車頭描述",
"type": "string"
},
"HeadsignEn": {
"title": "String",
+ "description": "車頭英文描述",
"type": "string"
},
"Direction": {
"format": "int32",
"title": "integer",
- "description": "[0:'去程',1:'返程',2:'迴圈',255:'未知']",
+ "description": "去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']",
"type": "integer"
},
"FirstBusTime": {
"title": "String",
+ "description": "平日第一班發車時間",
"type": "string"
},
"LastBusTime": {
"title": "String",
+ "description": "平日返程第一班發車時間",
"type": "string"
},
"HolidayFirstBusTime": {
"title": "String",
+ "description": "假日去程第一班發車時間",
"type": "string"
},
"HolidayLastBusTime": {
"title": "String",
+ "description": "假日返程第一班發車時間",
"type": "string"
}
}
@@ -3069,7 +3107,7 @@
"description": "營運業者",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.RouteOperator"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.RouteOperator"
}
},
"AuthorityID": {
@@ -3087,7 +3125,7 @@
"description": "附屬路線資料(如果原始資料並無提供附屬路線ID,而本平台基於跨來源資料之一致性,會以SubRouteID=RouteID產製一份相對應的附屬路線資料(若有去返程,則會有兩筆))",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusSubRoute"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.BusSubRoute"
}
},
"BusRouteType": {
@@ -3419,8 +3457,9 @@
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.ServiceDay": {
+ "PTX.Service.DTO.Tourism.Specification.V2.ServiceDay": {
"title": "ServiceDay",
+ "description": "週內營運日資料",
"required": [
"Friday",
"Monday",
@@ -3435,73 +3474,77 @@
"Sunday": {
"format": "int32",
"title": "integer",
- "description": "[0:'否',1:'是']",
+ "description": "星期日是否營運 : [0:'否',1:'是']",
"type": "integer"
},
"Monday": {
"format": "int32",
"title": "integer",
- "description": "[0:'否',1:'是']",
+ "description": "星期一是否營運 : [0:'否',1:'是']",
"type": "integer"
},
"Tuesday": {
"format": "int32",
"title": "integer",
- "description": "[0:'否',1:'是']",
+ "description": "星期二是否營運 : [0:'否',1:'是']",
"type": "integer"
},
"Wednesday": {
"format": "int32",
"title": "integer",
- "description": "[0:'否',1:'是']",
+ "description": "星期三是否營運 : [0:'否',1:'是']",
"type": "integer"
},
"Thursday": {
"format": "int32",
"title": "integer",
- "description": "[0:'否',1:'是']",
+ "description": "星期四是否營運 : [0:'否',1:'是']",
"type": "integer"
},
"Friday": {
"format": "int32",
"title": "integer",
- "description": "[0:'否',1:'是']",
+ "description": "星期五是否營運 : [0:'否',1:'是']",
"type": "integer"
},
"Saturday": {
"format": "int32",
"title": "integer",
- "description": "[0:'否',1:'是']",
+ "description": "星期六是否營運 : [0:'否',1:'是']",
"type": "integer"
},
"NationalHolidays": {
"format": "int32",
"title": "integer",
- "description": "[0:'否',1:'是']",
+ "description": "國定假日是否營運 : [0:'否',1:'是']",
"type": "integer"
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.DatePeriod": {
+ "PTX.Service.DTO.Tourism.Specification.V2.DatePeriod": {
"title": "DatePeriod",
"type": "object",
"properties": {
"StartDate": {
"title": "String",
+ "description": "營運起始日(格式: yyyy-MM-dd)",
"type": "string"
},
"EndDate": {
"title": "String",
+ "description": "營運結束日(格式: yyyy-MM-dd)",
"type": "string"
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.SpecialDay": {
+ "PTX.Service.DTO.Tourism.Specification.V2.SpecialDay": {
"title": "SpecialDay",
+ "description": "特殊營運日資料",
"type": "object",
"properties": {
"Dates": {
"title": "Array",
+ "description": "不連續特殊日期",
"type": "array",
"items": {
"title": "String",
@@ -3510,26 +3553,29 @@
},
"DatePeriod": {
"title": "DatePeriod",
+ "description": "連續特殊日期",
"allOf": [
{
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.DatePeriod"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.DatePeriod"
}
]
},
"ServiceStatus": {
"format": "int32",
"title": "integer",
- "description": "[0:'正常營運',1:'加班營運',2:'取消/停駛營運']",
+ "description": "營運服務狀態代碼 : [0:'正常營運',1:'加班營運',2:'取消/停駛營運']",
"type": "integer"
},
"Description": {
"title": "String",
+ "description": "特殊營運描述",
"type": "string"
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.BusStopTime": {
+ "PTX.Service.DTO.Tourism.Specification.V2.BusStopTime": {
"title": "BusStopTime",
+ "description": "公車停靠時間資料",
"required": [
"ArrivalTime",
"DepartureTime",
@@ -3543,19 +3589,22 @@
"StopSequence": {
"format": "int32",
"title": "Int32",
+ "description": "路線經過站牌之順序(由1開始)",
"type": "integer"
},
"StopUID": {
"title": "String",
+ "description": "站牌唯一識別代碼,規則為 {業管機關代碼} + {StopID},其中 {業管機關代碼} 可於Authority API中的AuthorityCode欄位查詢",
"type": "string"
},
"StopID": {
"title": "String",
+ "description": "地區既用中之站牌代碼(為原資料內碼)",
"type": "string"
},
"StopName": {
"title": "NameType",
- "description": "名稱資料型別",
+ "description": "站牌名稱",
"allOf": [
{
"$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType"
@@ -3564,16 +3613,19 @@
},
"ArrivalTime": {
"title": "String",
+ "description": "到站時間,格式為:HH:mm",
"type": "string"
},
"DepartureTime": {
"title": "String",
+ "description": "離站時間,格式為:HH:mm",
"type": "string"
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.BusTimetable": {
+ "PTX.Service.DTO.Tourism.Specification.V2.BusTimetable": {
"title": "BusTimetable",
+ "description": "班次資料",
"required": [
"StopTimes"
],
@@ -3581,34 +3633,39 @@
"properties": {
"TripID": {
"title": "String",
+ "description": "班次代碼,為無意義之編碼",
"type": "string"
},
"ServiceDay": {
"title": "ServiceDay",
+ "description": "週內營運日",
"allOf": [
{
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.ServiceDay"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.ServiceDay"
}
]
},
"SpecialDays": {
"title": "Array",
+ "description": "特殊營運日",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.SpecialDay"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.SpecialDay"
}
},
"StopTimes": {
"title": "Array",
+ "description": "公車停靠時間資料",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusStopTime"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.BusStopTime"
}
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.BusFrequency": {
+ "PTX.Service.DTO.Tourism.Specification.V2.BusFrequency": {
"title": "BusFrequency",
+ "description": "發車班距資料",
"required": [
"EndTime",
"MaxHeadwayMins",
@@ -3619,35 +3676,41 @@
"properties": {
"StartTime": {
"title": "String",
+ "description": "發車班距起始適用時間,格式為: HH:mm",
"type": "string"
},
"EndTime": {
"title": "String",
+ "description": "發車班距結束適用時間,格式為: HH:mm",
"type": "string"
},
"MinHeadwayMins": {
"format": "int32",
"title": "Int32",
+ "description": "最小班距時間(分鐘)",
"type": "integer"
},
"MaxHeadwayMins": {
"format": "int32",
"title": "Int32",
+ "description": "最大班距時間(分鐘)",
"type": "integer"
},
"ServiceDay": {
"title": "ServiceDay",
+ "description": "週內營運日",
"allOf": [
{
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.ServiceDay"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.ServiceDay"
}
]
},
"SpecialDays": {
"title": "Array",
+ "description": "特殊營運日",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.SpecialDay"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.SpecialDay"
}
}
}
@@ -3715,7 +3778,7 @@
"description": "預定班表",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusTimetable"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.BusTimetable"
}
},
"Frequencys": {
@@ -3723,7 +3786,7 @@
"description": "發車班距",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.BusFrequency"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.BusFrequency"
}
},
"UpdateTime": {
@@ -3746,11 +3809,6 @@
],
"type": "object",
"properties": {
- "UpdateTime": {
- "title": "DateTime",
- "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
- "type": "string"
- },
"RouteUID": {
"title": "String",
"description": "路線唯一識別代碼,規則為 {業管機關簡碼} + {RouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢",
@@ -3785,11 +3843,17 @@
"title": "DateTime",
"description": "來源端平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
"type": "string"
+ },
+ "UpdateTime": {
+ "title": "DateTime",
+ "description": "資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)",
+ "type": "string"
}
}
},
- "PTX.Service.DTO.Bus.Specification.V2.Stop": {
+ "PTX.Service.DTO.Tourism.Specification.V2.Stop": {
"title": "Stop",
+ "description": "站牌代碼資料",
"required": [
"StationGroupID",
"StopID",
@@ -3802,15 +3866,17 @@
"properties": {
"StopUID": {
"title": "String",
+ "description": "站牌唯一識別代碼,規則為 {業管機關簡碼} + {StopID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢",
"type": "string"
},
"StopID": {
"title": "String",
+ "description": "地區既用中之站牌代碼(為原資料內碼)",
"type": "string"
},
"StopName": {
"title": "NameType",
- "description": "名稱資料型別",
+ "description": "站牌名稱",
"allOf": [
{
"$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.NameType"
@@ -3820,17 +3886,18 @@
"StopBoarding": {
"format": "int32",
"title": "integer",
- "description": "[-1:'可下車',0:'可上下車',1:'可上車']",
+ "description": "上下車站別 : [-1:'可下車',0:'可上下車',1:'可上車']",
"type": "integer"
},
"StopSequence": {
"format": "int32",
"title": "Int32",
+ "description": "路線經過站牌之順序",
"type": "integer"
},
"StopPosition": {
"title": "PointType",
- "description": "座標資料型別",
+ "description": "站牌位置",
"allOf": [
{
"$ref": "#/definitions/PTX.Service.DTO.Shared.Specification.V2.Base.PointType"
@@ -3839,14 +3906,17 @@
},
"StationID": {
"title": "String",
+ "description": "站牌所屬的站位ID",
"type": "string"
},
"StationGroupID": {
"title": "String",
+ "description": "站牌所屬的組站位ID",
"type": "string"
},
"LocationCityCode": {
"title": "String",
+ "description": "站牌位置縣市之代碼(國際ISO 3166-2 三碼城市代碼)[若為公路/國道客運路線則為空值]",
"type": "string"
}
}
@@ -3922,7 +3992,7 @@
"description": "所有經過站牌",
"type": "array",
"items": {
- "$ref": "#/definitions/PTX.Service.DTO.Bus.Specification.V2.Stop"
+ "$ref": "#/definitions/PTX.Service.DTO.Tourism.Specification.V2.Stop"
}
},
"UpdateTime": {
diff --git a/rail/v2/client/metro/metro_api_alert_parameters.go b/rail/v2/client/metro/metro_api_alert_parameters.go
index bd122590..44def21b 100644
--- a/rail/v2/client/metro/metro_api_alert_parameters.go
+++ b/rail/v2/client/metro/metro_api_alert_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIAlertParams creates a new MetroAPIAlertParams object
-// with the default values initialized.
+// NewMetroAPIAlertParams creates a new MetroAPIAlertParams 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 NewMetroAPIAlertParams() *MetroAPIAlertParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIAlertParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIAlertParamsWithTimeout creates a new MetroAPIAlertParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIAlertParamsWithTimeout(timeout time.Duration) *MetroAPIAlertParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIAlertParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIAlertParamsWithContext creates a new MetroAPIAlertParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIAlertParamsWithContext(ctx context.Context) *MetroAPIAlertParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIAlertParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIAlertParamsWithHTTPClient creates a new MetroAPIAlertParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIAlertParamsWithHTTPClient(client *http.Client) *MetroAPIAlertParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIAlertParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIAlertParams contains all the parameters to send to the API endpoint
-for the metro Api alert operation typically these are written to a http.Request
+/* MetroAPIAlertParams contains all the parameters to send to the API endpoint
+ for the metro Api alert operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIAlertParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -119,6 +115,32 @@ type MetroAPIAlertParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api alert params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIAlertParams) WithDefaults() *MetroAPIAlertParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api alert params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIAlertParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIAlertParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api alert params
func (o *MetroAPIAlertParams) WithTimeout(timeout time.Duration) *MetroAPIAlertParams {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *MetroAPIAlertParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
@@ -293,64 +318,68 @@ func (o *MetroAPIAlertParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_alert_responses.go b/rail/v2/client/metro/metro_api_alert_responses.go
index 9354a9f2..5a1911c3 100644
--- a/rail/v2/client/metro/metro_api_alert_responses.go
+++ b/rail/v2/client/metro/metro_api_alert_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIAlertReader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIAlertNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIAlertOK() *MetroAPIAlertOK {
return &MetroAPIAlertOK{}
}
-/*MetroAPIAlertOK handles this case with default header values.
+/* MetroAPIAlertOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIAlertOK struct {
func (o *MetroAPIAlertOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/Alert/{Operator}][%d] metroApiAlertOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIAlertOK) GetPayload() *models.PTXAPIRailModelMRTRealTimeWrapperPTXServiceDTORailSpecificationV2MetroAlert {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *MetroAPIAlertOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewMetroAPIAlertNotModified creates a MetroAPIAlertNotModified with default headers values
+func NewMetroAPIAlertNotModified() *MetroAPIAlertNotModified {
+ return &MetroAPIAlertNotModified{}
+}
+
+/* MetroAPIAlertNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIAlertNotModified struct {
+}
+
+func (o *MetroAPIAlertNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/Alert/{Operator}][%d] metroApiAlertNotModified ", 304)
+}
+
+func (o *MetroAPIAlertNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_first_last_timetable_parameters.go b/rail/v2/client/metro/metro_api_first_last_timetable_parameters.go
index d2b14dc7..2d40668e 100644
--- a/rail/v2/client/metro/metro_api_first_last_timetable_parameters.go
+++ b/rail/v2/client/metro/metro_api_first_last_timetable_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIFirstLastTimetableParams creates a new MetroAPIFirstLastTimetableParams object
-// with the default values initialized.
+// NewMetroAPIFirstLastTimetableParams creates a new MetroAPIFirstLastTimetableParams 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 NewMetroAPIFirstLastTimetableParams() *MetroAPIFirstLastTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIFirstLastTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIFirstLastTimetableParamsWithTimeout creates a new MetroAPIFirstLastTimetableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIFirstLastTimetableParamsWithTimeout(timeout time.Duration) *MetroAPIFirstLastTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIFirstLastTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIFirstLastTimetableParamsWithContext creates a new MetroAPIFirstLastTimetableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIFirstLastTimetableParamsWithContext(ctx context.Context) *MetroAPIFirstLastTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIFirstLastTimetableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIFirstLastTimetableParamsWithHTTPClient creates a new MetroAPIFirstLastTimetableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIFirstLastTimetableParamsWithHTTPClient(client *http.Client) *MetroAPIFirstLastTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIFirstLastTimetableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIFirstLastTimetableParams contains all the parameters to send to the API endpoint
-for the metro Api first last timetable operation typically these are written to a http.Request
+/* MetroAPIFirstLastTimetableParams contains all the parameters to send to the API endpoint
+ for the metro Api first last timetable operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIFirstLastTimetableParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPIFirstLastTimetableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api first last timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIFirstLastTimetableParams) WithDefaults() *MetroAPIFirstLastTimetableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api first last timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIFirstLastTimetableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIFirstLastTimetableParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api first last timetable params
func (o *MetroAPIFirstLastTimetableParams) WithTimeout(timeout time.Duration) *MetroAPIFirstLastTimetableParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPIFirstLastTimetableParams) WriteToRequest(r runtime.ClientReques
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPIFirstLastTimetableParams) WriteToRequest(r runtime.ClientReques
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_first_last_timetable_responses.go b/rail/v2/client/metro/metro_api_first_last_timetable_responses.go
index 39359490..31125cf0 100644
--- a/rail/v2/client/metro/metro_api_first_last_timetable_responses.go
+++ b/rail/v2/client/metro/metro_api_first_last_timetable_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIFirstLastTimetableReader) ReadResponse(response runtime.ClientR
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIFirstLastTimetableNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIFirstLastTimetableOK() *MetroAPIFirstLastTimetableOK {
return &MetroAPIFirstLastTimetableOK{}
}
-/*MetroAPIFirstLastTimetableOK handles this case with default header values.
+/* MetroAPIFirstLastTimetableOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIFirstLastTimetableOK struct {
func (o *MetroAPIFirstLastTimetableOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/FirstLastTimetable/{Operator}][%d] metroApiFirstLastTimetableOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIFirstLastTimetableOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroFirstLastTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIFirstLastTimetableOK) readResponse(response runtime.ClientRespo
return nil
}
+
+// NewMetroAPIFirstLastTimetableNotModified creates a MetroAPIFirstLastTimetableNotModified with default headers values
+func NewMetroAPIFirstLastTimetableNotModified() *MetroAPIFirstLastTimetableNotModified {
+ return &MetroAPIFirstLastTimetableNotModified{}
+}
+
+/* MetroAPIFirstLastTimetableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIFirstLastTimetableNotModified struct {
+}
+
+func (o *MetroAPIFirstLastTimetableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/FirstLastTimetable/{Operator}][%d] metroApiFirstLastTimetableNotModified ", 304)
+}
+
+func (o *MetroAPIFirstLastTimetableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_frequency_parameters.go b/rail/v2/client/metro/metro_api_frequency_parameters.go
index b4af1b16..ad820405 100644
--- a/rail/v2/client/metro/metro_api_frequency_parameters.go
+++ b/rail/v2/client/metro/metro_api_frequency_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIFrequencyParams creates a new MetroAPIFrequencyParams object
-// with the default values initialized.
+// NewMetroAPIFrequencyParams creates a new MetroAPIFrequencyParams 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 NewMetroAPIFrequencyParams() *MetroAPIFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIFrequencyParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIFrequencyParamsWithTimeout creates a new MetroAPIFrequencyParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIFrequencyParamsWithTimeout(timeout time.Duration) *MetroAPIFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIFrequencyParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIFrequencyParamsWithContext creates a new MetroAPIFrequencyParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIFrequencyParamsWithContext(ctx context.Context) *MetroAPIFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIFrequencyParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIFrequencyParamsWithHTTPClient creates a new MetroAPIFrequencyParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIFrequencyParamsWithHTTPClient(client *http.Client) *MetroAPIFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIFrequencyParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIFrequencyParams contains all the parameters to send to the API endpoint
-for the metro Api frequency operation typically these are written to a http.Request
+/* MetroAPIFrequencyParams contains all the parameters to send to the API endpoint
+ for the metro Api frequency operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIFrequencyParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPIFrequencyParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api frequency params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIFrequencyParams) WithDefaults() *MetroAPIFrequencyParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api frequency params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIFrequencyParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIFrequencyParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api frequency params
func (o *MetroAPIFrequencyParams) WithTimeout(timeout time.Duration) *MetroAPIFrequencyParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPIFrequencyParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPIFrequencyParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_frequency_responses.go b/rail/v2/client/metro/metro_api_frequency_responses.go
index c6de6170..2e7d0e6e 100644
--- a/rail/v2/client/metro/metro_api_frequency_responses.go
+++ b/rail/v2/client/metro/metro_api_frequency_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIFrequencyReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIFrequencyNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIFrequencyOK() *MetroAPIFrequencyOK {
return &MetroAPIFrequencyOK{}
}
-/*MetroAPIFrequencyOK handles this case with default header values.
+/* MetroAPIFrequencyOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIFrequencyOK struct {
func (o *MetroAPIFrequencyOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/Frequency/{Operator}][%d] metroApiFrequencyOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIFrequencyOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroFrequency {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIFrequencyOK) readResponse(response runtime.ClientResponse, cons
return nil
}
+
+// NewMetroAPIFrequencyNotModified creates a MetroAPIFrequencyNotModified with default headers values
+func NewMetroAPIFrequencyNotModified() *MetroAPIFrequencyNotModified {
+ return &MetroAPIFrequencyNotModified{}
+}
+
+/* MetroAPIFrequencyNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIFrequencyNotModified struct {
+}
+
+func (o *MetroAPIFrequencyNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/Frequency/{Operator}][%d] metroApiFrequencyNotModified ", 304)
+}
+
+func (o *MetroAPIFrequencyNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_line_parameters.go b/rail/v2/client/metro/metro_api_line_parameters.go
index 29948bcc..c92b896d 100644
--- a/rail/v2/client/metro/metro_api_line_parameters.go
+++ b/rail/v2/client/metro/metro_api_line_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPILineParams creates a new MetroAPILineParams object
-// with the default values initialized.
+// NewMetroAPILineParams creates a new MetroAPILineParams 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 NewMetroAPILineParams() *MetroAPILineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILineParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPILineParamsWithTimeout creates a new MetroAPILineParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPILineParamsWithTimeout(timeout time.Duration) *MetroAPILineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILineParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPILineParamsWithContext creates a new MetroAPILineParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPILineParamsWithContext(ctx context.Context) *MetroAPILineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILineParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPILineParamsWithHTTPClient creates a new MetroAPILineParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPILineParamsWithHTTPClient(client *http.Client) *MetroAPILineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILineParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPILineParams contains all the parameters to send to the API endpoint
-for the metro Api line operation typically these are written to a http.Request
+/* MetroAPILineParams contains all the parameters to send to the API endpoint
+ for the metro Api line operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPILineParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPILineParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api line params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPILineParams) WithDefaults() *MetroAPILineParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api line params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPILineParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPILineParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api line params
func (o *MetroAPILineParams) WithTimeout(timeout time.Duration) *MetroAPILineParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPILineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPILineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_line_responses.go b/rail/v2/client/metro/metro_api_line_responses.go
index 4bedd664..1b924093 100644
--- a/rail/v2/client/metro/metro_api_line_responses.go
+++ b/rail/v2/client/metro/metro_api_line_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPILineReader) ReadResponse(response runtime.ClientResponse, consu
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPILineNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPILineOK() *MetroAPILineOK {
return &MetroAPILineOK{}
}
-/*MetroAPILineOK handles this case with default header values.
+/* MetroAPILineOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPILineOK struct {
func (o *MetroAPILineOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/Line/{Operator}][%d] metroApiLineOK %+v", 200, o.Payload)
}
-
func (o *MetroAPILineOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroLine {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPILineOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewMetroAPILineNotModified creates a MetroAPILineNotModified with default headers values
+func NewMetroAPILineNotModified() *MetroAPILineNotModified {
+ return &MetroAPILineNotModified{}
+}
+
+/* MetroAPILineNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPILineNotModified struct {
+}
+
+func (o *MetroAPILineNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/Line/{Operator}][%d] metroApiLineNotModified ", 304)
+}
+
+func (o *MetroAPILineNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_line_transfer_parameters.go b/rail/v2/client/metro/metro_api_line_transfer_parameters.go
index 682fbb64..9c2c9ffc 100644
--- a/rail/v2/client/metro/metro_api_line_transfer_parameters.go
+++ b/rail/v2/client/metro/metro_api_line_transfer_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPILineTransferParams creates a new MetroAPILineTransferParams object
-// with the default values initialized.
+// NewMetroAPILineTransferParams creates a new MetroAPILineTransferParams 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 NewMetroAPILineTransferParams() *MetroAPILineTransferParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILineTransferParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPILineTransferParamsWithTimeout creates a new MetroAPILineTransferParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPILineTransferParamsWithTimeout(timeout time.Duration) *MetroAPILineTransferParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILineTransferParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPILineTransferParamsWithContext creates a new MetroAPILineTransferParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPILineTransferParamsWithContext(ctx context.Context) *MetroAPILineTransferParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILineTransferParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPILineTransferParamsWithHTTPClient creates a new MetroAPILineTransferParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPILineTransferParamsWithHTTPClient(client *http.Client) *MetroAPILineTransferParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILineTransferParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPILineTransferParams contains all the parameters to send to the API endpoint
-for the metro Api line transfer operation typically these are written to a http.Request
+/* MetroAPILineTransferParams contains all the parameters to send to the API endpoint
+ for the metro Api line transfer operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPILineTransferParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPILineTransferParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api line transfer params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPILineTransferParams) WithDefaults() *MetroAPILineTransferParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api line transfer params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPILineTransferParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPILineTransferParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api line transfer params
func (o *MetroAPILineTransferParams) WithTimeout(timeout time.Duration) *MetroAPILineTransferParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPILineTransferParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPILineTransferParams) WriteToRequest(r runtime.ClientRequest, reg
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_line_transfer_responses.go b/rail/v2/client/metro/metro_api_line_transfer_responses.go
index 88b8f82a..2d1759bd 100644
--- a/rail/v2/client/metro/metro_api_line_transfer_responses.go
+++ b/rail/v2/client/metro/metro_api_line_transfer_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPILineTransferReader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPILineTransferNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPILineTransferOK() *MetroAPILineTransferOK {
return &MetroAPILineTransferOK{}
}
-/*MetroAPILineTransferOK handles this case with default header values.
+/* MetroAPILineTransferOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPILineTransferOK struct {
func (o *MetroAPILineTransferOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/LineTransfer/{Operator}][%d] metroApiLineTransferOK %+v", 200, o.Payload)
}
-
func (o *MetroAPILineTransferOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroLineTransfer {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPILineTransferOK) readResponse(response runtime.ClientResponse, c
return nil
}
+
+// NewMetroAPILineTransferNotModified creates a MetroAPILineTransferNotModified with default headers values
+func NewMetroAPILineTransferNotModified() *MetroAPILineTransferNotModified {
+ return &MetroAPILineTransferNotModified{}
+}
+
+/* MetroAPILineTransferNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPILineTransferNotModified struct {
+}
+
+func (o *MetroAPILineTransferNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/LineTransfer/{Operator}][%d] metroApiLineTransferNotModified ", 304)
+}
+
+func (o *MetroAPILineTransferNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_live_board_parameters.go b/rail/v2/client/metro/metro_api_live_board_parameters.go
index 94b14a76..48fec624 100644
--- a/rail/v2/client/metro/metro_api_live_board_parameters.go
+++ b/rail/v2/client/metro/metro_api_live_board_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPILiveBoardParams creates a new MetroAPILiveBoardParams object
-// with the default values initialized.
+// NewMetroAPILiveBoardParams creates a new MetroAPILiveBoardParams 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 NewMetroAPILiveBoardParams() *MetroAPILiveBoardParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILiveBoardParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPILiveBoardParamsWithTimeout creates a new MetroAPILiveBoardParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPILiveBoardParamsWithTimeout(timeout time.Duration) *MetroAPILiveBoardParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILiveBoardParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPILiveBoardParamsWithContext creates a new MetroAPILiveBoardParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPILiveBoardParamsWithContext(ctx context.Context) *MetroAPILiveBoardParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILiveBoardParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPILiveBoardParamsWithHTTPClient creates a new MetroAPILiveBoardParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPILiveBoardParamsWithHTTPClient(client *http.Client) *MetroAPILiveBoardParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPILiveBoardParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPILiveBoardParams contains all the parameters to send to the API endpoint
-for the metro Api live board operation typically these are written to a http.Request
+/* MetroAPILiveBoardParams contains all the parameters to send to the API endpoint
+ for the metro Api live board operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPILiveBoardParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPILiveBoardParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api live board params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPILiveBoardParams) WithDefaults() *MetroAPILiveBoardParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api live board params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPILiveBoardParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPILiveBoardParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api live board params
func (o *MetroAPILiveBoardParams) WithTimeout(timeout time.Duration) *MetroAPILiveBoardParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPILiveBoardParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPILiveBoardParams) WriteToRequest(r runtime.ClientRequest, reg st
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_live_board_responses.go b/rail/v2/client/metro/metro_api_live_board_responses.go
index e113d314..a5231700 100644
--- a/rail/v2/client/metro/metro_api_live_board_responses.go
+++ b/rail/v2/client/metro/metro_api_live_board_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPILiveBoardReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPILiveBoardNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPILiveBoardOK() *MetroAPILiveBoardOK {
return &MetroAPILiveBoardOK{}
}
-/*MetroAPILiveBoardOK handles this case with default header values.
+/* MetroAPILiveBoardOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPILiveBoardOK struct {
func (o *MetroAPILiveBoardOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/LiveBoard/{Operator}][%d] metroApiLiveBoardOK %+v", 200, o.Payload)
}
-
func (o *MetroAPILiveBoardOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroLiveBoard {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPILiveBoardOK) readResponse(response runtime.ClientResponse, cons
return nil
}
+
+// NewMetroAPILiveBoardNotModified creates a MetroAPILiveBoardNotModified with default headers values
+func NewMetroAPILiveBoardNotModified() *MetroAPILiveBoardNotModified {
+ return &MetroAPILiveBoardNotModified{}
+}
+
+/* MetroAPILiveBoardNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPILiveBoardNotModified struct {
+}
+
+func (o *MetroAPILiveBoardNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/LiveBoard/{Operator}][%d] metroApiLiveBoardNotModified ", 304)
+}
+
+func (o *MetroAPILiveBoardNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_network_parameters.go b/rail/v2/client/metro/metro_api_network_parameters.go
index f229ef28..9ff8777f 100644
--- a/rail/v2/client/metro/metro_api_network_parameters.go
+++ b/rail/v2/client/metro/metro_api_network_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPINetworkParams creates a new MetroAPINetworkParams object
-// with the default values initialized.
+// NewMetroAPINetworkParams creates a new MetroAPINetworkParams 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 NewMetroAPINetworkParams() *MetroAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPINetworkParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPINetworkParamsWithTimeout creates a new MetroAPINetworkParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPINetworkParamsWithTimeout(timeout time.Duration) *MetroAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPINetworkParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPINetworkParamsWithContext creates a new MetroAPINetworkParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPINetworkParamsWithContext(ctx context.Context) *MetroAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPINetworkParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPINetworkParamsWithHTTPClient creates a new MetroAPINetworkParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPINetworkParamsWithHTTPClient(client *http.Client) *MetroAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPINetworkParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPINetworkParams contains all the parameters to send to the API endpoint
-for the metro Api network operation typically these are written to a http.Request
+/* MetroAPINetworkParams contains all the parameters to send to the API endpoint
+ for the metro Api network operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPINetworkParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPINetworkParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api network params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPINetworkParams) WithDefaults() *MetroAPINetworkParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api network params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPINetworkParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPINetworkParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api network params
func (o *MetroAPINetworkParams) WithTimeout(timeout time.Duration) *MetroAPINetworkParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPINetworkParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPINetworkParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_network_responses.go b/rail/v2/client/metro/metro_api_network_responses.go
index 48f38f13..0703da7c 100644
--- a/rail/v2/client/metro/metro_api_network_responses.go
+++ b/rail/v2/client/metro/metro_api_network_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPINetworkReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPINetworkNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPINetworkOK() *MetroAPINetworkOK {
return &MetroAPINetworkOK{}
}
-/*MetroAPINetworkOK handles this case with default header values.
+/* MetroAPINetworkOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPINetworkOK struct {
func (o *MetroAPINetworkOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/Network/{Operator}][%d] metroApiNetworkOK %+v", 200, o.Payload)
}
-
func (o *MetroAPINetworkOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroNetwork {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPINetworkOK) readResponse(response runtime.ClientResponse, consum
return nil
}
+
+// NewMetroAPINetworkNotModified creates a MetroAPINetworkNotModified with default headers values
+func NewMetroAPINetworkNotModified() *MetroAPINetworkNotModified {
+ return &MetroAPINetworkNotModified{}
+}
+
+/* MetroAPINetworkNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPINetworkNotModified struct {
+}
+
+func (o *MetroAPINetworkNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/Network/{Operator}][%d] metroApiNetworkNotModified ", 304)
+}
+
+func (o *MetroAPINetworkNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_news_parameters.go b/rail/v2/client/metro/metro_api_news_parameters.go
index 10fb9627..0765b2fc 100644
--- a/rail/v2/client/metro/metro_api_news_parameters.go
+++ b/rail/v2/client/metro/metro_api_news_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPINewsParams creates a new MetroAPINewsParams object
-// with the default values initialized.
+// NewMetroAPINewsParams creates a new MetroAPINewsParams 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 NewMetroAPINewsParams() *MetroAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPINewsParamsWithTimeout creates a new MetroAPINewsParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPINewsParamsWithTimeout(timeout time.Duration) *MetroAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPINewsParamsWithContext creates a new MetroAPINewsParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPINewsParamsWithContext(ctx context.Context) *MetroAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPINewsParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPINewsParamsWithHTTPClient creates a new MetroAPINewsParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPINewsParamsWithHTTPClient(client *http.Client) *MetroAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPINewsParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPINewsParams contains all the parameters to send to the API endpoint
-for the metro Api news operation typically these are written to a http.Request
+/* MetroAPINewsParams contains all the parameters to send to the API endpoint
+ for the metro Api news operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPINewsParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -119,6 +115,32 @@ type MetroAPINewsParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPINewsParams) WithDefaults() *MetroAPINewsParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPINewsParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPINewsParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api news params
func (o *MetroAPINewsParams) WithTimeout(timeout time.Duration) *MetroAPINewsParams {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *MetroAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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
}
@@ -293,64 +318,68 @@ func (o *MetroAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_news_responses.go b/rail/v2/client/metro/metro_api_news_responses.go
index 0e254a13..118d8022 100644
--- a/rail/v2/client/metro/metro_api_news_responses.go
+++ b/rail/v2/client/metro/metro_api_news_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPINewsReader) ReadResponse(response runtime.ClientResponse, consu
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPINewsNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPINewsOK() *MetroAPINewsOK {
return &MetroAPINewsOK{}
}
-/*MetroAPINewsOK handles this case with default header values.
+/* MetroAPINewsOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPINewsOK struct {
func (o *MetroAPINewsOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/News/{Operator}][%d] metroApiNewsOK %+v", 200, o.Payload)
}
-
func (o *MetroAPINewsOK) GetPayload() *models.PTXAPIRailModelMRTRealTimeWrapperPTXServiceDTORailSpecificationV2MetroMRTNewsListNews {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *MetroAPINewsOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewMetroAPINewsNotModified creates a MetroAPINewsNotModified with default headers values
+func NewMetroAPINewsNotModified() *MetroAPINewsNotModified {
+ return &MetroAPINewsNotModified{}
+}
+
+/* MetroAPINewsNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPINewsNotModified struct {
+}
+
+func (o *MetroAPINewsNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/News/{Operator}][%d] metroApiNewsNotModified ", 304)
+}
+
+func (o *MetroAPINewsNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_o_d_fare_parameters.go b/rail/v2/client/metro/metro_api_o_d_fare_parameters.go
index 51d81b65..3fe4ba51 100644
--- a/rail/v2/client/metro/metro_api_o_d_fare_parameters.go
+++ b/rail/v2/client/metro/metro_api_o_d_fare_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIODFareParams creates a new MetroAPIODFareParams object
-// with the default values initialized.
+// NewMetroAPIODFareParams creates a new MetroAPIODFareParams 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 NewMetroAPIODFareParams() *MetroAPIODFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIODFareParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIODFareParamsWithTimeout creates a new MetroAPIODFareParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIODFareParamsWithTimeout(timeout time.Duration) *MetroAPIODFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIODFareParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIODFareParamsWithContext creates a new MetroAPIODFareParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIODFareParamsWithContext(ctx context.Context) *MetroAPIODFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIODFareParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIODFareParamsWithHTTPClient creates a new MetroAPIODFareParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIODFareParamsWithHTTPClient(client *http.Client) *MetroAPIODFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIODFareParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIODFareParams contains all the parameters to send to the API endpoint
-for the metro Api o d fare operation typically these are written to a http.Request
+/* MetroAPIODFareParams contains all the parameters to send to the API endpoint
+ for the metro Api o d fare operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIODFareParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPIODFareParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api o d fare params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIODFareParams) WithDefaults() *MetroAPIODFareParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api o d fare params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIODFareParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIODFareParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api o d fare params
func (o *MetroAPIODFareParams) WithTimeout(timeout time.Duration) *MetroAPIODFareParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPIODFareParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPIODFareParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_o_d_fare_responses.go b/rail/v2/client/metro/metro_api_o_d_fare_responses.go
index 8f74dcff..66267bda 100644
--- a/rail/v2/client/metro/metro_api_o_d_fare_responses.go
+++ b/rail/v2/client/metro/metro_api_o_d_fare_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIODFareReader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIODFareNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIODFareOK() *MetroAPIODFareOK {
return &MetroAPIODFareOK{}
}
-/*MetroAPIODFareOK handles this case with default header values.
+/* MetroAPIODFareOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIODFareOK struct {
func (o *MetroAPIODFareOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/ODFare/{Operator}][%d] metroApiODFareOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIODFareOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroODFare {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIODFareOK) readResponse(response runtime.ClientResponse, consume
return nil
}
+
+// NewMetroAPIODFareNotModified creates a MetroAPIODFareNotModified with default headers values
+func NewMetroAPIODFareNotModified() *MetroAPIODFareNotModified {
+ return &MetroAPIODFareNotModified{}
+}
+
+/* MetroAPIODFareNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIODFareNotModified struct {
+}
+
+func (o *MetroAPIODFareNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/ODFare/{Operator}][%d] metroApiODFareNotModified ", 304)
+}
+
+func (o *MetroAPIODFareNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_route_parameters.go b/rail/v2/client/metro/metro_api_route_parameters.go
index 69aa71c4..b1df4bd5 100644
--- a/rail/v2/client/metro/metro_api_route_parameters.go
+++ b/rail/v2/client/metro/metro_api_route_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIRouteParams creates a new MetroAPIRouteParams object
-// with the default values initialized.
+// NewMetroAPIRouteParams creates a new MetroAPIRouteParams 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 NewMetroAPIRouteParams() *MetroAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIRouteParamsWithTimeout creates a new MetroAPIRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIRouteParamsWithTimeout(timeout time.Duration) *MetroAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIRouteParamsWithContext creates a new MetroAPIRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIRouteParamsWithContext(ctx context.Context) *MetroAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIRouteParamsWithHTTPClient creates a new MetroAPIRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIRouteParamsWithHTTPClient(client *http.Client) *MetroAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIRouteParams contains all the parameters to send to the API endpoint
-for the metro Api route operation typically these are written to a http.Request
+/* MetroAPIRouteParams contains all the parameters to send to the API endpoint
+ for the metro Api route operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIRouteParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPIRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIRouteParams) WithDefaults() *MetroAPIRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIRouteParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api route params
func (o *MetroAPIRouteParams) WithTimeout(timeout time.Duration) *MetroAPIRouteParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPIRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPIRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_route_responses.go b/rail/v2/client/metro/metro_api_route_responses.go
index 65ea3d78..198bf63a 100644
--- a/rail/v2/client/metro/metro_api_route_responses.go
+++ b/rail/v2/client/metro/metro_api_route_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIRouteReader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIRouteNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIRouteOK() *MetroAPIRouteOK {
return &MetroAPIRouteOK{}
}
-/*MetroAPIRouteOK handles this case with default header values.
+/* MetroAPIRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIRouteOK struct {
func (o *MetroAPIRouteOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/Route/{Operator}][%d] metroApiRouteOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIRouteOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroRoute {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIRouteOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewMetroAPIRouteNotModified creates a MetroAPIRouteNotModified with default headers values
+func NewMetroAPIRouteNotModified() *MetroAPIRouteNotModified {
+ return &MetroAPIRouteNotModified{}
+}
+
+/* MetroAPIRouteNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIRouteNotModified struct {
+}
+
+func (o *MetroAPIRouteNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/Route/{Operator}][%d] metroApiRouteNotModified ", 304)
+}
+
+func (o *MetroAPIRouteNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_s2_s_travel_time_parameters.go b/rail/v2/client/metro/metro_api_s2_s_travel_time_parameters.go
index bdaccdae..8baab43a 100644
--- a/rail/v2/client/metro/metro_api_s2_s_travel_time_parameters.go
+++ b/rail/v2/client/metro/metro_api_s2_s_travel_time_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIS2STravelTimeParams creates a new MetroAPIS2STravelTimeParams object
-// with the default values initialized.
+// NewMetroAPIS2STravelTimeParams creates a new MetroAPIS2STravelTimeParams 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 NewMetroAPIS2STravelTimeParams() *MetroAPIS2STravelTimeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIS2STravelTimeParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIS2STravelTimeParamsWithTimeout creates a new MetroAPIS2STravelTimeParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIS2STravelTimeParamsWithTimeout(timeout time.Duration) *MetroAPIS2STravelTimeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIS2STravelTimeParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIS2STravelTimeParamsWithContext creates a new MetroAPIS2STravelTimeParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIS2STravelTimeParamsWithContext(ctx context.Context) *MetroAPIS2STravelTimeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIS2STravelTimeParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIS2STravelTimeParamsWithHTTPClient creates a new MetroAPIS2STravelTimeParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIS2STravelTimeParamsWithHTTPClient(client *http.Client) *MetroAPIS2STravelTimeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIS2STravelTimeParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIS2STravelTimeParams contains all the parameters to send to the API endpoint
-for the metro Api s2 s travel time operation typically these are written to a http.Request
+/* MetroAPIS2STravelTimeParams contains all the parameters to send to the API endpoint
+ for the metro Api s2 s travel time operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIS2STravelTimeParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPIS2STravelTimeParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api s2 s travel time params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIS2STravelTimeParams) WithDefaults() *MetroAPIS2STravelTimeParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api s2 s travel time params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIS2STravelTimeParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIS2STravelTimeParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api s2 s travel time params
func (o *MetroAPIS2STravelTimeParams) WithTimeout(timeout time.Duration) *MetroAPIS2STravelTimeParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPIS2STravelTimeParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPIS2STravelTimeParams) WriteToRequest(r runtime.ClientRequest, re
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_s2_s_travel_time_responses.go b/rail/v2/client/metro/metro_api_s2_s_travel_time_responses.go
index d1ddeb6f..1e21a1ae 100644
--- a/rail/v2/client/metro/metro_api_s2_s_travel_time_responses.go
+++ b/rail/v2/client/metro/metro_api_s2_s_travel_time_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIS2STravelTimeReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIS2STravelTimeNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIS2STravelTimeOK() *MetroAPIS2STravelTimeOK {
return &MetroAPIS2STravelTimeOK{}
}
-/*MetroAPIS2STravelTimeOK handles this case with default header values.
+/* MetroAPIS2STravelTimeOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIS2STravelTimeOK struct {
func (o *MetroAPIS2STravelTimeOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/S2STravelTime/{Operator}][%d] metroApiS2STravelTimeOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIS2STravelTimeOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroS2STravelTime {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIS2STravelTimeOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewMetroAPIS2STravelTimeNotModified creates a MetroAPIS2STravelTimeNotModified with default headers values
+func NewMetroAPIS2STravelTimeNotModified() *MetroAPIS2STravelTimeNotModified {
+ return &MetroAPIS2STravelTimeNotModified{}
+}
+
+/* MetroAPIS2STravelTimeNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIS2STravelTimeNotModified struct {
+}
+
+func (o *MetroAPIS2STravelTimeNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/S2STravelTime/{Operator}][%d] metroApiS2STravelTimeNotModified ", 304)
+}
+
+func (o *MetroAPIS2STravelTimeNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_shape_parameters.go b/rail/v2/client/metro/metro_api_shape_parameters.go
index e87d0966..fdf91cb9 100644
--- a/rail/v2/client/metro/metro_api_shape_parameters.go
+++ b/rail/v2/client/metro/metro_api_shape_parameters.go
@@ -17,93 +17,88 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIShapeParams creates a new MetroAPIShapeParams object
-// with the default values initialized.
+// NewMetroAPIShapeParams creates a new MetroAPIShapeParams 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 NewMetroAPIShapeParams() *MetroAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIShapeParamsWithTimeout creates a new MetroAPIShapeParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIShapeParamsWithTimeout(timeout time.Duration) *MetroAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIShapeParamsWithContext creates a new MetroAPIShapeParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIShapeParamsWithContext(ctx context.Context) *MetroAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIShapeParamsWithHTTPClient creates a new MetroAPIShapeParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIShapeParamsWithHTTPClient(client *http.Client) *MetroAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIShapeParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIShapeParams contains all the parameters to send to the API endpoint
-for the metro Api shape operation typically these are written to a http.Request
+/* MetroAPIShapeParams contains all the parameters to send to the API endpoint
+ for the metro Api shape operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIShapeParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator*/
+
+ // Operator.
Operator string
timeout time.Duration
@@ -111,6 +106,32 @@ type MetroAPIShapeParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIShapeParams) WithDefaults() *MetroAPIShapeParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIShapeParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIShapeParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api shape params
func (o *MetroAPIShapeParams) WithTimeout(timeout time.Duration) *MetroAPIShapeParams {
o.SetTimeout(timeout)
@@ -233,22 +254,24 @@ func (o *MetroAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
@@ -258,64 +281,68 @@ func (o *MetroAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_shape_responses.go b/rail/v2/client/metro/metro_api_shape_responses.go
index 83dc189a..ff2a5c71 100644
--- a/rail/v2/client/metro/metro_api_shape_responses.go
+++ b/rail/v2/client/metro/metro_api_shape_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIShapeReader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIShapeNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIShapeOK() *MetroAPIShapeOK {
return &MetroAPIShapeOK{}
}
-/*MetroAPIShapeOK handles this case with default header values.
+/* MetroAPIShapeOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIShapeOK struct {
func (o *MetroAPIShapeOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/Shape/{Operator}][%d] metroApiShapeOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIShapeOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroMetroShape {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIShapeOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewMetroAPIShapeNotModified creates a MetroAPIShapeNotModified with default headers values
+func NewMetroAPIShapeNotModified() *MetroAPIShapeNotModified {
+ return &MetroAPIShapeNotModified{}
+}
+
+/* MetroAPIShapeNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIShapeNotModified struct {
+}
+
+func (o *MetroAPIShapeNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/Shape/{Operator}][%d] metroApiShapeNotModified ", 304)
+}
+
+func (o *MetroAPIShapeNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_station_exit_parameters.go b/rail/v2/client/metro/metro_api_station_exit_parameters.go
index 8a85b5aa..1a281cf8 100644
--- a/rail/v2/client/metro/metro_api_station_exit_parameters.go
+++ b/rail/v2/client/metro/metro_api_station_exit_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIStationExitParams creates a new MetroAPIStationExitParams object
-// with the default values initialized.
+// NewMetroAPIStationExitParams creates a new MetroAPIStationExitParams 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 NewMetroAPIStationExitParams() *MetroAPIStationExitParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationExitParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIStationExitParamsWithTimeout creates a new MetroAPIStationExitParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIStationExitParamsWithTimeout(timeout time.Duration) *MetroAPIStationExitParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationExitParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIStationExitParamsWithContext creates a new MetroAPIStationExitParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIStationExitParamsWithContext(ctx context.Context) *MetroAPIStationExitParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationExitParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIStationExitParamsWithHTTPClient creates a new MetroAPIStationExitParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIStationExitParamsWithHTTPClient(client *http.Client) *MetroAPIStationExitParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationExitParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIStationExitParams contains all the parameters to send to the API endpoint
-for the metro Api station exit operation typically these are written to a http.Request
+/* MetroAPIStationExitParams contains all the parameters to send to the API endpoint
+ for the metro Api station exit operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIStationExitParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -119,6 +115,32 @@ type MetroAPIStationExitParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api station exit params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationExitParams) WithDefaults() *MetroAPIStationExitParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api station exit params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationExitParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIStationExitParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api station exit params
func (o *MetroAPIStationExitParams) WithTimeout(timeout time.Duration) *MetroAPIStationExitParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *MetroAPIStationExitParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -277,80 +301,85 @@ func (o *MetroAPIStationExitParams) WriteToRequest(r runtime.ClientRequest, reg
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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 Operator
diff --git a/rail/v2/client/metro/metro_api_station_exit_responses.go b/rail/v2/client/metro/metro_api_station_exit_responses.go
index 0f6b911f..bdf79b5a 100644
--- a/rail/v2/client/metro/metro_api_station_exit_responses.go
+++ b/rail/v2/client/metro/metro_api_station_exit_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIStationExitReader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIStationExitNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIStationExitOK() *MetroAPIStationExitOK {
return &MetroAPIStationExitOK{}
}
-/*MetroAPIStationExitOK handles this case with default header values.
+/* MetroAPIStationExitOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIStationExitOK struct {
func (o *MetroAPIStationExitOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/StationExit/{Operator}][%d] metroApiStationExitOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIStationExitOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroStationExit {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIStationExitOK) readResponse(response runtime.ClientResponse, co
return nil
}
+
+// NewMetroAPIStationExitNotModified creates a MetroAPIStationExitNotModified with default headers values
+func NewMetroAPIStationExitNotModified() *MetroAPIStationExitNotModified {
+ return &MetroAPIStationExitNotModified{}
+}
+
+/* MetroAPIStationExitNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIStationExitNotModified struct {
+}
+
+func (o *MetroAPIStationExitNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/StationExit/{Operator}][%d] metroApiStationExitNotModified ", 304)
+}
+
+func (o *MetroAPIStationExitNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_station_facility_parameters.go b/rail/v2/client/metro/metro_api_station_facility_parameters.go
index 44595e63..1a279e98 100644
--- a/rail/v2/client/metro/metro_api_station_facility_parameters.go
+++ b/rail/v2/client/metro/metro_api_station_facility_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIStationFacilityParams creates a new MetroAPIStationFacilityParams object
-// with the default values initialized.
+// NewMetroAPIStationFacilityParams creates a new MetroAPIStationFacilityParams 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 NewMetroAPIStationFacilityParams() *MetroAPIStationFacilityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationFacilityParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIStationFacilityParamsWithTimeout creates a new MetroAPIStationFacilityParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIStationFacilityParamsWithTimeout(timeout time.Duration) *MetroAPIStationFacilityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationFacilityParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIStationFacilityParamsWithContext creates a new MetroAPIStationFacilityParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIStationFacilityParamsWithContext(ctx context.Context) *MetroAPIStationFacilityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationFacilityParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIStationFacilityParamsWithHTTPClient creates a new MetroAPIStationFacilityParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIStationFacilityParamsWithHTTPClient(client *http.Client) *MetroAPIStationFacilityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationFacilityParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIStationFacilityParams contains all the parameters to send to the API endpoint
-for the metro Api station facility operation typically these are written to a http.Request
+/* MetroAPIStationFacilityParams contains all the parameters to send to the API endpoint
+ for the metro Api station facility operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIStationFacilityParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPIStationFacilityParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api station facility params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationFacilityParams) WithDefaults() *MetroAPIStationFacilityParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api station facility params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationFacilityParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIStationFacilityParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api station facility params
func (o *MetroAPIStationFacilityParams) WithTimeout(timeout time.Duration) *MetroAPIStationFacilityParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPIStationFacilityParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPIStationFacilityParams) WriteToRequest(r runtime.ClientRequest,
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_station_facility_responses.go b/rail/v2/client/metro/metro_api_station_facility_responses.go
index 60fa87b9..d6fc911d 100644
--- a/rail/v2/client/metro/metro_api_station_facility_responses.go
+++ b/rail/v2/client/metro/metro_api_station_facility_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIStationFacilityReader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIStationFacilityNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIStationFacilityOK() *MetroAPIStationFacilityOK {
return &MetroAPIStationFacilityOK{}
}
-/*MetroAPIStationFacilityOK handles this case with default header values.
+/* MetroAPIStationFacilityOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIStationFacilityOK struct {
func (o *MetroAPIStationFacilityOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/StationFacility/{Operator}][%d] metroApiStationFacilityOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIStationFacilityOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroStationFacility {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIStationFacilityOK) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewMetroAPIStationFacilityNotModified creates a MetroAPIStationFacilityNotModified with default headers values
+func NewMetroAPIStationFacilityNotModified() *MetroAPIStationFacilityNotModified {
+ return &MetroAPIStationFacilityNotModified{}
+}
+
+/* MetroAPIStationFacilityNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIStationFacilityNotModified struct {
+}
+
+func (o *MetroAPIStationFacilityNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/StationFacility/{Operator}][%d] metroApiStationFacilityNotModified ", 304)
+}
+
+func (o *MetroAPIStationFacilityNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_station_of_line_parameters.go b/rail/v2/client/metro/metro_api_station_of_line_parameters.go
index 826b327c..47ac945b 100644
--- a/rail/v2/client/metro/metro_api_station_of_line_parameters.go
+++ b/rail/v2/client/metro/metro_api_station_of_line_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIStationOfLineParams creates a new MetroAPIStationOfLineParams object
-// with the default values initialized.
+// NewMetroAPIStationOfLineParams creates a new MetroAPIStationOfLineParams 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 NewMetroAPIStationOfLineParams() *MetroAPIStationOfLineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationOfLineParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIStationOfLineParamsWithTimeout creates a new MetroAPIStationOfLineParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIStationOfLineParamsWithTimeout(timeout time.Duration) *MetroAPIStationOfLineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationOfLineParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIStationOfLineParamsWithContext creates a new MetroAPIStationOfLineParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIStationOfLineParamsWithContext(ctx context.Context) *MetroAPIStationOfLineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationOfLineParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIStationOfLineParamsWithHTTPClient creates a new MetroAPIStationOfLineParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIStationOfLineParamsWithHTTPClient(client *http.Client) *MetroAPIStationOfLineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationOfLineParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIStationOfLineParams contains all the parameters to send to the API endpoint
-for the metro Api station of line operation typically these are written to a http.Request
+/* MetroAPIStationOfLineParams contains all the parameters to send to the API endpoint
+ for the metro Api station of line operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIStationOfLineParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPIStationOfLineParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api station of line params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationOfLineParams) WithDefaults() *MetroAPIStationOfLineParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api station of line params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationOfLineParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIStationOfLineParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api station of line params
func (o *MetroAPIStationOfLineParams) WithTimeout(timeout time.Duration) *MetroAPIStationOfLineParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPIStationOfLineParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPIStationOfLineParams) WriteToRequest(r runtime.ClientRequest, re
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_station_of_line_responses.go b/rail/v2/client/metro/metro_api_station_of_line_responses.go
index b22e2e91..ff2e33d5 100644
--- a/rail/v2/client/metro/metro_api_station_of_line_responses.go
+++ b/rail/v2/client/metro/metro_api_station_of_line_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIStationOfLineReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIStationOfLineNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIStationOfLineOK() *MetroAPIStationOfLineOK {
return &MetroAPIStationOfLineOK{}
}
-/*MetroAPIStationOfLineOK handles this case with default header values.
+/* MetroAPIStationOfLineOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIStationOfLineOK struct {
func (o *MetroAPIStationOfLineOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/StationOfLine/{Operator}][%d] metroApiStationOfLineOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIStationOfLineOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroStationOfLine {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIStationOfLineOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewMetroAPIStationOfLineNotModified creates a MetroAPIStationOfLineNotModified with default headers values
+func NewMetroAPIStationOfLineNotModified() *MetroAPIStationOfLineNotModified {
+ return &MetroAPIStationOfLineNotModified{}
+}
+
+/* MetroAPIStationOfLineNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIStationOfLineNotModified struct {
+}
+
+func (o *MetroAPIStationOfLineNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/StationOfLine/{Operator}][%d] metroApiStationOfLineNotModified ", 304)
+}
+
+func (o *MetroAPIStationOfLineNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_station_of_route_parameters.go b/rail/v2/client/metro/metro_api_station_of_route_parameters.go
index aa6ebeef..465982b5 100644
--- a/rail/v2/client/metro/metro_api_station_of_route_parameters.go
+++ b/rail/v2/client/metro/metro_api_station_of_route_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIStationOfRouteParams creates a new MetroAPIStationOfRouteParams object
-// with the default values initialized.
+// NewMetroAPIStationOfRouteParams creates a new MetroAPIStationOfRouteParams 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 NewMetroAPIStationOfRouteParams() *MetroAPIStationOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationOfRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIStationOfRouteParamsWithTimeout creates a new MetroAPIStationOfRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIStationOfRouteParamsWithTimeout(timeout time.Duration) *MetroAPIStationOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationOfRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIStationOfRouteParamsWithContext creates a new MetroAPIStationOfRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIStationOfRouteParamsWithContext(ctx context.Context) *MetroAPIStationOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationOfRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIStationOfRouteParamsWithHTTPClient creates a new MetroAPIStationOfRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIStationOfRouteParamsWithHTTPClient(client *http.Client) *MetroAPIStationOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationOfRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIStationOfRouteParams contains all the parameters to send to the API endpoint
-for the metro Api station of route operation typically these are written to a http.Request
+/* MetroAPIStationOfRouteParams contains all the parameters to send to the API endpoint
+ for the metro Api station of route operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIStationOfRouteParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPIStationOfRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api station of route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationOfRouteParams) WithDefaults() *MetroAPIStationOfRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api station of route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationOfRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIStationOfRouteParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api station of route params
func (o *MetroAPIStationOfRouteParams) WithTimeout(timeout time.Duration) *MetroAPIStationOfRouteParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPIStationOfRouteParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPIStationOfRouteParams) WriteToRequest(r runtime.ClientRequest, r
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_station_of_route_responses.go b/rail/v2/client/metro/metro_api_station_of_route_responses.go
index 235fa61a..7cc59274 100644
--- a/rail/v2/client/metro/metro_api_station_of_route_responses.go
+++ b/rail/v2/client/metro/metro_api_station_of_route_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIStationOfRouteReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIStationOfRouteNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIStationOfRouteOK() *MetroAPIStationOfRouteOK {
return &MetroAPIStationOfRouteOK{}
}
-/*MetroAPIStationOfRouteOK handles this case with default header values.
+/* MetroAPIStationOfRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIStationOfRouteOK struct {
func (o *MetroAPIStationOfRouteOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/StationOfRoute/{Operator}][%d] metroApiStationOfRouteOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIStationOfRouteOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroStationOfRoute {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIStationOfRouteOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewMetroAPIStationOfRouteNotModified creates a MetroAPIStationOfRouteNotModified with default headers values
+func NewMetroAPIStationOfRouteNotModified() *MetroAPIStationOfRouteNotModified {
+ return &MetroAPIStationOfRouteNotModified{}
+}
+
+/* MetroAPIStationOfRouteNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIStationOfRouteNotModified struct {
+}
+
+func (o *MetroAPIStationOfRouteNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/StationOfRoute/{Operator}][%d] metroApiStationOfRouteNotModified ", 304)
+}
+
+func (o *MetroAPIStationOfRouteNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_station_parameters.go b/rail/v2/client/metro/metro_api_station_parameters.go
index d12eea0a..a6c7a5ed 100644
--- a/rail/v2/client/metro/metro_api_station_parameters.go
+++ b/rail/v2/client/metro/metro_api_station_parameters.go
@@ -17,100 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIStationParams creates a new MetroAPIStationParams object
-// with the default values initialized.
+// NewMetroAPIStationParams creates a new MetroAPIStationParams 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 NewMetroAPIStationParams() *MetroAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIStationParamsWithTimeout creates a new MetroAPIStationParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIStationParamsWithTimeout(timeout time.Duration) *MetroAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIStationParamsWithContext creates a new MetroAPIStationParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIStationParamsWithContext(ctx context.Context) *MetroAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIStationParamsWithHTTPClient creates a new MetroAPIStationParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIStationParamsWithHTTPClient(client *http.Client) *MetroAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIStationParams contains all the parameters to send to the API endpoint
-for the metro Api station operation typically these are written to a http.Request
+/* MetroAPIStationParams contains all the parameters to send to the API endpoint
+ for the metro Api station operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIStationParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
- */
- DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -119,6 +109,32 @@ type MetroAPIStationParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationParams) WithDefaults() *MetroAPIStationParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIStationParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api station params
func (o *MetroAPIStationParams) WithTimeout(timeout time.Duration) *MetroAPIStationParams {
o.SetTimeout(timeout)
@@ -207,17 +223,6 @@ func (o *MetroAPIStationParams) SetDollarSkip(dollarSkip *string) {
o.DollarSkip = dollarSkip
}
-// WithDollarSpatialFilter adds the dollarSpatialFilter to the metro Api station params
-func (o *MetroAPIStationParams) WithDollarSpatialFilter(dollarSpatialFilter *string) *MetroAPIStationParams {
- o.SetDollarSpatialFilter(dollarSpatialFilter)
- return o
-}
-
-// SetDollarSpatialFilter adds the dollarSpatialFilter to the metro Api station params
-func (o *MetroAPIStationParams) SetDollarSpatialFilter(dollarSpatialFilter *string) {
- o.DollarSpatialFilter = dollarSpatialFilter
-}
-
// WithDollarTop adds the dollarTop to the metro Api station params
func (o *MetroAPIStationParams) WithDollarTop(dollarTop *int64) *MetroAPIStationParams {
o.SetDollarTop(dollarTop)
@@ -252,22 +257,24 @@ func (o *MetroAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -277,80 +284,68 @@ func (o *MetroAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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.DollarSpatialFilter != nil {
- // query param $spatialFilter
- var qrDollarSpatialFilter string
- if o.DollarSpatialFilter != nil {
- qrDollarSpatialFilter = *o.DollarSpatialFilter
- }
- qDollarSpatialFilter := qrDollarSpatialFilter
- if qDollarSpatialFilter != "" {
- if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); err != nil {
+ 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 Operator
diff --git a/rail/v2/client/metro/metro_api_station_responses.go b/rail/v2/client/metro/metro_api_station_responses.go
index 356e70e3..bce22639 100644
--- a/rail/v2/client/metro/metro_api_station_responses.go
+++ b/rail/v2/client/metro/metro_api_station_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIStationReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIStationNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIStationOK() *MetroAPIStationOK {
return &MetroAPIStationOK{}
}
-/*MetroAPIStationOK handles this case with default header values.
+/* MetroAPIStationOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIStationOK struct {
func (o *MetroAPIStationOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/Station/{Operator}][%d] metroApiStationOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIStationOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroStation {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIStationOK) readResponse(response runtime.ClientResponse, consum
return nil
}
+
+// NewMetroAPIStationNotModified creates a MetroAPIStationNotModified with default headers values
+func NewMetroAPIStationNotModified() *MetroAPIStationNotModified {
+ return &MetroAPIStationNotModified{}
+}
+
+/* MetroAPIStationNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIStationNotModified struct {
+}
+
+func (o *MetroAPIStationNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/Station/{Operator}][%d] metroApiStationNotModified ", 304)
+}
+
+func (o *MetroAPIStationNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/metro/metro_api_station_time_table_parameters.go b/rail/v2/client/metro/metro_api_station_time_table_parameters.go
index 93dcaef9..94f255ec 100644
--- a/rail/v2/client/metro/metro_api_station_time_table_parameters.go
+++ b/rail/v2/client/metro/metro_api_station_time_table_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewMetroAPIStationTimeTableParams creates a new MetroAPIStationTimeTableParams object
-// with the default values initialized.
+// NewMetroAPIStationTimeTableParams creates a new MetroAPIStationTimeTableParams 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 NewMetroAPIStationTimeTableParams() *MetroAPIStationTimeTableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationTimeTableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewMetroAPIStationTimeTableParamsWithTimeout creates a new MetroAPIStationTimeTableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewMetroAPIStationTimeTableParamsWithTimeout(timeout time.Duration) *MetroAPIStationTimeTableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationTimeTableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewMetroAPIStationTimeTableParamsWithContext creates a new MetroAPIStationTimeTableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewMetroAPIStationTimeTableParamsWithContext(ctx context.Context) *MetroAPIStationTimeTableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationTimeTableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewMetroAPIStationTimeTableParamsWithHTTPClient creates a new MetroAPIStationTimeTableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewMetroAPIStationTimeTableParamsWithHTTPClient(client *http.Client) *MetroAPIStationTimeTableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &MetroAPIStationTimeTableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*MetroAPIStationTimeTableParams contains all the parameters to send to the API endpoint
-for the metro Api station time table operation typically these are written to a http.Request
+/* MetroAPIStationTimeTableParams contains all the parameters to send to the API endpoint
+ for the metro Api station time table operation.
+
+ Typically these are written to a http.Request.
*/
type MetroAPIStationTimeTableParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*Operator
- 欲查詢縣市
+ /* Operator.
+
+ 欲查詢縣市
*/
Operator string
@@ -114,6 +109,32 @@ type MetroAPIStationTimeTableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the metro Api station time table params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationTimeTableParams) WithDefaults() *MetroAPIStationTimeTableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the metro Api station time table params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *MetroAPIStationTimeTableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := MetroAPIStationTimeTableParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the metro Api station time table params
func (o *MetroAPIStationTimeTableParams) WithTimeout(timeout time.Duration) *MetroAPIStationTimeTableParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *MetroAPIStationTimeTableParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -261,64 +284,68 @@ func (o *MetroAPIStationTimeTableParams) WriteToRequest(r runtime.ClientRequest,
// 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 Operator
diff --git a/rail/v2/client/metro/metro_api_station_time_table_responses.go b/rail/v2/client/metro/metro_api_station_time_table_responses.go
index d3db65ae..18d80106 100644
--- a/rail/v2/client/metro/metro_api_station_time_table_responses.go
+++ b/rail/v2/client/metro/metro_api_station_time_table_responses.go
@@ -29,7 +29,12 @@ func (o *MetroAPIStationTimeTableReader) ReadResponse(response runtime.ClientRes
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewMetroAPIStationTimeTableNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewMetroAPIStationTimeTableOK() *MetroAPIStationTimeTableOK {
return &MetroAPIStationTimeTableOK{}
}
-/*MetroAPIStationTimeTableOK handles this case with default header values.
+/* MetroAPIStationTimeTableOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type MetroAPIStationTimeTableOK struct {
func (o *MetroAPIStationTimeTableOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Metro/StationTimeTable/{Operator}][%d] metroApiStationTimeTableOK %+v", 200, o.Payload)
}
-
func (o *MetroAPIStationTimeTableOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2MetroStationTimeTable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *MetroAPIStationTimeTableOK) readResponse(response runtime.ClientRespons
return nil
}
+
+// NewMetroAPIStationTimeTableNotModified creates a MetroAPIStationTimeTableNotModified with default headers values
+func NewMetroAPIStationTimeTableNotModified() *MetroAPIStationTimeTableNotModified {
+ return &MetroAPIStationTimeTableNotModified{}
+}
+
+/* MetroAPIStationTimeTableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type MetroAPIStationTimeTableNotModified struct {
+}
+
+func (o *MetroAPIStationTimeTableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Metro/StationTimeTable/{Operator}][%d] metroApiStationTimeTableNotModified ", 304)
+}
+
+func (o *MetroAPIStationTimeTableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/rail_basic/rail_api_operator_parameters.go b/rail/v2/client/rail_basic/rail_api_operator_parameters.go
index 43834a10..ad1bf810 100644
--- a/rail/v2/client/rail_basic/rail_api_operator_parameters.go
+++ b/rail/v2/client/rail_basic/rail_api_operator_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewRailAPIOperatorParams creates a new RailAPIOperatorParams object
-// with the default values initialized.
+// NewRailAPIOperatorParams creates a new RailAPIOperatorParams 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 NewRailAPIOperatorParams() *RailAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &RailAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewRailAPIOperatorParamsWithTimeout creates a new RailAPIOperatorParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewRailAPIOperatorParamsWithTimeout(timeout time.Duration) *RailAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &RailAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewRailAPIOperatorParamsWithContext creates a new RailAPIOperatorParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewRailAPIOperatorParamsWithContext(ctx context.Context) *RailAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &RailAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewRailAPIOperatorParamsWithHTTPClient creates a new RailAPIOperatorParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewRailAPIOperatorParamsWithHTTPClient(client *http.Client) *RailAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &RailAPIOperatorParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*RailAPIOperatorParams contains all the parameters to send to the API endpoint
-for the rail Api operator operation typically these are written to a http.Request
+/* RailAPIOperatorParams contains all the parameters to send to the API endpoint
+ for the rail Api operator operation.
+
+ Typically these are written to a http.Request.
*/
type RailAPIOperatorParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type RailAPIOperatorParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the rail Api operator params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *RailAPIOperatorParams) WithDefaults() *RailAPIOperatorParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the rail Api operator params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *RailAPIOperatorParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := RailAPIOperatorParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the rail Api operator params
func (o *RailAPIOperatorParams) WithTimeout(timeout time.Duration) *RailAPIOperatorParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *RailAPIOperatorParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -245,64 +267,68 @@ func (o *RailAPIOperatorParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/rail_basic/rail_api_operator_responses.go b/rail/v2/client/rail_basic/rail_api_operator_responses.go
index 423ee399..f6f56679 100644
--- a/rail/v2/client/rail_basic/rail_api_operator_responses.go
+++ b/rail/v2/client/rail_basic/rail_api_operator_responses.go
@@ -29,7 +29,12 @@ func (o *RailAPIOperatorReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewRailAPIOperatorNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewRailAPIOperatorOK() *RailAPIOperatorOK {
return &RailAPIOperatorOK{}
}
-/*RailAPIOperatorOK handles this case with default header values.
+/* RailAPIOperatorOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type RailAPIOperatorOK struct {
func (o *RailAPIOperatorOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/Operator][%d] railApiOperatorOK %+v", 200, o.Payload)
}
-
func (o *RailAPIOperatorOK) GetPayload() []*models.PTXServiceDTOSharedSpecificationV2BaseOperator {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *RailAPIOperatorOK) readResponse(response runtime.ClientResponse, consum
return nil
}
+
+// NewRailAPIOperatorNotModified creates a RailAPIOperatorNotModified with default headers values
+func NewRailAPIOperatorNotModified() *RailAPIOperatorNotModified {
+ return &RailAPIOperatorNotModified{}
+}
+
+/* RailAPIOperatorNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type RailAPIOperatorNotModified struct {
+}
+
+func (o *RailAPIOperatorNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/Operator][%d] railApiOperatorNotModified ", 304)
+}
+
+func (o *RailAPIOperatorNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_alert_info_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_alert_info_parameters.go
index 435c7bb9..7e1066a4 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_alert_info_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_alert_info_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIAlertInfoParams creates a new THSRAPIAlertInfoParams object
-// with the default values initialized.
+// NewTHSRAPIAlertInfoParams creates a new THSRAPIAlertInfoParams 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 NewTHSRAPIAlertInfoParams() *THSRAPIAlertInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAlertInfoParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIAlertInfoParamsWithTimeout creates a new THSRAPIAlertInfoParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIAlertInfoParamsWithTimeout(timeout time.Duration) *THSRAPIAlertInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAlertInfoParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIAlertInfoParamsWithContext creates a new THSRAPIAlertInfoParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIAlertInfoParamsWithContext(ctx context.Context) *THSRAPIAlertInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAlertInfoParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIAlertInfoParamsWithHTTPClient creates a new THSRAPIAlertInfoParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIAlertInfoParamsWithHTTPClient(client *http.Client) *THSRAPIAlertInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAlertInfoParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIAlertInfoParams contains all the parameters to send to the API endpoint
-for the t h s r Api alert info operation typically these are written to a http.Request
+/* THSRAPIAlertInfoParams contains all the parameters to send to the API endpoint
+ for the t h s r Api alert info operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIAlertInfoParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type THSRAPIAlertInfoParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api alert info params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAlertInfoParams) WithDefaults() *THSRAPIAlertInfoParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api alert info params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAlertInfoParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIAlertInfoParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api alert info params
func (o *THSRAPIAlertInfoParams) WithTimeout(timeout time.Duration) *THSRAPIAlertInfoParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *THSRAPIAlertInfoParams) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -245,64 +267,68 @@ func (o *THSRAPIAlertInfoParams) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_alert_info_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_alert_info_responses.go
index aab94cbb..3e9b8675 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_alert_info_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_alert_info_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIAlertInfoReader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIAlertInfoNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIAlertInfoOK() *THSRAPIAlertInfoOK {
return &THSRAPIAlertInfoOK{}
}
-/*THSRAPIAlertInfoOK handles this case with default header values.
+/* THSRAPIAlertInfoOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIAlertInfoOK struct {
func (o *THSRAPIAlertInfoOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/AlertInfo][%d] tHSRApiAlertInfoOK %+v", 200, o.Payload)
}
-
func (o *THSRAPIAlertInfoOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRAlertInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIAlertInfoOK) readResponse(response runtime.ClientResponse, consu
return nil
}
+
+// NewTHSRAPIAlertInfoNotModified creates a THSRAPIAlertInfoNotModified with default headers values
+func NewTHSRAPIAlertInfoNotModified() *THSRAPIAlertInfoNotModified {
+ return &THSRAPIAlertInfoNotModified{}
+}
+
+/* THSRAPIAlertInfoNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIAlertInfoNotModified struct {
+}
+
+func (o *THSRAPIAlertInfoNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/AlertInfo][%d] tHSRApiAlertInfoNotModified ", 304)
+}
+
+func (o *THSRAPIAlertInfoNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status1_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status1_parameters.go
index 80b90d05..8da56d4f 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status1_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIAvailableSeatStatus1Params creates a new THSRAPIAvailableSeatStatus1Params object
-// with the default values initialized.
+// NewTHSRAPIAvailableSeatStatus1Params creates a new THSRAPIAvailableSeatStatus1Params 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 NewTHSRAPIAvailableSeatStatus1Params() *THSRAPIAvailableSeatStatus1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatus1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIAvailableSeatStatus1ParamsWithTimeout creates a new THSRAPIAvailableSeatStatus1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIAvailableSeatStatus1ParamsWithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatus1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatus1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIAvailableSeatStatus1ParamsWithContext creates a new THSRAPIAvailableSeatStatus1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIAvailableSeatStatus1ParamsWithContext(ctx context.Context) *THSRAPIAvailableSeatStatus1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatus1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIAvailableSeatStatus1ParamsWithHTTPClient creates a new THSRAPIAvailableSeatStatus1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIAvailableSeatStatus1ParamsWithHTTPClient(client *http.Client) *THSRAPIAvailableSeatStatus1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatus1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIAvailableSeatStatus1Params contains all the parameters to send to the API endpoint
-for the t h s r Api available seat status 1 operation typically these are written to a http.Request
+/* THSRAPIAvailableSeatStatus1Params contains all the parameters to send to the API endpoint
+ for the t h s r Api available seat status 1 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIAvailableSeatStatus1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢車次的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢車次的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -119,6 +115,32 @@ type THSRAPIAvailableSeatStatus1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api available seat status 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatus1Params) WithDefaults() *THSRAPIAvailableSeatStatus1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api available seat status 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatus1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIAvailableSeatStatus1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api available seat status 1 params
func (o *THSRAPIAvailableSeatStatus1Params) WithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatus1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *THSRAPIAvailableSeatStatus1Params) WriteToRequest(r runtime.ClientReque
// 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
}
@@ -293,64 +318,68 @@ func (o *THSRAPIAvailableSeatStatus1Params) WriteToRequest(r runtime.ClientReque
// 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 TrainDate
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status1_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status1_responses.go
index b5a11066..f272c35e 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status1_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status1_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIAvailableSeatStatus1Reader) ReadResponse(response runtime.Client
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIAvailableSeatStatus1NotModified()
+ 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())
}
@@ -40,25 +45,24 @@ func NewTHSRAPIAvailableSeatStatus1OK() *THSRAPIAvailableSeatStatus1OK {
return &THSRAPIAvailableSeatStatus1OK{}
}
-/*THSRAPIAvailableSeatStatus1OK handles this case with default header values.
+/* THSRAPIAvailableSeatStatus1OK describes a response with status code 200, with default header values.
Success
*/
type THSRAPIAvailableSeatStatus1OK struct {
- Payload *models.PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat
+ Payload *models.PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat
}
func (o *THSRAPIAvailableSeatStatus1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatus/Train/Leg/TrainDate/{TrainDate}][%d] tHSRApiAvailableSeatStatus1OK %+v", 200, o.Payload)
}
-
-func (o *THSRAPIAvailableSeatStatus1OK) GetPayload() *models.PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat {
+func (o *THSRAPIAvailableSeatStatus1OK) GetPayload() *models.PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat {
return o.Payload
}
func (o *THSRAPIAvailableSeatStatus1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
- o.Payload = new(models.PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat)
+ o.Payload = new(models.PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@@ -67,3 +71,24 @@ func (o *THSRAPIAvailableSeatStatus1OK) readResponse(response runtime.ClientResp
return nil
}
+
+// NewTHSRAPIAvailableSeatStatus1NotModified creates a THSRAPIAvailableSeatStatus1NotModified with default headers values
+func NewTHSRAPIAvailableSeatStatus1NotModified() *THSRAPIAvailableSeatStatus1NotModified {
+ return &THSRAPIAvailableSeatStatus1NotModified{}
+}
+
+/* THSRAPIAvailableSeatStatus1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIAvailableSeatStatus1NotModified struct {
+}
+
+func (o *THSRAPIAvailableSeatStatus1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatus/Train/Leg/TrainDate/{TrainDate}][%d] tHSRApiAvailableSeatStatus1NotModified ", 304)
+}
+
+func (o *THSRAPIAvailableSeatStatus1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station1_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station1_parameters.go
index 5a9b620d..072cfb7a 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station1_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIAvailableSeatStatusListStation1Params creates a new THSRAPIAvailableSeatStatusListStation1Params object
-// with the default values initialized.
+// NewTHSRAPIAvailableSeatStatusListStation1Params creates a new THSRAPIAvailableSeatStatusListStation1Params 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 NewTHSRAPIAvailableSeatStatusListStation1Params() *THSRAPIAvailableSeatStatusListStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusListStation1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIAvailableSeatStatusListStation1ParamsWithTimeout creates a new THSRAPIAvailableSeatStatusListStation1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIAvailableSeatStatusListStation1ParamsWithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusListStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusListStation1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIAvailableSeatStatusListStation1ParamsWithContext creates a new THSRAPIAvailableSeatStatusListStation1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIAvailableSeatStatusListStation1ParamsWithContext(ctx context.Context) *THSRAPIAvailableSeatStatusListStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusListStation1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIAvailableSeatStatusListStation1ParamsWithHTTPClient creates a new THSRAPIAvailableSeatStatusListStation1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIAvailableSeatStatusListStation1ParamsWithHTTPClient(client *http.Client) *THSRAPIAvailableSeatStatusListStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusListStation1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIAvailableSeatStatusListStation1Params contains all the parameters to send to the API endpoint
-for the t h s r Api available seat status list station 1 operation typically these are written to a http.Request
+/* THSRAPIAvailableSeatStatusListStation1Params contains all the parameters to send to the API endpoint
+ for the t h s r Api available seat status list station 1 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIAvailableSeatStatusListStation1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*StationID
- 起點車站代碼
+ /* StationID.
+
+ 起點車站代碼
*/
StationID string
@@ -119,6 +115,32 @@ type THSRAPIAvailableSeatStatusListStation1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api available seat status list station 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusListStation1Params) WithDefaults() *THSRAPIAvailableSeatStatusListStation1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api available seat status list station 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusListStation1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIAvailableSeatStatusListStation1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api available seat status list station 1 params
func (o *THSRAPIAvailableSeatStatusListStation1Params) WithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusListStation1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *THSRAPIAvailableSeatStatusListStation1Params) WriteToRequest(r runtime.
// 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
}
@@ -293,64 +318,68 @@ func (o *THSRAPIAvailableSeatStatusListStation1Params) WriteToRequest(r runtime.
// 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 StationID
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station1_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station1_responses.go
index 840d8ffe..d4b1d08b 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station1_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station1_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIAvailableSeatStatusListStation1Reader) ReadResponse(response run
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIAvailableSeatStatusListStation1NotModified()
+ 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())
}
@@ -40,25 +45,24 @@ func NewTHSRAPIAvailableSeatStatusListStation1OK() *THSRAPIAvailableSeatStatusLi
return &THSRAPIAvailableSeatStatusListStation1OK{}
}
-/*THSRAPIAvailableSeatStatusListStation1OK handles this case with default header values.
+/* THSRAPIAvailableSeatStatusListStation1OK describes a response with status code 200, with default header values.
Success
*/
type THSRAPIAvailableSeatStatusListStation1OK struct {
- Payload *models.PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat
+ Payload *models.PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat
}
func (o *THSRAPIAvailableSeatStatusListStation1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatusList/{StationID}][%d] tHSRApiAvailableSeatStatusListStation1OK %+v", 200, o.Payload)
}
-
-func (o *THSRAPIAvailableSeatStatusListStation1OK) GetPayload() *models.PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat {
+func (o *THSRAPIAvailableSeatStatusListStation1OK) GetPayload() *models.PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat {
return o.Payload
}
func (o *THSRAPIAvailableSeatStatusListStation1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
- o.Payload = new(models.PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat)
+ o.Payload = new(models.PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@@ -67,3 +71,24 @@ func (o *THSRAPIAvailableSeatStatusListStation1OK) readResponse(response runtime
return nil
}
+
+// NewTHSRAPIAvailableSeatStatusListStation1NotModified creates a THSRAPIAvailableSeatStatusListStation1NotModified with default headers values
+func NewTHSRAPIAvailableSeatStatusListStation1NotModified() *THSRAPIAvailableSeatStatusListStation1NotModified {
+ return &THSRAPIAvailableSeatStatusListStation1NotModified{}
+}
+
+/* THSRAPIAvailableSeatStatusListStation1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIAvailableSeatStatusListStation1NotModified struct {
+}
+
+func (o *THSRAPIAvailableSeatStatusListStation1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatusList/{StationID}][%d] tHSRApiAvailableSeatStatusListStation1NotModified ", 304)
+}
+
+func (o *THSRAPIAvailableSeatStatusListStation1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station_parameters.go
index d2b337ef..298614cb 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIAvailableSeatStatusListStationParams creates a new THSRAPIAvailableSeatStatusListStationParams object
-// with the default values initialized.
+// NewTHSRAPIAvailableSeatStatusListStationParams creates a new THSRAPIAvailableSeatStatusListStationParams 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 NewTHSRAPIAvailableSeatStatusListStationParams() *THSRAPIAvailableSeatStatusListStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusListStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIAvailableSeatStatusListStationParamsWithTimeout creates a new THSRAPIAvailableSeatStatusListStationParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIAvailableSeatStatusListStationParamsWithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusListStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusListStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIAvailableSeatStatusListStationParamsWithContext creates a new THSRAPIAvailableSeatStatusListStationParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIAvailableSeatStatusListStationParamsWithContext(ctx context.Context) *THSRAPIAvailableSeatStatusListStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusListStationParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIAvailableSeatStatusListStationParamsWithHTTPClient creates a new THSRAPIAvailableSeatStatusListStationParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIAvailableSeatStatusListStationParamsWithHTTPClient(client *http.Client) *THSRAPIAvailableSeatStatusListStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusListStationParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIAvailableSeatStatusListStationParams contains all the parameters to send to the API endpoint
-for the t h s r Api available seat status list station operation typically these are written to a http.Request
+/* THSRAPIAvailableSeatStatusListStationParams contains all the parameters to send to the API endpoint
+ for the t h s r Api available seat status list station operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIAvailableSeatStatusListStationParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type THSRAPIAvailableSeatStatusListStationParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api available seat status list station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusListStationParams) WithDefaults() *THSRAPIAvailableSeatStatusListStationParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api available seat status list station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusListStationParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIAvailableSeatStatusListStationParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api available seat status list station params
func (o *THSRAPIAvailableSeatStatusListStationParams) WithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusListStationParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *THSRAPIAvailableSeatStatusListStationParams) WriteToRequest(r runtime.C
// 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
}
@@ -277,64 +301,68 @@ func (o *THSRAPIAvailableSeatStatusListStationParams) WriteToRequest(r runtime.C
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station_responses.go
index 44cfa977..56eda462 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_list_station_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIAvailableSeatStatusListStationReader) ReadResponse(response runt
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIAvailableSeatStatusListStationNotModified()
+ 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())
}
@@ -40,25 +45,24 @@ func NewTHSRAPIAvailableSeatStatusListStationOK() *THSRAPIAvailableSeatStatusLis
return &THSRAPIAvailableSeatStatusListStationOK{}
}
-/*THSRAPIAvailableSeatStatusListStationOK handles this case with default header values.
+/* THSRAPIAvailableSeatStatusListStationOK describes a response with status code 200, with default header values.
Success
*/
type THSRAPIAvailableSeatStatusListStationOK struct {
- Payload *models.PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat
+ Payload *models.PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat
}
func (o *THSRAPIAvailableSeatStatusListStationOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatusList][%d] tHSRApiAvailableSeatStatusListStationOK %+v", 200, o.Payload)
}
-
-func (o *THSRAPIAvailableSeatStatusListStationOK) GetPayload() *models.PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat {
+func (o *THSRAPIAvailableSeatStatusListStationOK) GetPayload() *models.PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat {
return o.Payload
}
func (o *THSRAPIAvailableSeatStatusListStationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
- o.Payload = new(models.PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat)
+ o.Payload = new(models.PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@@ -67,3 +71,24 @@ func (o *THSRAPIAvailableSeatStatusListStationOK) readResponse(response runtime.
return nil
}
+
+// NewTHSRAPIAvailableSeatStatusListStationNotModified creates a THSRAPIAvailableSeatStatusListStationNotModified with default headers values
+func NewTHSRAPIAvailableSeatStatusListStationNotModified() *THSRAPIAvailableSeatStatusListStationNotModified {
+ return &THSRAPIAvailableSeatStatusListStationNotModified{}
+}
+
+/* THSRAPIAvailableSeatStatusListStationNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIAvailableSeatStatusListStationNotModified struct {
+}
+
+func (o *THSRAPIAvailableSeatStatusListStationNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatusList][%d] tHSRApiAvailableSeatStatusListStationNotModified ", 304)
+}
+
+func (o *THSRAPIAvailableSeatStatusListStationNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d1_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d1_parameters.go
index fe91d387..f73c84e5 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d1_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d1_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIAvailableSeatStatusOD1Params creates a new THSRAPIAvailableSeatStatusOD1Params object
-// with the default values initialized.
+// NewTHSRAPIAvailableSeatStatusOD1Params creates a new THSRAPIAvailableSeatStatusOD1Params 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 NewTHSRAPIAvailableSeatStatusOD1Params() *THSRAPIAvailableSeatStatusOD1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusOD1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIAvailableSeatStatusOD1ParamsWithTimeout creates a new THSRAPIAvailableSeatStatusOD1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIAvailableSeatStatusOD1ParamsWithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusOD1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusOD1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIAvailableSeatStatusOD1ParamsWithContext creates a new THSRAPIAvailableSeatStatusOD1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIAvailableSeatStatusOD1ParamsWithContext(ctx context.Context) *THSRAPIAvailableSeatStatusOD1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusOD1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIAvailableSeatStatusOD1ParamsWithHTTPClient creates a new THSRAPIAvailableSeatStatusOD1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIAvailableSeatStatusOD1ParamsWithHTTPClient(client *http.Client) *THSRAPIAvailableSeatStatusOD1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusOD1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIAvailableSeatStatusOD1Params contains all the parameters to send to the API endpoint
-for the t h s r Api available seat status o d 1 operation typically these are written to a http.Request
+/* THSRAPIAvailableSeatStatusOD1Params contains all the parameters to send to the API endpoint
+ for the t h s r Api available seat status o d 1 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIAvailableSeatStatusOD1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*DestinationStationID
- 指定迄止車站
+ /* DestinationStationID.
+
+ 指定迄止車站
*/
DestinationStationID string
- /*OriginStationID
- 指定起始車站
+ /* OriginStationID.
+
+ 指定起始車站
*/
OriginStationID string
- /*TrainDate
- 欲查詢車次的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢車次的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -129,6 +127,32 @@ type THSRAPIAvailableSeatStatusOD1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api available seat status o d 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusOD1Params) WithDefaults() *THSRAPIAvailableSeatStatusOD1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api available seat status o d 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusOD1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIAvailableSeatStatusOD1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api available seat status o d 1 params
func (o *THSRAPIAvailableSeatStatusOD1Params) WithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusOD1Params {
o.SetTimeout(timeout)
@@ -284,38 +308,41 @@ func (o *THSRAPIAvailableSeatStatusOD1Params) WriteToRequest(r runtime.ClientReq
// 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
}
@@ -325,64 +352,68 @@ func (o *THSRAPIAvailableSeatStatusOD1Params) WriteToRequest(r runtime.ClientReq
// 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 DestinationStationID
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d1_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d1_responses.go
index 99716899..3ab39e01 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d1_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d1_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIAvailableSeatStatusOD1Reader) ReadResponse(response runtime.Clie
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIAvailableSeatStatusOD1NotModified()
+ 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())
}
@@ -40,25 +45,24 @@ func NewTHSRAPIAvailableSeatStatusOD1OK() *THSRAPIAvailableSeatStatusOD1OK {
return &THSRAPIAvailableSeatStatusOD1OK{}
}
-/*THSRAPIAvailableSeatStatusOD1OK handles this case with default header values.
+/* THSRAPIAvailableSeatStatusOD1OK describes a response with status code 200, with default header values.
Success
*/
type THSRAPIAvailableSeatStatusOD1OK struct {
- Payload *models.PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat
+ Payload *models.PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat
}
func (o *THSRAPIAvailableSeatStatusOD1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatus/Train/OD/{OriginStationID}/to/{DestinationStationID}/TrainDate/{TrainDate}][%d] tHSRApiAvailableSeatStatusOD1OK %+v", 200, o.Payload)
}
-
-func (o *THSRAPIAvailableSeatStatusOD1OK) GetPayload() *models.PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat {
+func (o *THSRAPIAvailableSeatStatusOD1OK) GetPayload() *models.PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat {
return o.Payload
}
func (o *THSRAPIAvailableSeatStatusOD1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
- o.Payload = new(models.PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat)
+ o.Payload = new(models.PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@@ -67,3 +71,24 @@ func (o *THSRAPIAvailableSeatStatusOD1OK) readResponse(response runtime.ClientRe
return nil
}
+
+// NewTHSRAPIAvailableSeatStatusOD1NotModified creates a THSRAPIAvailableSeatStatusOD1NotModified with default headers values
+func NewTHSRAPIAvailableSeatStatusOD1NotModified() *THSRAPIAvailableSeatStatusOD1NotModified {
+ return &THSRAPIAvailableSeatStatusOD1NotModified{}
+}
+
+/* THSRAPIAvailableSeatStatusOD1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIAvailableSeatStatusOD1NotModified struct {
+}
+
+func (o *THSRAPIAvailableSeatStatusOD1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatus/Train/OD/{OriginStationID}/to/{DestinationStationID}/TrainDate/{TrainDate}][%d] tHSRApiAvailableSeatStatusOD1NotModified ", 304)
+}
+
+func (o *THSRAPIAvailableSeatStatusOD1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d2_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d2_parameters.go
index 8d5a8005..8625fce4 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d2_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d2_parameters.go
@@ -17,115 +17,114 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIAvailableSeatStatusOD2Params creates a new THSRAPIAvailableSeatStatusOD2Params object
-// with the default values initialized.
+// NewTHSRAPIAvailableSeatStatusOD2Params creates a new THSRAPIAvailableSeatStatusOD2Params 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 NewTHSRAPIAvailableSeatStatusOD2Params() *THSRAPIAvailableSeatStatusOD2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusOD2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIAvailableSeatStatusOD2ParamsWithTimeout creates a new THSRAPIAvailableSeatStatusOD2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIAvailableSeatStatusOD2ParamsWithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusOD2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusOD2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIAvailableSeatStatusOD2ParamsWithContext creates a new THSRAPIAvailableSeatStatusOD2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIAvailableSeatStatusOD2ParamsWithContext(ctx context.Context) *THSRAPIAvailableSeatStatusOD2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusOD2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIAvailableSeatStatusOD2ParamsWithHTTPClient creates a new THSRAPIAvailableSeatStatusOD2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIAvailableSeatStatusOD2ParamsWithHTTPClient(client *http.Client) *THSRAPIAvailableSeatStatusOD2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusOD2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIAvailableSeatStatusOD2Params contains all the parameters to send to the API endpoint
-for the t h s r Api available seat status o d 2 operation typically these are written to a http.Request
+/* THSRAPIAvailableSeatStatusOD2Params contains all the parameters to send to the API endpoint
+ for the t h s r Api available seat status o d 2 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIAvailableSeatStatusOD2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*DestinationStationID
- 指定迄止車站
+ /* DestinationStationID.
+
+ 指定迄止車站
*/
DestinationStationID string
- /*OriginStationID
- 指定起始車站
+ /* OriginStationID.
+
+ 指定起始車站
*/
OriginStationID string
- /*TrainDate
- 欲查詢車次的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢車次的日期(格式: yyyy-MM-dd)
*/
TrainDate string
- /*TrainNo
- 欲查詢車次號碼(格式: yyyy-MM-dd)
+ /* TrainNo.
+
+ 欲查詢車次號碼(格式: yyyy-MM-dd)
*/
TrainNo string
@@ -134,6 +133,32 @@ type THSRAPIAvailableSeatStatusOD2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api available seat status o d 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusOD2Params) WithDefaults() *THSRAPIAvailableSeatStatusOD2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api available seat status o d 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusOD2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIAvailableSeatStatusOD2Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api available seat status o d 2 params
func (o *THSRAPIAvailableSeatStatusOD2Params) WithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusOD2Params {
o.SetTimeout(timeout)
@@ -300,38 +325,41 @@ func (o *THSRAPIAvailableSeatStatusOD2Params) WriteToRequest(r runtime.ClientReq
// 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
}
@@ -341,64 +369,68 @@ func (o *THSRAPIAvailableSeatStatusOD2Params) WriteToRequest(r runtime.ClientReq
// 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 DestinationStationID
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d2_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d2_responses.go
index 67df8791..aa12c543 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d2_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d2_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIAvailableSeatStatusOD2Reader) ReadResponse(response runtime.Clie
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIAvailableSeatStatusOD2NotModified()
+ 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())
}
@@ -40,25 +45,24 @@ func NewTHSRAPIAvailableSeatStatusOD2OK() *THSRAPIAvailableSeatStatusOD2OK {
return &THSRAPIAvailableSeatStatusOD2OK{}
}
-/*THSRAPIAvailableSeatStatusOD2OK handles this case with default header values.
+/* THSRAPIAvailableSeatStatusOD2OK describes a response with status code 200, with default header values.
Success
*/
type THSRAPIAvailableSeatStatusOD2OK struct {
- Payload *models.PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat
+ Payload *models.PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat
}
func (o *THSRAPIAvailableSeatStatusOD2OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatus/Train/OD/{OriginStationID}/to/{DestinationStationID}/TrainDate/{TrainDate}/TrainNo/{TrainNo}][%d] tHSRApiAvailableSeatStatusOD2OK %+v", 200, o.Payload)
}
-
-func (o *THSRAPIAvailableSeatStatusOD2OK) GetPayload() *models.PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat {
+func (o *THSRAPIAvailableSeatStatusOD2OK) GetPayload() *models.PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat {
return o.Payload
}
func (o *THSRAPIAvailableSeatStatusOD2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
- o.Payload = new(models.PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat)
+ o.Payload = new(models.PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@@ -67,3 +71,24 @@ func (o *THSRAPIAvailableSeatStatusOD2OK) readResponse(response runtime.ClientRe
return nil
}
+
+// NewTHSRAPIAvailableSeatStatusOD2NotModified creates a THSRAPIAvailableSeatStatusOD2NotModified with default headers values
+func NewTHSRAPIAvailableSeatStatusOD2NotModified() *THSRAPIAvailableSeatStatusOD2NotModified {
+ return &THSRAPIAvailableSeatStatusOD2NotModified{}
+}
+
+/* THSRAPIAvailableSeatStatusOD2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIAvailableSeatStatusOD2NotModified struct {
+}
+
+func (o *THSRAPIAvailableSeatStatusOD2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatus/Train/OD/{OriginStationID}/to/{DestinationStationID}/TrainDate/{TrainDate}/TrainNo/{TrainNo}][%d] tHSRApiAvailableSeatStatusOD2NotModified ", 304)
+}
+
+func (o *THSRAPIAvailableSeatStatusOD2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d_parameters.go
index a94bcf36..d79e0669 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIAvailableSeatStatusODParams creates a new THSRAPIAvailableSeatStatusODParams object
-// with the default values initialized.
+// NewTHSRAPIAvailableSeatStatusODParams creates a new THSRAPIAvailableSeatStatusODParams 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 NewTHSRAPIAvailableSeatStatusODParams() *THSRAPIAvailableSeatStatusODParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusODParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIAvailableSeatStatusODParamsWithTimeout creates a new THSRAPIAvailableSeatStatusODParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIAvailableSeatStatusODParamsWithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusODParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusODParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIAvailableSeatStatusODParamsWithContext creates a new THSRAPIAvailableSeatStatusODParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIAvailableSeatStatusODParamsWithContext(ctx context.Context) *THSRAPIAvailableSeatStatusODParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusODParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIAvailableSeatStatusODParamsWithHTTPClient creates a new THSRAPIAvailableSeatStatusODParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIAvailableSeatStatusODParamsWithHTTPClient(client *http.Client) *THSRAPIAvailableSeatStatusODParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusODParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIAvailableSeatStatusODParams contains all the parameters to send to the API endpoint
-for the t h s r Api available seat status o d operation typically these are written to a http.Request
+/* THSRAPIAvailableSeatStatusODParams contains all the parameters to send to the API endpoint
+ for the t h s r Api available seat status o d operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIAvailableSeatStatusODParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢車次的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢車次的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -119,6 +115,32 @@ type THSRAPIAvailableSeatStatusODParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api available seat status o d params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusODParams) WithDefaults() *THSRAPIAvailableSeatStatusODParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api available seat status o d params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusODParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIAvailableSeatStatusODParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api available seat status o d params
func (o *THSRAPIAvailableSeatStatusODParams) WithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusODParams {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *THSRAPIAvailableSeatStatusODParams) WriteToRequest(r runtime.ClientRequ
// 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
}
@@ -293,64 +318,68 @@ func (o *THSRAPIAvailableSeatStatusODParams) WriteToRequest(r runtime.ClientRequ
// 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 TrainDate
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d_responses.go
index 3079934f..a87a509a 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_o_d_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIAvailableSeatStatusODReader) ReadResponse(response runtime.Clien
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIAvailableSeatStatusODNotModified()
+ 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())
}
@@ -40,25 +45,24 @@ func NewTHSRAPIAvailableSeatStatusODOK() *THSRAPIAvailableSeatStatusODOK {
return &THSRAPIAvailableSeatStatusODOK{}
}
-/*THSRAPIAvailableSeatStatusODOK handles this case with default header values.
+/* THSRAPIAvailableSeatStatusODOK describes a response with status code 200, with default header values.
Success
*/
type THSRAPIAvailableSeatStatusODOK struct {
- Payload *models.PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat
+ Payload *models.PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat
}
func (o *THSRAPIAvailableSeatStatusODOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatus/Train/OD/TrainDate/{TrainDate}][%d] tHSRApiAvailableSeatStatusODOK %+v", 200, o.Payload)
}
-
-func (o *THSRAPIAvailableSeatStatusODOK) GetPayload() *models.PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat {
+func (o *THSRAPIAvailableSeatStatusODOK) GetPayload() *models.PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat {
return o.Payload
}
func (o *THSRAPIAvailableSeatStatusODOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
- o.Payload = new(models.PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat)
+ o.Payload = new(models.PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@@ -67,3 +71,24 @@ func (o *THSRAPIAvailableSeatStatusODOK) readResponse(response runtime.ClientRes
return nil
}
+
+// NewTHSRAPIAvailableSeatStatusODNotModified creates a THSRAPIAvailableSeatStatusODNotModified with default headers values
+func NewTHSRAPIAvailableSeatStatusODNotModified() *THSRAPIAvailableSeatStatusODNotModified {
+ return &THSRAPIAvailableSeatStatusODNotModified{}
+}
+
+/* THSRAPIAvailableSeatStatusODNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIAvailableSeatStatusODNotModified struct {
+}
+
+func (o *THSRAPIAvailableSeatStatusODNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatus/Train/OD/TrainDate/{TrainDate}][%d] tHSRApiAvailableSeatStatusODNotModified ", 304)
+}
+
+func (o *THSRAPIAvailableSeatStatusODNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_parameters.go
index 9c837eec..65c82fa6 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIAvailableSeatStatusParams creates a new THSRAPIAvailableSeatStatusParams object
-// with the default values initialized.
+// NewTHSRAPIAvailableSeatStatusParams creates a new THSRAPIAvailableSeatStatusParams 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 NewTHSRAPIAvailableSeatStatusParams() *THSRAPIAvailableSeatStatusParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIAvailableSeatStatusParamsWithTimeout creates a new THSRAPIAvailableSeatStatusParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIAvailableSeatStatusParamsWithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIAvailableSeatStatusParamsWithContext creates a new THSRAPIAvailableSeatStatusParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIAvailableSeatStatusParamsWithContext(ctx context.Context) *THSRAPIAvailableSeatStatusParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIAvailableSeatStatusParamsWithHTTPClient creates a new THSRAPIAvailableSeatStatusParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIAvailableSeatStatusParamsWithHTTPClient(client *http.Client) *THSRAPIAvailableSeatStatusParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIAvailableSeatStatusParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIAvailableSeatStatusParams contains all the parameters to send to the API endpoint
-for the t h s r Api available seat status operation typically these are written to a http.Request
+/* THSRAPIAvailableSeatStatusParams contains all the parameters to send to the API endpoint
+ for the t h s r Api available seat status operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIAvailableSeatStatusParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type THSRAPIAvailableSeatStatusParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api available seat status params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusParams) WithDefaults() *THSRAPIAvailableSeatStatusParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api available seat status params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIAvailableSeatStatusParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIAvailableSeatStatusParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api available seat status params
func (o *THSRAPIAvailableSeatStatusParams) WithTimeout(timeout time.Duration) *THSRAPIAvailableSeatStatusParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *THSRAPIAvailableSeatStatusParams) WriteToRequest(r runtime.ClientReques
// 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
}
@@ -277,64 +301,68 @@ func (o *THSRAPIAvailableSeatStatusParams) WriteToRequest(r runtime.ClientReques
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_responses.go
index 11e5433e..15b66c67 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_available_seat_status_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIAvailableSeatStatusReader) ReadResponse(response runtime.ClientR
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIAvailableSeatStatusNotModified()
+ 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())
}
@@ -40,25 +45,24 @@ func NewTHSRAPIAvailableSeatStatusOK() *THSRAPIAvailableSeatStatusOK {
return &THSRAPIAvailableSeatStatusOK{}
}
-/*THSRAPIAvailableSeatStatusOK handles this case with default header values.
+/* THSRAPIAvailableSeatStatusOK describes a response with status code 200, with default header values.
Success
*/
type THSRAPIAvailableSeatStatusOK struct {
- Payload *models.PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat
+ Payload *models.PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat
}
func (o *THSRAPIAvailableSeatStatusOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatus/Train/Leg/Today][%d] tHSRApiAvailableSeatStatusOK %+v", 200, o.Payload)
}
-
-func (o *THSRAPIAvailableSeatStatusOK) GetPayload() *models.PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat {
+func (o *THSRAPIAvailableSeatStatusOK) GetPayload() *models.PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat {
return o.Payload
}
func (o *THSRAPIAvailableSeatStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
- o.Payload = new(models.PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat)
+ o.Payload = new(models.PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@@ -67,3 +71,24 @@ func (o *THSRAPIAvailableSeatStatusOK) readResponse(response runtime.ClientRespo
return nil
}
+
+// NewTHSRAPIAvailableSeatStatusNotModified creates a THSRAPIAvailableSeatStatusNotModified with default headers values
+func NewTHSRAPIAvailableSeatStatusNotModified() *THSRAPIAvailableSeatStatusNotModified {
+ return &THSRAPIAvailableSeatStatusNotModified{}
+}
+
+/* THSRAPIAvailableSeatStatusNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIAvailableSeatStatusNotModified struct {
+}
+
+func (o *THSRAPIAvailableSeatStatusNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/AvailableSeatStatus/Train/Leg/Today][%d] tHSRApiAvailableSeatStatusNotModified ", 304)
+}
+
+func (o *THSRAPIAvailableSeatStatusNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable1_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable1_parameters.go
index ecdfcb40..4bfefb9a 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable1_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIDailyTimetable1Params creates a new THSRAPIDailyTimetable1Params object
-// with the default values initialized.
+// NewTHSRAPIDailyTimetable1Params creates a new THSRAPIDailyTimetable1Params 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 NewTHSRAPIDailyTimetable1Params() *THSRAPIDailyTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIDailyTimetable1ParamsWithTimeout creates a new THSRAPIDailyTimetable1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIDailyTimetable1ParamsWithTimeout(timeout time.Duration) *THSRAPIDailyTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIDailyTimetable1ParamsWithContext creates a new THSRAPIDailyTimetable1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIDailyTimetable1ParamsWithContext(ctx context.Context) *THSRAPIDailyTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIDailyTimetable1ParamsWithHTTPClient creates a new THSRAPIDailyTimetable1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIDailyTimetable1ParamsWithHTTPClient(client *http.Client) *THSRAPIDailyTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIDailyTimetable1Params contains all the parameters to send to the API endpoint
-for the t h s r Api daily timetable 1 operation typically these are written to a http.Request
+/* THSRAPIDailyTimetable1Params contains all the parameters to send to the API endpoint
+ for the t h s r Api daily timetable 1 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIDailyTimetable1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -114,6 +109,32 @@ type THSRAPIDailyTimetable1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api daily timetable 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTimetable1Params) WithDefaults() *THSRAPIDailyTimetable1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api daily timetable 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTimetable1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIDailyTimetable1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api daily timetable 1 params
func (o *THSRAPIDailyTimetable1Params) WithTimeout(timeout time.Duration) *THSRAPIDailyTimetable1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *THSRAPIDailyTimetable1Params) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -261,64 +284,68 @@ func (o *THSRAPIDailyTimetable1Params) WriteToRequest(r runtime.ClientRequest, r
// 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 TrainNo
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable1_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable1_responses.go
index 1353c839..92dbe231 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable1_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable1_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIDailyTimetable1Reader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIDailyTimetable1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIDailyTimetable1OK() *THSRAPIDailyTimetable1OK {
return &THSRAPIDailyTimetable1OK{}
}
-/*THSRAPIDailyTimetable1OK handles this case with default header values.
+/* THSRAPIDailyTimetable1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIDailyTimetable1OK struct {
func (o *THSRAPIDailyTimetable1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/Today/TrainNo/{TrainNo}][%d] tHSRApiDailyTimetable1OK %+v", 200, o.Payload)
}
-
func (o *THSRAPIDailyTimetable1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailDailyTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIDailyTimetable1OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTHSRAPIDailyTimetable1NotModified creates a THSRAPIDailyTimetable1NotModified with default headers values
+func NewTHSRAPIDailyTimetable1NotModified() *THSRAPIDailyTimetable1NotModified {
+ return &THSRAPIDailyTimetable1NotModified{}
+}
+
+/* THSRAPIDailyTimetable1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIDailyTimetable1NotModified struct {
+}
+
+func (o *THSRAPIDailyTimetable1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/Today/TrainNo/{TrainNo}][%d] tHSRApiDailyTimetable1NotModified ", 304)
+}
+
+func (o *THSRAPIDailyTimetable1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable2_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable2_parameters.go
index 4e3391b4..1ea4ba2f 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable2_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable2_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIDailyTimetable2Params creates a new THSRAPIDailyTimetable2Params object
-// with the default values initialized.
+// NewTHSRAPIDailyTimetable2Params creates a new THSRAPIDailyTimetable2Params 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 NewTHSRAPIDailyTimetable2Params() *THSRAPIDailyTimetable2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIDailyTimetable2ParamsWithTimeout creates a new THSRAPIDailyTimetable2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIDailyTimetable2ParamsWithTimeout(timeout time.Duration) *THSRAPIDailyTimetable2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIDailyTimetable2ParamsWithContext creates a new THSRAPIDailyTimetable2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIDailyTimetable2ParamsWithContext(ctx context.Context) *THSRAPIDailyTimetable2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIDailyTimetable2ParamsWithHTTPClient creates a new THSRAPIDailyTimetable2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIDailyTimetable2ParamsWithHTTPClient(client *http.Client) *THSRAPIDailyTimetable2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIDailyTimetable2Params contains all the parameters to send to the API endpoint
-for the t h s r Api daily timetable 2 operation typically these are written to a http.Request
+/* THSRAPIDailyTimetable2Params contains all the parameters to send to the API endpoint
+ for the t h s r Api daily timetable 2 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIDailyTimetable2Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -114,6 +109,32 @@ type THSRAPIDailyTimetable2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api daily timetable 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTimetable2Params) WithDefaults() *THSRAPIDailyTimetable2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api daily timetable 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTimetable2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIDailyTimetable2Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api daily timetable 2 params
func (o *THSRAPIDailyTimetable2Params) WithTimeout(timeout time.Duration) *THSRAPIDailyTimetable2Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *THSRAPIDailyTimetable2Params) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -261,64 +284,68 @@ func (o *THSRAPIDailyTimetable2Params) WriteToRequest(r runtime.ClientRequest, r
// 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 TrainDate
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable2_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable2_responses.go
index 1fc6a477..34038575 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable2_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable2_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIDailyTimetable2Reader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIDailyTimetable2NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIDailyTimetable2OK() *THSRAPIDailyTimetable2OK {
return &THSRAPIDailyTimetable2OK{}
}
-/*THSRAPIDailyTimetable2OK handles this case with default header values.
+/* THSRAPIDailyTimetable2OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIDailyTimetable2OK struct {
func (o *THSRAPIDailyTimetable2OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/TrainDate/{TrainDate}][%d] tHSRApiDailyTimetable2OK %+v", 200, o.Payload)
}
-
func (o *THSRAPIDailyTimetable2OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailDailyTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIDailyTimetable2OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTHSRAPIDailyTimetable2NotModified creates a THSRAPIDailyTimetable2NotModified with default headers values
+func NewTHSRAPIDailyTimetable2NotModified() *THSRAPIDailyTimetable2NotModified {
+ return &THSRAPIDailyTimetable2NotModified{}
+}
+
+/* THSRAPIDailyTimetable2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIDailyTimetable2NotModified struct {
+}
+
+func (o *THSRAPIDailyTimetable2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/TrainDate/{TrainDate}][%d] tHSRApiDailyTimetable2NotModified ", 304)
+}
+
+func (o *THSRAPIDailyTimetable2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable3_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable3_parameters.go
index f4f51c31..94242494 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable3_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable3_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIDailyTimetable3Params creates a new THSRAPIDailyTimetable3Params object
-// with the default values initialized.
+// NewTHSRAPIDailyTimetable3Params creates a new THSRAPIDailyTimetable3Params 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 NewTHSRAPIDailyTimetable3Params() *THSRAPIDailyTimetable3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable3Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIDailyTimetable3ParamsWithTimeout creates a new THSRAPIDailyTimetable3Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIDailyTimetable3ParamsWithTimeout(timeout time.Duration) *THSRAPIDailyTimetable3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable3Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIDailyTimetable3ParamsWithContext creates a new THSRAPIDailyTimetable3Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIDailyTimetable3ParamsWithContext(ctx context.Context) *THSRAPIDailyTimetable3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable3Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIDailyTimetable3ParamsWithHTTPClient creates a new THSRAPIDailyTimetable3Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIDailyTimetable3ParamsWithHTTPClient(client *http.Client) *THSRAPIDailyTimetable3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetable3Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIDailyTimetable3Params contains all the parameters to send to the API endpoint
-for the t h s r Api daily timetable 3 operation typically these are written to a http.Request
+/* THSRAPIDailyTimetable3Params contains all the parameters to send to the API endpoint
+ for the t h s r Api daily timetable 3 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIDailyTimetable3Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢的日期(格式: yyyy-MM-dd)
*/
TrainDate string
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -119,6 +115,32 @@ type THSRAPIDailyTimetable3Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api daily timetable 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTimetable3Params) WithDefaults() *THSRAPIDailyTimetable3Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api daily timetable 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTimetable3Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIDailyTimetable3Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api daily timetable 3 params
func (o *THSRAPIDailyTimetable3Params) WithTimeout(timeout time.Duration) *THSRAPIDailyTimetable3Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *THSRAPIDailyTimetable3Params) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -277,64 +301,68 @@ func (o *THSRAPIDailyTimetable3Params) WriteToRequest(r runtime.ClientRequest, r
// 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 TrainDate
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable3_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable3_responses.go
index de631b69..8d2b7f4b 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable3_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable3_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIDailyTimetable3Reader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIDailyTimetable3NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIDailyTimetable3OK() *THSRAPIDailyTimetable3OK {
return &THSRAPIDailyTimetable3OK{}
}
-/*THSRAPIDailyTimetable3OK handles this case with default header values.
+/* THSRAPIDailyTimetable3OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIDailyTimetable3OK struct {
func (o *THSRAPIDailyTimetable3OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/TrainNo/{TrainNo}/TrainDate/{TrainDate}][%d] tHSRApiDailyTimetable3OK %+v", 200, o.Payload)
}
-
func (o *THSRAPIDailyTimetable3OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailDailyTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIDailyTimetable3OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTHSRAPIDailyTimetable3NotModified creates a THSRAPIDailyTimetable3NotModified with default headers values
+func NewTHSRAPIDailyTimetable3NotModified() *THSRAPIDailyTimetable3NotModified {
+ return &THSRAPIDailyTimetable3NotModified{}
+}
+
+/* THSRAPIDailyTimetable3NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIDailyTimetable3NotModified struct {
+}
+
+func (o *THSRAPIDailyTimetable3NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/TrainNo/{TrainNo}/TrainDate/{TrainDate}][%d] tHSRApiDailyTimetable3NotModified ", 304)
+}
+
+func (o *THSRAPIDailyTimetable3NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable_parameters.go
index 98a2f61e..f683383d 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIDailyTimetableParams creates a new THSRAPIDailyTimetableParams object
-// with the default values initialized.
+// NewTHSRAPIDailyTimetableParams creates a new THSRAPIDailyTimetableParams 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 NewTHSRAPIDailyTimetableParams() *THSRAPIDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIDailyTimetableParamsWithTimeout creates a new THSRAPIDailyTimetableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIDailyTimetableParamsWithTimeout(timeout time.Duration) *THSRAPIDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIDailyTimetableParamsWithContext creates a new THSRAPIDailyTimetableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIDailyTimetableParamsWithContext(ctx context.Context) *THSRAPIDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIDailyTimetableParamsWithHTTPClient creates a new THSRAPIDailyTimetableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIDailyTimetableParamsWithHTTPClient(client *http.Client) *THSRAPIDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTimetableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIDailyTimetableParams contains all the parameters to send to the API endpoint
-for the t h s r Api daily timetable operation typically these are written to a http.Request
+/* THSRAPIDailyTimetableParams contains all the parameters to send to the API endpoint
+ for the t h s r Api daily timetable operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIDailyTimetableParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type THSRAPIDailyTimetableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api daily timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTimetableParams) WithDefaults() *THSRAPIDailyTimetableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api daily timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTimetableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIDailyTimetableParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api daily timetable params
func (o *THSRAPIDailyTimetableParams) WithTimeout(timeout time.Duration) *THSRAPIDailyTimetableParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *THSRAPIDailyTimetableParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -245,64 +267,68 @@ func (o *THSRAPIDailyTimetableParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable_responses.go
index f5703374..8d8656b4 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_timetable_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIDailyTimetableReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIDailyTimetableNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIDailyTimetableOK() *THSRAPIDailyTimetableOK {
return &THSRAPIDailyTimetableOK{}
}
-/*THSRAPIDailyTimetableOK handles this case with default header values.
+/* THSRAPIDailyTimetableOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIDailyTimetableOK struct {
func (o *THSRAPIDailyTimetableOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/Today][%d] tHSRApiDailyTimetableOK %+v", 200, o.Payload)
}
-
func (o *THSRAPIDailyTimetableOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailDailyTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIDailyTimetableOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTHSRAPIDailyTimetableNotModified creates a THSRAPIDailyTimetableNotModified with default headers values
+func NewTHSRAPIDailyTimetableNotModified() *THSRAPIDailyTimetableNotModified {
+ return &THSRAPIDailyTimetableNotModified{}
+}
+
+/* THSRAPIDailyTimetableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIDailyTimetableNotModified struct {
+}
+
+func (o *THSRAPIDailyTimetableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/Today][%d] tHSRApiDailyTimetableNotModified ", 304)
+}
+
+func (o *THSRAPIDailyTimetableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info1_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info1_parameters.go
index ccd44ef0..c100733e 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info1_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIDailyTrainInfo1Params creates a new THSRAPIDailyTrainInfo1Params object
-// with the default values initialized.
+// NewTHSRAPIDailyTrainInfo1Params creates a new THSRAPIDailyTrainInfo1Params 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 NewTHSRAPIDailyTrainInfo1Params() *THSRAPIDailyTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIDailyTrainInfo1ParamsWithTimeout creates a new THSRAPIDailyTrainInfo1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIDailyTrainInfo1ParamsWithTimeout(timeout time.Duration) *THSRAPIDailyTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIDailyTrainInfo1ParamsWithContext creates a new THSRAPIDailyTrainInfo1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIDailyTrainInfo1ParamsWithContext(ctx context.Context) *THSRAPIDailyTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIDailyTrainInfo1ParamsWithHTTPClient creates a new THSRAPIDailyTrainInfo1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIDailyTrainInfo1ParamsWithHTTPClient(client *http.Client) *THSRAPIDailyTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIDailyTrainInfo1Params contains all the parameters to send to the API endpoint
-for the t h s r Api daily train info 1 operation typically these are written to a http.Request
+/* THSRAPIDailyTrainInfo1Params contains all the parameters to send to the API endpoint
+ for the t h s r Api daily train info 1 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIDailyTrainInfo1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -114,6 +109,32 @@ type THSRAPIDailyTrainInfo1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api daily train info 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTrainInfo1Params) WithDefaults() *THSRAPIDailyTrainInfo1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api daily train info 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTrainInfo1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIDailyTrainInfo1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api daily train info 1 params
func (o *THSRAPIDailyTrainInfo1Params) WithTimeout(timeout time.Duration) *THSRAPIDailyTrainInfo1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *THSRAPIDailyTrainInfo1Params) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -261,64 +284,68 @@ func (o *THSRAPIDailyTrainInfo1Params) WriteToRequest(r runtime.ClientRequest, r
// 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 TrainNo
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info1_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info1_responses.go
index df441c38..af9f4eb7 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info1_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info1_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIDailyTrainInfo1Reader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIDailyTrainInfo1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIDailyTrainInfo1OK() *THSRAPIDailyTrainInfo1OK {
return &THSRAPIDailyTrainInfo1OK{}
}
-/*THSRAPIDailyTrainInfo1OK handles this case with default header values.
+/* THSRAPIDailyTrainInfo1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIDailyTrainInfo1OK struct {
func (o *THSRAPIDailyTrainInfo1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTrainInfo/Today/TrainNo/{TrainNo}][%d] tHSRApiDailyTrainInfo1OK %+v", 200, o.Payload)
}
-
func (o *THSRAPIDailyTrainInfo1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIDailyTrainInfo1OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTHSRAPIDailyTrainInfo1NotModified creates a THSRAPIDailyTrainInfo1NotModified with default headers values
+func NewTHSRAPIDailyTrainInfo1NotModified() *THSRAPIDailyTrainInfo1NotModified {
+ return &THSRAPIDailyTrainInfo1NotModified{}
+}
+
+/* THSRAPIDailyTrainInfo1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIDailyTrainInfo1NotModified struct {
+}
+
+func (o *THSRAPIDailyTrainInfo1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTrainInfo/Today/TrainNo/{TrainNo}][%d] tHSRApiDailyTrainInfo1NotModified ", 304)
+}
+
+func (o *THSRAPIDailyTrainInfo1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info2_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info2_parameters.go
index b6686803..33e35152 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info2_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info2_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIDailyTrainInfo2Params creates a new THSRAPIDailyTrainInfo2Params object
-// with the default values initialized.
+// NewTHSRAPIDailyTrainInfo2Params creates a new THSRAPIDailyTrainInfo2Params 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 NewTHSRAPIDailyTrainInfo2Params() *THSRAPIDailyTrainInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIDailyTrainInfo2ParamsWithTimeout creates a new THSRAPIDailyTrainInfo2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIDailyTrainInfo2ParamsWithTimeout(timeout time.Duration) *THSRAPIDailyTrainInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIDailyTrainInfo2ParamsWithContext creates a new THSRAPIDailyTrainInfo2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIDailyTrainInfo2ParamsWithContext(ctx context.Context) *THSRAPIDailyTrainInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIDailyTrainInfo2ParamsWithHTTPClient creates a new THSRAPIDailyTrainInfo2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIDailyTrainInfo2ParamsWithHTTPClient(client *http.Client) *THSRAPIDailyTrainInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIDailyTrainInfo2Params contains all the parameters to send to the API endpoint
-for the t h s r Api daily train info 2 operation typically these are written to a http.Request
+/* THSRAPIDailyTrainInfo2Params contains all the parameters to send to the API endpoint
+ for the t h s r Api daily train info 2 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIDailyTrainInfo2Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢車次的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢車次的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -114,6 +109,32 @@ type THSRAPIDailyTrainInfo2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api daily train info 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTrainInfo2Params) WithDefaults() *THSRAPIDailyTrainInfo2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api daily train info 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTrainInfo2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIDailyTrainInfo2Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api daily train info 2 params
func (o *THSRAPIDailyTrainInfo2Params) WithTimeout(timeout time.Duration) *THSRAPIDailyTrainInfo2Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *THSRAPIDailyTrainInfo2Params) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -261,64 +284,68 @@ func (o *THSRAPIDailyTrainInfo2Params) WriteToRequest(r runtime.ClientRequest, r
// 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 TrainDate
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info2_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info2_responses.go
index b23fe40f..d7d35a0c 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info2_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info2_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIDailyTrainInfo2Reader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIDailyTrainInfo2NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIDailyTrainInfo2OK() *THSRAPIDailyTrainInfo2OK {
return &THSRAPIDailyTrainInfo2OK{}
}
-/*THSRAPIDailyTrainInfo2OK handles this case with default header values.
+/* THSRAPIDailyTrainInfo2OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIDailyTrainInfo2OK struct {
func (o *THSRAPIDailyTrainInfo2OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTrainInfo/TrainDate/{TrainDate}][%d] tHSRApiDailyTrainInfo2OK %+v", 200, o.Payload)
}
-
func (o *THSRAPIDailyTrainInfo2OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIDailyTrainInfo2OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTHSRAPIDailyTrainInfo2NotModified creates a THSRAPIDailyTrainInfo2NotModified with default headers values
+func NewTHSRAPIDailyTrainInfo2NotModified() *THSRAPIDailyTrainInfo2NotModified {
+ return &THSRAPIDailyTrainInfo2NotModified{}
+}
+
+/* THSRAPIDailyTrainInfo2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIDailyTrainInfo2NotModified struct {
+}
+
+func (o *THSRAPIDailyTrainInfo2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTrainInfo/TrainDate/{TrainDate}][%d] tHSRApiDailyTrainInfo2NotModified ", 304)
+}
+
+func (o *THSRAPIDailyTrainInfo2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info3_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info3_parameters.go
index daa13d41..12956b78 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info3_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info3_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIDailyTrainInfo3Params creates a new THSRAPIDailyTrainInfo3Params object
-// with the default values initialized.
+// NewTHSRAPIDailyTrainInfo3Params creates a new THSRAPIDailyTrainInfo3Params 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 NewTHSRAPIDailyTrainInfo3Params() *THSRAPIDailyTrainInfo3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo3Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIDailyTrainInfo3ParamsWithTimeout creates a new THSRAPIDailyTrainInfo3Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIDailyTrainInfo3ParamsWithTimeout(timeout time.Duration) *THSRAPIDailyTrainInfo3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo3Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIDailyTrainInfo3ParamsWithContext creates a new THSRAPIDailyTrainInfo3Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIDailyTrainInfo3ParamsWithContext(ctx context.Context) *THSRAPIDailyTrainInfo3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo3Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIDailyTrainInfo3ParamsWithHTTPClient creates a new THSRAPIDailyTrainInfo3Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIDailyTrainInfo3ParamsWithHTTPClient(client *http.Client) *THSRAPIDailyTrainInfo3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfo3Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIDailyTrainInfo3Params contains all the parameters to send to the API endpoint
-for the t h s r Api daily train info 3 operation typically these are written to a http.Request
+/* THSRAPIDailyTrainInfo3Params contains all the parameters to send to the API endpoint
+ for the t h s r Api daily train info 3 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIDailyTrainInfo3Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢車次的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢車次的日期(格式: yyyy-MM-dd)
*/
TrainDate string
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -119,6 +115,32 @@ type THSRAPIDailyTrainInfo3Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api daily train info 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTrainInfo3Params) WithDefaults() *THSRAPIDailyTrainInfo3Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api daily train info 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTrainInfo3Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIDailyTrainInfo3Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api daily train info 3 params
func (o *THSRAPIDailyTrainInfo3Params) WithTimeout(timeout time.Duration) *THSRAPIDailyTrainInfo3Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *THSRAPIDailyTrainInfo3Params) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -277,64 +301,68 @@ func (o *THSRAPIDailyTrainInfo3Params) WriteToRequest(r runtime.ClientRequest, r
// 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 TrainDate
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info3_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info3_responses.go
index 4c96c669..5f3d8667 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info3_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info3_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIDailyTrainInfo3Reader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIDailyTrainInfo3NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIDailyTrainInfo3OK() *THSRAPIDailyTrainInfo3OK {
return &THSRAPIDailyTrainInfo3OK{}
}
-/*THSRAPIDailyTrainInfo3OK handles this case with default header values.
+/* THSRAPIDailyTrainInfo3OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIDailyTrainInfo3OK struct {
func (o *THSRAPIDailyTrainInfo3OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTrainInfo/TrainNo/{TrainNo}/TrainDate/{TrainDate}][%d] tHSRApiDailyTrainInfo3OK %+v", 200, o.Payload)
}
-
func (o *THSRAPIDailyTrainInfo3OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIDailyTrainInfo3OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTHSRAPIDailyTrainInfo3NotModified creates a THSRAPIDailyTrainInfo3NotModified with default headers values
+func NewTHSRAPIDailyTrainInfo3NotModified() *THSRAPIDailyTrainInfo3NotModified {
+ return &THSRAPIDailyTrainInfo3NotModified{}
+}
+
+/* THSRAPIDailyTrainInfo3NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIDailyTrainInfo3NotModified struct {
+}
+
+func (o *THSRAPIDailyTrainInfo3NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTrainInfo/TrainNo/{TrainNo}/TrainDate/{TrainDate}][%d] tHSRApiDailyTrainInfo3NotModified ", 304)
+}
+
+func (o *THSRAPIDailyTrainInfo3NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info_parameters.go
index af09ce34..f8fabd5b 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIDailyTrainInfoParams creates a new THSRAPIDailyTrainInfoParams object
-// with the default values initialized.
+// NewTHSRAPIDailyTrainInfoParams creates a new THSRAPIDailyTrainInfoParams 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 NewTHSRAPIDailyTrainInfoParams() *THSRAPIDailyTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfoParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIDailyTrainInfoParamsWithTimeout creates a new THSRAPIDailyTrainInfoParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIDailyTrainInfoParamsWithTimeout(timeout time.Duration) *THSRAPIDailyTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfoParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIDailyTrainInfoParamsWithContext creates a new THSRAPIDailyTrainInfoParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIDailyTrainInfoParamsWithContext(ctx context.Context) *THSRAPIDailyTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfoParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIDailyTrainInfoParamsWithHTTPClient creates a new THSRAPIDailyTrainInfoParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIDailyTrainInfoParamsWithHTTPClient(client *http.Client) *THSRAPIDailyTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIDailyTrainInfoParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIDailyTrainInfoParams contains all the parameters to send to the API endpoint
-for the t h s r Api daily train info operation typically these are written to a http.Request
+/* THSRAPIDailyTrainInfoParams contains all the parameters to send to the API endpoint
+ for the t h s r Api daily train info operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIDailyTrainInfoParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type THSRAPIDailyTrainInfoParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api daily train info params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTrainInfoParams) WithDefaults() *THSRAPIDailyTrainInfoParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api daily train info params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIDailyTrainInfoParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIDailyTrainInfoParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api daily train info params
func (o *THSRAPIDailyTrainInfoParams) WithTimeout(timeout time.Duration) *THSRAPIDailyTrainInfoParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *THSRAPIDailyTrainInfoParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -245,64 +267,68 @@ func (o *THSRAPIDailyTrainInfoParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info_responses.go
index 6585a9ca..8d85970c 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_daily_train_info_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIDailyTrainInfoReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIDailyTrainInfoNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIDailyTrainInfoOK() *THSRAPIDailyTrainInfoOK {
return &THSRAPIDailyTrainInfoOK{}
}
-/*THSRAPIDailyTrainInfoOK handles this case with default header values.
+/* THSRAPIDailyTrainInfoOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIDailyTrainInfoOK struct {
func (o *THSRAPIDailyTrainInfoOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTrainInfo/Today][%d] tHSRApiDailyTrainInfoOK %+v", 200, o.Payload)
}
-
func (o *THSRAPIDailyTrainInfoOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIDailyTrainInfoOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTHSRAPIDailyTrainInfoNotModified creates a THSRAPIDailyTrainInfoNotModified with default headers values
+func NewTHSRAPIDailyTrainInfoNotModified() *THSRAPIDailyTrainInfoNotModified {
+ return &THSRAPIDailyTrainInfoNotModified{}
+}
+
+/* THSRAPIDailyTrainInfoNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIDailyTrainInfoNotModified struct {
+}
+
+func (o *THSRAPIDailyTrainInfoNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTrainInfo/Today][%d] tHSRApiDailyTrainInfoNotModified ", 304)
+}
+
+func (o *THSRAPIDailyTrainInfoNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable1_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable1_parameters.go
index e1981521..dd5de8fa 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable1_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIGeneralTimetable1Params creates a new THSRAPIGeneralTimetable1Params object
-// with the default values initialized.
+// NewTHSRAPIGeneralTimetable1Params creates a new THSRAPIGeneralTimetable1Params 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 NewTHSRAPIGeneralTimetable1Params() *THSRAPIGeneralTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIGeneralTimetable1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIGeneralTimetable1ParamsWithTimeout creates a new THSRAPIGeneralTimetable1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIGeneralTimetable1ParamsWithTimeout(timeout time.Duration) *THSRAPIGeneralTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIGeneralTimetable1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIGeneralTimetable1ParamsWithContext creates a new THSRAPIGeneralTimetable1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIGeneralTimetable1ParamsWithContext(ctx context.Context) *THSRAPIGeneralTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIGeneralTimetable1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIGeneralTimetable1ParamsWithHTTPClient creates a new THSRAPIGeneralTimetable1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIGeneralTimetable1ParamsWithHTTPClient(client *http.Client) *THSRAPIGeneralTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIGeneralTimetable1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIGeneralTimetable1Params contains all the parameters to send to the API endpoint
-for the t h s r Api general timetable 1 operation typically these are written to a http.Request
+/* THSRAPIGeneralTimetable1Params contains all the parameters to send to the API endpoint
+ for the t h s r Api general timetable 1 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIGeneralTimetable1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -114,6 +109,32 @@ type THSRAPIGeneralTimetable1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api general timetable 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIGeneralTimetable1Params) WithDefaults() *THSRAPIGeneralTimetable1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api general timetable 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIGeneralTimetable1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIGeneralTimetable1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api general timetable 1 params
func (o *THSRAPIGeneralTimetable1Params) WithTimeout(timeout time.Duration) *THSRAPIGeneralTimetable1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *THSRAPIGeneralTimetable1Params) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -261,64 +284,68 @@ func (o *THSRAPIGeneralTimetable1Params) WriteToRequest(r runtime.ClientRequest,
// 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 TrainNo
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable1_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable1_responses.go
index b6aed931..a7457563 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable1_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable1_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIGeneralTimetable1Reader) ReadResponse(response runtime.ClientRes
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIGeneralTimetable1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIGeneralTimetable1OK() *THSRAPIGeneralTimetable1OK {
return &THSRAPIGeneralTimetable1OK{}
}
-/*THSRAPIGeneralTimetable1OK handles this case with default header values.
+/* THSRAPIGeneralTimetable1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIGeneralTimetable1OK struct {
func (o *THSRAPIGeneralTimetable1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/GeneralTimetable/TrainNo/{TrainNo}][%d] tHSRApiGeneralTimetable1OK %+v", 200, o.Payload)
}
-
func (o *THSRAPIGeneralTimetable1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailGeneralTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIGeneralTimetable1OK) readResponse(response runtime.ClientRespons
return nil
}
+
+// NewTHSRAPIGeneralTimetable1NotModified creates a THSRAPIGeneralTimetable1NotModified with default headers values
+func NewTHSRAPIGeneralTimetable1NotModified() *THSRAPIGeneralTimetable1NotModified {
+ return &THSRAPIGeneralTimetable1NotModified{}
+}
+
+/* THSRAPIGeneralTimetable1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIGeneralTimetable1NotModified struct {
+}
+
+func (o *THSRAPIGeneralTimetable1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/GeneralTimetable/TrainNo/{TrainNo}][%d] tHSRApiGeneralTimetable1NotModified ", 304)
+}
+
+func (o *THSRAPIGeneralTimetable1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable_parameters.go
index 0ca594a2..3dc7ca56 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIGeneralTimetableParams creates a new THSRAPIGeneralTimetableParams object
-// with the default values initialized.
+// NewTHSRAPIGeneralTimetableParams creates a new THSRAPIGeneralTimetableParams 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 NewTHSRAPIGeneralTimetableParams() *THSRAPIGeneralTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIGeneralTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIGeneralTimetableParamsWithTimeout creates a new THSRAPIGeneralTimetableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIGeneralTimetableParamsWithTimeout(timeout time.Duration) *THSRAPIGeneralTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIGeneralTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIGeneralTimetableParamsWithContext creates a new THSRAPIGeneralTimetableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIGeneralTimetableParamsWithContext(ctx context.Context) *THSRAPIGeneralTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIGeneralTimetableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIGeneralTimetableParamsWithHTTPClient creates a new THSRAPIGeneralTimetableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIGeneralTimetableParamsWithHTTPClient(client *http.Client) *THSRAPIGeneralTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIGeneralTimetableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIGeneralTimetableParams contains all the parameters to send to the API endpoint
-for the t h s r Api general timetable operation typically these are written to a http.Request
+/* THSRAPIGeneralTimetableParams contains all the parameters to send to the API endpoint
+ for the t h s r Api general timetable operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIGeneralTimetableParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type THSRAPIGeneralTimetableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api general timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIGeneralTimetableParams) WithDefaults() *THSRAPIGeneralTimetableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api general timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIGeneralTimetableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIGeneralTimetableParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api general timetable params
func (o *THSRAPIGeneralTimetableParams) WithTimeout(timeout time.Duration) *THSRAPIGeneralTimetableParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *THSRAPIGeneralTimetableParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -245,64 +267,68 @@ func (o *THSRAPIGeneralTimetableParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable_responses.go
index 38c8ae19..60b8c598 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_general_timetable_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIGeneralTimetableReader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIGeneralTimetableNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIGeneralTimetableOK() *THSRAPIGeneralTimetableOK {
return &THSRAPIGeneralTimetableOK{}
}
-/*THSRAPIGeneralTimetableOK handles this case with default header values.
+/* THSRAPIGeneralTimetableOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIGeneralTimetableOK struct {
func (o *THSRAPIGeneralTimetableOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/GeneralTimetable][%d] tHSRApiGeneralTimetableOK %+v", 200, o.Payload)
}
-
func (o *THSRAPIGeneralTimetableOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailGeneralTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIGeneralTimetableOK) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewTHSRAPIGeneralTimetableNotModified creates a THSRAPIGeneralTimetableNotModified with default headers values
+func NewTHSRAPIGeneralTimetableNotModified() *THSRAPIGeneralTimetableNotModified {
+ return &THSRAPIGeneralTimetableNotModified{}
+}
+
+/* THSRAPIGeneralTimetableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIGeneralTimetableNotModified struct {
+}
+
+func (o *THSRAPIGeneralTimetableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/GeneralTimetable][%d] tHSRApiGeneralTimetableNotModified ", 304)
+}
+
+func (o *THSRAPIGeneralTimetableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_news_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_news_parameters.go
index 1e5f8795..a9537c21 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_news_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_news_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPINewsParams creates a new THSRAPINewsParams object
-// with the default values initialized.
+// NewTHSRAPINewsParams creates a new THSRAPINewsParams 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 NewTHSRAPINewsParams() *THSRAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPINewsParamsWithTimeout creates a new THSRAPINewsParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPINewsParamsWithTimeout(timeout time.Duration) *THSRAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPINewsParamsWithContext creates a new THSRAPINewsParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPINewsParamsWithContext(ctx context.Context) *THSRAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPINewsParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPINewsParamsWithHTTPClient creates a new THSRAPINewsParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPINewsParamsWithHTTPClient(client *http.Client) *THSRAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPINewsParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPINewsParams contains all the parameters to send to the API endpoint
-for the t h s r Api news operation typically these are written to a http.Request
+/* THSRAPINewsParams contains all the parameters to send to the API endpoint
+ for the t h s r Api news operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPINewsParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type THSRAPINewsParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPINewsParams) WithDefaults() *THSRAPINewsParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPINewsParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPINewsParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api news params
func (o *THSRAPINewsParams) WithTimeout(timeout time.Duration) *THSRAPINewsParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *THSRAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// 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
}
@@ -245,64 +267,68 @@ func (o *THSRAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_news_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_news_responses.go
index 04421e57..73a85a34 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_news_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_news_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPINewsReader) ReadResponse(response runtime.ClientResponse, consum
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPINewsNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPINewsOK() *THSRAPINewsOK {
return &THSRAPINewsOK{}
}
-/*THSRAPINewsOK handles this case with default header values.
+/* THSRAPINewsOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPINewsOK struct {
func (o *THSRAPINewsOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/News][%d] tHSRApiNewsOK %+v", 200, o.Payload)
}
-
func (o *THSRAPINewsOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRNews {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPINewsOK) readResponse(response runtime.ClientResponse, consumer r
return nil
}
+
+// NewTHSRAPINewsNotModified creates a THSRAPINewsNotModified with default headers values
+func NewTHSRAPINewsNotModified() *THSRAPINewsNotModified {
+ return &THSRAPINewsNotModified{}
+}
+
+/* THSRAPINewsNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPINewsNotModified struct {
+}
+
+func (o *THSRAPINewsNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/News][%d] tHSRApiNewsNotModified ", 304)
+}
+
+func (o *THSRAPINewsNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_daily_timetable_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_daily_timetable_parameters.go
index 4d57c320..04a0d437 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_daily_timetable_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_daily_timetable_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIODDailyTimetableParams creates a new THSRAPIODDailyTimetableParams object
-// with the default values initialized.
+// NewTHSRAPIODDailyTimetableParams creates a new THSRAPIODDailyTimetableParams 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 NewTHSRAPIODDailyTimetableParams() *THSRAPIODDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIODDailyTimetableParamsWithTimeout creates a new THSRAPIODDailyTimetableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIODDailyTimetableParamsWithTimeout(timeout time.Duration) *THSRAPIODDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIODDailyTimetableParamsWithContext creates a new THSRAPIODDailyTimetableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIODDailyTimetableParamsWithContext(ctx context.Context) *THSRAPIODDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIODDailyTimetableParamsWithHTTPClient creates a new THSRAPIODDailyTimetableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIODDailyTimetableParamsWithHTTPClient(client *http.Client) *THSRAPIODDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODDailyTimetableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIODDailyTimetableParams contains all the parameters to send to the API endpoint
-for the t h s r Api o d daily timetable operation typically these are written to a http.Request
+/* THSRAPIODDailyTimetableParams contains all the parameters to send to the API endpoint
+ for the t h s r Api o d daily timetable operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIODDailyTimetableParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*DestinationStationID
- 迄點車站代碼
+ /* DestinationStationID.
+
+ 迄點車站代碼
*/
DestinationStationID string
- /*OriginStationID
- 起點車站代碼
+ /* OriginStationID.
+
+ 起點車站代碼
*/
OriginStationID string
- /*TrainDate
- 欲查詢的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -124,6 +121,32 @@ type THSRAPIODDailyTimetableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api o d daily timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIODDailyTimetableParams) WithDefaults() *THSRAPIODDailyTimetableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api o d daily timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIODDailyTimetableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIODDailyTimetableParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api o d daily timetable params
func (o *THSRAPIODDailyTimetableParams) WithTimeout(timeout time.Duration) *THSRAPIODDailyTimetableParams {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *THSRAPIODDailyTimetableParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -293,64 +318,68 @@ func (o *THSRAPIODDailyTimetableParams) WriteToRequest(r runtime.ClientRequest,
// 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 DestinationStationID
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_daily_timetable_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_daily_timetable_responses.go
index 615721ab..01df36f3 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_daily_timetable_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_daily_timetable_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIODDailyTimetableReader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIODDailyTimetableNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIODDailyTimetableOK() *THSRAPIODDailyTimetableOK {
return &THSRAPIODDailyTimetableOK{}
}
-/*THSRAPIODDailyTimetableOK handles this case with default header values.
+/* THSRAPIODDailyTimetableOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIODDailyTimetableOK struct {
func (o *THSRAPIODDailyTimetableOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/OD/{OriginStationID}/to/{DestinationStationID}/{TrainDate}][%d] tHSRApiODDailyTimetableOK %+v", 200, o.Payload)
}
-
func (o *THSRAPIODDailyTimetableOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailODDailyTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIODDailyTimetableOK) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewTHSRAPIODDailyTimetableNotModified creates a THSRAPIODDailyTimetableNotModified with default headers values
+func NewTHSRAPIODDailyTimetableNotModified() *THSRAPIODDailyTimetableNotModified {
+ return &THSRAPIODDailyTimetableNotModified{}
+}
+
+/* THSRAPIODDailyTimetableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIODDailyTimetableNotModified struct {
+}
+
+func (o *THSRAPIODDailyTimetableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/OD/{OriginStationID}/to/{DestinationStationID}/{TrainDate}][%d] tHSRApiODDailyTimetableNotModified ", 304)
+}
+
+func (o *THSRAPIODDailyTimetableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare1_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare1_parameters.go
index 2129abc5..38754cb3 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare1_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIODFare1Params creates a new THSRAPIODFare1Params object
-// with the default values initialized.
+// NewTHSRAPIODFare1Params creates a new THSRAPIODFare1Params 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 NewTHSRAPIODFare1Params() *THSRAPIODFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODFare1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIODFare1ParamsWithTimeout creates a new THSRAPIODFare1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIODFare1ParamsWithTimeout(timeout time.Duration) *THSRAPIODFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODFare1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIODFare1ParamsWithContext creates a new THSRAPIODFare1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIODFare1ParamsWithContext(ctx context.Context) *THSRAPIODFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODFare1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIODFare1ParamsWithHTTPClient creates a new THSRAPIODFare1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIODFare1ParamsWithHTTPClient(client *http.Client) *THSRAPIODFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODFare1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIODFare1Params contains all the parameters to send to the API endpoint
-for the t h s r Api o d fare 1 operation typically these are written to a http.Request
+/* THSRAPIODFare1Params contains all the parameters to send to the API endpoint
+ for the t h s r Api o d fare 1 operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIODFare1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*DestinationStationID
- 迄點車站代碼
+ /* DestinationStationID.
+
+ 迄點車站代碼
*/
DestinationStationID string
- /*OriginStationID
- 起點車站代碼
+ /* OriginStationID.
+
+ 起點車站代碼
*/
OriginStationID string
@@ -119,6 +115,32 @@ type THSRAPIODFare1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api o d fare 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIODFare1Params) WithDefaults() *THSRAPIODFare1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api o d fare 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIODFare1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIODFare1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api o d fare 1 params
func (o *THSRAPIODFare1Params) WithTimeout(timeout time.Duration) *THSRAPIODFare1Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *THSRAPIODFare1Params) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
@@ -277,64 +301,68 @@ func (o *THSRAPIODFare1Params) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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 DestinationStationID
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare1_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare1_responses.go
index 5efde095..54bfffcf 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare1_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare1_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIODFare1Reader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIODFare1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIODFare1OK() *THSRAPIODFare1OK {
return &THSRAPIODFare1OK{}
}
-/*THSRAPIODFare1OK handles this case with default header values.
+/* THSRAPIODFare1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIODFare1OK struct {
func (o *THSRAPIODFare1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/ODFare/{OriginStationID}/to/{DestinationStationID}][%d] tHSRApiODFare1OK %+v", 200, o.Payload)
}
-
func (o *THSRAPIODFare1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailODFare {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIODFare1OK) readResponse(response runtime.ClientResponse, consume
return nil
}
+
+// NewTHSRAPIODFare1NotModified creates a THSRAPIODFare1NotModified with default headers values
+func NewTHSRAPIODFare1NotModified() *THSRAPIODFare1NotModified {
+ return &THSRAPIODFare1NotModified{}
+}
+
+/* THSRAPIODFare1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIODFare1NotModified struct {
+}
+
+func (o *THSRAPIODFare1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/ODFare/{OriginStationID}/to/{DestinationStationID}][%d] tHSRApiODFare1NotModified ", 304)
+}
+
+func (o *THSRAPIODFare1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare_parameters.go
index b163f322..ea5cc562 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIODFareParams creates a new THSRAPIODFareParams object
-// with the default values initialized.
+// NewTHSRAPIODFareParams creates a new THSRAPIODFareParams 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 NewTHSRAPIODFareParams() *THSRAPIODFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODFareParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIODFareParamsWithTimeout creates a new THSRAPIODFareParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIODFareParamsWithTimeout(timeout time.Duration) *THSRAPIODFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODFareParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIODFareParamsWithContext creates a new THSRAPIODFareParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIODFareParamsWithContext(ctx context.Context) *THSRAPIODFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODFareParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIODFareParamsWithHTTPClient creates a new THSRAPIODFareParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIODFareParamsWithHTTPClient(client *http.Client) *THSRAPIODFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIODFareParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIODFareParams contains all the parameters to send to the API endpoint
-for the t h s r Api o d fare operation typically these are written to a http.Request
+/* THSRAPIODFareParams contains all the parameters to send to the API endpoint
+ for the t h s r Api o d fare operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIODFareParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type THSRAPIODFareParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api o d fare params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIODFareParams) WithDefaults() *THSRAPIODFareParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api o d fare params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIODFareParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIODFareParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api o d fare params
func (o *THSRAPIODFareParams) WithTimeout(timeout time.Duration) *THSRAPIODFareParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *THSRAPIODFareParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
@@ -245,64 +267,68 @@ func (o *THSRAPIODFareParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare_responses.go
index c53ebc38..bb8d2a50 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_o_d_fare_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIODFareReader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIODFareNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIODFareOK() *THSRAPIODFareOK {
return &THSRAPIODFareOK{}
}
-/*THSRAPIODFareOK handles this case with default header values.
+/* THSRAPIODFareOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIODFareOK struct {
func (o *THSRAPIODFareOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/ODFare][%d] tHSRApiODFareOK %+v", 200, o.Payload)
}
-
func (o *THSRAPIODFareOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailODFare {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIODFareOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewTHSRAPIODFareNotModified creates a THSRAPIODFareNotModified with default headers values
+func NewTHSRAPIODFareNotModified() *THSRAPIODFareNotModified {
+ return &THSRAPIODFareNotModified{}
+}
+
+/* THSRAPIODFareNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIODFareNotModified struct {
+}
+
+func (o *THSRAPIODFareNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/ODFare][%d] tHSRApiODFareNotModified ", 304)
+}
+
+func (o *THSRAPIODFareNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_shape_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_shape_parameters.go
index 06796bbe..6f5d29ff 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_shape_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_shape_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIShapeParams creates a new THSRAPIShapeParams object
-// with the default values initialized.
+// NewTHSRAPIShapeParams creates a new THSRAPIShapeParams 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 NewTHSRAPIShapeParams() *THSRAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIShapeParamsWithTimeout creates a new THSRAPIShapeParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIShapeParamsWithTimeout(timeout time.Duration) *THSRAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIShapeParamsWithContext creates a new THSRAPIShapeParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIShapeParamsWithContext(ctx context.Context) *THSRAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIShapeParamsWithHTTPClient creates a new THSRAPIShapeParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIShapeParamsWithHTTPClient(client *http.Client) *THSRAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIShapeParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIShapeParams contains all the parameters to send to the API endpoint
-for the t h s r Api shape operation typically these are written to a http.Request
+/* THSRAPIShapeParams contains all the parameters to send to the API endpoint
+ for the t h s r Api shape operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIShapeParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type THSRAPIShapeParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIShapeParams) WithDefaults() *THSRAPIShapeParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIShapeParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIShapeParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api shape params
func (o *THSRAPIShapeParams) WithTimeout(timeout time.Duration) *THSRAPIShapeParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *THSRAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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
}
@@ -245,64 +267,68 @@ func (o *THSRAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_shape_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_shape_responses.go
index 282985d9..54d1d652 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_shape_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_shape_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIShapeReader) ReadResponse(response runtime.ClientResponse, consu
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIShapeNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIShapeOK() *THSRAPIShapeOK {
return &THSRAPIShapeOK{}
}
-/*THSRAPIShapeOK handles this case with default header values.
+/* THSRAPIShapeOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIShapeOK struct {
func (o *THSRAPIShapeOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/Shape][%d] tHSRApiShapeOK %+v", 200, o.Payload)
}
-
func (o *THSRAPIShapeOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRTHSRShape {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIShapeOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewTHSRAPIShapeNotModified creates a THSRAPIShapeNotModified with default headers values
+func NewTHSRAPIShapeNotModified() *THSRAPIShapeNotModified {
+ return &THSRAPIShapeNotModified{}
+}
+
+/* THSRAPIShapeNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIShapeNotModified struct {
+}
+
+func (o *THSRAPIShapeNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/Shape][%d] tHSRApiShapeNotModified ", 304)
+}
+
+func (o *THSRAPIShapeNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_exit_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_exit_parameters.go
index 9793357a..6f77fe3c 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_exit_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_exit_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIStationExitParams creates a new THSRAPIStationExitParams object
-// with the default values initialized.
+// NewTHSRAPIStationExitParams creates a new THSRAPIStationExitParams 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 NewTHSRAPIStationExitParams() *THSRAPIStationExitParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationExitParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIStationExitParamsWithTimeout creates a new THSRAPIStationExitParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIStationExitParamsWithTimeout(timeout time.Duration) *THSRAPIStationExitParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationExitParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIStationExitParamsWithContext creates a new THSRAPIStationExitParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIStationExitParamsWithContext(ctx context.Context) *THSRAPIStationExitParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationExitParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIStationExitParamsWithHTTPClient creates a new THSRAPIStationExitParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIStationExitParamsWithHTTPClient(client *http.Client) *THSRAPIStationExitParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationExitParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIStationExitParams contains all the parameters to send to the API endpoint
-for the t h s r Api station exit operation typically these are written to a http.Request
+/* THSRAPIStationExitParams contains all the parameters to send to the API endpoint
+ for the t h s r Api station exit operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIStationExitParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type THSRAPIStationExitParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api station exit params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIStationExitParams) WithDefaults() *THSRAPIStationExitParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api station exit params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIStationExitParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIStationExitParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api station exit params
func (o *THSRAPIStationExitParams) WithTimeout(timeout time.Duration) *THSRAPIStationExitParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *THSRAPIStationExitParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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
}
@@ -261,80 +284,85 @@ func (o *THSRAPIStationExitParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_exit_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_exit_responses.go
index 90296ea9..d1b87e41 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_exit_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_exit_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIStationExitReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIStationExitNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIStationExitOK() *THSRAPIStationExitOK {
return &THSRAPIStationExitOK{}
}
-/*THSRAPIStationExitOK handles this case with default header values.
+/* THSRAPIStationExitOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIStationExitOK struct {
func (o *THSRAPIStationExitOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/StationExit][%d] tHSRApiStationExitOK %+v", 200, o.Payload)
}
-
func (o *THSRAPIStationExitOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRStationExit {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIStationExitOK) readResponse(response runtime.ClientResponse, con
return nil
}
+
+// NewTHSRAPIStationExitNotModified creates a THSRAPIStationExitNotModified with default headers values
+func NewTHSRAPIStationExitNotModified() *THSRAPIStationExitNotModified {
+ return &THSRAPIStationExitNotModified{}
+}
+
+/* THSRAPIStationExitNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIStationExitNotModified struct {
+}
+
+func (o *THSRAPIStationExitNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/StationExit][%d] tHSRApiStationExitNotModified ", 304)
+}
+
+func (o *THSRAPIStationExitNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_parameters.go
index 0bd44428..1d66b9fd 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_parameters.go
@@ -17,95 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIStationParams creates a new THSRAPIStationParams object
-// with the default values initialized.
+// NewTHSRAPIStationParams creates a new THSRAPIStationParams 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 NewTHSRAPIStationParams() *THSRAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIStationParamsWithTimeout creates a new THSRAPIStationParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIStationParamsWithTimeout(timeout time.Duration) *THSRAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIStationParamsWithContext creates a new THSRAPIStationParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIStationParamsWithContext(ctx context.Context) *THSRAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIStationParamsWithHTTPClient creates a new THSRAPIStationParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIStationParamsWithHTTPClient(client *http.Client) *THSRAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIStationParams contains all the parameters to send to the API endpoint
-for the t h s r Api station operation typically these are written to a http.Request
+/* THSRAPIStationParams contains all the parameters to send to the API endpoint
+ for the t h s r Api station operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIStationParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
- */
- DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +103,32 @@ type THSRAPIStationParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIStationParams) WithDefaults() *THSRAPIStationParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIStationParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIStationParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api station params
func (o *THSRAPIStationParams) WithTimeout(timeout time.Duration) *THSRAPIStationParams {
o.SetTimeout(timeout)
@@ -202,17 +217,6 @@ func (o *THSRAPIStationParams) SetDollarSkip(dollarSkip *string) {
o.DollarSkip = dollarSkip
}
-// WithDollarSpatialFilter adds the dollarSpatialFilter to the t h s r Api station params
-func (o *THSRAPIStationParams) WithDollarSpatialFilter(dollarSpatialFilter *string) *THSRAPIStationParams {
- o.SetDollarSpatialFilter(dollarSpatialFilter)
- return o
-}
-
-// SetDollarSpatialFilter adds the dollarSpatialFilter to the t h s r Api station params
-func (o *THSRAPIStationParams) SetDollarSpatialFilter(dollarSpatialFilter *string) {
- o.DollarSpatialFilter = dollarSpatialFilter
-}
-
// WithDollarTop adds the dollarTop to the t h s r Api station params
func (o *THSRAPIStationParams) WithDollarTop(dollarTop *int64) *THSRAPIStationParams {
o.SetDollarTop(dollarTop)
@@ -236,22 +240,24 @@ func (o *THSRAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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
}
@@ -261,80 +267,68 @@ func (o *THSRAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg strfm
// 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.DollarSpatialFilter != nil {
- // query param $spatialFilter
- var qrDollarSpatialFilter string
- if o.DollarSpatialFilter != nil {
- qrDollarSpatialFilter = *o.DollarSpatialFilter
- }
- qDollarSpatialFilter := qrDollarSpatialFilter
- if qDollarSpatialFilter != "" {
- if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); err != nil {
+ 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_responses.go
index e169507f..2416258a 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIStationReader) ReadResponse(response runtime.ClientResponse, con
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIStationNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIStationOK() *THSRAPIStationOK {
return &THSRAPIStationOK{}
}
-/*THSRAPIStationOK handles this case with default header values.
+/* THSRAPIStationOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIStationOK struct {
func (o *THSRAPIStationOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/Station][%d] tHSRApiStationOK %+v", 200, o.Payload)
}
-
func (o *THSRAPIStationOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailStation {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIStationOK) readResponse(response runtime.ClientResponse, consume
return nil
}
+
+// NewTHSRAPIStationNotModified creates a THSRAPIStationNotModified with default headers values
+func NewTHSRAPIStationNotModified() *THSRAPIStationNotModified {
+ return &THSRAPIStationNotModified{}
+}
+
+/* THSRAPIStationNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIStationNotModified struct {
+}
+
+func (o *THSRAPIStationNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/Station][%d] tHSRApiStationNotModified ", 304)
+}
+
+func (o *THSRAPIStationNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_timetable_parameters.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_timetable_parameters.go
index a006d5b5..cf1822e7 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_timetable_parameters.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_timetable_parameters.go
@@ -17,95 +17,91 @@ import (
"github.com/go-openapi/swag"
)
-// NewTHSRAPIStationTimetableParams creates a new THSRAPIStationTimetableParams object
-// with the default values initialized.
+// NewTHSRAPIStationTimetableParams creates a new THSRAPIStationTimetableParams 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 NewTHSRAPIStationTimetableParams() *THSRAPIStationTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTHSRAPIStationTimetableParamsWithTimeout creates a new THSRAPIStationTimetableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTHSRAPIStationTimetableParamsWithTimeout(timeout time.Duration) *THSRAPIStationTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTHSRAPIStationTimetableParamsWithContext creates a new THSRAPIStationTimetableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTHSRAPIStationTimetableParamsWithContext(ctx context.Context) *THSRAPIStationTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationTimetableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTHSRAPIStationTimetableParamsWithHTTPClient creates a new THSRAPIStationTimetableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTHSRAPIStationTimetableParamsWithHTTPClient(client *http.Client) *THSRAPIStationTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &THSRAPIStationTimetableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*THSRAPIStationTimetableParams contains all the parameters to send to the API endpoint
-for the t h s r Api station timetable operation typically these are written to a http.Request
+/* THSRAPIStationTimetableParams contains all the parameters to send to the API endpoint
+ for the t h s r Api station timetable operation.
+
+ Typically these are written to a http.Request.
*/
type THSRAPIStationTimetableParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*StationID*/
+
+ // StationID.
StationID string
- /*TrainDate*/
+
+ // TrainDate.
TrainDate string
timeout time.Duration
@@ -113,6 +109,32 @@ type THSRAPIStationTimetableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t h s r Api station timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIStationTimetableParams) WithDefaults() *THSRAPIStationTimetableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t h s r Api station timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *THSRAPIStationTimetableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := THSRAPIStationTimetableParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t h s r Api station timetable params
func (o *THSRAPIStationTimetableParams) WithTimeout(timeout time.Duration) *THSRAPIStationTimetableParams {
o.SetTimeout(timeout)
@@ -246,22 +268,24 @@ func (o *THSRAPIStationTimetableParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -271,64 +295,68 @@ func (o *THSRAPIStationTimetableParams) WriteToRequest(r runtime.ClientRequest,
// 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 StationID
diff --git a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_timetable_responses.go b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_timetable_responses.go
index 72d010c2..0a2d546f 100644
--- a/rail/v2/client/t_h_s_r/t_h_s_r_api_station_timetable_responses.go
+++ b/rail/v2/client/t_h_s_r/t_h_s_r_api_station_timetable_responses.go
@@ -29,7 +29,12 @@ func (o *THSRAPIStationTimetableReader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTHSRAPIStationTimetableNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTHSRAPIStationTimetableOK() *THSRAPIStationTimetableOK {
return &THSRAPIStationTimetableOK{}
}
-/*THSRAPIStationTimetableOK handles this case with default header values.
+/* THSRAPIStationTimetableOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type THSRAPIStationTimetableOK struct {
func (o *THSRAPIStationTimetableOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/Station/{StationID}/{TrainDate}][%d] tHSRApiStationTimetableOK %+v", 200, o.Payload)
}
-
func (o *THSRAPIStationTimetableOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2THSRRailStationTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *THSRAPIStationTimetableOK) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewTHSRAPIStationTimetableNotModified creates a THSRAPIStationTimetableNotModified with default headers values
+func NewTHSRAPIStationTimetableNotModified() *THSRAPIStationTimetableNotModified {
+ return &THSRAPIStationTimetableNotModified{}
+}
+
+/* THSRAPIStationTimetableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type THSRAPIStationTimetableNotModified struct {
+}
+
+func (o *THSRAPIStationTimetableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/THSR/DailyTimetable/Station/{StationID}/{TrainDate}][%d] tHSRApiStationTimetableNotModified ", 304)
+}
+
+func (o *THSRAPIStationTimetableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable1_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable1_parameters.go
index b1efb5f3..75121c4f 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable1_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIDailyTimetable1Params creates a new TRAAPIDailyTimetable1Params object
-// with the default values initialized.
+// NewTRAAPIDailyTimetable1Params creates a new TRAAPIDailyTimetable1Params 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 NewTRAAPIDailyTimetable1Params() *TRAAPIDailyTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIDailyTimetable1ParamsWithTimeout creates a new TRAAPIDailyTimetable1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIDailyTimetable1ParamsWithTimeout(timeout time.Duration) *TRAAPIDailyTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIDailyTimetable1ParamsWithContext creates a new TRAAPIDailyTimetable1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIDailyTimetable1ParamsWithContext(ctx context.Context) *TRAAPIDailyTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIDailyTimetable1ParamsWithHTTPClient creates a new TRAAPIDailyTimetable1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIDailyTimetable1ParamsWithHTTPClient(client *http.Client) *TRAAPIDailyTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIDailyTimetable1Params contains all the parameters to send to the API endpoint
-for the t r a Api daily timetable 1 operation typically these are written to a http.Request
+/* TRAAPIDailyTimetable1Params contains all the parameters to send to the API endpoint
+ for the t r a Api daily timetable 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIDailyTimetable1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -114,6 +109,32 @@ type TRAAPIDailyTimetable1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api daily timetable 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTimetable1Params) WithDefaults() *TRAAPIDailyTimetable1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api daily timetable 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTimetable1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIDailyTimetable1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api daily timetable 1 params
func (o *TRAAPIDailyTimetable1Params) WithTimeout(timeout time.Duration) *TRAAPIDailyTimetable1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TRAAPIDailyTimetable1Params) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -261,64 +284,68 @@ func (o *TRAAPIDailyTimetable1Params) WriteToRequest(r runtime.ClientRequest, re
// 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 TrainNo
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable1_responses.go b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable1_responses.go
index b83cdedd..1adf1f5c 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable1_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable1_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIDailyTimetable1Reader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIDailyTimetable1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIDailyTimetable1OK() *TRAAPIDailyTimetable1OK {
return &TRAAPIDailyTimetable1OK{}
}
-/*TRAAPIDailyTimetable1OK handles this case with default header values.
+/* TRAAPIDailyTimetable1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIDailyTimetable1OK struct {
func (o *TRAAPIDailyTimetable1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/Today/TrainNo/{TrainNo}][%d] tRAApiDailyTimetable1OK %+v", 200, o.Payload)
}
-
func (o *TRAAPIDailyTimetable1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailDailyTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIDailyTimetable1OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTRAAPIDailyTimetable1NotModified creates a TRAAPIDailyTimetable1NotModified with default headers values
+func NewTRAAPIDailyTimetable1NotModified() *TRAAPIDailyTimetable1NotModified {
+ return &TRAAPIDailyTimetable1NotModified{}
+}
+
+/* TRAAPIDailyTimetable1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIDailyTimetable1NotModified struct {
+}
+
+func (o *TRAAPIDailyTimetable1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/Today/TrainNo/{TrainNo}][%d] tRAApiDailyTimetable1NotModified ", 304)
+}
+
+func (o *TRAAPIDailyTimetable1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable2_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable2_parameters.go
index 5851625a..bcd22594 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable2_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable2_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIDailyTimetable2Params creates a new TRAAPIDailyTimetable2Params object
-// with the default values initialized.
+// NewTRAAPIDailyTimetable2Params creates a new TRAAPIDailyTimetable2Params 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 NewTRAAPIDailyTimetable2Params() *TRAAPIDailyTimetable2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIDailyTimetable2ParamsWithTimeout creates a new TRAAPIDailyTimetable2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIDailyTimetable2ParamsWithTimeout(timeout time.Duration) *TRAAPIDailyTimetable2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIDailyTimetable2ParamsWithContext creates a new TRAAPIDailyTimetable2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIDailyTimetable2ParamsWithContext(ctx context.Context) *TRAAPIDailyTimetable2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIDailyTimetable2ParamsWithHTTPClient creates a new TRAAPIDailyTimetable2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIDailyTimetable2ParamsWithHTTPClient(client *http.Client) *TRAAPIDailyTimetable2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIDailyTimetable2Params contains all the parameters to send to the API endpoint
-for the t r a Api daily timetable 2 operation typically these are written to a http.Request
+/* TRAAPIDailyTimetable2Params contains all the parameters to send to the API endpoint
+ for the t r a Api daily timetable 2 operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIDailyTimetable2Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -114,6 +109,32 @@ type TRAAPIDailyTimetable2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api daily timetable 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTimetable2Params) WithDefaults() *TRAAPIDailyTimetable2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api daily timetable 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTimetable2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIDailyTimetable2Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api daily timetable 2 params
func (o *TRAAPIDailyTimetable2Params) WithTimeout(timeout time.Duration) *TRAAPIDailyTimetable2Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TRAAPIDailyTimetable2Params) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -261,64 +284,68 @@ func (o *TRAAPIDailyTimetable2Params) WriteToRequest(r runtime.ClientRequest, re
// 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 TrainDate
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable2_responses.go b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable2_responses.go
index 5d3a0903..17d41083 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable2_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable2_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIDailyTimetable2Reader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIDailyTimetable2NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIDailyTimetable2OK() *TRAAPIDailyTimetable2OK {
return &TRAAPIDailyTimetable2OK{}
}
-/*TRAAPIDailyTimetable2OK handles this case with default header values.
+/* TRAAPIDailyTimetable2OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIDailyTimetable2OK struct {
func (o *TRAAPIDailyTimetable2OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/TrainDate/{TrainDate}][%d] tRAApiDailyTimetable2OK %+v", 200, o.Payload)
}
-
func (o *TRAAPIDailyTimetable2OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailDailyTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIDailyTimetable2OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTRAAPIDailyTimetable2NotModified creates a TRAAPIDailyTimetable2NotModified with default headers values
+func NewTRAAPIDailyTimetable2NotModified() *TRAAPIDailyTimetable2NotModified {
+ return &TRAAPIDailyTimetable2NotModified{}
+}
+
+/* TRAAPIDailyTimetable2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIDailyTimetable2NotModified struct {
+}
+
+func (o *TRAAPIDailyTimetable2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/TrainDate/{TrainDate}][%d] tRAApiDailyTimetable2NotModified ", 304)
+}
+
+func (o *TRAAPIDailyTimetable2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable3_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable3_parameters.go
index daddf027..98c085d2 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable3_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable3_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIDailyTimetable3Params creates a new TRAAPIDailyTimetable3Params object
-// with the default values initialized.
+// NewTRAAPIDailyTimetable3Params creates a new TRAAPIDailyTimetable3Params 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 NewTRAAPIDailyTimetable3Params() *TRAAPIDailyTimetable3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable3Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIDailyTimetable3ParamsWithTimeout creates a new TRAAPIDailyTimetable3Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIDailyTimetable3ParamsWithTimeout(timeout time.Duration) *TRAAPIDailyTimetable3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable3Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIDailyTimetable3ParamsWithContext creates a new TRAAPIDailyTimetable3Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIDailyTimetable3ParamsWithContext(ctx context.Context) *TRAAPIDailyTimetable3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable3Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIDailyTimetable3ParamsWithHTTPClient creates a new TRAAPIDailyTimetable3Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIDailyTimetable3ParamsWithHTTPClient(client *http.Client) *TRAAPIDailyTimetable3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetable3Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIDailyTimetable3Params contains all the parameters to send to the API endpoint
-for the t r a Api daily timetable 3 operation typically these are written to a http.Request
+/* TRAAPIDailyTimetable3Params contains all the parameters to send to the API endpoint
+ for the t r a Api daily timetable 3 operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIDailyTimetable3Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢的日期(格式: yyyy-MM-dd)
*/
TrainDate string
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -119,6 +115,32 @@ type TRAAPIDailyTimetable3Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api daily timetable 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTimetable3Params) WithDefaults() *TRAAPIDailyTimetable3Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api daily timetable 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTimetable3Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIDailyTimetable3Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api daily timetable 3 params
func (o *TRAAPIDailyTimetable3Params) WithTimeout(timeout time.Duration) *TRAAPIDailyTimetable3Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *TRAAPIDailyTimetable3Params) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -277,64 +301,68 @@ func (o *TRAAPIDailyTimetable3Params) WriteToRequest(r runtime.ClientRequest, re
// 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 TrainDate
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable3_responses.go b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable3_responses.go
index 62fb295c..e7b71d82 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable3_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable3_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIDailyTimetable3Reader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIDailyTimetable3NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIDailyTimetable3OK() *TRAAPIDailyTimetable3OK {
return &TRAAPIDailyTimetable3OK{}
}
-/*TRAAPIDailyTimetable3OK handles this case with default header values.
+/* TRAAPIDailyTimetable3OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIDailyTimetable3OK struct {
func (o *TRAAPIDailyTimetable3OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/TrainNo/{TrainNo}/TrainDate/{TrainDate}][%d] tRAApiDailyTimetable3OK %+v", 200, o.Payload)
}
-
func (o *TRAAPIDailyTimetable3OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailDailyTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIDailyTimetable3OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTRAAPIDailyTimetable3NotModified creates a TRAAPIDailyTimetable3NotModified with default headers values
+func NewTRAAPIDailyTimetable3NotModified() *TRAAPIDailyTimetable3NotModified {
+ return &TRAAPIDailyTimetable3NotModified{}
+}
+
+/* TRAAPIDailyTimetable3NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIDailyTimetable3NotModified struct {
+}
+
+func (o *TRAAPIDailyTimetable3NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/TrainNo/{TrainNo}/TrainDate/{TrainDate}][%d] tRAApiDailyTimetable3NotModified ", 304)
+}
+
+func (o *TRAAPIDailyTimetable3NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable_parameters.go
index 34367555..b01ca8ff 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIDailyTimetableParams creates a new TRAAPIDailyTimetableParams object
-// with the default values initialized.
+// NewTRAAPIDailyTimetableParams creates a new TRAAPIDailyTimetableParams 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 NewTRAAPIDailyTimetableParams() *TRAAPIDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIDailyTimetableParamsWithTimeout creates a new TRAAPIDailyTimetableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIDailyTimetableParamsWithTimeout(timeout time.Duration) *TRAAPIDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIDailyTimetableParamsWithContext creates a new TRAAPIDailyTimetableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIDailyTimetableParamsWithContext(ctx context.Context) *TRAAPIDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIDailyTimetableParamsWithHTTPClient creates a new TRAAPIDailyTimetableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIDailyTimetableParamsWithHTTPClient(client *http.Client) *TRAAPIDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTimetableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIDailyTimetableParams contains all the parameters to send to the API endpoint
-for the t r a Api daily timetable operation typically these are written to a http.Request
+/* TRAAPIDailyTimetableParams contains all the parameters to send to the API endpoint
+ for the t r a Api daily timetable operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIDailyTimetableParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPIDailyTimetableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api daily timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTimetableParams) WithDefaults() *TRAAPIDailyTimetableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api daily timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTimetableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIDailyTimetableParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api daily timetable params
func (o *TRAAPIDailyTimetableParams) WithTimeout(timeout time.Duration) *TRAAPIDailyTimetableParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPIDailyTimetableParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPIDailyTimetableParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable_responses.go b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable_responses.go
index 106f53ae..f7c4d2ea 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_timetable_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_timetable_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIDailyTimetableReader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIDailyTimetableNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIDailyTimetableOK() *TRAAPIDailyTimetableOK {
return &TRAAPIDailyTimetableOK{}
}
-/*TRAAPIDailyTimetableOK handles this case with default header values.
+/* TRAAPIDailyTimetableOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIDailyTimetableOK struct {
func (o *TRAAPIDailyTimetableOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/Today][%d] tRAApiDailyTimetableOK %+v", 200, o.Payload)
}
-
func (o *TRAAPIDailyTimetableOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailDailyTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIDailyTimetableOK) readResponse(response runtime.ClientResponse, c
return nil
}
+
+// NewTRAAPIDailyTimetableNotModified creates a TRAAPIDailyTimetableNotModified with default headers values
+func NewTRAAPIDailyTimetableNotModified() *TRAAPIDailyTimetableNotModified {
+ return &TRAAPIDailyTimetableNotModified{}
+}
+
+/* TRAAPIDailyTimetableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIDailyTimetableNotModified struct {
+}
+
+func (o *TRAAPIDailyTimetableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/Today][%d] tRAApiDailyTimetableNotModified ", 304)
+}
+
+func (o *TRAAPIDailyTimetableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info1_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info1_parameters.go
index 0db8f79e..4e891dcf 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info1_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIDailyTrainInfo1Params creates a new TRAAPIDailyTrainInfo1Params object
-// with the default values initialized.
+// NewTRAAPIDailyTrainInfo1Params creates a new TRAAPIDailyTrainInfo1Params 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 NewTRAAPIDailyTrainInfo1Params() *TRAAPIDailyTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIDailyTrainInfo1ParamsWithTimeout creates a new TRAAPIDailyTrainInfo1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIDailyTrainInfo1ParamsWithTimeout(timeout time.Duration) *TRAAPIDailyTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIDailyTrainInfo1ParamsWithContext creates a new TRAAPIDailyTrainInfo1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIDailyTrainInfo1ParamsWithContext(ctx context.Context) *TRAAPIDailyTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIDailyTrainInfo1ParamsWithHTTPClient creates a new TRAAPIDailyTrainInfo1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIDailyTrainInfo1ParamsWithHTTPClient(client *http.Client) *TRAAPIDailyTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIDailyTrainInfo1Params contains all the parameters to send to the API endpoint
-for the t r a Api daily train info 1 operation typically these are written to a http.Request
+/* TRAAPIDailyTrainInfo1Params contains all the parameters to send to the API endpoint
+ for the t r a Api daily train info 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIDailyTrainInfo1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -114,6 +109,32 @@ type TRAAPIDailyTrainInfo1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api daily train info 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTrainInfo1Params) WithDefaults() *TRAAPIDailyTrainInfo1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api daily train info 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTrainInfo1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIDailyTrainInfo1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api daily train info 1 params
func (o *TRAAPIDailyTrainInfo1Params) WithTimeout(timeout time.Duration) *TRAAPIDailyTrainInfo1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TRAAPIDailyTrainInfo1Params) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -261,64 +284,68 @@ func (o *TRAAPIDailyTrainInfo1Params) WriteToRequest(r runtime.ClientRequest, re
// 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 TrainNo
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info1_responses.go b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info1_responses.go
index 4dfbda97..9b6c70e8 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info1_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info1_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIDailyTrainInfo1Reader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIDailyTrainInfo1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIDailyTrainInfo1OK() *TRAAPIDailyTrainInfo1OK {
return &TRAAPIDailyTrainInfo1OK{}
}
-/*TRAAPIDailyTrainInfo1OK handles this case with default header values.
+/* TRAAPIDailyTrainInfo1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIDailyTrainInfo1OK struct {
func (o *TRAAPIDailyTrainInfo1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTrainInfo/Today/TrainNo/{TrainNo}][%d] tRAApiDailyTrainInfo1OK %+v", 200, o.Payload)
}
-
func (o *TRAAPIDailyTrainInfo1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIDailyTrainInfo1OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTRAAPIDailyTrainInfo1NotModified creates a TRAAPIDailyTrainInfo1NotModified with default headers values
+func NewTRAAPIDailyTrainInfo1NotModified() *TRAAPIDailyTrainInfo1NotModified {
+ return &TRAAPIDailyTrainInfo1NotModified{}
+}
+
+/* TRAAPIDailyTrainInfo1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIDailyTrainInfo1NotModified struct {
+}
+
+func (o *TRAAPIDailyTrainInfo1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTrainInfo/Today/TrainNo/{TrainNo}][%d] tRAApiDailyTrainInfo1NotModified ", 304)
+}
+
+func (o *TRAAPIDailyTrainInfo1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info2_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info2_parameters.go
index edaf101c..e69c860c 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info2_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info2_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIDailyTrainInfo2Params creates a new TRAAPIDailyTrainInfo2Params object
-// with the default values initialized.
+// NewTRAAPIDailyTrainInfo2Params creates a new TRAAPIDailyTrainInfo2Params 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 NewTRAAPIDailyTrainInfo2Params() *TRAAPIDailyTrainInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIDailyTrainInfo2ParamsWithTimeout creates a new TRAAPIDailyTrainInfo2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIDailyTrainInfo2ParamsWithTimeout(timeout time.Duration) *TRAAPIDailyTrainInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIDailyTrainInfo2ParamsWithContext creates a new TRAAPIDailyTrainInfo2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIDailyTrainInfo2ParamsWithContext(ctx context.Context) *TRAAPIDailyTrainInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIDailyTrainInfo2ParamsWithHTTPClient creates a new TRAAPIDailyTrainInfo2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIDailyTrainInfo2ParamsWithHTTPClient(client *http.Client) *TRAAPIDailyTrainInfo2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIDailyTrainInfo2Params contains all the parameters to send to the API endpoint
-for the t r a Api daily train info 2 operation typically these are written to a http.Request
+/* TRAAPIDailyTrainInfo2Params contains all the parameters to send to the API endpoint
+ for the t r a Api daily train info 2 operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIDailyTrainInfo2Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢車次的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢車次的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -114,6 +109,32 @@ type TRAAPIDailyTrainInfo2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api daily train info 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTrainInfo2Params) WithDefaults() *TRAAPIDailyTrainInfo2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api daily train info 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTrainInfo2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIDailyTrainInfo2Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api daily train info 2 params
func (o *TRAAPIDailyTrainInfo2Params) WithTimeout(timeout time.Duration) *TRAAPIDailyTrainInfo2Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TRAAPIDailyTrainInfo2Params) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -261,64 +284,68 @@ func (o *TRAAPIDailyTrainInfo2Params) WriteToRequest(r runtime.ClientRequest, re
// 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 TrainDate
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info2_responses.go b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info2_responses.go
index 1d6d6a41..80298ccf 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info2_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info2_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIDailyTrainInfo2Reader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIDailyTrainInfo2NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIDailyTrainInfo2OK() *TRAAPIDailyTrainInfo2OK {
return &TRAAPIDailyTrainInfo2OK{}
}
-/*TRAAPIDailyTrainInfo2OK handles this case with default header values.
+/* TRAAPIDailyTrainInfo2OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIDailyTrainInfo2OK struct {
func (o *TRAAPIDailyTrainInfo2OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTrainInfo/TrainDate/{TrainDate}][%d] tRAApiDailyTrainInfo2OK %+v", 200, o.Payload)
}
-
func (o *TRAAPIDailyTrainInfo2OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIDailyTrainInfo2OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTRAAPIDailyTrainInfo2NotModified creates a TRAAPIDailyTrainInfo2NotModified with default headers values
+func NewTRAAPIDailyTrainInfo2NotModified() *TRAAPIDailyTrainInfo2NotModified {
+ return &TRAAPIDailyTrainInfo2NotModified{}
+}
+
+/* TRAAPIDailyTrainInfo2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIDailyTrainInfo2NotModified struct {
+}
+
+func (o *TRAAPIDailyTrainInfo2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTrainInfo/TrainDate/{TrainDate}][%d] tRAApiDailyTrainInfo2NotModified ", 304)
+}
+
+func (o *TRAAPIDailyTrainInfo2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info3_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info3_parameters.go
index 317729d0..7376d0f5 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info3_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info3_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIDailyTrainInfo3Params creates a new TRAAPIDailyTrainInfo3Params object
-// with the default values initialized.
+// NewTRAAPIDailyTrainInfo3Params creates a new TRAAPIDailyTrainInfo3Params 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 NewTRAAPIDailyTrainInfo3Params() *TRAAPIDailyTrainInfo3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo3Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIDailyTrainInfo3ParamsWithTimeout creates a new TRAAPIDailyTrainInfo3Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIDailyTrainInfo3ParamsWithTimeout(timeout time.Duration) *TRAAPIDailyTrainInfo3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo3Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIDailyTrainInfo3ParamsWithContext creates a new TRAAPIDailyTrainInfo3Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIDailyTrainInfo3ParamsWithContext(ctx context.Context) *TRAAPIDailyTrainInfo3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo3Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIDailyTrainInfo3ParamsWithHTTPClient creates a new TRAAPIDailyTrainInfo3Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIDailyTrainInfo3ParamsWithHTTPClient(client *http.Client) *TRAAPIDailyTrainInfo3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfo3Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIDailyTrainInfo3Params contains all the parameters to send to the API endpoint
-for the t r a Api daily train info 3 operation typically these are written to a http.Request
+/* TRAAPIDailyTrainInfo3Params contains all the parameters to send to the API endpoint
+ for the t r a Api daily train info 3 operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIDailyTrainInfo3Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢車次的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢車次的日期(格式: yyyy-MM-dd)
*/
TrainDate string
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -119,6 +115,32 @@ type TRAAPIDailyTrainInfo3Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api daily train info 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTrainInfo3Params) WithDefaults() *TRAAPIDailyTrainInfo3Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api daily train info 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTrainInfo3Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIDailyTrainInfo3Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api daily train info 3 params
func (o *TRAAPIDailyTrainInfo3Params) WithTimeout(timeout time.Duration) *TRAAPIDailyTrainInfo3Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *TRAAPIDailyTrainInfo3Params) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -277,64 +301,68 @@ func (o *TRAAPIDailyTrainInfo3Params) WriteToRequest(r runtime.ClientRequest, re
// 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 TrainDate
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info3_responses.go b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info3_responses.go
index 13476601..f8aa4d50 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info3_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info3_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIDailyTrainInfo3Reader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIDailyTrainInfo3NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIDailyTrainInfo3OK() *TRAAPIDailyTrainInfo3OK {
return &TRAAPIDailyTrainInfo3OK{}
}
-/*TRAAPIDailyTrainInfo3OK handles this case with default header values.
+/* TRAAPIDailyTrainInfo3OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIDailyTrainInfo3OK struct {
func (o *TRAAPIDailyTrainInfo3OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTrainInfo/TrainNo/{TrainNo}/TrainDate/{TrainDate}][%d] tRAApiDailyTrainInfo3OK %+v", 200, o.Payload)
}
-
func (o *TRAAPIDailyTrainInfo3OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIDailyTrainInfo3OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTRAAPIDailyTrainInfo3NotModified creates a TRAAPIDailyTrainInfo3NotModified with default headers values
+func NewTRAAPIDailyTrainInfo3NotModified() *TRAAPIDailyTrainInfo3NotModified {
+ return &TRAAPIDailyTrainInfo3NotModified{}
+}
+
+/* TRAAPIDailyTrainInfo3NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIDailyTrainInfo3NotModified struct {
+}
+
+func (o *TRAAPIDailyTrainInfo3NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTrainInfo/TrainNo/{TrainNo}/TrainDate/{TrainDate}][%d] tRAApiDailyTrainInfo3NotModified ", 304)
+}
+
+func (o *TRAAPIDailyTrainInfo3NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info_parameters.go
index 4f30e5e0..d34584ba 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIDailyTrainInfoParams creates a new TRAAPIDailyTrainInfoParams object
-// with the default values initialized.
+// NewTRAAPIDailyTrainInfoParams creates a new TRAAPIDailyTrainInfoParams 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 NewTRAAPIDailyTrainInfoParams() *TRAAPIDailyTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfoParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIDailyTrainInfoParamsWithTimeout creates a new TRAAPIDailyTrainInfoParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIDailyTrainInfoParamsWithTimeout(timeout time.Duration) *TRAAPIDailyTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfoParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIDailyTrainInfoParamsWithContext creates a new TRAAPIDailyTrainInfoParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIDailyTrainInfoParamsWithContext(ctx context.Context) *TRAAPIDailyTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfoParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIDailyTrainInfoParamsWithHTTPClient creates a new TRAAPIDailyTrainInfoParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIDailyTrainInfoParamsWithHTTPClient(client *http.Client) *TRAAPIDailyTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIDailyTrainInfoParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIDailyTrainInfoParams contains all the parameters to send to the API endpoint
-for the t r a Api daily train info operation typically these are written to a http.Request
+/* TRAAPIDailyTrainInfoParams contains all the parameters to send to the API endpoint
+ for the t r a Api daily train info operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIDailyTrainInfoParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPIDailyTrainInfoParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api daily train info params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTrainInfoParams) WithDefaults() *TRAAPIDailyTrainInfoParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api daily train info params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIDailyTrainInfoParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIDailyTrainInfoParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api daily train info params
func (o *TRAAPIDailyTrainInfoParams) WithTimeout(timeout time.Duration) *TRAAPIDailyTrainInfoParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPIDailyTrainInfoParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPIDailyTrainInfoParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info_responses.go b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info_responses.go
index 69f4035d..6108ac36 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_daily_train_info_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_daily_train_info_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIDailyTrainInfoReader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIDailyTrainInfoNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIDailyTrainInfoOK() *TRAAPIDailyTrainInfoOK {
return &TRAAPIDailyTrainInfoOK{}
}
-/*TRAAPIDailyTrainInfoOK handles this case with default header values.
+/* TRAAPIDailyTrainInfoOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIDailyTrainInfoOK struct {
func (o *TRAAPIDailyTrainInfoOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTrainInfo/Today][%d] tRAApiDailyTrainInfoOK %+v", 200, o.Payload)
}
-
func (o *TRAAPIDailyTrainInfoOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIDailyTrainInfoOK) readResponse(response runtime.ClientResponse, c
return nil
}
+
+// NewTRAAPIDailyTrainInfoNotModified creates a TRAAPIDailyTrainInfoNotModified with default headers values
+func NewTRAAPIDailyTrainInfoNotModified() *TRAAPIDailyTrainInfoNotModified {
+ return &TRAAPIDailyTrainInfoNotModified{}
+}
+
+/* TRAAPIDailyTrainInfoNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIDailyTrainInfoNotModified struct {
+}
+
+func (o *TRAAPIDailyTrainInfoNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTrainInfo/Today][%d] tRAApiDailyTrainInfoNotModified ", 304)
+}
+
+func (o *TRAAPIDailyTrainInfoNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_general_timetable1_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_general_timetable1_parameters.go
index b48c83d4..0a924b39 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_general_timetable1_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_general_timetable1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIGeneralTimetable1Params creates a new TRAAPIGeneralTimetable1Params object
-// with the default values initialized.
+// NewTRAAPIGeneralTimetable1Params creates a new TRAAPIGeneralTimetable1Params 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 NewTRAAPIGeneralTimetable1Params() *TRAAPIGeneralTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTimetable1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIGeneralTimetable1ParamsWithTimeout creates a new TRAAPIGeneralTimetable1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIGeneralTimetable1ParamsWithTimeout(timeout time.Duration) *TRAAPIGeneralTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTimetable1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIGeneralTimetable1ParamsWithContext creates a new TRAAPIGeneralTimetable1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIGeneralTimetable1ParamsWithContext(ctx context.Context) *TRAAPIGeneralTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTimetable1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIGeneralTimetable1ParamsWithHTTPClient creates a new TRAAPIGeneralTimetable1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIGeneralTimetable1ParamsWithHTTPClient(client *http.Client) *TRAAPIGeneralTimetable1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTimetable1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIGeneralTimetable1Params contains all the parameters to send to the API endpoint
-for the t r a Api general timetable 1 operation typically these are written to a http.Request
+/* TRAAPIGeneralTimetable1Params contains all the parameters to send to the API endpoint
+ for the t r a Api general timetable 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIGeneralTimetable1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -114,6 +109,32 @@ type TRAAPIGeneralTimetable1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api general timetable 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIGeneralTimetable1Params) WithDefaults() *TRAAPIGeneralTimetable1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api general timetable 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIGeneralTimetable1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIGeneralTimetable1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api general timetable 1 params
func (o *TRAAPIGeneralTimetable1Params) WithTimeout(timeout time.Duration) *TRAAPIGeneralTimetable1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TRAAPIGeneralTimetable1Params) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -261,64 +284,68 @@ func (o *TRAAPIGeneralTimetable1Params) WriteToRequest(r runtime.ClientRequest,
// 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 TrainNo
diff --git a/rail/v2/client/t_r_a/t_r_a_api_general_timetable1_responses.go b/rail/v2/client/t_r_a/t_r_a_api_general_timetable1_responses.go
index 8ec934bb..8518bdcd 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_general_timetable1_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_general_timetable1_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIGeneralTimetable1Reader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIGeneralTimetable1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIGeneralTimetable1OK() *TRAAPIGeneralTimetable1OK {
return &TRAAPIGeneralTimetable1OK{}
}
-/*TRAAPIGeneralTimetable1OK handles this case with default header values.
+/* TRAAPIGeneralTimetable1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIGeneralTimetable1OK struct {
func (o *TRAAPIGeneralTimetable1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/GeneralTimetable/TrainNo/{TrainNo}][%d] tRAApiGeneralTimetable1OK %+v", 200, o.Payload)
}
-
func (o *TRAAPIGeneralTimetable1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailGeneralTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIGeneralTimetable1OK) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewTRAAPIGeneralTimetable1NotModified creates a TRAAPIGeneralTimetable1NotModified with default headers values
+func NewTRAAPIGeneralTimetable1NotModified() *TRAAPIGeneralTimetable1NotModified {
+ return &TRAAPIGeneralTimetable1NotModified{}
+}
+
+/* TRAAPIGeneralTimetable1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIGeneralTimetable1NotModified struct {
+}
+
+func (o *TRAAPIGeneralTimetable1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/GeneralTimetable/TrainNo/{TrainNo}][%d] tRAApiGeneralTimetable1NotModified ", 304)
+}
+
+func (o *TRAAPIGeneralTimetable1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_general_timetable_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_general_timetable_parameters.go
index 1379cab1..0acbf66f 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_general_timetable_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_general_timetable_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIGeneralTimetableParams creates a new TRAAPIGeneralTimetableParams object
-// with the default values initialized.
+// NewTRAAPIGeneralTimetableParams creates a new TRAAPIGeneralTimetableParams 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 NewTRAAPIGeneralTimetableParams() *TRAAPIGeneralTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIGeneralTimetableParamsWithTimeout creates a new TRAAPIGeneralTimetableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIGeneralTimetableParamsWithTimeout(timeout time.Duration) *TRAAPIGeneralTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIGeneralTimetableParamsWithContext creates a new TRAAPIGeneralTimetableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIGeneralTimetableParamsWithContext(ctx context.Context) *TRAAPIGeneralTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTimetableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIGeneralTimetableParamsWithHTTPClient creates a new TRAAPIGeneralTimetableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIGeneralTimetableParamsWithHTTPClient(client *http.Client) *TRAAPIGeneralTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTimetableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIGeneralTimetableParams contains all the parameters to send to the API endpoint
-for the t r a Api general timetable operation typically these are written to a http.Request
+/* TRAAPIGeneralTimetableParams contains all the parameters to send to the API endpoint
+ for the t r a Api general timetable operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIGeneralTimetableParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPIGeneralTimetableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api general timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIGeneralTimetableParams) WithDefaults() *TRAAPIGeneralTimetableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api general timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIGeneralTimetableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIGeneralTimetableParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api general timetable params
func (o *TRAAPIGeneralTimetableParams) WithTimeout(timeout time.Duration) *TRAAPIGeneralTimetableParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPIGeneralTimetableParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPIGeneralTimetableParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_general_timetable_responses.go b/rail/v2/client/t_r_a/t_r_a_api_general_timetable_responses.go
index 1e5cc777..d1249f75 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_general_timetable_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_general_timetable_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIGeneralTimetableReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIGeneralTimetableNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIGeneralTimetableOK() *TRAAPIGeneralTimetableOK {
return &TRAAPIGeneralTimetableOK{}
}
-/*TRAAPIGeneralTimetableOK handles this case with default header values.
+/* TRAAPIGeneralTimetableOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIGeneralTimetableOK struct {
func (o *TRAAPIGeneralTimetableOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/GeneralTimetable][%d] tRAApiGeneralTimetableOK %+v", 200, o.Payload)
}
-
func (o *TRAAPIGeneralTimetableOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailGeneralTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIGeneralTimetableOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTRAAPIGeneralTimetableNotModified creates a TRAAPIGeneralTimetableNotModified with default headers values
+func NewTRAAPIGeneralTimetableNotModified() *TRAAPIGeneralTimetableNotModified {
+ return &TRAAPIGeneralTimetableNotModified{}
+}
+
+/* TRAAPIGeneralTimetableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIGeneralTimetableNotModified struct {
+}
+
+func (o *TRAAPIGeneralTimetableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/GeneralTimetable][%d] tRAApiGeneralTimetableNotModified ", 304)
+}
+
+func (o *TRAAPIGeneralTimetableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_general_train_info1_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_general_train_info1_parameters.go
index d663b7e1..f1ca60cb 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_general_train_info1_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_general_train_info1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIGeneralTrainInfo1Params creates a new TRAAPIGeneralTrainInfo1Params object
-// with the default values initialized.
+// NewTRAAPIGeneralTrainInfo1Params creates a new TRAAPIGeneralTrainInfo1Params 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 NewTRAAPIGeneralTrainInfo1Params() *TRAAPIGeneralTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTrainInfo1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIGeneralTrainInfo1ParamsWithTimeout creates a new TRAAPIGeneralTrainInfo1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIGeneralTrainInfo1ParamsWithTimeout(timeout time.Duration) *TRAAPIGeneralTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTrainInfo1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIGeneralTrainInfo1ParamsWithContext creates a new TRAAPIGeneralTrainInfo1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIGeneralTrainInfo1ParamsWithContext(ctx context.Context) *TRAAPIGeneralTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTrainInfo1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIGeneralTrainInfo1ParamsWithHTTPClient creates a new TRAAPIGeneralTrainInfo1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIGeneralTrainInfo1ParamsWithHTTPClient(client *http.Client) *TRAAPIGeneralTrainInfo1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTrainInfo1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIGeneralTrainInfo1Params contains all the parameters to send to the API endpoint
-for the t r a Api general train info 1 operation typically these are written to a http.Request
+/* TRAAPIGeneralTrainInfo1Params contains all the parameters to send to the API endpoint
+ for the t r a Api general train info 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIGeneralTrainInfo1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -114,6 +109,32 @@ type TRAAPIGeneralTrainInfo1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api general train info 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIGeneralTrainInfo1Params) WithDefaults() *TRAAPIGeneralTrainInfo1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api general train info 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIGeneralTrainInfo1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIGeneralTrainInfo1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api general train info 1 params
func (o *TRAAPIGeneralTrainInfo1Params) WithTimeout(timeout time.Duration) *TRAAPIGeneralTrainInfo1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TRAAPIGeneralTrainInfo1Params) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -261,64 +284,68 @@ func (o *TRAAPIGeneralTrainInfo1Params) WriteToRequest(r runtime.ClientRequest,
// 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 TrainNo
diff --git a/rail/v2/client/t_r_a/t_r_a_api_general_train_info1_responses.go b/rail/v2/client/t_r_a/t_r_a_api_general_train_info1_responses.go
index 5227b819..ccaae488 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_general_train_info1_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_general_train_info1_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIGeneralTrainInfo1Reader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIGeneralTrainInfo1NotModified()
+ 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())
}
@@ -40,19 +45,18 @@ func NewTRAAPIGeneralTrainInfo1OK() *TRAAPIGeneralTrainInfo1OK {
return &TRAAPIGeneralTrainInfo1OK{}
}
-/*TRAAPIGeneralTrainInfo1OK handles this case with default header values.
+/* TRAAPIGeneralTrainInfo1OK describes a response with status code 200, with default header values.
Success
*/
type TRAAPIGeneralTrainInfo1OK struct {
- Payload []*models.PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo
+ Payload []*models.PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo
}
func (o *TRAAPIGeneralTrainInfo1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/GeneralTrainInfo/TrainNo/{TrainNo}][%d] tRAApiGeneralTrainInfo1OK %+v", 200, o.Payload)
}
-
-func (o *TRAAPIGeneralTrainInfo1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo {
+func (o *TRAAPIGeneralTrainInfo1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIGeneralTrainInfo1OK) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewTRAAPIGeneralTrainInfo1NotModified creates a TRAAPIGeneralTrainInfo1NotModified with default headers values
+func NewTRAAPIGeneralTrainInfo1NotModified() *TRAAPIGeneralTrainInfo1NotModified {
+ return &TRAAPIGeneralTrainInfo1NotModified{}
+}
+
+/* TRAAPIGeneralTrainInfo1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIGeneralTrainInfo1NotModified struct {
+}
+
+func (o *TRAAPIGeneralTrainInfo1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/GeneralTrainInfo/TrainNo/{TrainNo}][%d] tRAApiGeneralTrainInfo1NotModified ", 304)
+}
+
+func (o *TRAAPIGeneralTrainInfo1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_general_train_info_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_general_train_info_parameters.go
index 6fb24cc0..621aa0f4 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_general_train_info_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_general_train_info_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIGeneralTrainInfoParams creates a new TRAAPIGeneralTrainInfoParams object
-// with the default values initialized.
+// NewTRAAPIGeneralTrainInfoParams creates a new TRAAPIGeneralTrainInfoParams 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 NewTRAAPIGeneralTrainInfoParams() *TRAAPIGeneralTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTrainInfoParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIGeneralTrainInfoParamsWithTimeout creates a new TRAAPIGeneralTrainInfoParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIGeneralTrainInfoParamsWithTimeout(timeout time.Duration) *TRAAPIGeneralTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTrainInfoParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIGeneralTrainInfoParamsWithContext creates a new TRAAPIGeneralTrainInfoParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIGeneralTrainInfoParamsWithContext(ctx context.Context) *TRAAPIGeneralTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTrainInfoParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIGeneralTrainInfoParamsWithHTTPClient creates a new TRAAPIGeneralTrainInfoParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIGeneralTrainInfoParamsWithHTTPClient(client *http.Client) *TRAAPIGeneralTrainInfoParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIGeneralTrainInfoParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIGeneralTrainInfoParams contains all the parameters to send to the API endpoint
-for the t r a Api general train info operation typically these are written to a http.Request
+/* TRAAPIGeneralTrainInfoParams contains all the parameters to send to the API endpoint
+ for the t r a Api general train info operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIGeneralTrainInfoParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPIGeneralTrainInfoParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api general train info params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIGeneralTrainInfoParams) WithDefaults() *TRAAPIGeneralTrainInfoParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api general train info params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIGeneralTrainInfoParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIGeneralTrainInfoParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api general train info params
func (o *TRAAPIGeneralTrainInfoParams) WithTimeout(timeout time.Duration) *TRAAPIGeneralTrainInfoParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPIGeneralTrainInfoParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPIGeneralTrainInfoParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_general_train_info_responses.go b/rail/v2/client/t_r_a/t_r_a_api_general_train_info_responses.go
index 091c370b..17c7fbc7 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_general_train_info_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_general_train_info_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIGeneralTrainInfoReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIGeneralTrainInfoNotModified()
+ 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())
}
@@ -40,19 +45,18 @@ func NewTRAAPIGeneralTrainInfoOK() *TRAAPIGeneralTrainInfoOK {
return &TRAAPIGeneralTrainInfoOK{}
}
-/*TRAAPIGeneralTrainInfoOK handles this case with default header values.
+/* TRAAPIGeneralTrainInfoOK describes a response with status code 200, with default header values.
Success
*/
type TRAAPIGeneralTrainInfoOK struct {
- Payload []*models.PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo
+ Payload []*models.PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo
}
func (o *TRAAPIGeneralTrainInfoOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/GeneralTrainInfo][%d] tRAApiGeneralTrainInfoOK %+v", 200, o.Payload)
}
-
-func (o *TRAAPIGeneralTrainInfoOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo {
+func (o *TRAAPIGeneralTrainInfoOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIGeneralTrainInfoOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTRAAPIGeneralTrainInfoNotModified creates a TRAAPIGeneralTrainInfoNotModified with default headers values
+func NewTRAAPIGeneralTrainInfoNotModified() *TRAAPIGeneralTrainInfoNotModified {
+ return &TRAAPIGeneralTrainInfoNotModified{}
+}
+
+/* TRAAPIGeneralTrainInfoNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIGeneralTrainInfoNotModified struct {
+}
+
+func (o *TRAAPIGeneralTrainInfoNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/GeneralTrainInfo][%d] tRAApiGeneralTrainInfoNotModified ", 304)
+}
+
+func (o *TRAAPIGeneralTrainInfoNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_line_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_line_parameters.go
index e93bea9c..8239bad3 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_line_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_line_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPILineParams creates a new TRAAPILineParams object
-// with the default values initialized.
+// NewTRAAPILineParams creates a new TRAAPILineParams 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 NewTRAAPILineParams() *TRAAPILineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILineParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPILineParamsWithTimeout creates a new TRAAPILineParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPILineParamsWithTimeout(timeout time.Duration) *TRAAPILineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILineParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPILineParamsWithContext creates a new TRAAPILineParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPILineParamsWithContext(ctx context.Context) *TRAAPILineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILineParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPILineParamsWithHTTPClient creates a new TRAAPILineParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPILineParamsWithHTTPClient(client *http.Client) *TRAAPILineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILineParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPILineParams contains all the parameters to send to the API endpoint
-for the t r a Api line operation typically these are written to a http.Request
+/* TRAAPILineParams contains all the parameters to send to the API endpoint
+ for the t r a Api line operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPILineParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPILineParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api line params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPILineParams) WithDefaults() *TRAAPILineParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api line params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPILineParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPILineParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api line params
func (o *TRAAPILineParams) WithTimeout(timeout time.Duration) *TRAAPILineParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPILineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPILineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_line_responses.go b/rail/v2/client/t_r_a/t_r_a_api_line_responses.go
index 0da014eb..9efb8e1a 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_line_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_line_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPILineReader) ReadResponse(response runtime.ClientResponse, consume
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPILineNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPILineOK() *TRAAPILineOK {
return &TRAAPILineOK{}
}
-/*TRAAPILineOK handles this case with default header values.
+/* TRAAPILineOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPILineOK struct {
func (o *TRAAPILineOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/Line][%d] tRAApiLineOK %+v", 200, o.Payload)
}
-
func (o *TRAAPILineOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRALine {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPILineOK) readResponse(response runtime.ClientResponse, consumer ru
return nil
}
+
+// NewTRAAPILineNotModified creates a TRAAPILineNotModified with default headers values
+func NewTRAAPILineNotModified() *TRAAPILineNotModified {
+ return &TRAAPILineNotModified{}
+}
+
+/* TRAAPILineNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPILineNotModified struct {
+}
+
+func (o *TRAAPILineNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/Line][%d] tRAApiLineNotModified ", 304)
+}
+
+func (o *TRAAPILineNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_live_board1_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_live_board1_parameters.go
index 40fd6b88..f3333ded 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_live_board1_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_live_board1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPILiveBoard1Params creates a new TRAAPILiveBoard1Params object
-// with the default values initialized.
+// NewTRAAPILiveBoard1Params creates a new TRAAPILiveBoard1Params 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 NewTRAAPILiveBoard1Params() *TRAAPILiveBoard1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveBoard1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPILiveBoard1ParamsWithTimeout creates a new TRAAPILiveBoard1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPILiveBoard1ParamsWithTimeout(timeout time.Duration) *TRAAPILiveBoard1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveBoard1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPILiveBoard1ParamsWithContext creates a new TRAAPILiveBoard1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPILiveBoard1ParamsWithContext(ctx context.Context) *TRAAPILiveBoard1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveBoard1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPILiveBoard1ParamsWithHTTPClient creates a new TRAAPILiveBoard1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPILiveBoard1ParamsWithHTTPClient(client *http.Client) *TRAAPILiveBoard1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveBoard1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPILiveBoard1Params contains all the parameters to send to the API endpoint
-for the t r a Api live board 1 operation typically these are written to a http.Request
+/* TRAAPILiveBoard1Params contains all the parameters to send to the API endpoint
+ for the t r a Api live board 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPILiveBoard1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*StationID
- 車站代碼
+ /* StationID.
+
+ 車站代碼
*/
StationID string
@@ -114,6 +109,32 @@ type TRAAPILiveBoard1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api live board 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPILiveBoard1Params) WithDefaults() *TRAAPILiveBoard1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api live board 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPILiveBoard1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPILiveBoard1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api live board 1 params
func (o *TRAAPILiveBoard1Params) WithTimeout(timeout time.Duration) *TRAAPILiveBoard1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TRAAPILiveBoard1Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -261,64 +284,68 @@ func (o *TRAAPILiveBoard1Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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 StationID
diff --git a/rail/v2/client/t_r_a/t_r_a_api_live_board1_responses.go b/rail/v2/client/t_r_a/t_r_a_api_live_board1_responses.go
index a0c05147..dc1cb650 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_live_board1_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_live_board1_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPILiveBoard1Reader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPILiveBoard1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPILiveBoard1OK() *TRAAPILiveBoard1OK {
return &TRAAPILiveBoard1OK{}
}
-/*TRAAPILiveBoard1OK handles this case with default header values.
+/* TRAAPILiveBoard1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPILiveBoard1OK struct {
func (o *TRAAPILiveBoard1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/LiveBoard/Station/{StationID}][%d] tRAApiLiveBoard1OK %+v", 200, o.Payload)
}
-
func (o *TRAAPILiveBoard1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailLiveBoard {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPILiveBoard1OK) readResponse(response runtime.ClientResponse, consu
return nil
}
+
+// NewTRAAPILiveBoard1NotModified creates a TRAAPILiveBoard1NotModified with default headers values
+func NewTRAAPILiveBoard1NotModified() *TRAAPILiveBoard1NotModified {
+ return &TRAAPILiveBoard1NotModified{}
+}
+
+/* TRAAPILiveBoard1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPILiveBoard1NotModified struct {
+}
+
+func (o *TRAAPILiveBoard1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/LiveBoard/Station/{StationID}][%d] tRAApiLiveBoard1NotModified ", 304)
+}
+
+func (o *TRAAPILiveBoard1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_live_board_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_live_board_parameters.go
index 28ea4d0e..c2b5cbd8 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_live_board_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_live_board_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPILiveBoardParams creates a new TRAAPILiveBoardParams object
-// with the default values initialized.
+// NewTRAAPILiveBoardParams creates a new TRAAPILiveBoardParams 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 NewTRAAPILiveBoardParams() *TRAAPILiveBoardParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveBoardParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPILiveBoardParamsWithTimeout creates a new TRAAPILiveBoardParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPILiveBoardParamsWithTimeout(timeout time.Duration) *TRAAPILiveBoardParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveBoardParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPILiveBoardParamsWithContext creates a new TRAAPILiveBoardParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPILiveBoardParamsWithContext(ctx context.Context) *TRAAPILiveBoardParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveBoardParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPILiveBoardParamsWithHTTPClient creates a new TRAAPILiveBoardParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPILiveBoardParamsWithHTTPClient(client *http.Client) *TRAAPILiveBoardParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveBoardParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPILiveBoardParams contains all the parameters to send to the API endpoint
-for the t r a Api live board operation typically these are written to a http.Request
+/* TRAAPILiveBoardParams contains all the parameters to send to the API endpoint
+ for the t r a Api live board operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPILiveBoardParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPILiveBoardParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api live board params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPILiveBoardParams) WithDefaults() *TRAAPILiveBoardParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api live board params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPILiveBoardParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPILiveBoardParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api live board params
func (o *TRAAPILiveBoardParams) WithTimeout(timeout time.Duration) *TRAAPILiveBoardParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPILiveBoardParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPILiveBoardParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_live_board_responses.go b/rail/v2/client/t_r_a/t_r_a_api_live_board_responses.go
index f27d053f..6876675e 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_live_board_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_live_board_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPILiveBoardReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPILiveBoardNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPILiveBoardOK() *TRAAPILiveBoardOK {
return &TRAAPILiveBoardOK{}
}
-/*TRAAPILiveBoardOK handles this case with default header values.
+/* TRAAPILiveBoardOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPILiveBoardOK struct {
func (o *TRAAPILiveBoardOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/LiveBoard][%d] tRAApiLiveBoardOK %+v", 200, o.Payload)
}
-
func (o *TRAAPILiveBoardOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailLiveBoard {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPILiveBoardOK) readResponse(response runtime.ClientResponse, consum
return nil
}
+
+// NewTRAAPILiveBoardNotModified creates a TRAAPILiveBoardNotModified with default headers values
+func NewTRAAPILiveBoardNotModified() *TRAAPILiveBoardNotModified {
+ return &TRAAPILiveBoardNotModified{}
+}
+
+/* TRAAPILiveBoardNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPILiveBoardNotModified struct {
+}
+
+func (o *TRAAPILiveBoardNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/LiveBoard][%d] tRAApiLiveBoardNotModified ", 304)
+}
+
+func (o *TRAAPILiveBoardNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_live_train_delay_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_live_train_delay_parameters.go
index 007bfcbb..73a07ef0 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_live_train_delay_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_live_train_delay_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPILiveTrainDelayParams creates a new TRAAPILiveTrainDelayParams object
-// with the default values initialized.
+// NewTRAAPILiveTrainDelayParams creates a new TRAAPILiveTrainDelayParams 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 NewTRAAPILiveTrainDelayParams() *TRAAPILiveTrainDelayParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveTrainDelayParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPILiveTrainDelayParamsWithTimeout creates a new TRAAPILiveTrainDelayParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPILiveTrainDelayParamsWithTimeout(timeout time.Duration) *TRAAPILiveTrainDelayParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveTrainDelayParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPILiveTrainDelayParamsWithContext creates a new TRAAPILiveTrainDelayParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPILiveTrainDelayParamsWithContext(ctx context.Context) *TRAAPILiveTrainDelayParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveTrainDelayParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPILiveTrainDelayParamsWithHTTPClient creates a new TRAAPILiveTrainDelayParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPILiveTrainDelayParamsWithHTTPClient(client *http.Client) *TRAAPILiveTrainDelayParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPILiveTrainDelayParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPILiveTrainDelayParams contains all the parameters to send to the API endpoint
-for the t r a Api live train delay operation typically these are written to a http.Request
+/* TRAAPILiveTrainDelayParams contains all the parameters to send to the API endpoint
+ for the t r a Api live train delay operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPILiveTrainDelayParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPILiveTrainDelayParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api live train delay params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPILiveTrainDelayParams) WithDefaults() *TRAAPILiveTrainDelayParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api live train delay params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPILiveTrainDelayParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPILiveTrainDelayParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api live train delay params
func (o *TRAAPILiveTrainDelayParams) WithTimeout(timeout time.Duration) *TRAAPILiveTrainDelayParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPILiveTrainDelayParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPILiveTrainDelayParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_live_train_delay_responses.go b/rail/v2/client/t_r_a/t_r_a_api_live_train_delay_responses.go
index 135da173..7ba8079d 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_live_train_delay_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_live_train_delay_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPILiveTrainDelayReader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPILiveTrainDelayNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPILiveTrainDelayOK() *TRAAPILiveTrainDelayOK {
return &TRAAPILiveTrainDelayOK{}
}
-/*TRAAPILiveTrainDelayOK handles this case with default header values.
+/* TRAAPILiveTrainDelayOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPILiveTrainDelayOK struct {
func (o *TRAAPILiveTrainDelayOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/LiveTrainDelay][%d] tRAApiLiveTrainDelayOK %+v", 200, o.Payload)
}
-
func (o *TRAAPILiveTrainDelayOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailLiveTrainDelay {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPILiveTrainDelayOK) readResponse(response runtime.ClientResponse, c
return nil
}
+
+// NewTRAAPILiveTrainDelayNotModified creates a TRAAPILiveTrainDelayNotModified with default headers values
+func NewTRAAPILiveTrainDelayNotModified() *TRAAPILiveTrainDelayNotModified {
+ return &TRAAPILiveTrainDelayNotModified{}
+}
+
+/* TRAAPILiveTrainDelayNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPILiveTrainDelayNotModified struct {
+}
+
+func (o *TRAAPILiveTrainDelayNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/LiveTrainDelay][%d] tRAApiLiveTrainDelayNotModified ", 304)
+}
+
+func (o *TRAAPILiveTrainDelayNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_network_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_network_parameters.go
index 754303c6..41d22f1d 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_network_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_network_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPINetworkParams creates a new TRAAPINetworkParams object
-// with the default values initialized.
+// NewTRAAPINetworkParams creates a new TRAAPINetworkParams 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 NewTRAAPINetworkParams() *TRAAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPINetworkParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPINetworkParamsWithTimeout creates a new TRAAPINetworkParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPINetworkParamsWithTimeout(timeout time.Duration) *TRAAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPINetworkParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPINetworkParamsWithContext creates a new TRAAPINetworkParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPINetworkParamsWithContext(ctx context.Context) *TRAAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPINetworkParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPINetworkParamsWithHTTPClient creates a new TRAAPINetworkParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPINetworkParamsWithHTTPClient(client *http.Client) *TRAAPINetworkParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPINetworkParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPINetworkParams contains all the parameters to send to the API endpoint
-for the t r a Api network operation typically these are written to a http.Request
+/* TRAAPINetworkParams contains all the parameters to send to the API endpoint
+ for the t r a Api network operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPINetworkParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPINetworkParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api network params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPINetworkParams) WithDefaults() *TRAAPINetworkParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api network params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPINetworkParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPINetworkParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api network params
func (o *TRAAPINetworkParams) WithTimeout(timeout time.Duration) *TRAAPINetworkParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPINetworkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPINetworkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_network_responses.go b/rail/v2/client/t_r_a/t_r_a_api_network_responses.go
index afa1fbe3..e31253a2 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_network_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_network_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPINetworkReader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPINetworkNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPINetworkOK() *TRAAPINetworkOK {
return &TRAAPINetworkOK{}
}
-/*TRAAPINetworkOK handles this case with default header values.
+/* TRAAPINetworkOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPINetworkOK struct {
func (o *TRAAPINetworkOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/Network][%d] tRAApiNetworkOK %+v", 200, o.Payload)
}
-
func (o *TRAAPINetworkOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRANetwork {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPINetworkOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewTRAAPINetworkNotModified creates a TRAAPINetworkNotModified with default headers values
+func NewTRAAPINetworkNotModified() *TRAAPINetworkNotModified {
+ return &TRAAPINetworkNotModified{}
+}
+
+/* TRAAPINetworkNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPINetworkNotModified struct {
+}
+
+func (o *TRAAPINetworkNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/Network][%d] tRAApiNetworkNotModified ", 304)
+}
+
+func (o *TRAAPINetworkNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_o_d_daily_timetable_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_o_d_daily_timetable_parameters.go
index 2f383185..dd5ab103 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_o_d_daily_timetable_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_o_d_daily_timetable_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIODDailyTimetableParams creates a new TRAAPIODDailyTimetableParams object
-// with the default values initialized.
+// NewTRAAPIODDailyTimetableParams creates a new TRAAPIODDailyTimetableParams 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 NewTRAAPIODDailyTimetableParams() *TRAAPIODDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIODDailyTimetableParamsWithTimeout creates a new TRAAPIODDailyTimetableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIODDailyTimetableParamsWithTimeout(timeout time.Duration) *TRAAPIODDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIODDailyTimetableParamsWithContext creates a new TRAAPIODDailyTimetableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIODDailyTimetableParamsWithContext(ctx context.Context) *TRAAPIODDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODDailyTimetableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIODDailyTimetableParamsWithHTTPClient creates a new TRAAPIODDailyTimetableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIODDailyTimetableParamsWithHTTPClient(client *http.Client) *TRAAPIODDailyTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODDailyTimetableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIODDailyTimetableParams contains all the parameters to send to the API endpoint
-for the t r a Api o d daily timetable operation typically these are written to a http.Request
+/* TRAAPIODDailyTimetableParams contains all the parameters to send to the API endpoint
+ for the t r a Api o d daily timetable operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIODDailyTimetableParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*DestinationStationID
- 迄點車站代碼
+ /* DestinationStationID.
+
+ 迄點車站代碼
*/
DestinationStationID string
- /*OriginStationID
- 起點車站代碼
+ /* OriginStationID.
+
+ 起點車站代碼
*/
OriginStationID string
- /*TrainDate
- 欲查詢的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -124,6 +121,32 @@ type TRAAPIODDailyTimetableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api o d daily timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIODDailyTimetableParams) WithDefaults() *TRAAPIODDailyTimetableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api o d daily timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIODDailyTimetableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIODDailyTimetableParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api o d daily timetable params
func (o *TRAAPIODDailyTimetableParams) WithTimeout(timeout time.Duration) *TRAAPIODDailyTimetableParams {
o.SetTimeout(timeout)
@@ -268,22 +291,24 @@ func (o *TRAAPIODDailyTimetableParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -293,64 +318,68 @@ func (o *TRAAPIODDailyTimetableParams) WriteToRequest(r runtime.ClientRequest, r
// 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 DestinationStationID
diff --git a/rail/v2/client/t_r_a/t_r_a_api_o_d_daily_timetable_responses.go b/rail/v2/client/t_r_a/t_r_a_api_o_d_daily_timetable_responses.go
index bba221da..7c3bef3e 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_o_d_daily_timetable_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_o_d_daily_timetable_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIODDailyTimetableReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIODDailyTimetableNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIODDailyTimetableOK() *TRAAPIODDailyTimetableOK {
return &TRAAPIODDailyTimetableOK{}
}
-/*TRAAPIODDailyTimetableOK handles this case with default header values.
+/* TRAAPIODDailyTimetableOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIODDailyTimetableOK struct {
func (o *TRAAPIODDailyTimetableOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/OD/{OriginStationID}/to/{DestinationStationID}/{TrainDate}][%d] tRAApiODDailyTimetableOK %+v", 200, o.Payload)
}
-
func (o *TRAAPIODDailyTimetableOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailODDailyTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIODDailyTimetableOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTRAAPIODDailyTimetableNotModified creates a TRAAPIODDailyTimetableNotModified with default headers values
+func NewTRAAPIODDailyTimetableNotModified() *TRAAPIODDailyTimetableNotModified {
+ return &TRAAPIODDailyTimetableNotModified{}
+}
+
+/* TRAAPIODDailyTimetableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIODDailyTimetableNotModified struct {
+}
+
+func (o *TRAAPIODDailyTimetableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/OD/{OriginStationID}/to/{DestinationStationID}/{TrainDate}][%d] tRAApiODDailyTimetableNotModified ", 304)
+}
+
+func (o *TRAAPIODDailyTimetableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station1_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station1_parameters.go
index 9d57c5cf..f5c591ae 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station1_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station1_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIODFareStation1Params creates a new TRAAPIODFareStation1Params object
-// with the default values initialized.
+// NewTRAAPIODFareStation1Params creates a new TRAAPIODFareStation1Params 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 NewTRAAPIODFareStation1Params() *TRAAPIODFareStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODFareStation1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIODFareStation1ParamsWithTimeout creates a new TRAAPIODFareStation1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIODFareStation1ParamsWithTimeout(timeout time.Duration) *TRAAPIODFareStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODFareStation1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIODFareStation1ParamsWithContext creates a new TRAAPIODFareStation1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIODFareStation1ParamsWithContext(ctx context.Context) *TRAAPIODFareStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODFareStation1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIODFareStation1ParamsWithHTTPClient creates a new TRAAPIODFareStation1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIODFareStation1ParamsWithHTTPClient(client *http.Client) *TRAAPIODFareStation1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODFareStation1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIODFareStation1Params contains all the parameters to send to the API endpoint
-for the t r a Api o d fare station 1 operation typically these are written to a http.Request
+/* TRAAPIODFareStation1Params contains all the parameters to send to the API endpoint
+ for the t r a Api o d fare station 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIODFareStation1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPIODFareStation1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api o d fare station 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIODFareStation1Params) WithDefaults() *TRAAPIODFareStation1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api o d fare station 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIODFareStation1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIODFareStation1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api o d fare station 1 params
func (o *TRAAPIODFareStation1Params) WithTimeout(timeout time.Duration) *TRAAPIODFareStation1Params {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPIODFareStation1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPIODFareStation1Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station1_responses.go b/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station1_responses.go
index ba15f119..5446425d 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station1_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station1_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIODFareStation1Reader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIODFareStation1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIODFareStation1OK() *TRAAPIODFareStation1OK {
return &TRAAPIODFareStation1OK{}
}
-/*TRAAPIODFareStation1OK handles this case with default header values.
+/* TRAAPIODFareStation1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIODFareStation1OK struct {
func (o *TRAAPIODFareStation1OK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/ODFare][%d] tRAApiODFareStation1OK %+v", 200, o.Payload)
}
-
func (o *TRAAPIODFareStation1OK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailODFare {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIODFareStation1OK) readResponse(response runtime.ClientResponse, c
return nil
}
+
+// NewTRAAPIODFareStation1NotModified creates a TRAAPIODFareStation1NotModified with default headers values
+func NewTRAAPIODFareStation1NotModified() *TRAAPIODFareStation1NotModified {
+ return &TRAAPIODFareStation1NotModified{}
+}
+
+/* TRAAPIODFareStation1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIODFareStation1NotModified struct {
+}
+
+func (o *TRAAPIODFareStation1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/ODFare][%d] tRAApiODFareStation1NotModified ", 304)
+}
+
+func (o *TRAAPIODFareStation1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station_parameters.go
index 3377542d..090baff8 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIODFareStationParams creates a new TRAAPIODFareStationParams object
-// with the default values initialized.
+// NewTRAAPIODFareStationParams creates a new TRAAPIODFareStationParams 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 NewTRAAPIODFareStationParams() *TRAAPIODFareStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODFareStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIODFareStationParamsWithTimeout creates a new TRAAPIODFareStationParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIODFareStationParamsWithTimeout(timeout time.Duration) *TRAAPIODFareStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODFareStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIODFareStationParamsWithContext creates a new TRAAPIODFareStationParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIODFareStationParamsWithContext(ctx context.Context) *TRAAPIODFareStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODFareStationParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIODFareStationParamsWithHTTPClient creates a new TRAAPIODFareStationParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIODFareStationParamsWithHTTPClient(client *http.Client) *TRAAPIODFareStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIODFareStationParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIODFareStationParams contains all the parameters to send to the API endpoint
-for the t r a Api o d fare station operation typically these are written to a http.Request
+/* TRAAPIODFareStationParams contains all the parameters to send to the API endpoint
+ for the t r a Api o d fare station operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIODFareStationParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*DestinationStationID
- 迄點車站代碼
+ /* DestinationStationID.
+
+ 迄點車站代碼
*/
DestinationStationID string
- /*OriginStationID
- 起點車站代碼
+ /* OriginStationID.
+
+ 起點車站代碼
*/
OriginStationID string
@@ -119,6 +115,32 @@ type TRAAPIODFareStationParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api o d fare station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIODFareStationParams) WithDefaults() *TRAAPIODFareStationParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api o d fare station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIODFareStationParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIODFareStationParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api o d fare station params
func (o *TRAAPIODFareStationParams) WithTimeout(timeout time.Duration) *TRAAPIODFareStationParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *TRAAPIODFareStationParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -277,64 +301,68 @@ func (o *TRAAPIODFareStationParams) WriteToRequest(r runtime.ClientRequest, reg
// 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 DestinationStationID
diff --git a/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station_responses.go b/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station_responses.go
index 0e875531..415fed0d 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_o_d_fare_station_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIODFareStationReader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIODFareStationNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIODFareStationOK() *TRAAPIODFareStationOK {
return &TRAAPIODFareStationOK{}
}
-/*TRAAPIODFareStationOK handles this case with default header values.
+/* TRAAPIODFareStationOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIODFareStationOK struct {
func (o *TRAAPIODFareStationOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/ODFare/{OriginStationID}/to/{DestinationStationID}][%d] tRAApiODFareStationOK %+v", 200, o.Payload)
}
-
func (o *TRAAPIODFareStationOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailODFare {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIODFareStationOK) readResponse(response runtime.ClientResponse, co
return nil
}
+
+// NewTRAAPIODFareStationNotModified creates a TRAAPIODFareStationNotModified with default headers values
+func NewTRAAPIODFareStationNotModified() *TRAAPIODFareStationNotModified {
+ return &TRAAPIODFareStationNotModified{}
+}
+
+/* TRAAPIODFareStationNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIODFareStationNotModified struct {
+}
+
+func (o *TRAAPIODFareStationNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/ODFare/{OriginStationID}/to/{DestinationStationID}][%d] tRAApiODFareStationNotModified ", 304)
+}
+
+func (o *TRAAPIODFareStationNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_shape_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_shape_parameters.go
index 8979c4ee..3c6bf62e 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_shape_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_shape_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIShapeParams creates a new TRAAPIShapeParams object
-// with the default values initialized.
+// NewTRAAPIShapeParams creates a new TRAAPIShapeParams 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 NewTRAAPIShapeParams() *TRAAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIShapeParamsWithTimeout creates a new TRAAPIShapeParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIShapeParamsWithTimeout(timeout time.Duration) *TRAAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIShapeParamsWithContext creates a new TRAAPIShapeParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIShapeParamsWithContext(ctx context.Context) *TRAAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIShapeParamsWithHTTPClient creates a new TRAAPIShapeParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIShapeParamsWithHTTPClient(client *http.Client) *TRAAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIShapeParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIShapeParams contains all the parameters to send to the API endpoint
-for the t r a Api shape operation typically these are written to a http.Request
+/* TRAAPIShapeParams contains all the parameters to send to the API endpoint
+ for the t r a Api shape operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIShapeParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPIShapeParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIShapeParams) WithDefaults() *TRAAPIShapeParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIShapeParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIShapeParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api shape params
func (o *TRAAPIShapeParams) WithTimeout(timeout time.Duration) *TRAAPIShapeParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPIShapeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_shape_responses.go b/rail/v2/client/t_r_a/t_r_a_api_shape_responses.go
index 31c4d5be..0ecece2b 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_shape_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_shape_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIShapeReader) ReadResponse(response runtime.ClientResponse, consum
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIShapeNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIShapeOK() *TRAAPIShapeOK {
return &TRAAPIShapeOK{}
}
-/*TRAAPIShapeOK handles this case with default header values.
+/* TRAAPIShapeOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIShapeOK struct {
func (o *TRAAPIShapeOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/Shape][%d] tRAApiShapeOK %+v", 200, o.Payload)
}
-
func (o *TRAAPIShapeOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRATRAShape {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIShapeOK) readResponse(response runtime.ClientResponse, consumer r
return nil
}
+
+// NewTRAAPIShapeNotModified creates a TRAAPIShapeNotModified with default headers values
+func NewTRAAPIShapeNotModified() *TRAAPIShapeNotModified {
+ return &TRAAPIShapeNotModified{}
+}
+
+/* TRAAPIShapeNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIShapeNotModified struct {
+}
+
+func (o *TRAAPIShapeNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/Shape][%d] tRAApiShapeNotModified ", 304)
+}
+
+func (o *TRAAPIShapeNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_station_of_line_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_station_of_line_parameters.go
index d7085500..afbd2802 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_station_of_line_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_station_of_line_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIStationOfLineParams creates a new TRAAPIStationOfLineParams object
-// with the default values initialized.
+// NewTRAAPIStationOfLineParams creates a new TRAAPIStationOfLineParams 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 NewTRAAPIStationOfLineParams() *TRAAPIStationOfLineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationOfLineParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIStationOfLineParamsWithTimeout creates a new TRAAPIStationOfLineParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIStationOfLineParamsWithTimeout(timeout time.Duration) *TRAAPIStationOfLineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationOfLineParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIStationOfLineParamsWithContext creates a new TRAAPIStationOfLineParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIStationOfLineParamsWithContext(ctx context.Context) *TRAAPIStationOfLineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationOfLineParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIStationOfLineParamsWithHTTPClient creates a new TRAAPIStationOfLineParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIStationOfLineParamsWithHTTPClient(client *http.Client) *TRAAPIStationOfLineParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationOfLineParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIStationOfLineParams contains all the parameters to send to the API endpoint
-for the t r a Api station of line operation typically these are written to a http.Request
+/* TRAAPIStationOfLineParams contains all the parameters to send to the API endpoint
+ for the t r a Api station of line operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIStationOfLineParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPIStationOfLineParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api station of line params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIStationOfLineParams) WithDefaults() *TRAAPIStationOfLineParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api station of line params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIStationOfLineParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIStationOfLineParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api station of line params
func (o *TRAAPIStationOfLineParams) WithTimeout(timeout time.Duration) *TRAAPIStationOfLineParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPIStationOfLineParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPIStationOfLineParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_station_of_line_responses.go b/rail/v2/client/t_r_a/t_r_a_api_station_of_line_responses.go
index c3cb07a9..bad296b8 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_station_of_line_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_station_of_line_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIStationOfLineReader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIStationOfLineNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIStationOfLineOK() *TRAAPIStationOfLineOK {
return &TRAAPIStationOfLineOK{}
}
-/*TRAAPIStationOfLineOK handles this case with default header values.
+/* TRAAPIStationOfLineOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIStationOfLineOK struct {
func (o *TRAAPIStationOfLineOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/StationOfLine][%d] tRAApiStationOfLineOK %+v", 200, o.Payload)
}
-
func (o *TRAAPIStationOfLineOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRAStationOfLine {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIStationOfLineOK) readResponse(response runtime.ClientResponse, co
return nil
}
+
+// NewTRAAPIStationOfLineNotModified creates a TRAAPIStationOfLineNotModified with default headers values
+func NewTRAAPIStationOfLineNotModified() *TRAAPIStationOfLineNotModified {
+ return &TRAAPIStationOfLineNotModified{}
+}
+
+/* TRAAPIStationOfLineNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIStationOfLineNotModified struct {
+}
+
+func (o *TRAAPIStationOfLineNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/StationOfLine][%d] tRAApiStationOfLineNotModified ", 304)
+}
+
+func (o *TRAAPIStationOfLineNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_station_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_station_parameters.go
index 9a988ea8..34d24a65 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_station_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_station_parameters.go
@@ -17,95 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIStationParams creates a new TRAAPIStationParams object
-// with the default values initialized.
+// NewTRAAPIStationParams creates a new TRAAPIStationParams 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 NewTRAAPIStationParams() *TRAAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIStationParamsWithTimeout creates a new TRAAPIStationParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIStationParamsWithTimeout(timeout time.Duration) *TRAAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIStationParamsWithContext creates a new TRAAPIStationParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIStationParamsWithContext(ctx context.Context) *TRAAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIStationParamsWithHTTPClient creates a new TRAAPIStationParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIStationParamsWithHTTPClient(client *http.Client) *TRAAPIStationParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIStationParams contains all the parameters to send to the API endpoint
-for the t r a Api station operation typically these are written to a http.Request
+/* TRAAPIStationParams contains all the parameters to send to the API endpoint
+ for the t r a Api station operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIStationParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
- */
- DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +103,32 @@ type TRAAPIStationParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIStationParams) WithDefaults() *TRAAPIStationParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api station params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIStationParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIStationParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api station params
func (o *TRAAPIStationParams) WithTimeout(timeout time.Duration) *TRAAPIStationParams {
o.SetTimeout(timeout)
@@ -202,17 +217,6 @@ func (o *TRAAPIStationParams) SetDollarSkip(dollarSkip *string) {
o.DollarSkip = dollarSkip
}
-// WithDollarSpatialFilter adds the dollarSpatialFilter to the t r a Api station params
-func (o *TRAAPIStationParams) WithDollarSpatialFilter(dollarSpatialFilter *string) *TRAAPIStationParams {
- o.SetDollarSpatialFilter(dollarSpatialFilter)
- return o
-}
-
-// SetDollarSpatialFilter adds the dollarSpatialFilter to the t r a Api station params
-func (o *TRAAPIStationParams) SetDollarSpatialFilter(dollarSpatialFilter *string) {
- o.DollarSpatialFilter = dollarSpatialFilter
-}
-
// WithDollarTop adds the dollarTop to the t r a Api station params
func (o *TRAAPIStationParams) WithDollarTop(dollarTop *int64) *TRAAPIStationParams {
o.SetDollarTop(dollarTop)
@@ -236,22 +240,24 @@ func (o *TRAAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
@@ -261,80 +267,68 @@ func (o *TRAAPIStationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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.DollarSpatialFilter != nil {
- // query param $spatialFilter
- var qrDollarSpatialFilter string
- if o.DollarSpatialFilter != nil {
- qrDollarSpatialFilter = *o.DollarSpatialFilter
- }
- qDollarSpatialFilter := qrDollarSpatialFilter
- if qDollarSpatialFilter != "" {
- if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); err != nil {
+ 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_station_responses.go b/rail/v2/client/t_r_a/t_r_a_api_station_responses.go
index d7f6087a..cbfac5c8 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_station_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_station_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIStationReader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIStationNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIStationOK() *TRAAPIStationOK {
return &TRAAPIStationOK{}
}
-/*TRAAPIStationOK handles this case with default header values.
+/* TRAAPIStationOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIStationOK struct {
func (o *TRAAPIStationOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/Station][%d] tRAApiStationOK %+v", 200, o.Payload)
}
-
func (o *TRAAPIStationOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailStation {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIStationOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewTRAAPIStationNotModified creates a TRAAPIStationNotModified with default headers values
+func NewTRAAPIStationNotModified() *TRAAPIStationNotModified {
+ return &TRAAPIStationNotModified{}
+}
+
+/* TRAAPIStationNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIStationNotModified struct {
+}
+
+func (o *TRAAPIStationNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/Station][%d] tRAApiStationNotModified ", 304)
+}
+
+func (o *TRAAPIStationNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_station_timetable_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_station_timetable_parameters.go
index a428291b..a79f36d1 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_station_timetable_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_station_timetable_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPIStationTimetableParams creates a new TRAAPIStationTimetableParams object
-// with the default values initialized.
+// NewTRAAPIStationTimetableParams creates a new TRAAPIStationTimetableParams 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 NewTRAAPIStationTimetableParams() *TRAAPIStationTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPIStationTimetableParamsWithTimeout creates a new TRAAPIStationTimetableParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPIStationTimetableParamsWithTimeout(timeout time.Duration) *TRAAPIStationTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationTimetableParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPIStationTimetableParamsWithContext creates a new TRAAPIStationTimetableParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPIStationTimetableParamsWithContext(ctx context.Context) *TRAAPIStationTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationTimetableParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPIStationTimetableParamsWithHTTPClient creates a new TRAAPIStationTimetableParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPIStationTimetableParamsWithHTTPClient(client *http.Client) *TRAAPIStationTimetableParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPIStationTimetableParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPIStationTimetableParams contains all the parameters to send to the API endpoint
-for the t r a Api station timetable operation typically these are written to a http.Request
+/* TRAAPIStationTimetableParams contains all the parameters to send to the API endpoint
+ for the t r a Api station timetable operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPIStationTimetableParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*StationID
- 車站代號
+ /* StationID.
+
+ 車站代號
*/
StationID string
- /*TrainDate
- 時刻表日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 時刻表日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -119,6 +115,32 @@ type TRAAPIStationTimetableParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api station timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIStationTimetableParams) WithDefaults() *TRAAPIStationTimetableParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api station timetable params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPIStationTimetableParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPIStationTimetableParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api station timetable params
func (o *TRAAPIStationTimetableParams) WithTimeout(timeout time.Duration) *TRAAPIStationTimetableParams {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *TRAAPIStationTimetableParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -277,64 +301,68 @@ func (o *TRAAPIStationTimetableParams) WriteToRequest(r runtime.ClientRequest, r
// 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 StationID
diff --git a/rail/v2/client/t_r_a/t_r_a_api_station_timetable_responses.go b/rail/v2/client/t_r_a/t_r_a_api_station_timetable_responses.go
index 4c7e90a2..3baf397b 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_station_timetable_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_station_timetable_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPIStationTimetableReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPIStationTimetableNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPIStationTimetableOK() *TRAAPIStationTimetableOK {
return &TRAAPIStationTimetableOK{}
}
-/*TRAAPIStationTimetableOK handles this case with default header values.
+/* TRAAPIStationTimetableOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPIStationTimetableOK struct {
func (o *TRAAPIStationTimetableOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/Station/{StationID}/{TrainDate}][%d] tRAApiStationTimetableOK %+v", 200, o.Payload)
}
-
func (o *TRAAPIStationTimetableOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRARailStationTimetable {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPIStationTimetableOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTRAAPIStationTimetableNotModified creates a TRAAPIStationTimetableNotModified with default headers values
+func NewTRAAPIStationTimetableNotModified() *TRAAPIStationTimetableNotModified {
+ return &TRAAPIStationTimetableNotModified{}
+}
+
+/* TRAAPIStationTimetableNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPIStationTimetableNotModified struct {
+}
+
+func (o *TRAAPIStationTimetableNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/DailyTimetable/Station/{StationID}/{TrainDate}][%d] tRAApiStationTimetableNotModified ", 304)
+}
+
+func (o *TRAAPIStationTimetableNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/client/t_r_a/t_r_a_api_train_type_parameters.go b/rail/v2/client/t_r_a/t_r_a_api_train_type_parameters.go
index 07a18648..d61e81c5 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_train_type_parameters.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_train_type_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTRAAPITrainTypeParams creates a new TRAAPITrainTypeParams object
-// with the default values initialized.
+// NewTRAAPITrainTypeParams creates a new TRAAPITrainTypeParams 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 NewTRAAPITrainTypeParams() *TRAAPITrainTypeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPITrainTypeParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTRAAPITrainTypeParamsWithTimeout creates a new TRAAPITrainTypeParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTRAAPITrainTypeParamsWithTimeout(timeout time.Duration) *TRAAPITrainTypeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPITrainTypeParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTRAAPITrainTypeParamsWithContext creates a new TRAAPITrainTypeParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTRAAPITrainTypeParamsWithContext(ctx context.Context) *TRAAPITrainTypeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPITrainTypeParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTRAAPITrainTypeParamsWithHTTPClient creates a new TRAAPITrainTypeParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTRAAPITrainTypeParamsWithHTTPClient(client *http.Client) *TRAAPITrainTypeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TRAAPITrainTypeParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TRAAPITrainTypeParams contains all the parameters to send to the API endpoint
-for the t r a Api train type operation typically these are written to a http.Request
+/* TRAAPITrainTypeParams contains all the parameters to send to the API endpoint
+ for the t r a Api train type operation.
+
+ Typically these are written to a http.Request.
*/
type TRAAPITrainTypeParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TRAAPITrainTypeParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the t r a Api train type params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPITrainTypeParams) WithDefaults() *TRAAPITrainTypeParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the t r a Api train type params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TRAAPITrainTypeParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TRAAPITrainTypeParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the t r a Api train type params
func (o *TRAAPITrainTypeParams) WithTimeout(timeout time.Duration) *TRAAPITrainTypeParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TRAAPITrainTypeParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -245,64 +267,68 @@ func (o *TRAAPITrainTypeParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v2/client/t_r_a/t_r_a_api_train_type_responses.go b/rail/v2/client/t_r_a/t_r_a_api_train_type_responses.go
index 5669efcd..a7ad753e 100644
--- a/rail/v2/client/t_r_a/t_r_a_api_train_type_responses.go
+++ b/rail/v2/client/t_r_a/t_r_a_api_train_type_responses.go
@@ -29,7 +29,12 @@ func (o *TRAAPITrainTypeReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTRAAPITrainTypeNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTRAAPITrainTypeOK() *TRAAPITrainTypeOK {
return &TRAAPITrainTypeOK{}
}
-/*TRAAPITrainTypeOK handles this case with default header values.
+/* TRAAPITrainTypeOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TRAAPITrainTypeOK struct {
func (o *TRAAPITrainTypeOK) Error() string {
return fmt.Sprintf("[GET /v2/Rail/TRA/TrainType][%d] tRAApiTrainTypeOK %+v", 200, o.Payload)
}
-
func (o *TRAAPITrainTypeOK) GetPayload() []*models.PTXServiceDTORailSpecificationV2TRATrainType {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TRAAPITrainTypeOK) readResponse(response runtime.ClientResponse, consum
return nil
}
+
+// NewTRAAPITrainTypeNotModified creates a TRAAPITrainTypeNotModified with default headers values
+func NewTRAAPITrainTypeNotModified() *TRAAPITrainTypeNotModified {
+ return &TRAAPITrainTypeNotModified{}
+}
+
+/* TRAAPITrainTypeNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TRAAPITrainTypeNotModified struct {
+}
+
+func (o *TRAAPITrainTypeNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Rail/TRA/TrainType][%d] tRAApiTrainTypeNotModified ", 304)
+}
+
+func (o *TRAAPITrainTypeNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v2/models/p_t_x_api_rail_model_m_r_t_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v2_metro_alert.go b/rail/v2/models/p_t_x_api_rail_model_m_r_t_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v2_metro_alert.go
index 13abb267..00bd56d3 100644
--- a/rail/v2/models/p_t_x_api_rail_model_m_r_t_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v2_metro_alert.go
+++ b/rail/v2/models/p_t_x_api_rail_model_m_r_t_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v2_metro_alert.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelMRTRealTimeWrapperPTXServiceDTORailSpecificationV2MetroA
return nil
}
+// ContextValidate validate this p t x API rail model m r t real time wrapper p t x service d t o rail specification v2 metro alert based on the context it is used
+func (m *PTXAPIRailModelMRTRealTimeWrapperPTXServiceDTORailSpecificationV2MetroAlert) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAlerts(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelMRTRealTimeWrapperPTXServiceDTORailSpecificationV2MetroAlert) contextValidateAlerts(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Alerts); i++ {
+
+ if m.Alerts[i] != nil {
+ if err := m.Alerts[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Alerts" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelMRTRealTimeWrapperPTXServiceDTORailSpecificationV2MetroAlert) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_api_rail_model_m_r_t_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_news_list_news.go b/rail/v2/models/p_t_x_api_rail_model_m_r_t_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_news_list_news.go
index 874b4e61..92b71437 100644
--- a/rail/v2/models/p_t_x_api_rail_model_m_r_t_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_news_list_news.go
+++ b/rail/v2/models/p_t_x_api_rail_model_m_r_t_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_news_list_news.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelMRTRealTimeWrapperPTXServiceDTORailSpecificationV2MetroM
return nil
}
+// ContextValidate validate this p t x API rail model m r t real time wrapper p t x service d t o rail specification v2 metro m r t news list news based on the context it is used
+func (m *PTXAPIRailModelMRTRealTimeWrapperPTXServiceDTORailSpecificationV2MetroMRTNewsListNews) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateNewses(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelMRTRealTimeWrapperPTXServiceDTORailSpecificationV2MetroMRTNewsListNews) contextValidateNewses(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Newses); i++ {
+
+ if m.Newses[i] != nil {
+ if err := m.Newses[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Newses" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelMRTRealTimeWrapperPTXServiceDTORailSpecificationV2MetroMRTNewsListNews) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_avaliable_seat_status_old_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_old_available_seat.go b/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_available_seat_status_old_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_old_available_seat.go
similarity index 58%
rename from rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_avaliable_seat_status_old_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_old_available_seat.go
rename to rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_available_seat_status_old_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_old_available_seat.go
index c6d01809..95b2b3f3 100644
--- a/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_avaliable_seat_status_old_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_old_available_seat.go
+++ b/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_available_seat_status_old_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_old_available_seat.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -14,10 +15,10 @@ import (
"github.com/go-openapi/validate"
)
-// PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat V2THSRAvaliableSeatStatusWrapper
+// PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat AvailableSeatStatus
//
-// swagger:model PTX.API.Rail.Model.V2THSRAvaliableSeatStatusOldWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.Old.AvailableSeat]
-type PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat struct {
+// swagger:model PTX.API.Rail.Model.V2THSRAvailableSeatStatusOldWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.Old.AvailableSeat]
+type PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat struct {
// Array
//
@@ -34,8 +35,8 @@ type PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecific
UpdateTime string `json:"UpdateTime,omitempty"`
}
-// Validate validates this p t x API rail model v2 t h s r avaliable seat status old wrapper p t x service d t o rail specification v2 t h s r old available seat
-func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat) Validate(formats strfmt.Registry) error {
+// Validate validates this p t x API rail model v2 t h s r available seat status old wrapper p t x service d t o rail specification v2 t h s r old available seat
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAvailableSeats(formats); err != nil {
@@ -48,7 +49,7 @@ func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpec
return nil
}
-func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat) validateAvailableSeats(formats strfmt.Registry) error {
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat) validateAvailableSeats(formats strfmt.Registry) error {
if err := validate.Required("AvailableSeats", "body", m.AvailableSeats); err != nil {
return err
@@ -73,8 +74,40 @@ func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpec
return nil
}
+// ContextValidate validate this p t x API rail model v2 t h s r available seat status old wrapper p t x service d t o rail specification v2 t h s r old available seat based on the context it is used
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAvailableSeats(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat) contextValidateAvailableSeats(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.AvailableSeats); i++ {
+
+ if m.AvailableSeats[i] != nil {
+ if err := m.AvailableSeats[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("AvailableSeats" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
-func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat) MarshalBinary() ([]byte, error) {
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -82,8 +115,8 @@ func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpec
}
// UnmarshalBinary interface implementation
-func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat) UnmarshalBinary(b []byte) error {
- var res PTXAPIRailModelV2THSRAvaliableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat) UnmarshalBinary(b []byte) error {
+ var res PTXAPIRailModelV2THSRAvailableSeatStatusOldWrapperPTXServiceDTORailSpecificationV2THSROldAvailableSeat
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
diff --git a/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_avaliable_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_available_seat.go b/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_available_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_available_seat.go
similarity index 60%
rename from rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_avaliable_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_available_seat.go
rename to rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_available_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_available_seat.go
index 31a60117..fd2bba1b 100644
--- a/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_avaliable_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_available_seat.go
+++ b/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_available_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_available_seat.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -14,10 +15,10 @@ import (
"github.com/go-openapi/validate"
)
-// PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat AvaliableSeatStatus
+// PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat AvailableSeatStatus
//
-// swagger:model PTX.API.Rail.Model.V2THSRAvaliableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.AvailableSeat]
-type PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat struct {
+// swagger:model PTX.API.Rail.Model.V2THSRAvailableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.AvailableSeat]
+type PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat struct {
// Array
//
@@ -44,8 +45,8 @@ type PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificati
UpdateTime string `json:"UpdateTime,omitempty"`
}
-// Validate validates this p t x API rail model v2 t h s r avaliable seat status wrapper p t x service d t o rail specification v2 t h s r available seat
-func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat) Validate(formats strfmt.Registry) error {
+// Validate validates this p t x API rail model v2 t h s r available seat status wrapper p t x service d t o rail specification v2 t h s r available seat
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAvailableSeats(formats); err != nil {
@@ -58,7 +59,7 @@ func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecifi
return nil
}
-func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat) validateAvailableSeats(formats strfmt.Registry) error {
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat) validateAvailableSeats(formats strfmt.Registry) error {
if err := validate.Required("AvailableSeats", "body", m.AvailableSeats); err != nil {
return err
@@ -83,8 +84,40 @@ func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecifi
return nil
}
+// ContextValidate validate this p t x API rail model v2 t h s r available seat status wrapper p t x service d t o rail specification v2 t h s r available seat based on the context it is used
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAvailableSeats(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat) contextValidateAvailableSeats(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.AvailableSeats); i++ {
+
+ if m.AvailableSeats[i] != nil {
+ if err := m.AvailableSeats[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("AvailableSeats" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
-func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat) MarshalBinary() ([]byte, error) {
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -92,8 +125,8 @@ func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecifi
}
// UnmarshalBinary interface implementation
-func (m *PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat) UnmarshalBinary(b []byte) error {
- var res PTXAPIRailModelV2THSRAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat
+func (m *PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat) UnmarshalBinary(b []byte) error {
+ var res PTXAPIRailModelV2THSRAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRAvailableSeat
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
diff --git a/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_o_d_avaliable_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_o_d_available_seat.go b/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_o_d_available_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_o_d_available_seat.go
similarity index 62%
rename from rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_o_d_avaliable_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_o_d_available_seat.go
rename to rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_o_d_available_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_o_d_available_seat.go
index 901ebd09..8da2b985 100644
--- a/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_o_d_avaliable_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_o_d_available_seat.go
+++ b/rail/v2/models/p_t_x_api_rail_model_v2_t_h_s_r_o_d_available_seat_status_wrapper_p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_o_d_available_seat.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -14,10 +15,10 @@ import (
"github.com/go-openapi/validate"
)
-// PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat AvaliableSeatStatus
+// PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat AvailableSeatStatus
//
-// swagger:model PTX.API.Rail.Model.V2THSRODAvaliableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.OD.AvailableSeat]
-type PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat struct {
+// swagger:model PTX.API.Rail.Model.V2THSRODAvailableSeatStatusWrapper[PTX.Service.DTO.Rail.Specification.V2.THSR.OD.AvailableSeat]
+type PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat struct {
// Array
//
@@ -54,8 +55,8 @@ type PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecifica
UpdateTime string `json:"UpdateTime,omitempty"`
}
-// Validate validates this p t x API rail model v2 t h s r o d avaliable seat status wrapper p t x service d t o rail specification v2 t h s r o d available seat
-func (m *PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat) Validate(formats strfmt.Registry) error {
+// Validate validates this p t x API rail model v2 t h s r o d available seat status wrapper p t x service d t o rail specification v2 t h s r o d available seat
+func (m *PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAvailableSeats(formats); err != nil {
@@ -68,7 +69,7 @@ func (m *PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpeci
return nil
}
-func (m *PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat) validateAvailableSeats(formats strfmt.Registry) error {
+func (m *PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat) validateAvailableSeats(formats strfmt.Registry) error {
if err := validate.Required("AvailableSeats", "body", m.AvailableSeats); err != nil {
return err
@@ -93,8 +94,40 @@ func (m *PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpeci
return nil
}
+// ContextValidate validate this p t x API rail model v2 t h s r o d available seat status wrapper p t x service d t o rail specification v2 t h s r o d available seat based on the context it is used
+func (m *PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAvailableSeats(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat) contextValidateAvailableSeats(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.AvailableSeats); i++ {
+
+ if m.AvailableSeats[i] != nil {
+ if err := m.AvailableSeats[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("AvailableSeats" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
-func (m *PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat) MarshalBinary() ([]byte, error) {
+func (m *PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -102,8 +135,8 @@ func (m *PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpeci
}
// UnmarshalBinary interface implementation
-func (m *PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat) UnmarshalBinary(b []byte) error {
- var res PTXAPIRailModelV2THSRODAvaliableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat
+func (m *PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat) UnmarshalBinary(b []byte) error {
+ var res PTXAPIRailModelV2THSRODAvailableSeatStatusWrapperPTXServiceDTORailSpecificationV2THSRODAvailableSeat
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_alert.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_alert.go
index 4c44c501..056ccc51 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_alert.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_alert.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -180,6 +182,25 @@ func (m *PTXServiceDTORailSpecificationV2MetroAlert) validateUpdateTime(formats
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro alert based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroAlert) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateScope(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroAlert) contextValidateScope(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroAlert) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_drinking_fountain.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_drinking_fountain.go
index d39d6389..ada2af86 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_drinking_fountain.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_drinking_fountain.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -68,6 +70,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroDrinkingFountain) validateFloorLev
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro drinking fountain based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroDrinkingFountain) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroDrinkingFountain) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_elevator.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_elevator.go
index d635cbe6..6242012d 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_elevator.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_elevator.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -68,6 +70,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroElevator) validateFloorLevel(forma
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro elevator based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroElevator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroElevator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_first_last_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_first_last_timetable.go
index 57a4336d..ba0164d2 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_first_last_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_first_last_timetable.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -56,13 +58,13 @@ type PTXServiceDTORailSpecificationV2MetroFirstLastTimetable struct {
// 首末班車次之路線代號
LineNo string `json:"LineNo,omitempty"`
- // ServiceDays
+ // ServiceDay
//
// 服務日型態
// Required: true
- ServiceDays struct {
- PTXServiceDTORailSpecificationV2MetroSubClassServiceDays
- } `json:"ServiceDays"`
+ ServiceDay struct {
+ PTXServiceDTORailSpecificationV2MetroSubClassServiceDay
+ } `json:"ServiceDay"`
// DateTime
//
@@ -129,7 +131,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroFirstLastTimetable) Validate(forma
res = append(res, err)
}
- if err := m.validateServiceDays(formats); err != nil {
+ if err := m.validateServiceDay(formats); err != nil {
res = append(res, err)
}
@@ -200,7 +202,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroFirstLastTimetable) validateLineID
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroFirstLastTimetable) validateServiceDays(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroFirstLastTimetable) validateServiceDay(formats strfmt.Registry) error {
return nil
}
@@ -246,6 +248,43 @@ func (m *PTXServiceDTORailSpecificationV2MetroFirstLastTimetable) validateVersio
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro first last timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroFirstLastTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroFirstLastTimetable) contextValidateDestinationStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroFirstLastTimetable) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroFirstLastTimetable) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroFirstLastTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_frequency.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_frequency.go
index e3fc71e9..5de39e99 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_frequency.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_frequency.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -52,13 +53,13 @@ type PTXServiceDTORailSpecificationV2MetroFrequency struct {
// Required: true
RouteID *string `json:"RouteID"`
- // ServiceDays
+ // ServiceDay
//
// 服務日型態
// Required: true
- ServiceDays struct {
- PTXServiceDTORailSpecificationV2MetroSubClassServiceDays
- } `json:"ServiceDays"`
+ ServiceDay struct {
+ PTXServiceDTORailSpecificationV2MetroSubClassServiceDay
+ } `json:"ServiceDay"`
// DateTime
//
@@ -102,7 +103,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroFrequency) Validate(formats strfmt
res = append(res, err)
}
- if err := m.validateServiceDays(formats); err != nil {
+ if err := m.validateServiceDay(formats); err != nil {
res = append(res, err)
}
@@ -172,7 +173,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroFrequency) validateRouteID(formats
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroFrequency) validateServiceDays(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroFrequency) validateServiceDay(formats strfmt.Registry) error {
return nil
}
@@ -204,6 +205,56 @@ func (m *PTXServiceDTORailSpecificationV2MetroFrequency) validateVersionID(forma
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro frequency based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroFrequency) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateHeadways(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOperationTime(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroFrequency) contextValidateHeadways(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Headways); i++ {
+
+ if m.Headways[i] != nil {
+ if err := m.Headways[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Headways" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroFrequency) contextValidateOperationTime(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroFrequency) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroFrequency) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_information_spot.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_information_spot.go
index 9a0310a9..dac6b95a 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_information_spot.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_information_spot.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -68,6 +70,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroInformationSpot) validateFloorLeve
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro information spot based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroInformationSpot) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroInformationSpot) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_line.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_line.go
index c7d32a4c..33250b8b 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_line.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_line.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -183,6 +185,34 @@ func (m *PTXServiceDTORailSpecificationV2MetroLine) validateVersionID(formats st
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro line based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroLine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateLineSectionName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroLine) contextValidateLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroLine) contextValidateLineSectionName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroLine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_line_transfer.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_line_transfer.go
index e5d7cd5f..4766b8f4 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_line_transfer.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_line_transfer.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -298,6 +300,52 @@ func (m *PTXServiceDTORailSpecificationV2MetroLineTransfer) validateVersionID(fo
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro line transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroLineTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFromLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFromStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateToLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateToStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroLineTransfer) contextValidateFromLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroLineTransfer) contextValidateFromStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroLineTransfer) contextValidateToLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroLineTransfer) contextValidateToStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroLineTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_live_board.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_live_board.go
index 9d838885..e5b001a4 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_live_board.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_live_board.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -238,6 +240,43 @@ func (m *PTXServiceDTORailSpecificationV2MetroLiveBoard) validateUpdateTime(form
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro live board based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroLiveBoard) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroLiveBoard) contextValidateDestinationStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroLiveBoard) contextValidateLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroLiveBoard) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroLiveBoard) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope.go
index 99c55bbb..2cc6d12e 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -144,7 +145,6 @@ func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) validateLi
}
func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) validateNetwork(formats strfmt.Registry) error {
-
if swag.IsZero(m.Network) { // not required
return nil
}
@@ -227,6 +227,135 @@ func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) validateTr
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro m r t alert list alert scope based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineSections(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateLines(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNetwork(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStations(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrains(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) contextValidateLineSections(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.LineSections); i++ {
+
+ if m.LineSections[i] != nil {
+ if err := m.LineSections[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("LineSections" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) contextValidateLines(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Lines); i++ {
+
+ if m.Lines[i] != nil {
+ if err := m.Lines[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Lines" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) contextValidateRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Routes); i++ {
+
+ if m.Routes[i] != nil {
+ if err := m.Routes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Routes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) contextValidateStations(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Stations); i++ {
+
+ if m.Stations[i] != nil {
+ if err := m.Stations[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Stations" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) contextValidateTrains(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Trains); i++ {
+
+ if m.Trains[i] != nil {
+ if err := m.Trains[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Trains" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScope) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_line.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_line.go
index 4e3d1c07..24337376 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_line.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_line.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -33,6 +35,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeLine) Valida
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro m r t alert list alert scope line based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeLine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeLine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_line_section.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_line_section.go
index b8096c42..f8b6ac15 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_line_section.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_line_section.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -53,6 +55,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeLineSection)
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro m r t alert list alert scope line section based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeLineSection) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeLineSection) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_network.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_network.go
index e838ef25..a8c1c712 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_network.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_network.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -28,6 +30,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeNetwork) Val
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro m r t alert list alert scope network based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeNetwork) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_route.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_route.go
index adcbdaae..f3792454 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_route.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_route.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -33,6 +35,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeRoute) Valid
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro m r t alert list alert scope route based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_station.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_station.go
index 7ff162e6..6315e503 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_station.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_station.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -33,6 +35,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeStation) Val
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro m r t alert list alert scope station based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_train.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_train.go
index e22334e3..00932715 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_train.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_alert_list_alert_scope_train.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -28,6 +30,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeTrain) Valid
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro m r t alert list alert scope train based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeTrain) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroMRTAlertListAlertScopeTrain) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_news_list_news.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_news_list_news.go
index 7fce74a5..c9bfb8e8 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_news_list_news.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_m_r_t_news_list_news.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -172,6 +174,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroMRTNewsListNews) validateUpdateTim
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro m r t news list news based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroMRTNewsListNews) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroMRTNewsListNews) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_metro_shape.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_metro_shape.go
index fcaa868d..c29b9cd3 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_metro_shape.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_metro_shape.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -128,6 +130,25 @@ func (m *PTXServiceDTORailSpecificationV2MetroMetroShape) validateUpdateTime(for
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro metro shape based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroMetroShape) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroMetroShape) contextValidateLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroMetroShape) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_network.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_network.go
index 7f5650bd..224d64db 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_network.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_network.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -61,6 +62,12 @@ type PTXServiceDTORailSpecificationV2MetroNetwork struct {
PTXServiceDTOSharedSpecificationV2BaseNameType
} `json:"OperatorName"`
+ // DateTime
+ //
+ // 來源端平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
+ // Required: true
+ SrcUpdateTime *string `json:"SrcUpdateTime"`
+
// DateTime
//
// 本平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
@@ -102,6 +109,10 @@ func (m *PTXServiceDTORailSpecificationV2MetroNetwork) Validate(formats strfmt.R
res = append(res, err)
}
+ if err := m.validateSrcUpdateTime(formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.validateUpdateTime(formats); err != nil {
res = append(res, err)
}
@@ -178,6 +189,15 @@ func (m *PTXServiceDTORailSpecificationV2MetroNetwork) validateOperatorName(form
return nil
}
+func (m *PTXServiceDTORailSpecificationV2MetroNetwork) validateSrcUpdateTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("SrcUpdateTime", "body", m.SrcUpdateTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *PTXServiceDTORailSpecificationV2MetroNetwork) validateUpdateTime(formats strfmt.Registry) error {
if err := validate.Required("UpdateTime", "body", m.UpdateTime); err != nil {
@@ -196,6 +216,56 @@ func (m *PTXServiceDTORailSpecificationV2MetroNetwork) validateVersionID(formats
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro network based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLines(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNetworkName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroNetwork) contextValidateLines(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Lines); i++ {
+
+ if m.Lines[i] != nil {
+ if err := m.Lines[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Lines" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroNetwork) contextValidateNetworkName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroNetwork) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroNetwork) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_network_sub_class_line.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_network_sub_class_line.go
index 3be5f914..e03a4b37 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_network_sub_class_line.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_network_sub_class_line.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -54,6 +56,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroNetworkSubClassLine) validateLineI
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro network sub class line based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroNetworkSubClassLine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroNetworkSubClassLine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_o_d_fare.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_o_d_fare.go
index 57595488..c3ae9ef5 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_o_d_fare.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_o_d_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -205,6 +206,56 @@ func (m *PTXServiceDTORailSpecificationV2MetroODFare) validateVersionID(formats
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro o d fare based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroODFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroODFare) contextValidateDestinationStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroODFare) contextValidateFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Fares); i++ {
+
+ if m.Fares[i] != nil {
+ if err := m.Fares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Fares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroODFare) contextValidateOriginStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroODFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_route.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_route.go
index fd28463e..080425d4 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_route.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_route.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -96,11 +98,11 @@ type PTXServiceDTORailSpecificationV2MetroRoute struct {
PTXServiceDTOSharedSpecificationV2BaseNameType
} `json:"StartStationName"`
- // Int32
+ // Single
//
// 營運路線運行時間
// Required: true
- TravelTime *int32 `json:"TravelTime"`
+ TravelTime *float32 `json:"TravelTime"`
// DateTime
//
@@ -295,6 +297,43 @@ func (m *PTXServiceDTORailSpecificationV2MetroRoute) validateVersionID(formats s
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro route based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroRoute) contextValidateEndStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroRoute) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroRoute) contextValidateStartStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_s2_s_travel_time.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_s2_s_travel_time.go
index c336d25f..cfeab8ed 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_s2_s_travel_time.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_s2_s_travel_time.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -170,6 +171,38 @@ func (m *PTXServiceDTORailSpecificationV2MetroS2STravelTime) validateVersionID(f
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro s2 s travel time based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroS2STravelTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTravelTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroS2STravelTime) contextValidateTravelTimes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TravelTimes); i++ {
+
+ if m.TravelTimes[i] != nil {
+ if err := m.TravelTimes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TravelTimes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroS2STravelTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station.go
index 4d76dc43..13c8dc28 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -25,6 +27,26 @@ type PTXServiceDTORailSpecificationV2MetroStation struct {
// Required: true
BikeAllowOnHoliday *bool `json:"BikeAllowOnHoliday"`
+ // String
+ //
+ // 車站位置所屬縣市
+ LocationCity string `json:"LocationCity,omitempty"`
+
+ // String
+ //
+ // 車站位置所屬縣市代碼
+ LocationCityCode string `json:"LocationCityCode,omitempty"`
+
+ // String
+ //
+ // 車站位置所屬鄉鎮
+ LocationTown string `json:"LocationTown,omitempty"`
+
+ // String
+ //
+ // 車站位置所屬鄉鎮代碼
+ LocationTownCode string `json:"LocationTownCode,omitempty"`
+
// DateTime
//
// 來源端平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
@@ -53,11 +75,10 @@ type PTXServiceDTORailSpecificationV2MetroStation struct {
// PointType
//
- // 車站座標
- // Required: true
+ // 車站位置
StationPosition struct {
- PTXServiceDTOSharedSpecificationV2BasePointType
- } `json:"StationPosition"`
+ PTXServiceDTORailSpecificationV2PointType
+ } `json:"StationPosition,omitempty"`
// String
//
@@ -166,6 +187,9 @@ func (m *PTXServiceDTORailSpecificationV2MetroStation) validateStationName(forma
}
func (m *PTXServiceDTORailSpecificationV2MetroStation) validateStationPosition(formats strfmt.Registry) error {
+ if swag.IsZero(m.StationPosition) { // not required
+ return nil
+ }
return nil
}
@@ -197,6 +221,34 @@ func (m *PTXServiceDTORailSpecificationV2MetroStation) validateVersionID(formats
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro station based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStation) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStation) contextValidateStationPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_exit.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_exit.go
index d0cff755..8c0f07b8 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_exit.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_exit.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -246,6 +248,43 @@ func (m *PTXServiceDTORailSpecificationV2MetroStationExit) validateVersionID(for
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro station exit based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroStationExit) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateExitName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateExitPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationExit) contextValidateExitName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationExit) contextValidateExitPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationExit) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroStationExit) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_facility.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_facility.go
index 57908035..a159fe3f 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_facility.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_facility.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -265,6 +266,113 @@ func (m *PTXServiceDTORailSpecificationV2MetroStationFacility) validateVersionID
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro station facility based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroStationFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDrinkingFountains(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateElevators(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateInformationSpots(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateToilets(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationFacility) contextValidateDrinkingFountains(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.DrinkingFountains); i++ {
+
+ if m.DrinkingFountains[i] != nil {
+ if err := m.DrinkingFountains[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("DrinkingFountains" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationFacility) contextValidateElevators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Elevators); i++ {
+
+ if m.Elevators[i] != nil {
+ if err := m.Elevators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Elevators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationFacility) contextValidateInformationSpots(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.InformationSpots); i++ {
+
+ if m.InformationSpots[i] != nil {
+ if err := m.InformationSpots[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("InformationSpots" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationFacility) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationFacility) contextValidateToilets(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Toilets); i++ {
+
+ if m.Toilets[i] != nil {
+ if err := m.Toilets[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Toilets" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroStationFacility) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_of_line.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_of_line.go
index 41a73d8c..613ff99f 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_of_line.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_of_line.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -148,6 +149,38 @@ func (m *PTXServiceDTORailSpecificationV2MetroStationOfLine) validateVersionID(f
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro station of line based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroStationOfLine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStations(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationOfLine) contextValidateStations(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Stations); i++ {
+
+ if m.Stations[i] != nil {
+ if err := m.Stations[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Stations" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroStationOfLine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_of_route.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_of_route.go
index ee60da0b..b9bfdb1c 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_of_route.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_of_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -203,6 +204,47 @@ func (m *PTXServiceDTORailSpecificationV2MetroStationOfRoute) validateVersionID(
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro station of route based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroStationOfRoute) 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.contextValidateStations(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationOfRoute) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationOfRoute) contextValidateStations(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Stations); i++ {
+
+ if m.Stations[i] != nil {
+ if err := m.Stations[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Stations" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroStationOfRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_time_table.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_time_table.go
index 1c895ead..e0d47e4f 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_time_table.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_station_time_table.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -51,13 +52,13 @@ type PTXServiceDTORailSpecificationV2MetroStationTimeTable struct {
// 營運路線代碼
RouteID string `json:"RouteID,omitempty"`
- // ServiceDays
+ // ServiceDay
//
// 服務日型態
// Required: true
- ServiceDays struct {
- PTXServiceDTORailSpecificationV2MetroSubClassServiceDays
- } `json:"ServiceDays"`
+ ServiceDay struct {
+ PTXServiceDTORailSpecificationV2MetroSubClassServiceDay
+ } `json:"ServiceDay"`
// Array
//
@@ -119,7 +120,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) Validate(formats
res = append(res, err)
}
- if err := m.validateServiceDays(formats); err != nil {
+ if err := m.validateServiceDay(formats); err != nil {
res = append(res, err)
}
@@ -180,13 +181,12 @@ func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) validateLineID(f
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) validateServiceDays(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) validateServiceDay(formats strfmt.Registry) error {
return nil
}
func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) validateSpecialDays(formats strfmt.Registry) error {
-
if swag.IsZero(m.SpecialDays) { // not required
return nil
}
@@ -276,6 +276,87 @@ func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) validateVersionI
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro station time table based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSpecialDays(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(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 *PTXServiceDTORailSpecificationV2MetroStationTimeTable) contextValidateDestinationStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) contextValidateSpecialDays(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SpecialDays); i++ {
+
+ if m.SpecialDays[i] != nil {
+ if err := m.SpecialDays[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SpecialDays" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroStationTimeTable) 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 *PTXServiceDTORailSpecificationV2MetroStationTimeTable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_fare.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_fare.go
index a7586676..2062ed43 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_fare.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_fare.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -97,6 +99,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassFare) validateTicketType(f
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro sub class fare based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroSubClassFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_headway.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_headway.go
index c042df85..eeb184e6 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_headway.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_headway.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -125,6 +127,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassHeadway) validateStartTime
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro sub class headway based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassHeadway) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroSubClassHeadway) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_operation_time.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_operation_time.go
index 08a96102..aedd258d 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_operation_time.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_operation_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -68,6 +70,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassOperationTime) validateSta
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro sub class operation time based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassOperationTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroSubClassOperationTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_service_days.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_service_day.go
similarity index 79%
rename from rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_service_days.go
rename to rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_service_day.go
index 69c8b062..ada97201 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_service_days.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_service_day.go
@@ -6,18 +6,20 @@ package models
// 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"
)
-// PTXServiceDTORailSpecificationV2MetroSubClassServiceDays ServiceDays
+// PTXServiceDTORailSpecificationV2MetroSubClassServiceDay ServiceDay
//
// 服務日型態
//
-// swagger:model PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.ServiceDays
-type PTXServiceDTORailSpecificationV2MetroSubClassServiceDays struct {
+// swagger:model PTX.Service.DTO.Rail.Specification.V2.Metro.SubClass.ServiceDay
+type PTXServiceDTORailSpecificationV2MetroSubClassServiceDay struct {
// Boolean
//
@@ -73,8 +75,8 @@ type PTXServiceDTORailSpecificationV2MetroSubClassServiceDays struct {
Wednesday *bool `json:"Wednesday"`
}
-// Validate validates this p t x service d t o rail specification v2 metro sub class service days
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) Validate(formats strfmt.Registry) error {
+// Validate validates this p t x service d t o rail specification v2 metro sub class service day
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFriday(formats); err != nil {
@@ -115,7 +117,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) Validate(form
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateFriday(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) validateFriday(formats strfmt.Registry) error {
if err := validate.Required("Friday", "body", m.Friday); err != nil {
return err
@@ -124,7 +126,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateFrida
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateMonday(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) validateMonday(formats strfmt.Registry) error {
if err := validate.Required("Monday", "body", m.Monday); err != nil {
return err
@@ -133,7 +135,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateMonda
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateNationalHolidays(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) validateNationalHolidays(formats strfmt.Registry) error {
if err := validate.Required("NationalHolidays", "body", m.NationalHolidays); err != nil {
return err
@@ -142,7 +144,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateNatio
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateSaturday(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) validateSaturday(formats strfmt.Registry) error {
if err := validate.Required("Saturday", "body", m.Saturday); err != nil {
return err
@@ -151,7 +153,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateSatur
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateSunday(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) validateSunday(formats strfmt.Registry) error {
if err := validate.Required("Sunday", "body", m.Sunday); err != nil {
return err
@@ -160,7 +162,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateSunda
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateThursday(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) validateThursday(formats strfmt.Registry) error {
if err := validate.Required("Thursday", "body", m.Thursday); err != nil {
return err
@@ -169,7 +171,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateThurs
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateTuesday(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) validateTuesday(formats strfmt.Registry) error {
if err := validate.Required("Tuesday", "body", m.Tuesday); err != nil {
return err
@@ -178,7 +180,7 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateTuesd
return nil
}
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateWednesday(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) validateWednesday(formats strfmt.Registry) error {
if err := validate.Required("Wednesday", "body", m.Wednesday); err != nil {
return err
@@ -187,8 +189,13 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) validateWedne
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro sub class service day based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) MarshalBinary() ([]byte, error) {
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -196,8 +203,8 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) MarshalBinary
}
// UnmarshalBinary interface implementation
-func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDays) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTORailSpecificationV2MetroSubClassServiceDays
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassServiceDay) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTORailSpecificationV2MetroSubClassServiceDay
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_special_day.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_special_day.go
index 8eb3004b..95a7d22c 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_special_day.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_special_day.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -87,6 +89,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassSpecialDay) validateSaterD
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro sub class special day based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassSpecialDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroSubClassSpecialDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_station.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_station.go
index 94df23e2..1605ce0c 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_station.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_station.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -88,6 +90,25 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassStation) validateStationNa
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro sub class station based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassStation) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroSubClassStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_timetable.go
index 6529025c..e761b6f5 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_timetable.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -109,6 +111,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassTimetable) validateTrainNo
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro sub class timetable based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroSubClassTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_travel_time.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_travel_time.go
index 3eea4a42..458379bf 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_travel_time.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_sub_class_travel_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -143,6 +145,34 @@ func (m *PTXServiceDTORailSpecificationV2MetroSubClassTravelTime) validateToStat
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 metro sub class travel time based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassTravelTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFromStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateToStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassTravelTime) contextValidateFromStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2MetroSubClassTravelTime) contextValidateToStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroSubClassTravelTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_toilet.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_toilet.go
index 534ca67a..c33bc44c 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_toilet.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_metro_toilet.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -68,6 +70,11 @@ func (m *PTXServiceDTORailSpecificationV2MetroToilet) validateFloorLevel(formats
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 metro toilet based on context it is used
+func (m *PTXServiceDTORailSpecificationV2MetroToilet) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2MetroToilet) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_point_type.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_point_type.go
new file mode 100644
index 00000000..6ea54912
--- /dev/null
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_point_type.go
@@ -0,0 +1,60 @@
+// 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/strfmt"
+ "github.com/go-openapi/swag"
+)
+
+// PTXServiceDTORailSpecificationV2PointType PointType
+//
+// 座標資料型別
+//
+// swagger:model PTX.Service.DTO.Rail.Specification.V2.PointType
+type PTXServiceDTORailSpecificationV2PointType struct {
+
+ // String
+ //
+ // 地理空間編碼
+ GeoHash string `json:"GeoHash,omitempty"`
+
+ // 位置緯度(WGS84)
+ PositionLat float64 `json:"PositionLat,omitempty"`
+
+ // 位置經度(WGS84)
+ PositionLon float64 `json:"PositionLon,omitempty"`
+}
+
+// Validate validates this p t x service d t o rail specification v2 point type
+func (m *PTXServiceDTORailSpecificationV2PointType) Validate(formats strfmt.Registry) error {
+ return nil
+}
+
+// ContextValidate validates this p t x service d t o rail specification v2 point type based on context it is used
+func (m *PTXServiceDTORailSpecificationV2PointType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTORailSpecificationV2PointType) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTORailSpecificationV2PointType) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTORailSpecificationV2PointType
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_alert_info.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_alert_info.go
index e24ef541..b4f7f7d8 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_alert_info.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_alert_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -211,6 +213,11 @@ func (m *PTXServiceDTORailSpecificationV2THSRAlertInfo) validateUpdateTime(forma
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 t h s r alert info based on context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRAlertInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRAlertInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_available_seat.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_available_seat.go
index 81a09132..bbbf8c92 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_available_seat.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_available_seat.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -215,6 +216,56 @@ func (m *PTXServiceDTORailSpecificationV2THSRAvailableSeat) validateTrainNo(form
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r available seat based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRAvailableSeat) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopStations(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRAvailableSeat) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRAvailableSeat) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRAvailableSeat) contextValidateStopStations(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StopStations); i++ {
+
+ if m.StopStations[i] != nil {
+ if err := m.StopStations[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StopStations" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRAvailableSeat) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_general_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_general_timetable.go
index 780f4f83..4abc0c0f 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_general_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_general_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -120,6 +121,56 @@ func (m *PTXServiceDTORailSpecificationV2THSRGeneralTimetable) validateStopTimes
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r general timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRGeneralTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateGeneralTrainInfo(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRGeneralTimetable) contextValidateGeneralTrainInfo(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRGeneralTimetable) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRGeneralTimetable) 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 *PTXServiceDTORailSpecificationV2THSRGeneralTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_news.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_news.go
index 636f6a61..b5c73be0 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_news.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_news.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -244,6 +246,11 @@ func (m *PTXServiceDTORailSpecificationV2THSRNews) validateUpdateTime(formats st
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 t h s r news based on context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRNews) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRNews) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_o_d_available_seat.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_o_d_available_seat.go
index 982a8582..87b6be80 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_o_d_available_seat.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_o_d_available_seat.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -216,6 +218,34 @@ func (m *PTXServiceDTORailSpecificationV2THSRODAvailableSeat) validateTrainNo(fo
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r o d available seat based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRODAvailableSeat) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRODAvailableSeat) contextValidateDestinationStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRODAvailableSeat) contextValidateOriginStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRODAvailableSeat) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_old_available_seat.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_old_available_seat.go
index ea684cb3..1fab3bc9 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_old_available_seat.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_old_available_seat.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -49,9 +50,9 @@ type PTXServiceDTORailSpecificationV2THSROldAvailableSeat struct {
// DateTime
//
- // 來源端平台接收時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
+ // 來源平台更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
// Required: true
- SrcRecTime *string `json:"SrcRecTime"`
+ SrcUpdateTime *string `json:"SrcUpdateTime"`
// String
//
@@ -78,12 +79,6 @@ type PTXServiceDTORailSpecificationV2THSROldAvailableSeat struct {
// 車次號碼
// Required: true
TrainNo *string `json:"TrainNo"`
-
- // DateTime
- //
- // 本平台資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
- // Required: true
- UpdateTime *string `json:"UpdateTime"`
}
// Validate validates this p t x service d t o rail specification v2 t h s r old available seat
@@ -106,7 +101,7 @@ func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) Validate(formats
res = append(res, err)
}
- if err := m.validateSrcRecTime(formats); err != nil {
+ if err := m.validateSrcUpdateTime(formats); err != nil {
res = append(res, err)
}
@@ -126,10 +121,6 @@ func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) Validate(formats
res = append(res, err)
}
- if err := m.validateUpdateTime(formats); err != nil {
- res = append(res, err)
- }
-
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -168,9 +159,9 @@ func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) validateEndingSta
return nil
}
-func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) validateSrcRecTime(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) validateSrcUpdateTime(formats strfmt.Registry) error {
- if err := validate.Required("SrcRecTime", "body", m.SrcRecTime); err != nil {
+ if err := validate.Required("SrcUpdateTime", "body", m.SrcUpdateTime); err != nil {
return err
}
@@ -225,10 +216,51 @@ func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) validateTrainNo(f
return nil
}
-func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) validateUpdateTime(formats strfmt.Registry) error {
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r old available seat based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopStations(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSROldAvailableSeat) contextValidateStopStations(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StopStations); i++ {
+
+ if m.StopStations[i] != nil {
+ if err := m.StopStations[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StopStations" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
- if err := validate.Required("UpdateTime", "body", m.UpdateTime); err != nil {
- return err
}
return nil
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_daily_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_daily_timetable.go
index 7caa801c..6e547fd6 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_daily_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_daily_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -141,6 +142,47 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTimetable) validateVersion
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r rail daily timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDailyTrainInfo(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTimetable) contextValidateDailyTrainInfo(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTimetable) 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 *PTXServiceDTORailSpecificationV2THSRRailDailyTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_daily_train_info.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_daily_train_info.go
index df12de18..4b9439b6 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_daily_train_info.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_daily_train_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -123,7 +125,6 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) validateDirecti
}
func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) validateEndingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.EndingStationName) { // not required
return nil
}
@@ -132,7 +133,6 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) validateEndingS
}
func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) validateNote(formats strfmt.Registry) error {
-
if swag.IsZero(m.Note) { // not required
return nil
}
@@ -141,7 +141,6 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) validateNote(fo
}
func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) validateStartingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StartingStationName) { // not required
return nil
}
@@ -176,6 +175,43 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) validateVersion
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r rail daily train info based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNote(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) contextValidateNote(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRRailDailyTrainInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_general_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_general_timetable.go
index ab15e272..cd5275a2 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_general_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_general_timetable.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -109,6 +111,25 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTimetable) validateVersi
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r rail general timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateGeneralTimetable(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTimetable) contextValidateGeneralTimetable(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_general_train_info.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_general_train_info.go
index 13c42310..6133d630 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_general_train_info.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_general_train_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -103,7 +105,6 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) validateDirec
}
func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) validateEndingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.EndingStationName) { // not required
return nil
}
@@ -112,7 +113,6 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) validateEndin
}
func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) validateNote(formats strfmt.Registry) error {
-
if swag.IsZero(m.Note) { // not required
return nil
}
@@ -121,7 +121,6 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) validateNote(
}
func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) validateStartingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StartingStationName) { // not required
return nil
}
@@ -138,6 +137,43 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) validateTrain
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r rail general train info based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNote(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) contextValidateNote(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRRailGeneralTrainInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_o_d_daily_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_o_d_daily_timetable.go
index 0d3a34b0..8d60d6e9 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_o_d_daily_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_o_d_daily_timetable.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -138,6 +140,43 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailODDailyTimetable) validateVersi
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r rail o d daily timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRRailODDailyTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDailyTrainInfo(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateDestinationStopTime(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginStopTime(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailODDailyTimetable) contextValidateDailyTrainInfo(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailODDailyTimetable) contextValidateDestinationStopTime(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailODDailyTimetable) contextValidateOriginStopTime(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRRailODDailyTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_o_d_fare.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_o_d_fare.go
index faa10e59..6ebd3500 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_o_d_fare.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_o_d_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -215,6 +216,56 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailODFare) validateVersionID(forma
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r rail o d fare based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRRailODFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailODFare) contextValidateDestinationStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailODFare) contextValidateFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Fares); i++ {
+
+ if m.Fares[i] != nil {
+ if err := m.Fares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Fares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailODFare) contextValidateOriginStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRRailODFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_station.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_station.go
index 2f1025d1..940603ac 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_station.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_station.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -19,6 +21,26 @@ import (
// swagger:model PTX.Service.DTO.Rail.Specification.V2.THSR.RailStation
type PTXServiceDTORailSpecificationV2THSRRailStation struct {
+ // String
+ //
+ // 車站位置所屬縣市
+ LocationCity string `json:"LocationCity,omitempty"`
+
+ // String
+ //
+ // 車站位置所屬縣市代碼
+ LocationCityCode string `json:"LocationCityCode,omitempty"`
+
+ // String
+ //
+ // 車站位置所屬鄉鎮
+ LocationTown string `json:"LocationTown,omitempty"`
+
+ // String
+ //
+ // 車站位置所屬鄉鎮代碼
+ LocationTownCode string `json:"LocationTownCode,omitempty"`
+
// String
//
// 營運業者代碼
@@ -31,6 +53,12 @@ type PTXServiceDTORailSpecificationV2THSRRailStation struct {
// Required: true
StationAddress *string `json:"StationAddress"`
+ // String
+ //
+ // 車站簡碼(訂票系統用)
+ // Required: true
+ StationCode *string `json:"StationCode"`
+
// String
//
// 車站代碼
@@ -53,10 +81,9 @@ type PTXServiceDTORailSpecificationV2THSRRailStation struct {
// PointType
//
// 車站位置
- // Required: true
StationPosition struct {
- PTXServiceDTOSharedSpecificationV2BasePointType
- } `json:"StationPosition"`
+ PTXServiceDTORailSpecificationV2PointType
+ } `json:"StationPosition,omitempty"`
// String
//
@@ -89,6 +116,10 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailStation) Validate(formats strfm
res = append(res, err)
}
+ if err := m.validateStationCode(formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.validateStationID(formats); err != nil {
res = append(res, err)
}
@@ -137,6 +168,15 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailStation) validateStationAddress
return nil
}
+func (m *PTXServiceDTORailSpecificationV2THSRRailStation) validateStationCode(formats strfmt.Registry) error {
+
+ if err := validate.Required("StationCode", "body", m.StationCode); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *PTXServiceDTORailSpecificationV2THSRRailStation) validateStationID(formats strfmt.Registry) error {
if err := validate.Required("StationID", "body", m.StationID); err != nil {
@@ -152,6 +192,9 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailStation) validateStationName(fo
}
func (m *PTXServiceDTORailSpecificationV2THSRRailStation) validateStationPosition(formats strfmt.Registry) error {
+ if swag.IsZero(m.StationPosition) { // not required
+ return nil
+ }
return nil
}
@@ -183,6 +226,34 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailStation) validateVersionID(form
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r rail station based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRRailStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailStation) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailStation) contextValidateStationPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRRailStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_station_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_station_timetable.go
index dc2a7770..68493e4d 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_station_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_station_timetable.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -271,6 +273,43 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailStationTimetable) validateVersi
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r rail station timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRRailStationTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailStationTimetable) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailStationTimetable) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailStationTimetable) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRRailStationTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_stop_time.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_stop_time.go
index 8ad7157f..31f39b96 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_stop_time.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_rail_stop_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -109,6 +111,25 @@ func (m *PTXServiceDTORailSpecificationV2THSRRailStopTime) validateStopSequence(
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r rail stop time based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRRailStopTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRRailStopTime) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRRailStopTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_service_day.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_service_day.go
index cbe6e9a8..9feedf6f 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_service_day.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_service_day.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -163,6 +165,11 @@ func (m *PTXServiceDTORailSpecificationV2THSRServiceDay) validateWednesday(forma
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 t h s r service day based on context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_station_exit.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_station_exit.go
index b0dc6dd3..3ba41efe 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_station_exit.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_station_exit.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -227,6 +229,43 @@ func (m *PTXServiceDTORailSpecificationV2THSRStationExit) validateUpdateTime(for
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r station exit based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRStationExit) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateExitName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateExitPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRStationExit) contextValidateExitName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRStationExit) contextValidateExitPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRStationExit) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRStationExit) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_stop_station.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_stop_station.go
index 047b7371..a1d8f85b 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_stop_station.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_stop_station.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -197,6 +199,34 @@ func (m *PTXServiceDTORailSpecificationV2THSRStopStation) validateStopSequence(f
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r stop station based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRStopStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateNextStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRStopStation) contextValidateNextStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRStopStation) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRStopStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_t_h_s_r_shape.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_t_h_s_r_shape.go
index 9d1057e2..d6b833b2 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_t_h_s_r_shape.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_t_h_s_r_shape.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -121,6 +123,25 @@ func (m *PTXServiceDTORailSpecificationV2THSRTHSRShape) validateUpdateTime(forma
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r t h s r shape based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRTHSRShape) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRTHSRShape) contextValidateLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRTHSRShape) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_time_info_rail_daily_train_info.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_time_info_rail_daily_train_info.go
index d6386f82..ba15e8b9 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_time_info_rail_daily_train_info.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_h_s_r_time_info_rail_daily_train_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -103,7 +105,6 @@ func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) validat
}
func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) validateEndingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.EndingStationName) { // not required
return nil
}
@@ -112,7 +113,6 @@ func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) validat
}
func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) validateNote(formats strfmt.Registry) error {
-
if swag.IsZero(m.Note) { // not required
return nil
}
@@ -121,7 +121,6 @@ func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) validat
}
func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) validateStartingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StartingStationName) { // not required
return nil
}
@@ -138,6 +137,43 @@ func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) validat
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t h s r time info rail daily train info based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNote(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) contextValidateNote(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2THSRTimeInfoRailDailyTrainInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_general_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_general_timetable.go
index b75c316c..009c87d2 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_general_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_general_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -106,6 +107,56 @@ func (m *PTXServiceDTORailSpecificationV2TRAGeneralTimetable) validateStopTimes(
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a general timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRAGeneralTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateGeneralTrainInfo(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRAGeneralTimetable) contextValidateGeneralTrainInfo(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRAGeneralTimetable) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRAGeneralTimetable) 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 *PTXServiceDTORailSpecificationV2TRAGeneralTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line.go
index cbcbd5b0..2c33d454 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -187,6 +189,11 @@ func (m *PTXServiceDTORailSpecificationV2TRALine) validateUpdateTime(formats str
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 t r a line based on context it is used
+func (m *PTXServiceDTORailSpecificationV2TRALine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRALine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line_simple.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line_simple.go
index 01fb5eb2..fb9f0eb8 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line_simple.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line_simple.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -68,6 +70,11 @@ func (m *PTXServiceDTORailSpecificationV2TRALineSimple) validateLineNo(formats s
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 t r a line simple based on context it is used
+func (m *PTXServiceDTORailSpecificationV2TRALineSimple) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRALineSimple) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line_station.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line_station.go
index cd9fd5fa..dda85c36 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line_station.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_line_station.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -106,6 +108,11 @@ func (m *PTXServiceDTORailSpecificationV2TRALineStation) validateTraveledDistanc
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 t r a line station based on context it is used
+func (m *PTXServiceDTORailSpecificationV2TRALineStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRALineStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_network.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_network.go
index 5a4a95d6..a5a2c31b 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_network.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_network.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -219,6 +220,38 @@ func (m *PTXServiceDTORailSpecificationV2TRANetwork) validateUpdateTime(formats
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a network based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRANetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLines(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRANetwork) contextValidateLines(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Lines); i++ {
+
+ if m.Lines[i] != nil {
+ if err := m.Lines[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Lines" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRANetwork) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_daily_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_daily_timetable.go
index db022ecb..1c32183e 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_daily_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_daily_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -141,6 +142,47 @@ func (m *PTXServiceDTORailSpecificationV2TRARailDailyTimetable) validateVersionI
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail daily timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailDailyTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDailyTrainInfo(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailDailyTimetable) contextValidateDailyTrainInfo(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailDailyTimetable) 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 *PTXServiceDTORailSpecificationV2TRARailDailyTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_daily_train_info.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_daily_train_info.go
index 66deb442..3adff3dd 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_daily_train_info.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_daily_train_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -276,7 +278,6 @@ func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) validateDirectio
}
func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) validateEndingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.EndingStationName) { // not required
return nil
}
@@ -285,7 +286,6 @@ func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) validateEndingSt
}
func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) validateNote(formats strfmt.Registry) error {
-
if swag.IsZero(m.Note) { // not required
return nil
}
@@ -312,7 +312,6 @@ func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) validateServiceA
}
func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) validateStartingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StartingStationName) { // not required
return nil
}
@@ -379,6 +378,52 @@ func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) validateWheelcha
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail daily train info based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNote(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) contextValidateNote(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRARailDailyTrainInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_general_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_general_timetable.go
index c98c586e..d1f53cd8 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_general_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_general_timetable.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -71,6 +73,25 @@ func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTimetable) validateVersio
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail general timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateGeneralTimetable(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTimetable) contextValidateGeneralTimetable(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_general_train_info.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_general_train_info.go
new file mode 100644
index 00000000..7c550dc0
--- /dev/null
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_general_train_info.go
@@ -0,0 +1,393 @@
+// 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"
+)
+
+// PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo RailGeneralTrainInfo
+//
+// 臺鐵車次定期資料型別
+//
+// swagger:model PTX.Service.DTO.Rail.Specification.V2.TRA.RailGeneralTrainInfo
+type PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo struct {
+
+ // integer
+ //
+ // 是否人車同行班次(置於攜車袋之自行車各級列車均可乘車) : [0:'否',1:'是']
+ // Required: true
+ BikeFlag *int32 `json:"BikeFlag"`
+
+ // integer
+ //
+ // 是否設有哺(集)乳室車廂 : [0:'否',1:'是']
+ // Required: true
+ BreastFeedingFlag *int32 `json:"BreastFeedingFlag"`
+
+ // integer
+ //
+ // 是否為每日行駛 : [0:'否',1:'是']
+ // Required: true
+ DailyFlag *int32 `json:"DailyFlag"`
+
+ // integer
+ //
+ // 是否提供訂便當服務 : [0:'否',1:'是']
+ // Required: true
+ DiningFlag *int32 `json:"DiningFlag"`
+
+ // integer
+ //
+ // 順逆行 : [0:'順行',1:'逆行']
+ // Required: true
+ Direction *int32 `json:"Direction"`
+
+ // String
+ //
+ // 列車終點車站代號
+ EndingStationID string `json:"EndingStationID,omitempty"`
+
+ // NameType
+ //
+ // 列車終點車站名稱
+ EndingStationName struct {
+ PTXServiceDTOSharedSpecificationV2BaseNameType
+ } `json:"EndingStationName,omitempty"`
+
+ // NameType
+ //
+ // 附註說明
+ Note struct {
+ PTXServiceDTOSharedSpecificationV2BaseNameType
+ } `json:"Note,omitempty"`
+
+ // String
+ //
+ // 跨夜車站代碼
+ OverNightStationID string `json:"OverNightStationID,omitempty"`
+
+ // integer
+ //
+ // 是否提供行李服務 : [0:'否',1:'是']
+ // Required: true
+ PackageServiceFlag *int32 `json:"PackageServiceFlag"`
+
+ // String
+ //
+ // 列車起點車站代號
+ StartingStationID string `json:"StartingStationID,omitempty"`
+
+ // NameType
+ //
+ // 列車起點車站名稱
+ StartingStationName struct {
+ PTXServiceDTOSharedSpecificationV2BaseNameType
+ } `json:"StartingStationName,omitempty"`
+
+ // String
+ //
+ // 車次代碼
+ // Required: true
+ TrainNo *string `json:"TrainNo"`
+
+ // String
+ //
+ // 列車車種簡碼
+ TrainTypeCode string `json:"TrainTypeCode,omitempty"`
+
+ // String
+ //
+ // 列車車種代碼
+ TrainTypeID string `json:"TrainTypeID,omitempty"`
+
+ // NameType
+ //
+ // 列車車種名稱
+ TrainTypeName struct {
+ PTXServiceDTOSharedSpecificationV2BaseNameType
+ } `json:"TrainTypeName,omitempty"`
+
+ // integer
+ //
+ // 山海線類型 : [0:'不經山海線',1:'山線',2:'海線',3:'成追線']
+ TripLine int32 `json:"TripLine,omitempty"`
+
+ // DateTime
+ //
+ // 資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
+ // Required: true
+ UpdateTime *string `json:"UpdateTime"`
+
+ // Int32
+ //
+ // 資料版本編號
+ // Required: true
+ VersionID *int32 `json:"VersionID"`
+
+ // integer
+ //
+ // 是否設身障旅客專用座位車 : [0:'否',1:'是']
+ // Required: true
+ WheelchairFlag *int32 `json:"WheelchairFlag"`
+}
+
+// Validate validates this p t x service d t o rail specification v2 t r a rail general train info
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateBikeFlag(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateBreastFeedingFlag(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateDailyFlag(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateDiningFlag(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateDirection(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateEndingStationName(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateNote(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validatePackageServiceFlag(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateStartingStationName(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateTrainNo(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateTrainTypeName(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateUpdateTime(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateVersionID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateWheelchairFlag(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateBikeFlag(formats strfmt.Registry) error {
+
+ if err := validate.Required("BikeFlag", "body", m.BikeFlag); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateBreastFeedingFlag(formats strfmt.Registry) error {
+
+ if err := validate.Required("BreastFeedingFlag", "body", m.BreastFeedingFlag); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateDailyFlag(formats strfmt.Registry) error {
+
+ if err := validate.Required("DailyFlag", "body", m.DailyFlag); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateDiningFlag(formats strfmt.Registry) error {
+
+ if err := validate.Required("DiningFlag", "body", m.DiningFlag); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateDirection(formats strfmt.Registry) error {
+
+ if err := validate.Required("Direction", "body", m.Direction); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateEndingStationName(formats strfmt.Registry) error {
+ if swag.IsZero(m.EndingStationName) { // not required
+ return nil
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateNote(formats strfmt.Registry) error {
+ if swag.IsZero(m.Note) { // not required
+ return nil
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validatePackageServiceFlag(formats strfmt.Registry) error {
+
+ if err := validate.Required("PackageServiceFlag", "body", m.PackageServiceFlag); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateStartingStationName(formats strfmt.Registry) error {
+ if swag.IsZero(m.StartingStationName) { // not required
+ return nil
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateTrainNo(formats strfmt.Registry) error {
+
+ if err := validate.Required("TrainNo", "body", m.TrainNo); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateTrainTypeName(formats strfmt.Registry) error {
+ if swag.IsZero(m.TrainTypeName) { // not required
+ return nil
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateUpdateTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("UpdateTime", "body", m.UpdateTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateVersionID(formats strfmt.Registry) error {
+
+ if err := validate.Required("VersionID", "body", m.VersionID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) validateWheelchairFlag(formats strfmt.Registry) error {
+
+ if err := validate.Required("WheelchairFlag", "body", m.WheelchairFlag); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail general train info based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNote(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) contextValidateNote(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTORailSpecificationV2TRARailGeneralTrainInfo
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_live_board.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_live_board.go
index 21085ca9..fbfd8476 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_live_board.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_live_board.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -253,7 +255,6 @@ func (m *PTXServiceDTORailSpecificationV2TRARailLiveBoard) validateTrainNo(forma
}
func (m *PTXServiceDTORailSpecificationV2TRARailLiveBoard) validateTrainTypeName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TrainTypeName) { // not required
return nil
}
@@ -270,6 +271,43 @@ func (m *PTXServiceDTORailSpecificationV2TRARailLiveBoard) validateUpdateTime(fo
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail live board based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailLiveBoard) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailLiveBoard) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailLiveBoard) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailLiveBoard) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRARailLiveBoard) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_live_train_delay.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_live_train_delay.go
index 2d52f7b6..6d0564bb 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_live_train_delay.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_live_train_delay.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -142,6 +144,25 @@ func (m *PTXServiceDTORailSpecificationV2TRARailLiveTrainDelay) validateUpdateTi
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail live train delay based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailLiveTrainDelay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailLiveTrainDelay) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRARailLiveTrainDelay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_o_d_daily_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_o_d_daily_timetable.go
index 930032b4..bfdd5229 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_o_d_daily_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_o_d_daily_timetable.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -138,6 +140,43 @@ func (m *PTXServiceDTORailSpecificationV2TRARailODDailyTimetable) validateVersio
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail o d daily timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailODDailyTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDailyTrainInfo(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateDestinationStopTime(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginStopTime(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailODDailyTimetable) contextValidateDailyTrainInfo(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailODDailyTimetable) contextValidateDestinationStopTime(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailODDailyTimetable) contextValidateOriginStopTime(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRARailODDailyTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_o_d_fare.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_o_d_fare.go
index ae7f171c..3cca58a5 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_o_d_fare.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_o_d_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -196,6 +197,56 @@ func (m *PTXServiceDTORailSpecificationV2TRARailODFare) validateVersionID(format
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail o d fare based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailODFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailODFare) contextValidateDestinationStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailODFare) contextValidateFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Fares); i++ {
+
+ if m.Fares[i] != nil {
+ if err := m.Fares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Fares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailODFare) contextValidateOriginStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRARailODFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_station.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_station.go
index 13233e95..b0cd899b 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_station.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_station.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -19,6 +21,26 @@ import (
// swagger:model PTX.Service.DTO.Rail.Specification.V2.TRA.RailStation
type PTXServiceDTORailSpecificationV2TRARailStation struct {
+ // String
+ //
+ // 車站位置所屬縣市
+ LocationCity string `json:"LocationCity,omitempty"`
+
+ // String
+ //
+ // 車站位置所屬縣市代碼
+ LocationCityCode string `json:"LocationCityCode,omitempty"`
+
+ // String
+ //
+ // 車站位置所屬鄉鎮
+ LocationTown string `json:"LocationTown,omitempty"`
+
+ // String
+ //
+ // 車站位置所屬鄉鎮代碼
+ LocationTownCode string `json:"LocationTownCode,omitempty"`
+
// String
//
// 營運業者代碼
@@ -63,10 +85,9 @@ type PTXServiceDTORailSpecificationV2TRARailStation struct {
// PointType
//
// 車站位置
- // Required: true
StationPosition struct {
- PTXServiceDTOSharedSpecificationV2BasePointType
- } `json:"StationPosition"`
+ PTXServiceDTORailSpecificationV2PointType
+ } `json:"StationPosition,omitempty"`
// String
//
@@ -162,6 +183,9 @@ func (m *PTXServiceDTORailSpecificationV2TRARailStation) validateStationName(for
}
func (m *PTXServiceDTORailSpecificationV2TRARailStation) validateStationPosition(formats strfmt.Registry) error {
+ if swag.IsZero(m.StationPosition) { // not required
+ return nil
+ }
return nil
}
@@ -193,6 +217,34 @@ func (m *PTXServiceDTORailSpecificationV2TRARailStation) validateVersionID(forma
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail station based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailStation) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailStation) contextValidateStationPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRARailStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_station_timetable.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_station_timetable.go
index 3adc29bd..9773970a 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_station_timetable.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_station_timetable.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -280,7 +282,6 @@ func (m *PTXServiceDTORailSpecificationV2TRARailStationTimetable) validateTrainN
}
func (m *PTXServiceDTORailSpecificationV2TRARailStationTimetable) validateTrainTypeName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TrainTypeName) { // not required
return nil
}
@@ -306,6 +307,52 @@ func (m *PTXServiceDTORailSpecificationV2TRARailStationTimetable) validateVersio
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail station timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailStationTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailStationTimetable) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailStationTimetable) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailStationTimetable) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailStationTimetable) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRARailStationTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_stop_time.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_stop_time.go
index a2042f5a..e6ce1ff0 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_stop_time.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_rail_stop_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -123,6 +125,25 @@ func (m *PTXServiceDTORailSpecificationV2TRARailStopTime) validateStopSequence(f
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a rail stop time based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRARailStopTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRARailStopTime) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRARailStopTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_service_day.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_service_day.go
index 87b643dc..b0fecea6 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_service_day.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_service_day.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -163,6 +165,11 @@ func (m *PTXServiceDTORailSpecificationV2TRAServiceDay) validateWednesday(format
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v2 t r a service day based on context it is used
+func (m *PTXServiceDTORailSpecificationV2TRAServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRAServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_station_of_line.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_station_of_line.go
index a52db0b0..4dd3a30d 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_station_of_line.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_station_of_line.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -124,6 +125,38 @@ func (m *PTXServiceDTORailSpecificationV2TRAStationOfLine) validateUpdateTime(fo
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a station of line based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRAStationOfLine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStations(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRAStationOfLine) contextValidateStations(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Stations); i++ {
+
+ if m.Stations[i] != nil {
+ if err := m.Stations[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Stations" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRAStationOfLine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_t_r_a_shape.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_t_r_a_shape.go
index 795c8a31..ccadbf1e 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_t_r_a_shape.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_t_r_a_shape.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -142,6 +144,25 @@ func (m *PTXServiceDTORailSpecificationV2TRATRAShape) validateUpdateTime(formats
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a t r a shape based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRATRAShape) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRATRAShape) contextValidateLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRATRAShape) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_time_info_rail_daily_train_info.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_time_info_rail_daily_train_info.go
index a2de2a36..3d823c1e 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_time_info_rail_daily_train_info.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_time_info_rail_daily_train_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -245,7 +247,6 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) validate
}
func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) validateEndingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.EndingStationName) { // not required
return nil
}
@@ -254,7 +255,6 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) validate
}
func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) validateNote(formats strfmt.Registry) error {
-
if swag.IsZero(m.Note) { // not required
return nil
}
@@ -281,7 +281,6 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) validate
}
func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) validateStartingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StartingStationName) { // not required
return nil
}
@@ -299,7 +298,6 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) validate
}
func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) validateTrainTypeName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TrainTypeName) { // not required
return nil
}
@@ -316,6 +314,52 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) validate
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a time info rail daily train info based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNote(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) contextValidateNote(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailDailyTrainInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_time_info_rail_general_train_info.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_time_info_rail_general_train_info.go
index 60eb3fbe..49738823 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_time_info_rail_general_train_info.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_time_info_rail_general_train_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -119,18 +121,6 @@ type PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo struct {
// 山海線類型 : [0:'不經山海線',1:'山線',2:'海線',3:'成追線']
TripLine int32 `json:"TripLine,omitempty"`
- // DateTime
- //
- // 資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
- // Required: true
- UpdateTime *string `json:"UpdateTime"`
-
- // Int32
- //
- // 資料版本編號
- // Required: true
- VersionID *int32 `json:"VersionID"`
-
// integer
//
// 是否設身障旅客專用座位車 : [0:'否',1:'是']
@@ -186,14 +176,6 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) Valida
res = append(res, err)
}
- if err := m.validateUpdateTime(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateVersionID(formats); err != nil {
- res = append(res, err)
- }
-
if err := m.validateWheelchairFlag(formats); err != nil {
res = append(res, err)
}
@@ -250,7 +232,6 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) valida
}
func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) validateEndingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.EndingStationName) { // not required
return nil
}
@@ -259,7 +240,6 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) valida
}
func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) validateNote(formats strfmt.Registry) error {
-
if swag.IsZero(m.Note) { // not required
return nil
}
@@ -277,7 +257,6 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) valida
}
func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) validateStartingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StartingStationName) { // not required
return nil
}
@@ -295,7 +274,6 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) valida
}
func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) validateTrainTypeName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TrainTypeName) { // not required
return nil
}
@@ -303,29 +281,57 @@ func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) valida
return nil
}
-func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) validateUpdateTime(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) validateWheelchairFlag(formats strfmt.Registry) error {
- if err := validate.Required("UpdateTime", "body", m.UpdateTime); err != nil {
+ if err := validate.Required("WheelchairFlag", "body", m.WheelchairFlag); err != nil {
return err
}
return nil
}
-func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) validateVersionID(formats strfmt.Registry) error {
+// ContextValidate validate this p t x service d t o rail specification v2 t r a time info rail general train info based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
- if err := validate.Required("VersionID", "body", m.VersionID); err != nil {
- return err
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNote(ctx, formats); err != nil {
+ res = append(res, err)
}
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
return nil
}
-func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) validateWheelchairFlag(formats strfmt.Registry) error {
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
- if err := validate.Required("WheelchairFlag", "body", m.WheelchairFlag); err != nil {
- return err
- }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) contextValidateNote(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRATimeInfoRailGeneralTrainInfo) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
return nil
}
diff --git a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_train_type.go b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_train_type.go
index 1bd2e99b..169c54ab 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_train_type.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_rail_specification_v2_t_r_a_train_type.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -123,6 +125,25 @@ func (m *PTXServiceDTORailSpecificationV2TRATrainType) validateVersionID(formats
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v2 t r a train type based on the context it is used
+func (m *PTXServiceDTORailSpecificationV2TRATrainType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV2TRATrainType) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV2TRATrainType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_fare.go b/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_fare.go
index ee02b1cf..b96869b2 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_fare.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_fare.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -31,6 +33,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseFare) Validate(formats strfmt.Reg
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base fare based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go b/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
index ae2f0ea5..b757afa0 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -33,6 +35,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) Validate(formats strfmt
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base name type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go b/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go
index 84cf731f..cead550e 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_operator.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -191,6 +193,25 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) validateUpdateTime(form
return nil
}
+// ContextValidate validate this p t x service d t o shared specification v2 base operator based on the context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseOperator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go b/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
index 33cfe90a..02645203 100644
--- a/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
+++ b/rail/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -34,6 +36,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BasePointType) Validate(formats strfm
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base point type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BasePointType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BasePointType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/client/t_r_a/alert_api_controller_get_parameters.go b/rail/v3/client/t_r_a/alert_api_controller_get_parameters.go
index 5b5943ff..045d8e04 100644
--- a/rail/v3/client/t_r_a/alert_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/alert_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewAlertAPIControllerGetParams creates a new AlertAPIControllerGetParams object
-// with the default values initialized.
+// NewAlertAPIControllerGetParams creates a new AlertAPIControllerGetParams 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 NewAlertAPIControllerGetParams() *AlertAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AlertAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewAlertAPIControllerGetParamsWithTimeout creates a new AlertAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewAlertAPIControllerGetParamsWithTimeout(timeout time.Duration) *AlertAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AlertAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewAlertAPIControllerGetParamsWithContext creates a new AlertAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewAlertAPIControllerGetParamsWithContext(ctx context.Context) *AlertAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AlertAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewAlertAPIControllerGetParamsWithHTTPClient creates a new AlertAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewAlertAPIControllerGetParamsWithHTTPClient(client *http.Client) *AlertAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &AlertAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*AlertAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the alert Api controller get operation typically these are written to a http.Request
+/* AlertAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the alert Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type AlertAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type AlertAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the alert Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AlertAPIControllerGetParams) WithDefaults() *AlertAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the alert Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *AlertAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := AlertAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the alert Api controller get params
func (o *AlertAPIControllerGetParams) WithTimeout(timeout time.Duration) *AlertAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *AlertAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -277,64 +301,68 @@ func (o *AlertAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/alert_api_controller_get_responses.go b/rail/v3/client/t_r_a/alert_api_controller_get_responses.go
index 34c3dd44..a73601c5 100644
--- a/rail/v3/client/t_r_a/alert_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/alert_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *AlertAPIControllerGetReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewAlertAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewAlertAPIControllerGetOK() *AlertAPIControllerGetOK {
return &AlertAPIControllerGetOK{}
}
-/*AlertAPIControllerGetOK handles this case with default header values.
+/* AlertAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type AlertAPIControllerGetOK struct {
func (o *AlertAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/Alert][%d] alertApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *AlertAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRAAlertListAlert {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *AlertAPIControllerGetOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewAlertAPIControllerGetNotModified creates a AlertAPIControllerGetNotModified with default headers values
+func NewAlertAPIControllerGetNotModified() *AlertAPIControllerGetNotModified {
+ return &AlertAPIControllerGetNotModified{}
+}
+
+/* AlertAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type AlertAPIControllerGetNotModified struct {
+}
+
+func (o *AlertAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/Alert][%d] alertApiControllerGetNotModified ", 304)
+}
+
+func (o *AlertAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get1_parameters.go b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get1_parameters.go
index 650fa111..d38e9b71 100644
--- a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get1_parameters.go
+++ b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewDailyStationTimeTableAPIControllerGet1Params creates a new DailyStationTimeTableAPIControllerGet1Params object
-// with the default values initialized.
+// NewDailyStationTimeTableAPIControllerGet1Params creates a new DailyStationTimeTableAPIControllerGet1Params 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 NewDailyStationTimeTableAPIControllerGet1Params() *DailyStationTimeTableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewDailyStationTimeTableAPIControllerGet1ParamsWithTimeout creates a new DailyStationTimeTableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewDailyStationTimeTableAPIControllerGet1ParamsWithTimeout(timeout time.Duration) *DailyStationTimeTableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewDailyStationTimeTableAPIControllerGet1ParamsWithContext creates a new DailyStationTimeTableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewDailyStationTimeTableAPIControllerGet1ParamsWithContext(ctx context.Context) *DailyStationTimeTableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewDailyStationTimeTableAPIControllerGet1ParamsWithHTTPClient creates a new DailyStationTimeTableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewDailyStationTimeTableAPIControllerGet1ParamsWithHTTPClient(client *http.Client) *DailyStationTimeTableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*DailyStationTimeTableAPIControllerGet1Params contains all the parameters to send to the API endpoint
-for the daily station time table Api controller get 1 operation typically these are written to a http.Request
+/* DailyStationTimeTableAPIControllerGet1Params contains all the parameters to send to the API endpoint
+ for the daily station time table Api controller get 1 operation.
+
+ Typically these are written to a http.Request.
*/
type DailyStationTimeTableAPIControllerGet1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*StationID
- 欲查詢車站的代碼
+ /* StationID.
+
+ 欲查詢車站的代碼
*/
StationID string
@@ -119,6 +115,32 @@ type DailyStationTimeTableAPIControllerGet1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the daily station time table Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyStationTimeTableAPIControllerGet1Params) WithDefaults() *DailyStationTimeTableAPIControllerGet1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the daily station time table Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyStationTimeTableAPIControllerGet1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := DailyStationTimeTableAPIControllerGet1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the daily station time table Api controller get 1 params
func (o *DailyStationTimeTableAPIControllerGet1Params) WithTimeout(timeout time.Duration) *DailyStationTimeTableAPIControllerGet1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *DailyStationTimeTableAPIControllerGet1Params) WriteToRequest(r runtime.
// 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
}
@@ -293,64 +318,68 @@ func (o *DailyStationTimeTableAPIControllerGet1Params) WriteToRequest(r runtime.
// 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 StationID
diff --git a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get1_responses.go b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get1_responses.go
index a2d5f7df..db415a1b 100644
--- a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get1_responses.go
+++ b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get1_responses.go
@@ -29,7 +29,12 @@ func (o *DailyStationTimeTableAPIControllerGet1Reader) ReadResponse(response run
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewDailyStationTimeTableAPIControllerGet1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewDailyStationTimeTableAPIControllerGet1OK() *DailyStationTimeTableAPICont
return &DailyStationTimeTableAPIControllerGet1OK{}
}
-/*DailyStationTimeTableAPIControllerGet1OK handles this case with default header values.
+/* DailyStationTimeTableAPIControllerGet1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type DailyStationTimeTableAPIControllerGet1OK struct {
func (o *DailyStationTimeTableAPIControllerGet1OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/DailyStationTimetable/Today/Station/{StationID}][%d] dailyStationTimeTableApiControllerGet1OK %+v", 200, o.Payload)
}
-
func (o *DailyStationTimeTableAPIControllerGet1OK) GetPayload() *models.PTXAPIRailModelTraDailyStationWrapperPTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *DailyStationTimeTableAPIControllerGet1OK) readResponse(response runtime
return nil
}
+
+// NewDailyStationTimeTableAPIControllerGet1NotModified creates a DailyStationTimeTableAPIControllerGet1NotModified with default headers values
+func NewDailyStationTimeTableAPIControllerGet1NotModified() *DailyStationTimeTableAPIControllerGet1NotModified {
+ return &DailyStationTimeTableAPIControllerGet1NotModified{}
+}
+
+/* DailyStationTimeTableAPIControllerGet1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type DailyStationTimeTableAPIControllerGet1NotModified struct {
+}
+
+func (o *DailyStationTimeTableAPIControllerGet1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/DailyStationTimetable/Today/Station/{StationID}][%d] dailyStationTimeTableApiControllerGet1NotModified ", 304)
+}
+
+func (o *DailyStationTimeTableAPIControllerGet1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get2_parameters.go b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get2_parameters.go
index ffc13710..4e8c79b3 100644
--- a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get2_parameters.go
+++ b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get2_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewDailyStationTimeTableAPIControllerGet2Params creates a new DailyStationTimeTableAPIControllerGet2Params object
-// with the default values initialized.
+// NewDailyStationTimeTableAPIControllerGet2Params creates a new DailyStationTimeTableAPIControllerGet2Params 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 NewDailyStationTimeTableAPIControllerGet2Params() *DailyStationTimeTableAPIControllerGet2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGet2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewDailyStationTimeTableAPIControllerGet2ParamsWithTimeout creates a new DailyStationTimeTableAPIControllerGet2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewDailyStationTimeTableAPIControllerGet2ParamsWithTimeout(timeout time.Duration) *DailyStationTimeTableAPIControllerGet2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGet2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewDailyStationTimeTableAPIControllerGet2ParamsWithContext creates a new DailyStationTimeTableAPIControllerGet2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewDailyStationTimeTableAPIControllerGet2ParamsWithContext(ctx context.Context) *DailyStationTimeTableAPIControllerGet2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGet2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewDailyStationTimeTableAPIControllerGet2ParamsWithHTTPClient creates a new DailyStationTimeTableAPIControllerGet2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewDailyStationTimeTableAPIControllerGet2ParamsWithHTTPClient(client *http.Client) *DailyStationTimeTableAPIControllerGet2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGet2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*DailyStationTimeTableAPIControllerGet2Params contains all the parameters to send to the API endpoint
-for the daily station time table Api controller get 2 operation typically these are written to a http.Request
+/* DailyStationTimeTableAPIControllerGet2Params contains all the parameters to send to the API endpoint
+ for the daily station time table Api controller get 2 operation.
+
+ Typically these are written to a http.Request.
*/
type DailyStationTimeTableAPIControllerGet2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -119,6 +115,32 @@ type DailyStationTimeTableAPIControllerGet2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the daily station time table Api controller get 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyStationTimeTableAPIControllerGet2Params) WithDefaults() *DailyStationTimeTableAPIControllerGet2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the daily station time table Api controller get 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyStationTimeTableAPIControllerGet2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := DailyStationTimeTableAPIControllerGet2Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the daily station time table Api controller get 2 params
func (o *DailyStationTimeTableAPIControllerGet2Params) WithTimeout(timeout time.Duration) *DailyStationTimeTableAPIControllerGet2Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *DailyStationTimeTableAPIControllerGet2Params) WriteToRequest(r runtime.
// 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
}
@@ -293,64 +318,68 @@ func (o *DailyStationTimeTableAPIControllerGet2Params) WriteToRequest(r runtime.
// 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 TrainDate
diff --git a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get2_responses.go b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get2_responses.go
index f4bd30c9..2ea9859e 100644
--- a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get2_responses.go
+++ b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get2_responses.go
@@ -29,7 +29,12 @@ func (o *DailyStationTimeTableAPIControllerGet2Reader) ReadResponse(response run
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewDailyStationTimeTableAPIControllerGet2NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewDailyStationTimeTableAPIControllerGet2OK() *DailyStationTimeTableAPICont
return &DailyStationTimeTableAPIControllerGet2OK{}
}
-/*DailyStationTimeTableAPIControllerGet2OK handles this case with default header values.
+/* DailyStationTimeTableAPIControllerGet2OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type DailyStationTimeTableAPIControllerGet2OK struct {
func (o *DailyStationTimeTableAPIControllerGet2OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/DailyStationTimetable/TrainDate/{TrainDate}][%d] dailyStationTimeTableApiControllerGet2OK %+v", 200, o.Payload)
}
-
func (o *DailyStationTimeTableAPIControllerGet2OK) GetPayload() *models.PTXAPIRailModelTraDailyStationWrapperPTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *DailyStationTimeTableAPIControllerGet2OK) readResponse(response runtime
return nil
}
+
+// NewDailyStationTimeTableAPIControllerGet2NotModified creates a DailyStationTimeTableAPIControllerGet2NotModified with default headers values
+func NewDailyStationTimeTableAPIControllerGet2NotModified() *DailyStationTimeTableAPIControllerGet2NotModified {
+ return &DailyStationTimeTableAPIControllerGet2NotModified{}
+}
+
+/* DailyStationTimeTableAPIControllerGet2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type DailyStationTimeTableAPIControllerGet2NotModified struct {
+}
+
+func (o *DailyStationTimeTableAPIControllerGet2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/DailyStationTimetable/TrainDate/{TrainDate}][%d] dailyStationTimeTableApiControllerGet2NotModified ", 304)
+}
+
+func (o *DailyStationTimeTableAPIControllerGet2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get_parameters.go b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get_parameters.go
index 2e96c13f..0dfce860 100644
--- a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewDailyStationTimeTableAPIControllerGetParams creates a new DailyStationTimeTableAPIControllerGetParams object
-// with the default values initialized.
+// NewDailyStationTimeTableAPIControllerGetParams creates a new DailyStationTimeTableAPIControllerGetParams 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 NewDailyStationTimeTableAPIControllerGetParams() *DailyStationTimeTableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewDailyStationTimeTableAPIControllerGetParamsWithTimeout creates a new DailyStationTimeTableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewDailyStationTimeTableAPIControllerGetParamsWithTimeout(timeout time.Duration) *DailyStationTimeTableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewDailyStationTimeTableAPIControllerGetParamsWithContext creates a new DailyStationTimeTableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewDailyStationTimeTableAPIControllerGetParamsWithContext(ctx context.Context) *DailyStationTimeTableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewDailyStationTimeTableAPIControllerGetParamsWithHTTPClient creates a new DailyStationTimeTableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewDailyStationTimeTableAPIControllerGetParamsWithHTTPClient(client *http.Client) *DailyStationTimeTableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyStationTimeTableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*DailyStationTimeTableAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the daily station time table Api controller get operation typically these are written to a http.Request
+/* DailyStationTimeTableAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the daily station time table Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type DailyStationTimeTableAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type DailyStationTimeTableAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the daily station time table Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyStationTimeTableAPIControllerGetParams) WithDefaults() *DailyStationTimeTableAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the daily station time table Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyStationTimeTableAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := DailyStationTimeTableAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the daily station time table Api controller get params
func (o *DailyStationTimeTableAPIControllerGetParams) WithTimeout(timeout time.Duration) *DailyStationTimeTableAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *DailyStationTimeTableAPIControllerGetParams) WriteToRequest(r runtime.C
// 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
}
@@ -277,64 +301,68 @@ func (o *DailyStationTimeTableAPIControllerGetParams) WriteToRequest(r runtime.C
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get_responses.go b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get_responses.go
index d5469c80..089eebfe 100644
--- a/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/daily_station_time_table_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *DailyStationTimeTableAPIControllerGetReader) ReadResponse(response runt
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewDailyStationTimeTableAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewDailyStationTimeTableAPIControllerGetOK() *DailyStationTimeTableAPIContr
return &DailyStationTimeTableAPIControllerGetOK{}
}
-/*DailyStationTimeTableAPIControllerGetOK handles this case with default header values.
+/* DailyStationTimeTableAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type DailyStationTimeTableAPIControllerGetOK struct {
func (o *DailyStationTimeTableAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/DailyStationTimetable/Today][%d] dailyStationTimeTableApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *DailyStationTimeTableAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTraDailyStationWrapperPTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *DailyStationTimeTableAPIControllerGetOK) readResponse(response runtime.
return nil
}
+
+// NewDailyStationTimeTableAPIControllerGetNotModified creates a DailyStationTimeTableAPIControllerGetNotModified with default headers values
+func NewDailyStationTimeTableAPIControllerGetNotModified() *DailyStationTimeTableAPIControllerGetNotModified {
+ return &DailyStationTimeTableAPIControllerGetNotModified{}
+}
+
+/* DailyStationTimeTableAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type DailyStationTimeTableAPIControllerGetNotModified struct {
+}
+
+func (o *DailyStationTimeTableAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/DailyStationTimetable/Today][%d] dailyStationTimeTableApiControllerGetNotModified ", 304)
+}
+
+func (o *DailyStationTimeTableAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get1_parameters.go b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get1_parameters.go
index cc035b85..a079e819 100644
--- a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get1_parameters.go
+++ b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewDailyTrainTimeTableAPIControllerGet1Params creates a new DailyTrainTimeTableAPIControllerGet1Params object
-// with the default values initialized.
+// NewDailyTrainTimeTableAPIControllerGet1Params creates a new DailyTrainTimeTableAPIControllerGet1Params 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 NewDailyTrainTimeTableAPIControllerGet1Params() *DailyTrainTimeTableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewDailyTrainTimeTableAPIControllerGet1ParamsWithTimeout creates a new DailyTrainTimeTableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewDailyTrainTimeTableAPIControllerGet1ParamsWithTimeout(timeout time.Duration) *DailyTrainTimeTableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewDailyTrainTimeTableAPIControllerGet1ParamsWithContext creates a new DailyTrainTimeTableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewDailyTrainTimeTableAPIControllerGet1ParamsWithContext(ctx context.Context) *DailyTrainTimeTableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewDailyTrainTimeTableAPIControllerGet1ParamsWithHTTPClient creates a new DailyTrainTimeTableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewDailyTrainTimeTableAPIControllerGet1ParamsWithHTTPClient(client *http.Client) *DailyTrainTimeTableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*DailyTrainTimeTableAPIControllerGet1Params contains all the parameters to send to the API endpoint
-for the daily train time table Api controller get 1 operation typically these are written to a http.Request
+/* DailyTrainTimeTableAPIControllerGet1Params contains all the parameters to send to the API endpoint
+ for the daily train time table Api controller get 1 operation.
+
+ Typically these are written to a http.Request.
*/
type DailyTrainTimeTableAPIControllerGet1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -119,6 +115,32 @@ type DailyTrainTimeTableAPIControllerGet1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the daily train time table Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyTrainTimeTableAPIControllerGet1Params) WithDefaults() *DailyTrainTimeTableAPIControllerGet1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the daily train time table Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyTrainTimeTableAPIControllerGet1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := DailyTrainTimeTableAPIControllerGet1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the daily train time table Api controller get 1 params
func (o *DailyTrainTimeTableAPIControllerGet1Params) WithTimeout(timeout time.Duration) *DailyTrainTimeTableAPIControllerGet1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *DailyTrainTimeTableAPIControllerGet1Params) WriteToRequest(r runtime.Cl
// 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
}
@@ -293,64 +318,68 @@ func (o *DailyTrainTimeTableAPIControllerGet1Params) WriteToRequest(r runtime.Cl
// 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 TrainNo
diff --git a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get1_responses.go b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get1_responses.go
index 486c45da..10308f86 100644
--- a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get1_responses.go
+++ b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get1_responses.go
@@ -29,7 +29,12 @@ func (o *DailyTrainTimeTableAPIControllerGet1Reader) ReadResponse(response runti
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewDailyTrainTimeTableAPIControllerGet1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewDailyTrainTimeTableAPIControllerGet1OK() *DailyTrainTimeTableAPIControll
return &DailyTrainTimeTableAPIControllerGet1OK{}
}
-/*DailyTrainTimeTableAPIControllerGet1OK handles this case with default header values.
+/* DailyTrainTimeTableAPIControllerGet1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type DailyTrainTimeTableAPIControllerGet1OK struct {
func (o *DailyTrainTimeTableAPIControllerGet1OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/DailyTrainTimetable/Today/TrainNo/{TrainNo}][%d] dailyTrainTimeTableApiControllerGet1OK %+v", 200, o.Payload)
}
-
func (o *DailyTrainTimeTableAPIControllerGet1OK) GetPayload() *models.PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *DailyTrainTimeTableAPIControllerGet1OK) readResponse(response runtime.C
return nil
}
+
+// NewDailyTrainTimeTableAPIControllerGet1NotModified creates a DailyTrainTimeTableAPIControllerGet1NotModified with default headers values
+func NewDailyTrainTimeTableAPIControllerGet1NotModified() *DailyTrainTimeTableAPIControllerGet1NotModified {
+ return &DailyTrainTimeTableAPIControllerGet1NotModified{}
+}
+
+/* DailyTrainTimeTableAPIControllerGet1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type DailyTrainTimeTableAPIControllerGet1NotModified struct {
+}
+
+func (o *DailyTrainTimeTableAPIControllerGet1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/DailyTrainTimetable/Today/TrainNo/{TrainNo}][%d] dailyTrainTimeTableApiControllerGet1NotModified ", 304)
+}
+
+func (o *DailyTrainTimeTableAPIControllerGet1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get2_parameters.go b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get2_parameters.go
index 4a84d920..b7aaacd9 100644
--- a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get2_parameters.go
+++ b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get2_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewDailyTrainTimeTableAPIControllerGet2Params creates a new DailyTrainTimeTableAPIControllerGet2Params object
-// with the default values initialized.
+// NewDailyTrainTimeTableAPIControllerGet2Params creates a new DailyTrainTimeTableAPIControllerGet2Params 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 NewDailyTrainTimeTableAPIControllerGet2Params() *DailyTrainTimeTableAPIControllerGet2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet2Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewDailyTrainTimeTableAPIControllerGet2ParamsWithTimeout creates a new DailyTrainTimeTableAPIControllerGet2Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewDailyTrainTimeTableAPIControllerGet2ParamsWithTimeout(timeout time.Duration) *DailyTrainTimeTableAPIControllerGet2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet2Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewDailyTrainTimeTableAPIControllerGet2ParamsWithContext creates a new DailyTrainTimeTableAPIControllerGet2Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewDailyTrainTimeTableAPIControllerGet2ParamsWithContext(ctx context.Context) *DailyTrainTimeTableAPIControllerGet2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet2Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewDailyTrainTimeTableAPIControllerGet2ParamsWithHTTPClient creates a new DailyTrainTimeTableAPIControllerGet2Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewDailyTrainTimeTableAPIControllerGet2ParamsWithHTTPClient(client *http.Client) *DailyTrainTimeTableAPIControllerGet2Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet2Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*DailyTrainTimeTableAPIControllerGet2Params contains all the parameters to send to the API endpoint
-for the daily train time table Api controller get 2 operation typically these are written to a http.Request
+/* DailyTrainTimeTableAPIControllerGet2Params contains all the parameters to send to the API endpoint
+ for the daily train time table Api controller get 2 operation.
+
+ Typically these are written to a http.Request.
*/
type DailyTrainTimeTableAPIControllerGet2Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainDate
- 欲查詢車次的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢車次的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -119,6 +115,32 @@ type DailyTrainTimeTableAPIControllerGet2Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the daily train time table Api controller get 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyTrainTimeTableAPIControllerGet2Params) WithDefaults() *DailyTrainTimeTableAPIControllerGet2Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the daily train time table Api controller get 2 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyTrainTimeTableAPIControllerGet2Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := DailyTrainTimeTableAPIControllerGet2Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the daily train time table Api controller get 2 params
func (o *DailyTrainTimeTableAPIControllerGet2Params) WithTimeout(timeout time.Duration) *DailyTrainTimeTableAPIControllerGet2Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *DailyTrainTimeTableAPIControllerGet2Params) WriteToRequest(r runtime.Cl
// 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
}
@@ -293,64 +318,68 @@ func (o *DailyTrainTimeTableAPIControllerGet2Params) WriteToRequest(r runtime.Cl
// 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 TrainDate
diff --git a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get2_responses.go b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get2_responses.go
index c855aff7..40ea1005 100644
--- a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get2_responses.go
+++ b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get2_responses.go
@@ -29,7 +29,12 @@ func (o *DailyTrainTimeTableAPIControllerGet2Reader) ReadResponse(response runti
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewDailyTrainTimeTableAPIControllerGet2NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewDailyTrainTimeTableAPIControllerGet2OK() *DailyTrainTimeTableAPIControll
return &DailyTrainTimeTableAPIControllerGet2OK{}
}
-/*DailyTrainTimeTableAPIControllerGet2OK handles this case with default header values.
+/* DailyTrainTimeTableAPIControllerGet2OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type DailyTrainTimeTableAPIControllerGet2OK struct {
func (o *DailyTrainTimeTableAPIControllerGet2OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/DailyTrainTimetable/TrainDate/{TrainDate}][%d] dailyTrainTimeTableApiControllerGet2OK %+v", 200, o.Payload)
}
-
func (o *DailyTrainTimeTableAPIControllerGet2OK) GetPayload() *models.PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *DailyTrainTimeTableAPIControllerGet2OK) readResponse(response runtime.C
return nil
}
+
+// NewDailyTrainTimeTableAPIControllerGet2NotModified creates a DailyTrainTimeTableAPIControllerGet2NotModified with default headers values
+func NewDailyTrainTimeTableAPIControllerGet2NotModified() *DailyTrainTimeTableAPIControllerGet2NotModified {
+ return &DailyTrainTimeTableAPIControllerGet2NotModified{}
+}
+
+/* DailyTrainTimeTableAPIControllerGet2NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type DailyTrainTimeTableAPIControllerGet2NotModified struct {
+}
+
+func (o *DailyTrainTimeTableAPIControllerGet2NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/DailyTrainTimetable/TrainDate/{TrainDate}][%d] dailyTrainTimeTableApiControllerGet2NotModified ", 304)
+}
+
+func (o *DailyTrainTimeTableAPIControllerGet2NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get3_parameters.go b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get3_parameters.go
index 0a7bf394..b0dc76bc 100644
--- a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get3_parameters.go
+++ b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get3_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewDailyTrainTimeTableAPIControllerGet3Params creates a new DailyTrainTimeTableAPIControllerGet3Params object
-// with the default values initialized.
+// NewDailyTrainTimeTableAPIControllerGet3Params creates a new DailyTrainTimeTableAPIControllerGet3Params 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 NewDailyTrainTimeTableAPIControllerGet3Params() *DailyTrainTimeTableAPIControllerGet3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet3Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewDailyTrainTimeTableAPIControllerGet3ParamsWithTimeout creates a new DailyTrainTimeTableAPIControllerGet3Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewDailyTrainTimeTableAPIControllerGet3ParamsWithTimeout(timeout time.Duration) *DailyTrainTimeTableAPIControllerGet3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet3Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewDailyTrainTimeTableAPIControllerGet3ParamsWithContext creates a new DailyTrainTimeTableAPIControllerGet3Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewDailyTrainTimeTableAPIControllerGet3ParamsWithContext(ctx context.Context) *DailyTrainTimeTableAPIControllerGet3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet3Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewDailyTrainTimeTableAPIControllerGet3ParamsWithHTTPClient creates a new DailyTrainTimeTableAPIControllerGet3Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewDailyTrainTimeTableAPIControllerGet3ParamsWithHTTPClient(client *http.Client) *DailyTrainTimeTableAPIControllerGet3Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet3Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*DailyTrainTimeTableAPIControllerGet3Params contains all the parameters to send to the API endpoint
-for the daily train time table Api controller get 3 operation typically these are written to a http.Request
+/* DailyTrainTimeTableAPIControllerGet3Params contains all the parameters to send to the API endpoint
+ for the daily train time table Api controller get 3 operation.
+
+ Typically these are written to a http.Request.
*/
type DailyTrainTimeTableAPIControllerGet3Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*DestinationStationID
- 迄點車站代碼
+ /* DestinationStationID.
+
+ 迄點車站代碼
*/
DestinationStationID string
- /*OriginStationID
- 起點車站代碼
+ /* OriginStationID.
+
+ 起點車站代碼
*/
OriginStationID string
- /*TrainDate
- 欲查詢的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -129,6 +127,32 @@ type DailyTrainTimeTableAPIControllerGet3Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the daily train time table Api controller get 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyTrainTimeTableAPIControllerGet3Params) WithDefaults() *DailyTrainTimeTableAPIControllerGet3Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the daily train time table Api controller get 3 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyTrainTimeTableAPIControllerGet3Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := DailyTrainTimeTableAPIControllerGet3Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the daily train time table Api controller get 3 params
func (o *DailyTrainTimeTableAPIControllerGet3Params) WithTimeout(timeout time.Duration) *DailyTrainTimeTableAPIControllerGet3Params {
o.SetTimeout(timeout)
@@ -284,38 +308,41 @@ func (o *DailyTrainTimeTableAPIControllerGet3Params) WriteToRequest(r runtime.Cl
// 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
}
@@ -325,64 +352,68 @@ func (o *DailyTrainTimeTableAPIControllerGet3Params) WriteToRequest(r runtime.Cl
// 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 DestinationStationID
diff --git a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get3_responses.go b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get3_responses.go
index 7361470d..80a10efd 100644
--- a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get3_responses.go
+++ b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get3_responses.go
@@ -29,7 +29,12 @@ func (o *DailyTrainTimeTableAPIControllerGet3Reader) ReadResponse(response runti
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewDailyTrainTimeTableAPIControllerGet3NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewDailyTrainTimeTableAPIControllerGet3OK() *DailyTrainTimeTableAPIControll
return &DailyTrainTimeTableAPIControllerGet3OK{}
}
-/*DailyTrainTimeTableAPIControllerGet3OK handles this case with default header values.
+/* DailyTrainTimeTableAPIControllerGet3OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type DailyTrainTimeTableAPIControllerGet3OK struct {
func (o *DailyTrainTimeTableAPIControllerGet3OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/DailyTrainTimetable/OD/{OriginStationID}/to/{DestinationStationID}/{TrainDate}][%d] dailyTrainTimeTableApiControllerGet3OK %+v", 200, o.Payload)
}
-
func (o *DailyTrainTimeTableAPIControllerGet3OK) GetPayload() *models.PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *DailyTrainTimeTableAPIControllerGet3OK) readResponse(response runtime.C
return nil
}
+
+// NewDailyTrainTimeTableAPIControllerGet3NotModified creates a DailyTrainTimeTableAPIControllerGet3NotModified with default headers values
+func NewDailyTrainTimeTableAPIControllerGet3NotModified() *DailyTrainTimeTableAPIControllerGet3NotModified {
+ return &DailyTrainTimeTableAPIControllerGet3NotModified{}
+}
+
+/* DailyTrainTimeTableAPIControllerGet3NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type DailyTrainTimeTableAPIControllerGet3NotModified struct {
+}
+
+func (o *DailyTrainTimeTableAPIControllerGet3NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/DailyTrainTimetable/OD/{OriginStationID}/to/{DestinationStationID}/{TrainDate}][%d] dailyTrainTimeTableApiControllerGet3NotModified ", 304)
+}
+
+func (o *DailyTrainTimeTableAPIControllerGet3NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get4_parameters.go b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get4_parameters.go
index ad590469..e98e9cf8 100644
--- a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get4_parameters.go
+++ b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get4_parameters.go
@@ -17,110 +17,108 @@ import (
"github.com/go-openapi/swag"
)
-// NewDailyTrainTimeTableAPIControllerGet4Params creates a new DailyTrainTimeTableAPIControllerGet4Params object
-// with the default values initialized.
+// NewDailyTrainTimeTableAPIControllerGet4Params creates a new DailyTrainTimeTableAPIControllerGet4Params 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 NewDailyTrainTimeTableAPIControllerGet4Params() *DailyTrainTimeTableAPIControllerGet4Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet4Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewDailyTrainTimeTableAPIControllerGet4ParamsWithTimeout creates a new DailyTrainTimeTableAPIControllerGet4Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewDailyTrainTimeTableAPIControllerGet4ParamsWithTimeout(timeout time.Duration) *DailyTrainTimeTableAPIControllerGet4Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet4Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewDailyTrainTimeTableAPIControllerGet4ParamsWithContext creates a new DailyTrainTimeTableAPIControllerGet4Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewDailyTrainTimeTableAPIControllerGet4ParamsWithContext(ctx context.Context) *DailyTrainTimeTableAPIControllerGet4Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet4Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewDailyTrainTimeTableAPIControllerGet4ParamsWithHTTPClient creates a new DailyTrainTimeTableAPIControllerGet4Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewDailyTrainTimeTableAPIControllerGet4ParamsWithHTTPClient(client *http.Client) *DailyTrainTimeTableAPIControllerGet4Params {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGet4Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*DailyTrainTimeTableAPIControllerGet4Params contains all the parameters to send to the API endpoint
-for the daily train time table Api controller get 4 operation typically these are written to a http.Request
+/* DailyTrainTimeTableAPIControllerGet4Params contains all the parameters to send to the API endpoint
+ for the daily train time table Api controller get 4 operation.
+
+ Typically these are written to a http.Request.
*/
type DailyTrainTimeTableAPIControllerGet4Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*DestinationStationID
- 迄點車站代碼
+ /* DestinationStationID.
+
+ 迄點車站代碼
*/
DestinationStationID string
- /*OriginStationID
- 起點車站代碼
+ /* OriginStationID.
+
+ 起點車站代碼
*/
OriginStationID string
- /*TrainDate
- 欲查詢的日期(格式: yyyy-MM-dd)
+ /* TrainDate.
+
+ 欲查詢的日期(格式: yyyy-MM-dd)
*/
TrainDate string
@@ -129,6 +127,32 @@ type DailyTrainTimeTableAPIControllerGet4Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the daily train time table Api controller get 4 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyTrainTimeTableAPIControllerGet4Params) WithDefaults() *DailyTrainTimeTableAPIControllerGet4Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the daily train time table Api controller get 4 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyTrainTimeTableAPIControllerGet4Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := DailyTrainTimeTableAPIControllerGet4Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the daily train time table Api controller get 4 params
func (o *DailyTrainTimeTableAPIControllerGet4Params) WithTimeout(timeout time.Duration) *DailyTrainTimeTableAPIControllerGet4Params {
o.SetTimeout(timeout)
@@ -284,38 +308,41 @@ func (o *DailyTrainTimeTableAPIControllerGet4Params) WriteToRequest(r runtime.Cl
// 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
}
@@ -325,64 +352,68 @@ func (o *DailyTrainTimeTableAPIControllerGet4Params) WriteToRequest(r runtime.Cl
// 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 DestinationStationID
diff --git a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get4_responses.go b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get4_responses.go
index db3740eb..79e34f67 100644
--- a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get4_responses.go
+++ b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get4_responses.go
@@ -29,7 +29,12 @@ func (o *DailyTrainTimeTableAPIControllerGet4Reader) ReadResponse(response runti
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewDailyTrainTimeTableAPIControllerGet4NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewDailyTrainTimeTableAPIControllerGet4OK() *DailyTrainTimeTableAPIControll
return &DailyTrainTimeTableAPIControllerGet4OK{}
}
-/*DailyTrainTimeTableAPIControllerGet4OK handles this case with default header values.
+/* DailyTrainTimeTableAPIControllerGet4OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type DailyTrainTimeTableAPIControllerGet4OK struct {
func (o *DailyTrainTimeTableAPIControllerGet4OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/DailyTrainTimetable/OD/Inclusive/{OriginStationID}/to/{DestinationStationID}/{TrainDate}][%d] dailyTrainTimeTableApiControllerGet4OK %+v", 200, o.Payload)
}
-
func (o *DailyTrainTimeTableAPIControllerGet4OK) GetPayload() *models.PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *DailyTrainTimeTableAPIControllerGet4OK) readResponse(response runtime.C
return nil
}
+
+// NewDailyTrainTimeTableAPIControllerGet4NotModified creates a DailyTrainTimeTableAPIControllerGet4NotModified with default headers values
+func NewDailyTrainTimeTableAPIControllerGet4NotModified() *DailyTrainTimeTableAPIControllerGet4NotModified {
+ return &DailyTrainTimeTableAPIControllerGet4NotModified{}
+}
+
+/* DailyTrainTimeTableAPIControllerGet4NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type DailyTrainTimeTableAPIControllerGet4NotModified struct {
+}
+
+func (o *DailyTrainTimeTableAPIControllerGet4NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/DailyTrainTimetable/OD/Inclusive/{OriginStationID}/to/{DestinationStationID}/{TrainDate}][%d] dailyTrainTimeTableApiControllerGet4NotModified ", 304)
+}
+
+func (o *DailyTrainTimeTableAPIControllerGet4NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get_parameters.go b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get_parameters.go
index 43a77448..889cfbb1 100644
--- a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewDailyTrainTimeTableAPIControllerGetParams creates a new DailyTrainTimeTableAPIControllerGetParams object
-// with the default values initialized.
+// NewDailyTrainTimeTableAPIControllerGetParams creates a new DailyTrainTimeTableAPIControllerGetParams 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 NewDailyTrainTimeTableAPIControllerGetParams() *DailyTrainTimeTableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewDailyTrainTimeTableAPIControllerGetParamsWithTimeout creates a new DailyTrainTimeTableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewDailyTrainTimeTableAPIControllerGetParamsWithTimeout(timeout time.Duration) *DailyTrainTimeTableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewDailyTrainTimeTableAPIControllerGetParamsWithContext creates a new DailyTrainTimeTableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewDailyTrainTimeTableAPIControllerGetParamsWithContext(ctx context.Context) *DailyTrainTimeTableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewDailyTrainTimeTableAPIControllerGetParamsWithHTTPClient creates a new DailyTrainTimeTableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewDailyTrainTimeTableAPIControllerGetParamsWithHTTPClient(client *http.Client) *DailyTrainTimeTableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &DailyTrainTimeTableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*DailyTrainTimeTableAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the daily train time table Api controller get operation typically these are written to a http.Request
+/* DailyTrainTimeTableAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the daily train time table Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type DailyTrainTimeTableAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type DailyTrainTimeTableAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the daily train time table Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyTrainTimeTableAPIControllerGetParams) WithDefaults() *DailyTrainTimeTableAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the daily train time table Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *DailyTrainTimeTableAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := DailyTrainTimeTableAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the daily train time table Api controller get params
func (o *DailyTrainTimeTableAPIControllerGetParams) WithTimeout(timeout time.Duration) *DailyTrainTimeTableAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *DailyTrainTimeTableAPIControllerGetParams) WriteToRequest(r runtime.Cli
// 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
}
@@ -277,64 +301,68 @@ func (o *DailyTrainTimeTableAPIControllerGetParams) WriteToRequest(r runtime.Cli
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get_responses.go b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get_responses.go
index 53b7f8a9..7dde4e63 100644
--- a/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/daily_train_time_table_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *DailyTrainTimeTableAPIControllerGetReader) ReadResponse(response runtim
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewDailyTrainTimeTableAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewDailyTrainTimeTableAPIControllerGetOK() *DailyTrainTimeTableAPIControlle
return &DailyTrainTimeTableAPIControllerGetOK{}
}
-/*DailyTrainTimeTableAPIControllerGetOK handles this case with default header values.
+/* DailyTrainTimeTableAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type DailyTrainTimeTableAPIControllerGetOK struct {
func (o *DailyTrainTimeTableAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/DailyTrainTimetable/Today][%d] dailyTrainTimeTableApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *DailyTrainTimeTableAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *DailyTrainTimeTableAPIControllerGetOK) readResponse(response runtime.Cl
return nil
}
+
+// NewDailyTrainTimeTableAPIControllerGetNotModified creates a DailyTrainTimeTableAPIControllerGetNotModified with default headers values
+func NewDailyTrainTimeTableAPIControllerGetNotModified() *DailyTrainTimeTableAPIControllerGetNotModified {
+ return &DailyTrainTimeTableAPIControllerGetNotModified{}
+}
+
+/* DailyTrainTimeTableAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type DailyTrainTimeTableAPIControllerGetNotModified struct {
+}
+
+func (o *DailyTrainTimeTableAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/DailyTrainTimetable/Today][%d] dailyTrainTimeTableApiControllerGetNotModified ", 304)
+}
+
+func (o *DailyTrainTimeTableAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/general_station_timetable_api_controller_get1_parameters.go b/rail/v3/client/t_r_a/general_station_timetable_api_controller_get1_parameters.go
index 1c2e8630..a474cc84 100644
--- a/rail/v3/client/t_r_a/general_station_timetable_api_controller_get1_parameters.go
+++ b/rail/v3/client/t_r_a/general_station_timetable_api_controller_get1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewGeneralStationTimetableAPIControllerGet1Params creates a new GeneralStationTimetableAPIControllerGet1Params object
-// with the default values initialized.
+// NewGeneralStationTimetableAPIControllerGet1Params creates a new GeneralStationTimetableAPIControllerGet1Params 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 NewGeneralStationTimetableAPIControllerGet1Params() *GeneralStationTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralStationTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewGeneralStationTimetableAPIControllerGet1ParamsWithTimeout creates a new GeneralStationTimetableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewGeneralStationTimetableAPIControllerGet1ParamsWithTimeout(timeout time.Duration) *GeneralStationTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralStationTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewGeneralStationTimetableAPIControllerGet1ParamsWithContext creates a new GeneralStationTimetableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewGeneralStationTimetableAPIControllerGet1ParamsWithContext(ctx context.Context) *GeneralStationTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralStationTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewGeneralStationTimetableAPIControllerGet1ParamsWithHTTPClient creates a new GeneralStationTimetableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewGeneralStationTimetableAPIControllerGet1ParamsWithHTTPClient(client *http.Client) *GeneralStationTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralStationTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*GeneralStationTimetableAPIControllerGet1Params contains all the parameters to send to the API endpoint
-for the general station timetable Api controller get 1 operation typically these are written to a http.Request
+/* GeneralStationTimetableAPIControllerGet1Params contains all the parameters to send to the API endpoint
+ for the general station timetable Api controller get 1 operation.
+
+ Typically these are written to a http.Request.
*/
type GeneralStationTimetableAPIControllerGet1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*StationID
- 欲查詢車站的代碼
+ /* StationID.
+
+ 欲查詢車站的代碼
*/
StationID string
@@ -119,6 +115,32 @@ type GeneralStationTimetableAPIControllerGet1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the general station timetable Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *GeneralStationTimetableAPIControllerGet1Params) WithDefaults() *GeneralStationTimetableAPIControllerGet1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the general station timetable Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *GeneralStationTimetableAPIControllerGet1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := GeneralStationTimetableAPIControllerGet1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the general station timetable Api controller get 1 params
func (o *GeneralStationTimetableAPIControllerGet1Params) WithTimeout(timeout time.Duration) *GeneralStationTimetableAPIControllerGet1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *GeneralStationTimetableAPIControllerGet1Params) WriteToRequest(r runtim
// 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
}
@@ -293,64 +318,68 @@ func (o *GeneralStationTimetableAPIControllerGet1Params) WriteToRequest(r runtim
// 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 StationID
diff --git a/rail/v3/client/t_r_a/general_station_timetable_api_controller_get1_responses.go b/rail/v3/client/t_r_a/general_station_timetable_api_controller_get1_responses.go
index 68d80c81..5a0706f5 100644
--- a/rail/v3/client/t_r_a/general_station_timetable_api_controller_get1_responses.go
+++ b/rail/v3/client/t_r_a/general_station_timetable_api_controller_get1_responses.go
@@ -29,7 +29,12 @@ func (o *GeneralStationTimetableAPIControllerGet1Reader) ReadResponse(response r
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewGeneralStationTimetableAPIControllerGet1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewGeneralStationTimetableAPIControllerGet1OK() *GeneralStationTimetableAPI
return &GeneralStationTimetableAPIControllerGet1OK{}
}
-/*GeneralStationTimetableAPIControllerGet1OK handles this case with default header values.
+/* GeneralStationTimetableAPIControllerGet1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type GeneralStationTimetableAPIControllerGet1OK struct {
func (o *GeneralStationTimetableAPIControllerGet1OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/GeneralStationTimetable/Station/{StationID}][%d] generalStationTimetableApiControllerGet1OK %+v", 200, o.Payload)
}
-
func (o *GeneralStationTimetableAPIControllerGet1OK) GetPayload() *models.PTXAPIRailModelTRAGeneralStationWrapperPTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *GeneralStationTimetableAPIControllerGet1OK) readResponse(response runti
return nil
}
+
+// NewGeneralStationTimetableAPIControllerGet1NotModified creates a GeneralStationTimetableAPIControllerGet1NotModified with default headers values
+func NewGeneralStationTimetableAPIControllerGet1NotModified() *GeneralStationTimetableAPIControllerGet1NotModified {
+ return &GeneralStationTimetableAPIControllerGet1NotModified{}
+}
+
+/* GeneralStationTimetableAPIControllerGet1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type GeneralStationTimetableAPIControllerGet1NotModified struct {
+}
+
+func (o *GeneralStationTimetableAPIControllerGet1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/GeneralStationTimetable/Station/{StationID}][%d] generalStationTimetableApiControllerGet1NotModified ", 304)
+}
+
+func (o *GeneralStationTimetableAPIControllerGet1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/general_station_timetable_api_controller_get_parameters.go b/rail/v3/client/t_r_a/general_station_timetable_api_controller_get_parameters.go
index 1c9e2f45..055f31fc 100644
--- a/rail/v3/client/t_r_a/general_station_timetable_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/general_station_timetable_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewGeneralStationTimetableAPIControllerGetParams creates a new GeneralStationTimetableAPIControllerGetParams object
-// with the default values initialized.
+// NewGeneralStationTimetableAPIControllerGetParams creates a new GeneralStationTimetableAPIControllerGetParams 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 NewGeneralStationTimetableAPIControllerGetParams() *GeneralStationTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralStationTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewGeneralStationTimetableAPIControllerGetParamsWithTimeout creates a new GeneralStationTimetableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewGeneralStationTimetableAPIControllerGetParamsWithTimeout(timeout time.Duration) *GeneralStationTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralStationTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewGeneralStationTimetableAPIControllerGetParamsWithContext creates a new GeneralStationTimetableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewGeneralStationTimetableAPIControllerGetParamsWithContext(ctx context.Context) *GeneralStationTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralStationTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewGeneralStationTimetableAPIControllerGetParamsWithHTTPClient creates a new GeneralStationTimetableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewGeneralStationTimetableAPIControllerGetParamsWithHTTPClient(client *http.Client) *GeneralStationTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralStationTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*GeneralStationTimetableAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the general station timetable Api controller get operation typically these are written to a http.Request
+/* GeneralStationTimetableAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the general station timetable Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type GeneralStationTimetableAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type GeneralStationTimetableAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the general station timetable Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *GeneralStationTimetableAPIControllerGetParams) WithDefaults() *GeneralStationTimetableAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the general station timetable Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *GeneralStationTimetableAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := GeneralStationTimetableAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the general station timetable Api controller get params
func (o *GeneralStationTimetableAPIControllerGetParams) WithTimeout(timeout time.Duration) *GeneralStationTimetableAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *GeneralStationTimetableAPIControllerGetParams) WriteToRequest(r runtime
// 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
}
@@ -277,64 +301,68 @@ func (o *GeneralStationTimetableAPIControllerGetParams) WriteToRequest(r runtime
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/general_station_timetable_api_controller_get_responses.go b/rail/v3/client/t_r_a/general_station_timetable_api_controller_get_responses.go
index 52f5c098..2b42e9a6 100644
--- a/rail/v3/client/t_r_a/general_station_timetable_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/general_station_timetable_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *GeneralStationTimetableAPIControllerGetReader) ReadResponse(response ru
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewGeneralStationTimetableAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewGeneralStationTimetableAPIControllerGetOK() *GeneralStationTimetableAPIC
return &GeneralStationTimetableAPIControllerGetOK{}
}
-/*GeneralStationTimetableAPIControllerGetOK handles this case with default header values.
+/* GeneralStationTimetableAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type GeneralStationTimetableAPIControllerGetOK struct {
func (o *GeneralStationTimetableAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/GeneralStationTimetable][%d] generalStationTimetableApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *GeneralStationTimetableAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRAGeneralStationWrapperPTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *GeneralStationTimetableAPIControllerGetOK) readResponse(response runtim
return nil
}
+
+// NewGeneralStationTimetableAPIControllerGetNotModified creates a GeneralStationTimetableAPIControllerGetNotModified with default headers values
+func NewGeneralStationTimetableAPIControllerGetNotModified() *GeneralStationTimetableAPIControllerGetNotModified {
+ return &GeneralStationTimetableAPIControllerGetNotModified{}
+}
+
+/* GeneralStationTimetableAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type GeneralStationTimetableAPIControllerGetNotModified struct {
+}
+
+func (o *GeneralStationTimetableAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/GeneralStationTimetable][%d] generalStationTimetableApiControllerGetNotModified ", 304)
+}
+
+func (o *GeneralStationTimetableAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/general_train_timetable_api_controller_get1_parameters.go b/rail/v3/client/t_r_a/general_train_timetable_api_controller_get1_parameters.go
index f21b46f0..f2928a0a 100644
--- a/rail/v3/client/t_r_a/general_train_timetable_api_controller_get1_parameters.go
+++ b/rail/v3/client/t_r_a/general_train_timetable_api_controller_get1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewGeneralTrainTimetableAPIControllerGet1Params creates a new GeneralTrainTimetableAPIControllerGet1Params object
-// with the default values initialized.
+// NewGeneralTrainTimetableAPIControllerGet1Params creates a new GeneralTrainTimetableAPIControllerGet1Params 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 NewGeneralTrainTimetableAPIControllerGet1Params() *GeneralTrainTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralTrainTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewGeneralTrainTimetableAPIControllerGet1ParamsWithTimeout creates a new GeneralTrainTimetableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewGeneralTrainTimetableAPIControllerGet1ParamsWithTimeout(timeout time.Duration) *GeneralTrainTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralTrainTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewGeneralTrainTimetableAPIControllerGet1ParamsWithContext creates a new GeneralTrainTimetableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewGeneralTrainTimetableAPIControllerGet1ParamsWithContext(ctx context.Context) *GeneralTrainTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralTrainTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewGeneralTrainTimetableAPIControllerGet1ParamsWithHTTPClient creates a new GeneralTrainTimetableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewGeneralTrainTimetableAPIControllerGet1ParamsWithHTTPClient(client *http.Client) *GeneralTrainTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralTrainTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*GeneralTrainTimetableAPIControllerGet1Params contains all the parameters to send to the API endpoint
-for the general train timetable Api controller get 1 operation typically these are written to a http.Request
+/* GeneralTrainTimetableAPIControllerGet1Params contains all the parameters to send to the API endpoint
+ for the general train timetable Api controller get 1 operation.
+
+ Typically these are written to a http.Request.
*/
type GeneralTrainTimetableAPIControllerGet1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -119,6 +115,32 @@ type GeneralTrainTimetableAPIControllerGet1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the general train timetable Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *GeneralTrainTimetableAPIControllerGet1Params) WithDefaults() *GeneralTrainTimetableAPIControllerGet1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the general train timetable Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *GeneralTrainTimetableAPIControllerGet1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := GeneralTrainTimetableAPIControllerGet1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the general train timetable Api controller get 1 params
func (o *GeneralTrainTimetableAPIControllerGet1Params) WithTimeout(timeout time.Duration) *GeneralTrainTimetableAPIControllerGet1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *GeneralTrainTimetableAPIControllerGet1Params) WriteToRequest(r runtime.
// 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
}
@@ -293,64 +318,68 @@ func (o *GeneralTrainTimetableAPIControllerGet1Params) WriteToRequest(r runtime.
// 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 TrainNo
diff --git a/rail/v3/client/t_r_a/general_train_timetable_api_controller_get1_responses.go b/rail/v3/client/t_r_a/general_train_timetable_api_controller_get1_responses.go
index 8b2b6f9d..eec15267 100644
--- a/rail/v3/client/t_r_a/general_train_timetable_api_controller_get1_responses.go
+++ b/rail/v3/client/t_r_a/general_train_timetable_api_controller_get1_responses.go
@@ -29,7 +29,12 @@ func (o *GeneralTrainTimetableAPIControllerGet1Reader) ReadResponse(response run
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewGeneralTrainTimetableAPIControllerGet1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewGeneralTrainTimetableAPIControllerGet1OK() *GeneralTrainTimetableAPICont
return &GeneralTrainTimetableAPIControllerGet1OK{}
}
-/*GeneralTrainTimetableAPIControllerGet1OK handles this case with default header values.
+/* GeneralTrainTimetableAPIControllerGet1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type GeneralTrainTimetableAPIControllerGet1OK struct {
func (o *GeneralTrainTimetableAPIControllerGet1OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/GeneralTrainTimetable/TrainNo/{TrainNo}][%d] generalTrainTimetableApiControllerGet1OK %+v", 200, o.Payload)
}
-
func (o *GeneralTrainTimetableAPIControllerGet1OK) GetPayload() *models.PTXAPIRailModelTRAGeneralTrainWrapperPTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *GeneralTrainTimetableAPIControllerGet1OK) readResponse(response runtime
return nil
}
+
+// NewGeneralTrainTimetableAPIControllerGet1NotModified creates a GeneralTrainTimetableAPIControllerGet1NotModified with default headers values
+func NewGeneralTrainTimetableAPIControllerGet1NotModified() *GeneralTrainTimetableAPIControllerGet1NotModified {
+ return &GeneralTrainTimetableAPIControllerGet1NotModified{}
+}
+
+/* GeneralTrainTimetableAPIControllerGet1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type GeneralTrainTimetableAPIControllerGet1NotModified struct {
+}
+
+func (o *GeneralTrainTimetableAPIControllerGet1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/GeneralTrainTimetable/TrainNo/{TrainNo}][%d] generalTrainTimetableApiControllerGet1NotModified ", 304)
+}
+
+func (o *GeneralTrainTimetableAPIControllerGet1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/general_train_timetable_api_controller_get_parameters.go b/rail/v3/client/t_r_a/general_train_timetable_api_controller_get_parameters.go
index 1524f6d2..d8e398f1 100644
--- a/rail/v3/client/t_r_a/general_train_timetable_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/general_train_timetable_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewGeneralTrainTimetableAPIControllerGetParams creates a new GeneralTrainTimetableAPIControllerGetParams object
-// with the default values initialized.
+// NewGeneralTrainTimetableAPIControllerGetParams creates a new GeneralTrainTimetableAPIControllerGetParams 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 NewGeneralTrainTimetableAPIControllerGetParams() *GeneralTrainTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralTrainTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewGeneralTrainTimetableAPIControllerGetParamsWithTimeout creates a new GeneralTrainTimetableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewGeneralTrainTimetableAPIControllerGetParamsWithTimeout(timeout time.Duration) *GeneralTrainTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralTrainTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewGeneralTrainTimetableAPIControllerGetParamsWithContext creates a new GeneralTrainTimetableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewGeneralTrainTimetableAPIControllerGetParamsWithContext(ctx context.Context) *GeneralTrainTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralTrainTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewGeneralTrainTimetableAPIControllerGetParamsWithHTTPClient creates a new GeneralTrainTimetableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewGeneralTrainTimetableAPIControllerGetParamsWithHTTPClient(client *http.Client) *GeneralTrainTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &GeneralTrainTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*GeneralTrainTimetableAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the general train timetable Api controller get operation typically these are written to a http.Request
+/* GeneralTrainTimetableAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the general train timetable Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type GeneralTrainTimetableAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type GeneralTrainTimetableAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the general train timetable Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *GeneralTrainTimetableAPIControllerGetParams) WithDefaults() *GeneralTrainTimetableAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the general train timetable Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *GeneralTrainTimetableAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := GeneralTrainTimetableAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the general train timetable Api controller get params
func (o *GeneralTrainTimetableAPIControllerGetParams) WithTimeout(timeout time.Duration) *GeneralTrainTimetableAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *GeneralTrainTimetableAPIControllerGetParams) WriteToRequest(r runtime.C
// 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
}
@@ -277,64 +301,68 @@ func (o *GeneralTrainTimetableAPIControllerGetParams) WriteToRequest(r runtime.C
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/general_train_timetable_api_controller_get_responses.go b/rail/v3/client/t_r_a/general_train_timetable_api_controller_get_responses.go
index ebffd6f4..27db5ee4 100644
--- a/rail/v3/client/t_r_a/general_train_timetable_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/general_train_timetable_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *GeneralTrainTimetableAPIControllerGetReader) ReadResponse(response runt
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewGeneralTrainTimetableAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewGeneralTrainTimetableAPIControllerGetOK() *GeneralTrainTimetableAPIContr
return &GeneralTrainTimetableAPIControllerGetOK{}
}
-/*GeneralTrainTimetableAPIControllerGetOK handles this case with default header values.
+/* GeneralTrainTimetableAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type GeneralTrainTimetableAPIControllerGetOK struct {
func (o *GeneralTrainTimetableAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/GeneralTrainTimetable][%d] generalTrainTimetableApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *GeneralTrainTimetableAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRAGeneralTrainWrapperPTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *GeneralTrainTimetableAPIControllerGetOK) readResponse(response runtime.
return nil
}
+
+// NewGeneralTrainTimetableAPIControllerGetNotModified creates a GeneralTrainTimetableAPIControllerGetNotModified with default headers values
+func NewGeneralTrainTimetableAPIControllerGetNotModified() *GeneralTrainTimetableAPIControllerGetNotModified {
+ return &GeneralTrainTimetableAPIControllerGetNotModified{}
+}
+
+/* GeneralTrainTimetableAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type GeneralTrainTimetableAPIControllerGetNotModified struct {
+}
+
+func (o *GeneralTrainTimetableAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/GeneralTrainTimetable][%d] generalTrainTimetableApiControllerGetNotModified ", 304)
+}
+
+func (o *GeneralTrainTimetableAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/line_api_controller_get_parameters.go b/rail/v3/client/t_r_a/line_api_controller_get_parameters.go
index 2665034e..25b931a7 100644
--- a/rail/v3/client/t_r_a/line_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/line_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewLineAPIControllerGetParams creates a new LineAPIControllerGetParams object
-// with the default values initialized.
+// NewLineAPIControllerGetParams creates a new LineAPIControllerGetParams 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 NewLineAPIControllerGetParams() *LineAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewLineAPIControllerGetParamsWithTimeout creates a new LineAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewLineAPIControllerGetParamsWithTimeout(timeout time.Duration) *LineAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewLineAPIControllerGetParamsWithContext creates a new LineAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewLineAPIControllerGetParamsWithContext(ctx context.Context) *LineAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewLineAPIControllerGetParamsWithHTTPClient creates a new LineAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewLineAPIControllerGetParamsWithHTTPClient(client *http.Client) *LineAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*LineAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the line Api controller get operation typically these are written to a http.Request
+/* LineAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the line Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type LineAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type LineAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the line Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *LineAPIControllerGetParams) WithDefaults() *LineAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the line Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *LineAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := LineAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the line Api controller get params
func (o *LineAPIControllerGetParams) WithTimeout(timeout time.Duration) *LineAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *LineAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -277,64 +301,68 @@ func (o *LineAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/line_api_controller_get_responses.go b/rail/v3/client/t_r_a/line_api_controller_get_responses.go
index a0d84a58..339f30a5 100644
--- a/rail/v3/client/t_r_a/line_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/line_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *LineAPIControllerGetReader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewLineAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewLineAPIControllerGetOK() *LineAPIControllerGetOK {
return &LineAPIControllerGetOK{}
}
-/*LineAPIControllerGetOK handles this case with default header values.
+/* LineAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type LineAPIControllerGetOK struct {
func (o *LineAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/Line][%d] lineApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *LineAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALine {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *LineAPIControllerGetOK) readResponse(response runtime.ClientResponse, c
return nil
}
+
+// NewLineAPIControllerGetNotModified creates a LineAPIControllerGetNotModified with default headers values
+func NewLineAPIControllerGetNotModified() *LineAPIControllerGetNotModified {
+ return &LineAPIControllerGetNotModified{}
+}
+
+/* LineAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type LineAPIControllerGetNotModified struct {
+}
+
+func (o *LineAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/Line][%d] lineApiControllerGetNotModified ", 304)
+}
+
+func (o *LineAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/line_network_api_controller_get_parameters.go b/rail/v3/client/t_r_a/line_network_api_controller_get_parameters.go
index b37d0ff4..1df1c94a 100644
--- a/rail/v3/client/t_r_a/line_network_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/line_network_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewLineNetworkAPIControllerGetParams creates a new LineNetworkAPIControllerGetParams object
-// with the default values initialized.
+// NewLineNetworkAPIControllerGetParams creates a new LineNetworkAPIControllerGetParams 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 NewLineNetworkAPIControllerGetParams() *LineNetworkAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineNetworkAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewLineNetworkAPIControllerGetParamsWithTimeout creates a new LineNetworkAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewLineNetworkAPIControllerGetParamsWithTimeout(timeout time.Duration) *LineNetworkAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineNetworkAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewLineNetworkAPIControllerGetParamsWithContext creates a new LineNetworkAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewLineNetworkAPIControllerGetParamsWithContext(ctx context.Context) *LineNetworkAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineNetworkAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewLineNetworkAPIControllerGetParamsWithHTTPClient creates a new LineNetworkAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewLineNetworkAPIControllerGetParamsWithHTTPClient(client *http.Client) *LineNetworkAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineNetworkAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*LineNetworkAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the line network Api controller get operation typically these are written to a http.Request
+/* LineNetworkAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the line network Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type LineNetworkAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type LineNetworkAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the line network Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *LineNetworkAPIControllerGetParams) WithDefaults() *LineNetworkAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the line network Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *LineNetworkAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := LineNetworkAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the line network Api controller get params
func (o *LineNetworkAPIControllerGetParams) WithTimeout(timeout time.Duration) *LineNetworkAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *LineNetworkAPIControllerGetParams) WriteToRequest(r runtime.ClientReque
// 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
}
@@ -277,64 +301,68 @@ func (o *LineNetworkAPIControllerGetParams) WriteToRequest(r runtime.ClientReque
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/line_network_api_controller_get_responses.go b/rail/v3/client/t_r_a/line_network_api_controller_get_responses.go
index 3b6a760d..3f3d287a 100644
--- a/rail/v3/client/t_r_a/line_network_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/line_network_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *LineNetworkAPIControllerGetReader) ReadResponse(response runtime.Client
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewLineNetworkAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewLineNetworkAPIControllerGetOK() *LineNetworkAPIControllerGetOK {
return &LineNetworkAPIControllerGetOK{}
}
-/*LineNetworkAPIControllerGetOK handles this case with default header values.
+/* LineNetworkAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type LineNetworkAPIControllerGetOK struct {
func (o *LineNetworkAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/LineNetwork][%d] lineNetworkApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *LineNetworkAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *LineNetworkAPIControllerGetOK) readResponse(response runtime.ClientResp
return nil
}
+
+// NewLineNetworkAPIControllerGetNotModified creates a LineNetworkAPIControllerGetNotModified with default headers values
+func NewLineNetworkAPIControllerGetNotModified() *LineNetworkAPIControllerGetNotModified {
+ return &LineNetworkAPIControllerGetNotModified{}
+}
+
+/* LineNetworkAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type LineNetworkAPIControllerGetNotModified struct {
+}
+
+func (o *LineNetworkAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/LineNetwork][%d] lineNetworkApiControllerGetNotModified ", 304)
+}
+
+func (o *LineNetworkAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/line_transfer_api_controller_get_parameters.go b/rail/v3/client/t_r_a/line_transfer_api_controller_get_parameters.go
index 175934d9..51bf77f6 100644
--- a/rail/v3/client/t_r_a/line_transfer_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/line_transfer_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewLineTransferAPIControllerGetParams creates a new LineTransferAPIControllerGetParams object
-// with the default values initialized.
+// NewLineTransferAPIControllerGetParams creates a new LineTransferAPIControllerGetParams 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 NewLineTransferAPIControllerGetParams() *LineTransferAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineTransferAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewLineTransferAPIControllerGetParamsWithTimeout creates a new LineTransferAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewLineTransferAPIControllerGetParamsWithTimeout(timeout time.Duration) *LineTransferAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineTransferAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewLineTransferAPIControllerGetParamsWithContext creates a new LineTransferAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewLineTransferAPIControllerGetParamsWithContext(ctx context.Context) *LineTransferAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineTransferAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewLineTransferAPIControllerGetParamsWithHTTPClient creates a new LineTransferAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewLineTransferAPIControllerGetParamsWithHTTPClient(client *http.Client) *LineTransferAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &LineTransferAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*LineTransferAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the line transfer Api controller get operation typically these are written to a http.Request
+/* LineTransferAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the line transfer Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type LineTransferAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type LineTransferAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the line transfer Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *LineTransferAPIControllerGetParams) WithDefaults() *LineTransferAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the line transfer Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *LineTransferAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := LineTransferAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the line transfer Api controller get params
func (o *LineTransferAPIControllerGetParams) WithTimeout(timeout time.Duration) *LineTransferAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *LineTransferAPIControllerGetParams) WriteToRequest(r runtime.ClientRequ
// 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
}
@@ -277,64 +301,68 @@ func (o *LineTransferAPIControllerGetParams) WriteToRequest(r runtime.ClientRequ
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/line_transfer_api_controller_get_responses.go b/rail/v3/client/t_r_a/line_transfer_api_controller_get_responses.go
index 212ba87d..388c1e63 100644
--- a/rail/v3/client/t_r_a/line_transfer_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/line_transfer_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *LineTransferAPIControllerGetReader) ReadResponse(response runtime.Clien
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewLineTransferAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewLineTransferAPIControllerGetOK() *LineTransferAPIControllerGetOK {
return &LineTransferAPIControllerGetOK{}
}
-/*LineTransferAPIControllerGetOK handles this case with default header values.
+/* LineTransferAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type LineTransferAPIControllerGetOK struct {
func (o *LineTransferAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/LineTransfer][%d] lineTransferApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *LineTransferAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALineTransfer {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *LineTransferAPIControllerGetOK) readResponse(response runtime.ClientRes
return nil
}
+
+// NewLineTransferAPIControllerGetNotModified creates a LineTransferAPIControllerGetNotModified with default headers values
+func NewLineTransferAPIControllerGetNotModified() *LineTransferAPIControllerGetNotModified {
+ return &LineTransferAPIControllerGetNotModified{}
+}
+
+/* LineTransferAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type LineTransferAPIControllerGetNotModified struct {
+}
+
+func (o *LineTransferAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/LineTransfer][%d] lineTransferApiControllerGetNotModified ", 304)
+}
+
+func (o *LineTransferAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/network_api_controller_get_parameters.go b/rail/v3/client/t_r_a/network_api_controller_get_parameters.go
index ac6112f2..827ca629 100644
--- a/rail/v3/client/t_r_a/network_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/network_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewNetworkAPIControllerGetParams creates a new NetworkAPIControllerGetParams object
-// with the default values initialized.
+// NewNetworkAPIControllerGetParams creates a new NetworkAPIControllerGetParams 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 NewNetworkAPIControllerGetParams() *NetworkAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &NetworkAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewNetworkAPIControllerGetParamsWithTimeout creates a new NetworkAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewNetworkAPIControllerGetParamsWithTimeout(timeout time.Duration) *NetworkAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &NetworkAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewNetworkAPIControllerGetParamsWithContext creates a new NetworkAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewNetworkAPIControllerGetParamsWithContext(ctx context.Context) *NetworkAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &NetworkAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewNetworkAPIControllerGetParamsWithHTTPClient creates a new NetworkAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewNetworkAPIControllerGetParamsWithHTTPClient(client *http.Client) *NetworkAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &NetworkAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*NetworkAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the network Api controller get operation typically these are written to a http.Request
+/* NetworkAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the network Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type NetworkAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type NetworkAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the network Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *NetworkAPIControllerGetParams) WithDefaults() *NetworkAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the network Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *NetworkAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := NetworkAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the network Api controller get params
func (o *NetworkAPIControllerGetParams) WithTimeout(timeout time.Duration) *NetworkAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *NetworkAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -277,64 +301,68 @@ func (o *NetworkAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/network_api_controller_get_responses.go b/rail/v3/client/t_r_a/network_api_controller_get_responses.go
index 10153a0d..80f18783 100644
--- a/rail/v3/client/t_r_a/network_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/network_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *NetworkAPIControllerGetReader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewNetworkAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewNetworkAPIControllerGetOK() *NetworkAPIControllerGetOK {
return &NetworkAPIControllerGetOK{}
}
-/*NetworkAPIControllerGetOK handles this case with default header values.
+/* NetworkAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type NetworkAPIControllerGetOK struct {
func (o *NetworkAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/Network][%d] networkApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *NetworkAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRANetworkNetwork {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *NetworkAPIControllerGetOK) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewNetworkAPIControllerGetNotModified creates a NetworkAPIControllerGetNotModified with default headers values
+func NewNetworkAPIControllerGetNotModified() *NetworkAPIControllerGetNotModified {
+ return &NetworkAPIControllerGetNotModified{}
+}
+
+/* NetworkAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type NetworkAPIControllerGetNotModified struct {
+}
+
+func (o *NetworkAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/Network][%d] networkApiControllerGetNotModified ", 304)
+}
+
+func (o *NetworkAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/news_api_controller_get_parameters.go b/rail/v3/client/t_r_a/news_api_controller_get_parameters.go
index cfab3bde..d07a2469 100644
--- a/rail/v3/client/t_r_a/news_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/news_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewNewsAPIControllerGetParams creates a new NewsAPIControllerGetParams object
-// with the default values initialized.
+// NewNewsAPIControllerGetParams creates a new NewsAPIControllerGetParams 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 NewNewsAPIControllerGetParams() *NewsAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &NewsAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewNewsAPIControllerGetParamsWithTimeout creates a new NewsAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewNewsAPIControllerGetParamsWithTimeout(timeout time.Duration) *NewsAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &NewsAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewNewsAPIControllerGetParamsWithContext creates a new NewsAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewNewsAPIControllerGetParamsWithContext(ctx context.Context) *NewsAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &NewsAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewNewsAPIControllerGetParamsWithHTTPClient creates a new NewsAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewNewsAPIControllerGetParamsWithHTTPClient(client *http.Client) *NewsAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &NewsAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*NewsAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the news Api controller get operation typically these are written to a http.Request
+/* NewsAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the news Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type NewsAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type NewsAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the news Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *NewsAPIControllerGetParams) WithDefaults() *NewsAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the news Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *NewsAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := NewsAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the news Api controller get params
func (o *NewsAPIControllerGetParams) WithTimeout(timeout time.Duration) *NewsAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *NewsAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -277,64 +301,68 @@ func (o *NewsAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/news_api_controller_get_responses.go b/rail/v3/client/t_r_a/news_api_controller_get_responses.go
index 28eb664a..f673f981 100644
--- a/rail/v3/client/t_r_a/news_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/news_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *NewsAPIControllerGetReader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewNewsAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewNewsAPIControllerGetOK() *NewsAPIControllerGetOK {
return &NewsAPIControllerGetOK{}
}
-/*NewsAPIControllerGetOK handles this case with default header values.
+/* NewsAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type NewsAPIControllerGetOK struct {
func (o *NewsAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/News][%d] newsApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *NewsAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRANewsListNews {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *NewsAPIControllerGetOK) readResponse(response runtime.ClientResponse, c
return nil
}
+
+// NewNewsAPIControllerGetNotModified creates a NewsAPIControllerGetNotModified with default headers values
+func NewNewsAPIControllerGetNotModified() *NewsAPIControllerGetNotModified {
+ return &NewsAPIControllerGetNotModified{}
+}
+
+/* NewsAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type NewsAPIControllerGetNotModified struct {
+}
+
+func (o *NewsAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/News][%d] newsApiControllerGetNotModified ", 304)
+}
+
+func (o *NewsAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get1_parameters.go b/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get1_parameters.go
index da4b00ee..51f6a28a 100644
--- a/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get1_parameters.go
+++ b/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get1_parameters.go
@@ -17,105 +17,102 @@ import (
"github.com/go-openapi/swag"
)
-// NewODFareAPIControllerAPIControllerGet1Params creates a new ODFareAPIControllerAPIControllerGet1Params object
-// with the default values initialized.
+// NewODFareAPIControllerAPIControllerGet1Params creates a new ODFareAPIControllerAPIControllerGet1Params 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 NewODFareAPIControllerAPIControllerGet1Params() *ODFareAPIControllerAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ODFareAPIControllerAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewODFareAPIControllerAPIControllerGet1ParamsWithTimeout creates a new ODFareAPIControllerAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewODFareAPIControllerAPIControllerGet1ParamsWithTimeout(timeout time.Duration) *ODFareAPIControllerAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ODFareAPIControllerAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewODFareAPIControllerAPIControllerGet1ParamsWithContext creates a new ODFareAPIControllerAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewODFareAPIControllerAPIControllerGet1ParamsWithContext(ctx context.Context) *ODFareAPIControllerAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ODFareAPIControllerAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewODFareAPIControllerAPIControllerGet1ParamsWithHTTPClient creates a new ODFareAPIControllerAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewODFareAPIControllerAPIControllerGet1ParamsWithHTTPClient(client *http.Client) *ODFareAPIControllerAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ODFareAPIControllerAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ODFareAPIControllerAPIControllerGet1Params contains all the parameters to send to the API endpoint
-for the o d fare Api controller Api controller get 1 operation typically these are written to a http.Request
+/* ODFareAPIControllerAPIControllerGet1Params contains all the parameters to send to the API endpoint
+ for the o d fare Api controller Api controller get 1 operation.
+
+ Typically these are written to a http.Request.
*/
type ODFareAPIControllerAPIControllerGet1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*DestinationStationID
- 迄點車站代碼
+ /* DestinationStationID.
+
+ 迄點車站代碼
*/
DestinationStationID string
- /*OriginStationID
- 起點車站代碼
+ /* OriginStationID.
+
+ 起點車站代碼
*/
OriginStationID string
@@ -124,6 +121,32 @@ type ODFareAPIControllerAPIControllerGet1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the o d fare Api controller Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ODFareAPIControllerAPIControllerGet1Params) WithDefaults() *ODFareAPIControllerAPIControllerGet1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the o d fare Api controller Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ODFareAPIControllerAPIControllerGet1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ODFareAPIControllerAPIControllerGet1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the o d fare Api controller Api controller get 1 params
func (o *ODFareAPIControllerAPIControllerGet1Params) WithTimeout(timeout time.Duration) *ODFareAPIControllerAPIControllerGet1Params {
o.SetTimeout(timeout)
@@ -268,38 +291,41 @@ func (o *ODFareAPIControllerAPIControllerGet1Params) WriteToRequest(r runtime.Cl
// 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
}
@@ -309,64 +335,68 @@ func (o *ODFareAPIControllerAPIControllerGet1Params) WriteToRequest(r runtime.Cl
// 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 DestinationStationID
diff --git a/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get1_responses.go b/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get1_responses.go
index 07d13df8..785178d4 100644
--- a/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get1_responses.go
+++ b/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get1_responses.go
@@ -29,7 +29,12 @@ func (o *ODFareAPIControllerAPIControllerGet1Reader) ReadResponse(response runti
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewODFareAPIControllerAPIControllerGet1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewODFareAPIControllerAPIControllerGet1OK() *ODFareAPIControllerAPIControll
return &ODFareAPIControllerAPIControllerGet1OK{}
}
-/*ODFareAPIControllerAPIControllerGet1OK handles this case with default header values.
+/* ODFareAPIControllerAPIControllerGet1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ODFareAPIControllerAPIControllerGet1OK struct {
func (o *ODFareAPIControllerAPIControllerGet1OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/ODFare/{OriginStationID}/to/{DestinationStationID}][%d] oDFareApiControllerApiControllerGet1OK %+v", 200, o.Payload)
}
-
func (o *ODFareAPIControllerAPIControllerGet1OK) GetPayload() *models.PTXAPIRailModelTRAODFareWrapperPTXServiceDTORailSpecificationV3TRAODFareODFare {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ODFareAPIControllerAPIControllerGet1OK) readResponse(response runtime.C
return nil
}
+
+// NewODFareAPIControllerAPIControllerGet1NotModified creates a ODFareAPIControllerAPIControllerGet1NotModified with default headers values
+func NewODFareAPIControllerAPIControllerGet1NotModified() *ODFareAPIControllerAPIControllerGet1NotModified {
+ return &ODFareAPIControllerAPIControllerGet1NotModified{}
+}
+
+/* ODFareAPIControllerAPIControllerGet1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ODFareAPIControllerAPIControllerGet1NotModified struct {
+}
+
+func (o *ODFareAPIControllerAPIControllerGet1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/ODFare/{OriginStationID}/to/{DestinationStationID}][%d] oDFareApiControllerApiControllerGet1NotModified ", 304)
+}
+
+func (o *ODFareAPIControllerAPIControllerGet1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get_parameters.go b/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get_parameters.go
index 6bbf1e9e..9a4e492f 100644
--- a/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get_parameters.go
@@ -16,47 +16,46 @@ import (
"github.com/go-openapi/strfmt"
)
-// NewODFareAPIControllerAPIControllerGetParams creates a new ODFareAPIControllerAPIControllerGetParams object
-// with the default values initialized.
+// NewODFareAPIControllerAPIControllerGetParams creates a new ODFareAPIControllerAPIControllerGetParams 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 NewODFareAPIControllerAPIControllerGetParams() *ODFareAPIControllerAPIControllerGetParams {
-
return &ODFareAPIControllerAPIControllerGetParams{
-
timeout: cr.DefaultTimeout,
}
}
// NewODFareAPIControllerAPIControllerGetParamsWithTimeout creates a new ODFareAPIControllerAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewODFareAPIControllerAPIControllerGetParamsWithTimeout(timeout time.Duration) *ODFareAPIControllerAPIControllerGetParams {
-
return &ODFareAPIControllerAPIControllerGetParams{
-
timeout: timeout,
}
}
// NewODFareAPIControllerAPIControllerGetParamsWithContext creates a new ODFareAPIControllerAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewODFareAPIControllerAPIControllerGetParamsWithContext(ctx context.Context) *ODFareAPIControllerAPIControllerGetParams {
-
return &ODFareAPIControllerAPIControllerGetParams{
-
Context: ctx,
}
}
// NewODFareAPIControllerAPIControllerGetParamsWithHTTPClient creates a new ODFareAPIControllerAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewODFareAPIControllerAPIControllerGetParamsWithHTTPClient(client *http.Client) *ODFareAPIControllerAPIControllerGetParams {
-
return &ODFareAPIControllerAPIControllerGetParams{
HTTPClient: client,
}
}
-/*ODFareAPIControllerAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the o d fare Api controller Api controller get operation typically these are written to a http.Request
+/* ODFareAPIControllerAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the o d fare Api controller Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type ODFareAPIControllerAPIControllerGetParams struct {
timeout time.Duration
@@ -64,6 +63,21 @@ type ODFareAPIControllerAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the o d fare Api controller Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ODFareAPIControllerAPIControllerGetParams) WithDefaults() *ODFareAPIControllerAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the o d fare Api controller Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ODFareAPIControllerAPIControllerGetParams) SetDefaults() {
+ // no default values defined for this parameter
+}
+
// WithTimeout adds the timeout to the o d fare Api controller Api controller get params
func (o *ODFareAPIControllerAPIControllerGetParams) WithTimeout(timeout time.Duration) *ODFareAPIControllerAPIControllerGetParams {
o.SetTimeout(timeout)
diff --git a/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get_responses.go b/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get_responses.go
index 8bd6f694..aa8f87e5 100644
--- a/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/o_d_fare_api_controller_api_controller_get_responses.go
@@ -29,7 +29,6 @@ func (o *ODFareAPIControllerAPIControllerGetReader) ReadResponse(response runtim
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewODFareAPIControllerAPIControllerGetOK() *ODFareAPIControllerAPIControlle
return &ODFareAPIControllerAPIControllerGetOK{}
}
-/*ODFareAPIControllerAPIControllerGetOK handles this case with default header values.
+/* ODFareAPIControllerAPIControllerGetOK describes a response with status code 200, with default header values.
Gzipped Attachment Response
*/
@@ -51,7 +50,6 @@ type ODFareAPIControllerAPIControllerGetOK struct {
func (o *ODFareAPIControllerAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/ODFare][%d] oDFareApiControllerApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *ODFareAPIControllerAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRAODFareWrapperPTXServiceDTORailSpecificationV3TRAODFareODFare {
return o.Payload
}
diff --git a/rail/v3/client/t_r_a/operator_api_controller_get_parameters.go b/rail/v3/client/t_r_a/operator_api_controller_get_parameters.go
index 3ad9bdba..50f657ab 100644
--- a/rail/v3/client/t_r_a/operator_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/operator_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewOperatorAPIControllerGetParams creates a new OperatorAPIControllerGetParams object
-// with the default values initialized.
+// NewOperatorAPIControllerGetParams creates a new OperatorAPIControllerGetParams 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 NewOperatorAPIControllerGetParams() *OperatorAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &OperatorAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewOperatorAPIControllerGetParamsWithTimeout creates a new OperatorAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewOperatorAPIControllerGetParamsWithTimeout(timeout time.Duration) *OperatorAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &OperatorAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewOperatorAPIControllerGetParamsWithContext creates a new OperatorAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewOperatorAPIControllerGetParamsWithContext(ctx context.Context) *OperatorAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &OperatorAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewOperatorAPIControllerGetParamsWithHTTPClient creates a new OperatorAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewOperatorAPIControllerGetParamsWithHTTPClient(client *http.Client) *OperatorAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &OperatorAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*OperatorAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the operator Api controller get operation typically these are written to a http.Request
+/* OperatorAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the operator Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type OperatorAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type OperatorAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the operator Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *OperatorAPIControllerGetParams) WithDefaults() *OperatorAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the operator Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *OperatorAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := OperatorAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the operator Api controller get params
func (o *OperatorAPIControllerGetParams) WithTimeout(timeout time.Duration) *OperatorAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *OperatorAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -277,64 +301,68 @@ func (o *OperatorAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/operator_api_controller_get_responses.go b/rail/v3/client/t_r_a/operator_api_controller_get_responses.go
index 9ee0db77..49b998c8 100644
--- a/rail/v3/client/t_r_a/operator_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/operator_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *OperatorAPIControllerGetReader) ReadResponse(response runtime.ClientRes
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewOperatorAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewOperatorAPIControllerGetOK() *OperatorAPIControllerGetOK {
return &OperatorAPIControllerGetOK{}
}
-/*OperatorAPIControllerGetOK handles this case with default header values.
+/* OperatorAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type OperatorAPIControllerGetOK struct {
func (o *OperatorAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/Operator][%d] operatorApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *OperatorAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAOperator {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *OperatorAPIControllerGetOK) readResponse(response runtime.ClientRespons
return nil
}
+
+// NewOperatorAPIControllerGetNotModified creates a OperatorAPIControllerGetNotModified with default headers values
+func NewOperatorAPIControllerGetNotModified() *OperatorAPIControllerGetNotModified {
+ return &OperatorAPIControllerGetNotModified{}
+}
+
+/* OperatorAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type OperatorAPIControllerGetNotModified struct {
+}
+
+func (o *OperatorAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/Operator][%d] operatorApiControllerGetNotModified ", 304)
+}
+
+func (o *OperatorAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/shape_api_controller_get_parameters.go b/rail/v3/client/t_r_a/shape_api_controller_get_parameters.go
index 8cb01e4e..e3be0fb9 100644
--- a/rail/v3/client/t_r_a/shape_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/shape_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewShapeAPIControllerGetParams creates a new ShapeAPIControllerGetParams object
-// with the default values initialized.
+// NewShapeAPIControllerGetParams creates a new ShapeAPIControllerGetParams 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 NewShapeAPIControllerGetParams() *ShapeAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShapeAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewShapeAPIControllerGetParamsWithTimeout creates a new ShapeAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewShapeAPIControllerGetParamsWithTimeout(timeout time.Duration) *ShapeAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShapeAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewShapeAPIControllerGetParamsWithContext creates a new ShapeAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewShapeAPIControllerGetParamsWithContext(ctx context.Context) *ShapeAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShapeAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewShapeAPIControllerGetParamsWithHTTPClient creates a new ShapeAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewShapeAPIControllerGetParamsWithHTTPClient(client *http.Client) *ShapeAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShapeAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ShapeAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the shape Api controller get operation typically these are written to a http.Request
+/* ShapeAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the shape Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type ShapeAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type ShapeAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the shape Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShapeAPIControllerGetParams) WithDefaults() *ShapeAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the shape Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShapeAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShapeAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the shape Api controller get params
func (o *ShapeAPIControllerGetParams) WithTimeout(timeout time.Duration) *ShapeAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *ShapeAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -277,64 +301,68 @@ func (o *ShapeAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/shape_api_controller_get_responses.go b/rail/v3/client/t_r_a/shape_api_controller_get_responses.go
index ffd496a6..91e19f9e 100644
--- a/rail/v3/client/t_r_a/shape_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/shape_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *ShapeAPIControllerGetReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewShapeAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewShapeAPIControllerGetOK() *ShapeAPIControllerGetOK {
return &ShapeAPIControllerGetOK{}
}
-/*ShapeAPIControllerGetOK handles this case with default header values.
+/* ShapeAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ShapeAPIControllerGetOK struct {
func (o *ShapeAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/Shape][%d] shapeApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *ShapeAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAShape {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ShapeAPIControllerGetOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewShapeAPIControllerGetNotModified creates a ShapeAPIControllerGetNotModified with default headers values
+func NewShapeAPIControllerGetNotModified() *ShapeAPIControllerGetNotModified {
+ return &ShapeAPIControllerGetNotModified{}
+}
+
+/* ShapeAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShapeAPIControllerGetNotModified struct {
+}
+
+func (o *ShapeAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/Shape][%d] shapeApiControllerGetNotModified ", 304)
+}
+
+func (o *ShapeAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get1_parameters.go b/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get1_parameters.go
index 3d8b9259..0d3261c6 100644
--- a/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get1_parameters.go
+++ b/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewSpecificTrainTimetableAPIControllerGet1Params creates a new SpecificTrainTimetableAPIControllerGet1Params object
-// with the default values initialized.
+// NewSpecificTrainTimetableAPIControllerGet1Params creates a new SpecificTrainTimetableAPIControllerGet1Params 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 NewSpecificTrainTimetableAPIControllerGet1Params() *SpecificTrainTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &SpecificTrainTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewSpecificTrainTimetableAPIControllerGet1ParamsWithTimeout creates a new SpecificTrainTimetableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewSpecificTrainTimetableAPIControllerGet1ParamsWithTimeout(timeout time.Duration) *SpecificTrainTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &SpecificTrainTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewSpecificTrainTimetableAPIControllerGet1ParamsWithContext creates a new SpecificTrainTimetableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewSpecificTrainTimetableAPIControllerGet1ParamsWithContext(ctx context.Context) *SpecificTrainTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &SpecificTrainTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewSpecificTrainTimetableAPIControllerGet1ParamsWithHTTPClient creates a new SpecificTrainTimetableAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewSpecificTrainTimetableAPIControllerGet1ParamsWithHTTPClient(client *http.Client) *SpecificTrainTimetableAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &SpecificTrainTimetableAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*SpecificTrainTimetableAPIControllerGet1Params contains all the parameters to send to the API endpoint
-for the specific train timetable Api controller get 1 operation typically these are written to a http.Request
+/* SpecificTrainTimetableAPIControllerGet1Params contains all the parameters to send to the API endpoint
+ for the specific train timetable Api controller get 1 operation.
+
+ Typically these are written to a http.Request.
*/
type SpecificTrainTimetableAPIControllerGet1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -119,6 +115,32 @@ type SpecificTrainTimetableAPIControllerGet1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the specific train timetable Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *SpecificTrainTimetableAPIControllerGet1Params) WithDefaults() *SpecificTrainTimetableAPIControllerGet1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the specific train timetable Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *SpecificTrainTimetableAPIControllerGet1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := SpecificTrainTimetableAPIControllerGet1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the specific train timetable Api controller get 1 params
func (o *SpecificTrainTimetableAPIControllerGet1Params) WithTimeout(timeout time.Duration) *SpecificTrainTimetableAPIControllerGet1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *SpecificTrainTimetableAPIControllerGet1Params) WriteToRequest(r runtime
// 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
}
@@ -293,64 +318,68 @@ func (o *SpecificTrainTimetableAPIControllerGet1Params) WriteToRequest(r runtime
// 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 TrainNo
diff --git a/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get1_responses.go b/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get1_responses.go
index f7784ba3..4ad6af8c 100644
--- a/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get1_responses.go
+++ b/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get1_responses.go
@@ -29,7 +29,12 @@ func (o *SpecificTrainTimetableAPIControllerGet1Reader) ReadResponse(response ru
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewSpecificTrainTimetableAPIControllerGet1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewSpecificTrainTimetableAPIControllerGet1OK() *SpecificTrainTimetableAPICo
return &SpecificTrainTimetableAPIControllerGet1OK{}
}
-/*SpecificTrainTimetableAPIControllerGet1OK handles this case with default header values.
+/* SpecificTrainTimetableAPIControllerGet1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type SpecificTrainTimetableAPIControllerGet1OK struct {
func (o *SpecificTrainTimetableAPIControllerGet1OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/SpecificTrainTimetable/TrainNo/{TrainNo}][%d] specificTrainTimetableApiControllerGet1OK %+v", 200, o.Payload)
}
-
func (o *SpecificTrainTimetableAPIControllerGet1OK) GetPayload() *models.PTXAPIRailModelTRASpecificWrapperPTXServiceDTORailSpecificationV3TRASpecificTrainTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *SpecificTrainTimetableAPIControllerGet1OK) readResponse(response runtim
return nil
}
+
+// NewSpecificTrainTimetableAPIControllerGet1NotModified creates a SpecificTrainTimetableAPIControllerGet1NotModified with default headers values
+func NewSpecificTrainTimetableAPIControllerGet1NotModified() *SpecificTrainTimetableAPIControllerGet1NotModified {
+ return &SpecificTrainTimetableAPIControllerGet1NotModified{}
+}
+
+/* SpecificTrainTimetableAPIControllerGet1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type SpecificTrainTimetableAPIControllerGet1NotModified struct {
+}
+
+func (o *SpecificTrainTimetableAPIControllerGet1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/SpecificTrainTimetable/TrainNo/{TrainNo}][%d] specificTrainTimetableApiControllerGet1NotModified ", 304)
+}
+
+func (o *SpecificTrainTimetableAPIControllerGet1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get_parameters.go b/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get_parameters.go
index 94835ff3..c1665509 100644
--- a/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewSpecificTrainTimetableAPIControllerGetParams creates a new SpecificTrainTimetableAPIControllerGetParams object
-// with the default values initialized.
+// NewSpecificTrainTimetableAPIControllerGetParams creates a new SpecificTrainTimetableAPIControllerGetParams 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 NewSpecificTrainTimetableAPIControllerGetParams() *SpecificTrainTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &SpecificTrainTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewSpecificTrainTimetableAPIControllerGetParamsWithTimeout creates a new SpecificTrainTimetableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewSpecificTrainTimetableAPIControllerGetParamsWithTimeout(timeout time.Duration) *SpecificTrainTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &SpecificTrainTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewSpecificTrainTimetableAPIControllerGetParamsWithContext creates a new SpecificTrainTimetableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewSpecificTrainTimetableAPIControllerGetParamsWithContext(ctx context.Context) *SpecificTrainTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &SpecificTrainTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewSpecificTrainTimetableAPIControllerGetParamsWithHTTPClient creates a new SpecificTrainTimetableAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewSpecificTrainTimetableAPIControllerGetParamsWithHTTPClient(client *http.Client) *SpecificTrainTimetableAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &SpecificTrainTimetableAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*SpecificTrainTimetableAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the specific train timetable Api controller get operation typically these are written to a http.Request
+/* SpecificTrainTimetableAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the specific train timetable Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type SpecificTrainTimetableAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type SpecificTrainTimetableAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the specific train timetable Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *SpecificTrainTimetableAPIControllerGetParams) WithDefaults() *SpecificTrainTimetableAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the specific train timetable Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *SpecificTrainTimetableAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := SpecificTrainTimetableAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the specific train timetable Api controller get params
func (o *SpecificTrainTimetableAPIControllerGetParams) WithTimeout(timeout time.Duration) *SpecificTrainTimetableAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *SpecificTrainTimetableAPIControllerGetParams) WriteToRequest(r runtime.
// 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
}
@@ -277,64 +301,68 @@ func (o *SpecificTrainTimetableAPIControllerGetParams) WriteToRequest(r runtime.
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get_responses.go b/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get_responses.go
index d789dd19..12588e2c 100644
--- a/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/specific_train_timetable_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *SpecificTrainTimetableAPIControllerGetReader) ReadResponse(response run
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewSpecificTrainTimetableAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewSpecificTrainTimetableAPIControllerGetOK() *SpecificTrainTimetableAPICon
return &SpecificTrainTimetableAPIControllerGetOK{}
}
-/*SpecificTrainTimetableAPIControllerGetOK handles this case with default header values.
+/* SpecificTrainTimetableAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type SpecificTrainTimetableAPIControllerGetOK struct {
func (o *SpecificTrainTimetableAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/SpecificTrainTimetable][%d] specificTrainTimetableApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *SpecificTrainTimetableAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRASpecificWrapperPTXServiceDTORailSpecificationV3TRASpecificTrainTimetable {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *SpecificTrainTimetableAPIControllerGetOK) readResponse(response runtime
return nil
}
+
+// NewSpecificTrainTimetableAPIControllerGetNotModified creates a SpecificTrainTimetableAPIControllerGetNotModified with default headers values
+func NewSpecificTrainTimetableAPIControllerGetNotModified() *SpecificTrainTimetableAPIControllerGetNotModified {
+ return &SpecificTrainTimetableAPIControllerGetNotModified{}
+}
+
+/* SpecificTrainTimetableAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type SpecificTrainTimetableAPIControllerGetNotModified struct {
+}
+
+func (o *SpecificTrainTimetableAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/SpecificTrainTimetable][%d] specificTrainTimetableApiControllerGetNotModified ", 304)
+}
+
+func (o *SpecificTrainTimetableAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/station_api_controller_get_parameters.go b/rail/v3/client/t_r_a/station_api_controller_get_parameters.go
index ff0c51cb..89076c75 100644
--- a/rail/v3/client/t_r_a/station_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/station_api_controller_get_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewStationAPIControllerGetParams creates a new StationAPIControllerGetParams object
-// with the default values initialized.
+// NewStationAPIControllerGetParams creates a new StationAPIControllerGetParams 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 NewStationAPIControllerGetParams() *StationAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewStationAPIControllerGetParamsWithTimeout creates a new StationAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewStationAPIControllerGetParamsWithTimeout(timeout time.Duration) *StationAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewStationAPIControllerGetParamsWithContext creates a new StationAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewStationAPIControllerGetParamsWithContext(ctx context.Context) *StationAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewStationAPIControllerGetParamsWithHTTPClient creates a new StationAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewStationAPIControllerGetParamsWithHTTPClient(client *http.Client) *StationAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*StationAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the station Api controller get operation typically these are written to a http.Request
+/* StationAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the station Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type StationAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -119,6 +115,32 @@ type StationAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the station Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationAPIControllerGetParams) WithDefaults() *StationAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the station Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := StationAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the station Api controller get params
func (o *StationAPIControllerGetParams) WithTimeout(timeout time.Duration) *StationAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *StationAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -293,80 +318,85 @@ func (o *StationAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest,
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/station_api_controller_get_responses.go b/rail/v3/client/t_r_a/station_api_controller_get_responses.go
index 10e56028..76525ffb 100644
--- a/rail/v3/client/t_r_a/station_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/station_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *StationAPIControllerGetReader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewStationAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewStationAPIControllerGetOK() *StationAPIControllerGetOK {
return &StationAPIControllerGetOK{}
}
-/*StationAPIControllerGetOK handles this case with default header values.
+/* StationAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type StationAPIControllerGetOK struct {
func (o *StationAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/Station][%d] stationApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *StationAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStation {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *StationAPIControllerGetOK) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewStationAPIControllerGetNotModified creates a StationAPIControllerGetNotModified with default headers values
+func NewStationAPIControllerGetNotModified() *StationAPIControllerGetNotModified {
+ return &StationAPIControllerGetNotModified{}
+}
+
+/* StationAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type StationAPIControllerGetNotModified struct {
+}
+
+func (o *StationAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/Station][%d] stationApiControllerGetNotModified ", 304)
+}
+
+func (o *StationAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/station_exit_api_controller_get_parameters.go b/rail/v3/client/t_r_a/station_exit_api_controller_get_parameters.go
index 3d8a3d2d..95af0ed1 100644
--- a/rail/v3/client/t_r_a/station_exit_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/station_exit_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewStationExitAPIControllerGetParams creates a new StationExitAPIControllerGetParams object
-// with the default values initialized.
+// NewStationExitAPIControllerGetParams creates a new StationExitAPIControllerGetParams 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 NewStationExitAPIControllerGetParams() *StationExitAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationExitAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewStationExitAPIControllerGetParamsWithTimeout creates a new StationExitAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewStationExitAPIControllerGetParamsWithTimeout(timeout time.Duration) *StationExitAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationExitAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewStationExitAPIControllerGetParamsWithContext creates a new StationExitAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewStationExitAPIControllerGetParamsWithContext(ctx context.Context) *StationExitAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationExitAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewStationExitAPIControllerGetParamsWithHTTPClient creates a new StationExitAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewStationExitAPIControllerGetParamsWithHTTPClient(client *http.Client) *StationExitAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationExitAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*StationExitAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the station exit Api controller get operation typically these are written to a http.Request
+/* StationExitAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the station exit Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type StationExitAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type StationExitAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the station exit Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationExitAPIControllerGetParams) WithDefaults() *StationExitAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the station exit Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationExitAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := StationExitAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the station exit Api controller get params
func (o *StationExitAPIControllerGetParams) WithTimeout(timeout time.Duration) *StationExitAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *StationExitAPIControllerGetParams) WriteToRequest(r runtime.ClientReque
// 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
}
@@ -277,64 +301,68 @@ func (o *StationExitAPIControllerGetParams) WriteToRequest(r runtime.ClientReque
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/station_exit_api_controller_get_responses.go b/rail/v3/client/t_r_a/station_exit_api_controller_get_responses.go
index 65cb201e..5547a788 100644
--- a/rail/v3/client/t_r_a/station_exit_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/station_exit_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *StationExitAPIControllerGetReader) ReadResponse(response runtime.Client
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewStationExitAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewStationExitAPIControllerGetOK() *StationExitAPIControllerGetOK {
return &StationExitAPIControllerGetOK{}
}
-/*StationExitAPIControllerGetOK handles this case with default header values.
+/* StationExitAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type StationExitAPIControllerGetOK struct {
func (o *StationExitAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/StationExit][%d] stationExitApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *StationExitAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationExitStationExit {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *StationExitAPIControllerGetOK) readResponse(response runtime.ClientResp
return nil
}
+
+// NewStationExitAPIControllerGetNotModified creates a StationExitAPIControllerGetNotModified with default headers values
+func NewStationExitAPIControllerGetNotModified() *StationExitAPIControllerGetNotModified {
+ return &StationExitAPIControllerGetNotModified{}
+}
+
+/* StationExitAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type StationExitAPIControllerGetNotModified struct {
+}
+
+func (o *StationExitAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/StationExit][%d] stationExitApiControllerGetNotModified ", 304)
+}
+
+func (o *StationExitAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/station_facility_api_controller_get_parameters.go b/rail/v3/client/t_r_a/station_facility_api_controller_get_parameters.go
index 51823901..e9295a30 100644
--- a/rail/v3/client/t_r_a/station_facility_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/station_facility_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewStationFacilityAPIControllerGetParams creates a new StationFacilityAPIControllerGetParams object
-// with the default values initialized.
+// NewStationFacilityAPIControllerGetParams creates a new StationFacilityAPIControllerGetParams 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 NewStationFacilityAPIControllerGetParams() *StationFacilityAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationFacilityAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewStationFacilityAPIControllerGetParamsWithTimeout creates a new StationFacilityAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewStationFacilityAPIControllerGetParamsWithTimeout(timeout time.Duration) *StationFacilityAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationFacilityAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewStationFacilityAPIControllerGetParamsWithContext creates a new StationFacilityAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewStationFacilityAPIControllerGetParamsWithContext(ctx context.Context) *StationFacilityAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationFacilityAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewStationFacilityAPIControllerGetParamsWithHTTPClient creates a new StationFacilityAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewStationFacilityAPIControllerGetParamsWithHTTPClient(client *http.Client) *StationFacilityAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationFacilityAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*StationFacilityAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the station facility Api controller get operation typically these are written to a http.Request
+/* StationFacilityAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the station facility Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type StationFacilityAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type StationFacilityAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the station facility Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationFacilityAPIControllerGetParams) WithDefaults() *StationFacilityAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the station facility Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationFacilityAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := StationFacilityAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the station facility Api controller get params
func (o *StationFacilityAPIControllerGetParams) WithTimeout(timeout time.Duration) *StationFacilityAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *StationFacilityAPIControllerGetParams) WriteToRequest(r runtime.ClientR
// 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
}
@@ -277,64 +301,68 @@ func (o *StationFacilityAPIControllerGetParams) WriteToRequest(r runtime.ClientR
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/station_facility_api_controller_get_responses.go b/rail/v3/client/t_r_a/station_facility_api_controller_get_responses.go
index 8deb399d..b1c60fe2 100644
--- a/rail/v3/client/t_r_a/station_facility_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/station_facility_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *StationFacilityAPIControllerGetReader) ReadResponse(response runtime.Cl
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewStationFacilityAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewStationFacilityAPIControllerGetOK() *StationFacilityAPIControllerGetOK {
return &StationFacilityAPIControllerGetOK{}
}
-/*StationFacilityAPIControllerGetOK handles this case with default header values.
+/* StationFacilityAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type StationFacilityAPIControllerGetOK struct {
func (o *StationFacilityAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/StationFacility][%d] stationFacilityApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *StationFacilityAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *StationFacilityAPIControllerGetOK) readResponse(response runtime.Client
return nil
}
+
+// NewStationFacilityAPIControllerGetNotModified creates a StationFacilityAPIControllerGetNotModified with default headers values
+func NewStationFacilityAPIControllerGetNotModified() *StationFacilityAPIControllerGetNotModified {
+ return &StationFacilityAPIControllerGetNotModified{}
+}
+
+/* StationFacilityAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type StationFacilityAPIControllerGetNotModified struct {
+}
+
+func (o *StationFacilityAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/StationFacility][%d] stationFacilityApiControllerGetNotModified ", 304)
+}
+
+func (o *StationFacilityAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/station_live_board_api_controller_get1_parameters.go b/rail/v3/client/t_r_a/station_live_board_api_controller_get1_parameters.go
index 2fe24bec..5d07359b 100644
--- a/rail/v3/client/t_r_a/station_live_board_api_controller_get1_parameters.go
+++ b/rail/v3/client/t_r_a/station_live_board_api_controller_get1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewStationLiveBoardAPIControllerGet1Params creates a new StationLiveBoardAPIControllerGet1Params object
-// with the default values initialized.
+// NewStationLiveBoardAPIControllerGet1Params creates a new StationLiveBoardAPIControllerGet1Params 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 NewStationLiveBoardAPIControllerGet1Params() *StationLiveBoardAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &StationLiveBoardAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewStationLiveBoardAPIControllerGet1ParamsWithTimeout creates a new StationLiveBoardAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewStationLiveBoardAPIControllerGet1ParamsWithTimeout(timeout time.Duration) *StationLiveBoardAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &StationLiveBoardAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewStationLiveBoardAPIControllerGet1ParamsWithContext creates a new StationLiveBoardAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewStationLiveBoardAPIControllerGet1ParamsWithContext(ctx context.Context) *StationLiveBoardAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &StationLiveBoardAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewStationLiveBoardAPIControllerGet1ParamsWithHTTPClient creates a new StationLiveBoardAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewStationLiveBoardAPIControllerGet1ParamsWithHTTPClient(client *http.Client) *StationLiveBoardAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &StationLiveBoardAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*StationLiveBoardAPIControllerGet1Params contains all the parameters to send to the API endpoint
-for the station live board Api controller get 1 operation typically these are written to a http.Request
+/* StationLiveBoardAPIControllerGet1Params contains all the parameters to send to the API endpoint
+ for the station live board Api controller get 1 operation.
+
+ Typically these are written to a http.Request.
*/
type StationLiveBoardAPIControllerGet1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*StationID
- 欲查詢車站的代碼
+ /* StationID.
+
+ 欲查詢車站的代碼
*/
StationID string
@@ -119,6 +115,32 @@ type StationLiveBoardAPIControllerGet1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the station live board Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationLiveBoardAPIControllerGet1Params) WithDefaults() *StationLiveBoardAPIControllerGet1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the station live board Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationLiveBoardAPIControllerGet1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := StationLiveBoardAPIControllerGet1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the station live board Api controller get 1 params
func (o *StationLiveBoardAPIControllerGet1Params) WithTimeout(timeout time.Duration) *StationLiveBoardAPIControllerGet1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *StationLiveBoardAPIControllerGet1Params) WriteToRequest(r runtime.Clien
// 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
}
@@ -293,64 +318,68 @@ func (o *StationLiveBoardAPIControllerGet1Params) WriteToRequest(r runtime.Clien
// 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 StationID
diff --git a/rail/v3/client/t_r_a/station_live_board_api_controller_get1_responses.go b/rail/v3/client/t_r_a/station_live_board_api_controller_get1_responses.go
index 981f928c..bae2ca45 100644
--- a/rail/v3/client/t_r_a/station_live_board_api_controller_get1_responses.go
+++ b/rail/v3/client/t_r_a/station_live_board_api_controller_get1_responses.go
@@ -29,7 +29,12 @@ func (o *StationLiveBoardAPIControllerGet1Reader) ReadResponse(response runtime.
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewStationLiveBoardAPIControllerGet1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewStationLiveBoardAPIControllerGet1OK() *StationLiveBoardAPIControllerGet1
return &StationLiveBoardAPIControllerGet1OK{}
}
-/*StationLiveBoardAPIControllerGet1OK handles this case with default header values.
+/* StationLiveBoardAPIControllerGet1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type StationLiveBoardAPIControllerGet1OK struct {
func (o *StationLiveBoardAPIControllerGet1OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/StationLiveBoard/Station/{StationID}][%d] stationLiveBoardApiControllerGet1OK %+v", 200, o.Payload)
}
-
func (o *StationLiveBoardAPIControllerGet1OK) GetPayload() *models.PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBoard {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *StationLiveBoardAPIControllerGet1OK) readResponse(response runtime.Clie
return nil
}
+
+// NewStationLiveBoardAPIControllerGet1NotModified creates a StationLiveBoardAPIControllerGet1NotModified with default headers values
+func NewStationLiveBoardAPIControllerGet1NotModified() *StationLiveBoardAPIControllerGet1NotModified {
+ return &StationLiveBoardAPIControllerGet1NotModified{}
+}
+
+/* StationLiveBoardAPIControllerGet1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type StationLiveBoardAPIControllerGet1NotModified struct {
+}
+
+func (o *StationLiveBoardAPIControllerGet1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/StationLiveBoard/Station/{StationID}][%d] stationLiveBoardApiControllerGet1NotModified ", 304)
+}
+
+func (o *StationLiveBoardAPIControllerGet1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/station_live_board_api_controller_get_parameters.go b/rail/v3/client/t_r_a/station_live_board_api_controller_get_parameters.go
index e2d3d0c0..73be1d10 100644
--- a/rail/v3/client/t_r_a/station_live_board_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/station_live_board_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewStationLiveBoardAPIControllerGetParams creates a new StationLiveBoardAPIControllerGetParams object
-// with the default values initialized.
+// NewStationLiveBoardAPIControllerGetParams creates a new StationLiveBoardAPIControllerGetParams 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 NewStationLiveBoardAPIControllerGetParams() *StationLiveBoardAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationLiveBoardAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewStationLiveBoardAPIControllerGetParamsWithTimeout creates a new StationLiveBoardAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewStationLiveBoardAPIControllerGetParamsWithTimeout(timeout time.Duration) *StationLiveBoardAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationLiveBoardAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewStationLiveBoardAPIControllerGetParamsWithContext creates a new StationLiveBoardAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewStationLiveBoardAPIControllerGetParamsWithContext(ctx context.Context) *StationLiveBoardAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationLiveBoardAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewStationLiveBoardAPIControllerGetParamsWithHTTPClient creates a new StationLiveBoardAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewStationLiveBoardAPIControllerGetParamsWithHTTPClient(client *http.Client) *StationLiveBoardAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationLiveBoardAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*StationLiveBoardAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the station live board Api controller get operation typically these are written to a http.Request
+/* StationLiveBoardAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the station live board Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type StationLiveBoardAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type StationLiveBoardAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the station live board Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationLiveBoardAPIControllerGetParams) WithDefaults() *StationLiveBoardAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the station live board Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationLiveBoardAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := StationLiveBoardAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the station live board Api controller get params
func (o *StationLiveBoardAPIControllerGetParams) WithTimeout(timeout time.Duration) *StationLiveBoardAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *StationLiveBoardAPIControllerGetParams) WriteToRequest(r runtime.Client
// 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
}
@@ -277,64 +301,68 @@ func (o *StationLiveBoardAPIControllerGetParams) WriteToRequest(r runtime.Client
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/station_live_board_api_controller_get_responses.go b/rail/v3/client/t_r_a/station_live_board_api_controller_get_responses.go
index c20ebece..d903b6de 100644
--- a/rail/v3/client/t_r_a/station_live_board_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/station_live_board_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *StationLiveBoardAPIControllerGetReader) ReadResponse(response runtime.C
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewStationLiveBoardAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewStationLiveBoardAPIControllerGetOK() *StationLiveBoardAPIControllerGetOK
return &StationLiveBoardAPIControllerGetOK{}
}
-/*StationLiveBoardAPIControllerGetOK handles this case with default header values.
+/* StationLiveBoardAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type StationLiveBoardAPIControllerGetOK struct {
func (o *StationLiveBoardAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/StationLiveBoard][%d] stationLiveBoardApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *StationLiveBoardAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBoard {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *StationLiveBoardAPIControllerGetOK) readResponse(response runtime.Clien
return nil
}
+
+// NewStationLiveBoardAPIControllerGetNotModified creates a StationLiveBoardAPIControllerGetNotModified with default headers values
+func NewStationLiveBoardAPIControllerGetNotModified() *StationLiveBoardAPIControllerGetNotModified {
+ return &StationLiveBoardAPIControllerGetNotModified{}
+}
+
+/* StationLiveBoardAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type StationLiveBoardAPIControllerGetNotModified struct {
+}
+
+func (o *StationLiveBoardAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/StationLiveBoard][%d] stationLiveBoardApiControllerGetNotModified ", 304)
+}
+
+func (o *StationLiveBoardAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/station_of_line_api_controller_get_parameters.go b/rail/v3/client/t_r_a/station_of_line_api_controller_get_parameters.go
index ec642b2f..f0a589b3 100644
--- a/rail/v3/client/t_r_a/station_of_line_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/station_of_line_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewStationOfLineAPIControllerGetParams creates a new StationOfLineAPIControllerGetParams object
-// with the default values initialized.
+// NewStationOfLineAPIControllerGetParams creates a new StationOfLineAPIControllerGetParams 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 NewStationOfLineAPIControllerGetParams() *StationOfLineAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationOfLineAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewStationOfLineAPIControllerGetParamsWithTimeout creates a new StationOfLineAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewStationOfLineAPIControllerGetParamsWithTimeout(timeout time.Duration) *StationOfLineAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationOfLineAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewStationOfLineAPIControllerGetParamsWithContext creates a new StationOfLineAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewStationOfLineAPIControllerGetParamsWithContext(ctx context.Context) *StationOfLineAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationOfLineAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewStationOfLineAPIControllerGetParamsWithHTTPClient creates a new StationOfLineAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewStationOfLineAPIControllerGetParamsWithHTTPClient(client *http.Client) *StationOfLineAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationOfLineAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*StationOfLineAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the station of line Api controller get operation typically these are written to a http.Request
+/* StationOfLineAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the station of line Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type StationOfLineAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type StationOfLineAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the station of line Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationOfLineAPIControllerGetParams) WithDefaults() *StationOfLineAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the station of line Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationOfLineAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := StationOfLineAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the station of line Api controller get params
func (o *StationOfLineAPIControllerGetParams) WithTimeout(timeout time.Duration) *StationOfLineAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *StationOfLineAPIControllerGetParams) WriteToRequest(r runtime.ClientReq
// 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
}
@@ -277,64 +301,68 @@ func (o *StationOfLineAPIControllerGetParams) WriteToRequest(r runtime.ClientReq
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/station_of_line_api_controller_get_responses.go b/rail/v3/client/t_r_a/station_of_line_api_controller_get_responses.go
index ada56e59..85d04b95 100644
--- a/rail/v3/client/t_r_a/station_of_line_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/station_of_line_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *StationOfLineAPIControllerGetReader) ReadResponse(response runtime.Clie
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewStationOfLineAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewStationOfLineAPIControllerGetOK() *StationOfLineAPIControllerGetOK {
return &StationOfLineAPIControllerGetOK{}
}
-/*StationOfLineAPIControllerGetOK handles this case with default header values.
+/* StationOfLineAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type StationOfLineAPIControllerGetOK struct {
func (o *StationOfLineAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/StationOfLine][%d] stationOfLineApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *StationOfLineAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationOfLineStationOfLine {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *StationOfLineAPIControllerGetOK) readResponse(response runtime.ClientRe
return nil
}
+
+// NewStationOfLineAPIControllerGetNotModified creates a StationOfLineAPIControllerGetNotModified with default headers values
+func NewStationOfLineAPIControllerGetNotModified() *StationOfLineAPIControllerGetNotModified {
+ return &StationOfLineAPIControllerGetNotModified{}
+}
+
+/* StationOfLineAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type StationOfLineAPIControllerGetNotModified struct {
+}
+
+func (o *StationOfLineAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/StationOfLine][%d] stationOfLineApiControllerGetNotModified ", 304)
+}
+
+func (o *StationOfLineAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/station_transfer_api_controller_get_parameters.go b/rail/v3/client/t_r_a/station_transfer_api_controller_get_parameters.go
index a3113263..c762aedc 100644
--- a/rail/v3/client/t_r_a/station_transfer_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/station_transfer_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewStationTransferAPIControllerGetParams creates a new StationTransferAPIControllerGetParams object
-// with the default values initialized.
+// NewStationTransferAPIControllerGetParams creates a new StationTransferAPIControllerGetParams 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 NewStationTransferAPIControllerGetParams() *StationTransferAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationTransferAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewStationTransferAPIControllerGetParamsWithTimeout creates a new StationTransferAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewStationTransferAPIControllerGetParamsWithTimeout(timeout time.Duration) *StationTransferAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationTransferAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewStationTransferAPIControllerGetParamsWithContext creates a new StationTransferAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewStationTransferAPIControllerGetParamsWithContext(ctx context.Context) *StationTransferAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationTransferAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewStationTransferAPIControllerGetParamsWithHTTPClient creates a new StationTransferAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewStationTransferAPIControllerGetParamsWithHTTPClient(client *http.Client) *StationTransferAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &StationTransferAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*StationTransferAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the station transfer Api controller get operation typically these are written to a http.Request
+/* StationTransferAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the station transfer Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type StationTransferAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type StationTransferAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the station transfer Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationTransferAPIControllerGetParams) WithDefaults() *StationTransferAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the station transfer Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *StationTransferAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := StationTransferAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the station transfer Api controller get params
func (o *StationTransferAPIControllerGetParams) WithTimeout(timeout time.Duration) *StationTransferAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *StationTransferAPIControllerGetParams) WriteToRequest(r runtime.ClientR
// 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
}
@@ -277,64 +301,68 @@ func (o *StationTransferAPIControllerGetParams) WriteToRequest(r runtime.ClientR
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/station_transfer_api_controller_get_responses.go b/rail/v3/client/t_r_a/station_transfer_api_controller_get_responses.go
index 0c16620c..0d0b7344 100644
--- a/rail/v3/client/t_r_a/station_transfer_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/station_transfer_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *StationTransferAPIControllerGetReader) ReadResponse(response runtime.Cl
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewStationTransferAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewStationTransferAPIControllerGetOK() *StationTransferAPIControllerGetOK {
return &StationTransferAPIControllerGetOK{}
}
-/*StationTransferAPIControllerGetOK handles this case with default header values.
+/* StationTransferAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type StationTransferAPIControllerGetOK struct {
func (o *StationTransferAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/StationTransfer][%d] stationTransferApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *StationTransferAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *StationTransferAPIControllerGetOK) readResponse(response runtime.Client
return nil
}
+
+// NewStationTransferAPIControllerGetNotModified creates a StationTransferAPIControllerGetNotModified with default headers values
+func NewStationTransferAPIControllerGetNotModified() *StationTransferAPIControllerGetNotModified {
+ return &StationTransferAPIControllerGetNotModified{}
+}
+
+/* StationTransferAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type StationTransferAPIControllerGetNotModified struct {
+}
+
+func (o *StationTransferAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/StationTransfer][%d] stationTransferApiControllerGetNotModified ", 304)
+}
+
+func (o *StationTransferAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/train_live_board_api_controller_get1_parameters.go b/rail/v3/client/t_r_a/train_live_board_api_controller_get1_parameters.go
index 1232694c..b2c486f3 100644
--- a/rail/v3/client/t_r_a/train_live_board_api_controller_get1_parameters.go
+++ b/rail/v3/client/t_r_a/train_live_board_api_controller_get1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTrainLiveBoardAPIControllerGet1Params creates a new TrainLiveBoardAPIControllerGet1Params object
-// with the default values initialized.
+// NewTrainLiveBoardAPIControllerGet1Params creates a new TrainLiveBoardAPIControllerGet1Params 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 NewTrainLiveBoardAPIControllerGet1Params() *TrainLiveBoardAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainLiveBoardAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTrainLiveBoardAPIControllerGet1ParamsWithTimeout creates a new TrainLiveBoardAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTrainLiveBoardAPIControllerGet1ParamsWithTimeout(timeout time.Duration) *TrainLiveBoardAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainLiveBoardAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTrainLiveBoardAPIControllerGet1ParamsWithContext creates a new TrainLiveBoardAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTrainLiveBoardAPIControllerGet1ParamsWithContext(ctx context.Context) *TrainLiveBoardAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainLiveBoardAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTrainLiveBoardAPIControllerGet1ParamsWithHTTPClient creates a new TrainLiveBoardAPIControllerGet1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTrainLiveBoardAPIControllerGet1ParamsWithHTTPClient(client *http.Client) *TrainLiveBoardAPIControllerGet1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainLiveBoardAPIControllerGet1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TrainLiveBoardAPIControllerGet1Params contains all the parameters to send to the API endpoint
-for the train live board Api controller get 1 operation typically these are written to a http.Request
+/* TrainLiveBoardAPIControllerGet1Params contains all the parameters to send to the API endpoint
+ for the train live board Api controller get 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TrainLiveBoardAPIControllerGet1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TrainNo
- 欲查詢車次的代碼
+ /* TrainNo.
+
+ 欲查詢車次的代碼
*/
TrainNo string
@@ -119,6 +115,32 @@ type TrainLiveBoardAPIControllerGet1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the train live board Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TrainLiveBoardAPIControllerGet1Params) WithDefaults() *TrainLiveBoardAPIControllerGet1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the train live board Api controller get 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TrainLiveBoardAPIControllerGet1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TrainLiveBoardAPIControllerGet1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the train live board Api controller get 1 params
func (o *TrainLiveBoardAPIControllerGet1Params) WithTimeout(timeout time.Duration) *TrainLiveBoardAPIControllerGet1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *TrainLiveBoardAPIControllerGet1Params) WriteToRequest(r runtime.ClientR
// 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
}
@@ -293,64 +318,68 @@ func (o *TrainLiveBoardAPIControllerGet1Params) WriteToRequest(r runtime.ClientR
// 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 TrainNo
diff --git a/rail/v3/client/t_r_a/train_live_board_api_controller_get1_responses.go b/rail/v3/client/t_r_a/train_live_board_api_controller_get1_responses.go
index 1e262308..17e9062d 100644
--- a/rail/v3/client/t_r_a/train_live_board_api_controller_get1_responses.go
+++ b/rail/v3/client/t_r_a/train_live_board_api_controller_get1_responses.go
@@ -29,7 +29,12 @@ func (o *TrainLiveBoardAPIControllerGet1Reader) ReadResponse(response runtime.Cl
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTrainLiveBoardAPIControllerGet1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTrainLiveBoardAPIControllerGet1OK() *TrainLiveBoardAPIControllerGet1OK {
return &TrainLiveBoardAPIControllerGet1OK{}
}
-/*TrainLiveBoardAPIControllerGet1OK handles this case with default header values.
+/* TrainLiveBoardAPIControllerGet1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TrainLiveBoardAPIControllerGet1OK struct {
func (o *TrainLiveBoardAPIControllerGet1OK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/TrainLiveBoard/TrainNo/{TrainNo}][%d] trainLiveBoardApiControllerGet1OK %+v", 200, o.Payload)
}
-
func (o *TrainLiveBoardAPIControllerGet1OK) GetPayload() *models.PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRATrainLiveBoardListTrainLiveBoard {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *TrainLiveBoardAPIControllerGet1OK) readResponse(response runtime.Client
return nil
}
+
+// NewTrainLiveBoardAPIControllerGet1NotModified creates a TrainLiveBoardAPIControllerGet1NotModified with default headers values
+func NewTrainLiveBoardAPIControllerGet1NotModified() *TrainLiveBoardAPIControllerGet1NotModified {
+ return &TrainLiveBoardAPIControllerGet1NotModified{}
+}
+
+/* TrainLiveBoardAPIControllerGet1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TrainLiveBoardAPIControllerGet1NotModified struct {
+}
+
+func (o *TrainLiveBoardAPIControllerGet1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/TrainLiveBoard/TrainNo/{TrainNo}][%d] trainLiveBoardApiControllerGet1NotModified ", 304)
+}
+
+func (o *TrainLiveBoardAPIControllerGet1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/train_live_board_api_controller_get_parameters.go b/rail/v3/client/t_r_a/train_live_board_api_controller_get_parameters.go
index 101249b4..97c45814 100644
--- a/rail/v3/client/t_r_a/train_live_board_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/train_live_board_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTrainLiveBoardAPIControllerGetParams creates a new TrainLiveBoardAPIControllerGetParams object
-// with the default values initialized.
+// NewTrainLiveBoardAPIControllerGetParams creates a new TrainLiveBoardAPIControllerGetParams 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 NewTrainLiveBoardAPIControllerGetParams() *TrainLiveBoardAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainLiveBoardAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTrainLiveBoardAPIControllerGetParamsWithTimeout creates a new TrainLiveBoardAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTrainLiveBoardAPIControllerGetParamsWithTimeout(timeout time.Duration) *TrainLiveBoardAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainLiveBoardAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTrainLiveBoardAPIControllerGetParamsWithContext creates a new TrainLiveBoardAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTrainLiveBoardAPIControllerGetParamsWithContext(ctx context.Context) *TrainLiveBoardAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainLiveBoardAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTrainLiveBoardAPIControllerGetParamsWithHTTPClient creates a new TrainLiveBoardAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTrainLiveBoardAPIControllerGetParamsWithHTTPClient(client *http.Client) *TrainLiveBoardAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainLiveBoardAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TrainLiveBoardAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the train live board Api controller get operation typically these are written to a http.Request
+/* TrainLiveBoardAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the train live board Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type TrainLiveBoardAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type TrainLiveBoardAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the train live board Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TrainLiveBoardAPIControllerGetParams) WithDefaults() *TrainLiveBoardAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the train live board Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TrainLiveBoardAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TrainLiveBoardAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the train live board Api controller get params
func (o *TrainLiveBoardAPIControllerGetParams) WithTimeout(timeout time.Duration) *TrainLiveBoardAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *TrainLiveBoardAPIControllerGetParams) WriteToRequest(r runtime.ClientRe
// 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
}
@@ -277,64 +301,68 @@ func (o *TrainLiveBoardAPIControllerGetParams) WriteToRequest(r runtime.ClientRe
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/train_live_board_api_controller_get_responses.go b/rail/v3/client/t_r_a/train_live_board_api_controller_get_responses.go
index e38c81e5..50ec9de5 100644
--- a/rail/v3/client/t_r_a/train_live_board_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/train_live_board_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *TrainLiveBoardAPIControllerGetReader) ReadResponse(response runtime.Cli
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTrainLiveBoardAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTrainLiveBoardAPIControllerGetOK() *TrainLiveBoardAPIControllerGetOK {
return &TrainLiveBoardAPIControllerGetOK{}
}
-/*TrainLiveBoardAPIControllerGetOK handles this case with default header values.
+/* TrainLiveBoardAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TrainLiveBoardAPIControllerGetOK struct {
func (o *TrainLiveBoardAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/TrainLiveBoard][%d] trainLiveBoardApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *TrainLiveBoardAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRATrainLiveBoardListTrainLiveBoard {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *TrainLiveBoardAPIControllerGetOK) readResponse(response runtime.ClientR
return nil
}
+
+// NewTrainLiveBoardAPIControllerGetNotModified creates a TrainLiveBoardAPIControllerGetNotModified with default headers values
+func NewTrainLiveBoardAPIControllerGetNotModified() *TrainLiveBoardAPIControllerGetNotModified {
+ return &TrainLiveBoardAPIControllerGetNotModified{}
+}
+
+/* TrainLiveBoardAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TrainLiveBoardAPIControllerGetNotModified struct {
+}
+
+func (o *TrainLiveBoardAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/TrainLiveBoard][%d] trainLiveBoardApiControllerGetNotModified ", 304)
+}
+
+func (o *TrainLiveBoardAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/client/t_r_a/train_type_api_controller_get_parameters.go b/rail/v3/client/t_r_a/train_type_api_controller_get_parameters.go
index 3d17ec95..cc68edfa 100644
--- a/rail/v3/client/t_r_a/train_type_api_controller_get_parameters.go
+++ b/rail/v3/client/t_r_a/train_type_api_controller_get_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTrainTypeAPIControllerGetParams creates a new TrainTypeAPIControllerGetParams object
-// with the default values initialized.
+// NewTrainTypeAPIControllerGetParams creates a new TrainTypeAPIControllerGetParams 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 NewTrainTypeAPIControllerGetParams() *TrainTypeAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainTypeAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTrainTypeAPIControllerGetParamsWithTimeout creates a new TrainTypeAPIControllerGetParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTrainTypeAPIControllerGetParamsWithTimeout(timeout time.Duration) *TrainTypeAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainTypeAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTrainTypeAPIControllerGetParamsWithContext creates a new TrainTypeAPIControllerGetParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTrainTypeAPIControllerGetParamsWithContext(ctx context.Context) *TrainTypeAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainTypeAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTrainTypeAPIControllerGetParamsWithHTTPClient creates a new TrainTypeAPIControllerGetParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTrainTypeAPIControllerGetParamsWithHTTPClient(client *http.Client) *TrainTypeAPIControllerGetParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TrainTypeAPIControllerGetParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TrainTypeAPIControllerGetParams contains all the parameters to send to the API endpoint
-for the train type Api controller get operation typically these are written to a http.Request
+/* TrainTypeAPIControllerGetParams contains all the parameters to send to the API endpoint
+ for the train type Api controller get operation.
+
+ Typically these are written to a http.Request.
*/
type TrainTypeAPIControllerGetParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type TrainTypeAPIControllerGetParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the train type Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TrainTypeAPIControllerGetParams) WithDefaults() *TrainTypeAPIControllerGetParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the train type Api controller get params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TrainTypeAPIControllerGetParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TrainTypeAPIControllerGetParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the train type Api controller get params
func (o *TrainTypeAPIControllerGetParams) WithTimeout(timeout time.Duration) *TrainTypeAPIControllerGetParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *TrainTypeAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest
// 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
}
@@ -277,64 +301,68 @@ func (o *TrainTypeAPIControllerGetParams) WriteToRequest(r runtime.ClientRequest
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/rail/v3/client/t_r_a/train_type_api_controller_get_responses.go b/rail/v3/client/t_r_a/train_type_api_controller_get_responses.go
index 62a65c7e..35c4b522 100644
--- a/rail/v3/client/t_r_a/train_type_api_controller_get_responses.go
+++ b/rail/v3/client/t_r_a/train_type_api_controller_get_responses.go
@@ -29,7 +29,12 @@ func (o *TrainTypeAPIControllerGetReader) ReadResponse(response runtime.ClientRe
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTrainTypeAPIControllerGetNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTrainTypeAPIControllerGetOK() *TrainTypeAPIControllerGetOK {
return &TrainTypeAPIControllerGetOK{}
}
-/*TrainTypeAPIControllerGetOK handles this case with default header values.
+/* TrainTypeAPIControllerGetOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TrainTypeAPIControllerGetOK struct {
func (o *TrainTypeAPIControllerGetOK) Error() string {
return fmt.Sprintf("[GET /v3/Rail/TRA/TrainType][%d] trainTypeApiControllerGetOK %+v", 200, o.Payload)
}
-
func (o *TrainTypeAPIControllerGetOK) GetPayload() *models.PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRATrainType {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *TrainTypeAPIControllerGetOK) readResponse(response runtime.ClientRespon
return nil
}
+
+// NewTrainTypeAPIControllerGetNotModified creates a TrainTypeAPIControllerGetNotModified with default headers values
+func NewTrainTypeAPIControllerGetNotModified() *TrainTypeAPIControllerGetNotModified {
+ return &TrainTypeAPIControllerGetNotModified{}
+}
+
+/* TrainTypeAPIControllerGetNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TrainTypeAPIControllerGetNotModified struct {
+}
+
+func (o *TrainTypeAPIControllerGetNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Rail/TRA/TrainType][%d] trainTypeApiControllerGetNotModified ", 304)
+}
+
+func (o *TrainTypeAPIControllerGetNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line.go
index 9e991102..ea4bd5bb 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALine) v
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a line based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLines(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALine) contextValidateLines(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Lines); i++ {
+
+ if m.Lines[i] != nil {
+ if err := m.Lines[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Lines" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_network.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_network.go
index 72624d49..4fb30ed1 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_network.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_network.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALineNet
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a line network line network based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineNetworks(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork) contextValidateLineNetworks(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.LineNetworks); i++ {
+
+ if m.LineNetworks[i] != nil {
+ if err := m.LineNetworks[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("LineNetworks" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_transfer.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_transfer.go
index c7288dd7..ce4bc5ed 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_transfer.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_transfer.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALineTra
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a line transfer based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALineTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineTransfers(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALineTransfer) contextValidateLineTransfers(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.LineTransfers); i++ {
+
+ if m.LineTransfers[i] != nil {
+ if err := m.LineTransfers[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("LineTransfers" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRALineTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_network.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_network.go
index 22cfbb16..8f795fbd 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_network.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_network.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRANetwork
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a network network based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRANetworkNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateNetworks(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRANetworkNetwork) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Networks); i++ {
+
+ if m.Networks[i] != nil {
+ if err := m.Networks[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Networks" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRANetworkNetwork) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_operator.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_operator.go
index 01ef120b..9ae45988 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_operator.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_operator.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAOperato
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a operator based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAOperator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperators(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAOperator) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Operators); i++ {
+
+ if m.Operators[i] != nil {
+ if err := m.Operators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Operators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAOperator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_shape.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_shape.go
index b3c73ec2..c5740e75 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_shape.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_shape.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAShape)
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a shape based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAShape) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateShapes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAShape) contextValidateShapes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Shapes); i++ {
+
+ if m.Shapes[i] != nil {
+ if err := m.Shapes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Shapes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAShape) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station.go
index e9c53b85..8c184cfa 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStation
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a station based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStations(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStation) contextValidateStations(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Stations); i++ {
+
+ if m.Stations[i] != nil {
+ if err := m.Stations[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Stations" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_station_exit.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_station_exit.go
index e46a4a87..8c197ad9 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_station_exit.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_station_exit.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStation
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a station exit station exit based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationExitStationExit) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationExits(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationExitStationExit) contextValidateStationExits(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StationExits); i++ {
+
+ if m.StationExits[i] != nil {
+ if err := m.StationExits[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StationExits" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationExitStationExit) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_station_facility.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_station_facility.go
index 9d9afa25..b974584f 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_station_facility.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_station_facility.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStation
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a station facility station facility based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationFacilities(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) contextValidateStationFacilities(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StationFacilities); i++ {
+
+ if m.StationFacilities[i] != nil {
+ if err := m.StationFacilities[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StationFacilities" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_station_of_line.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_station_of_line.go
index c45db7ea..626f4faf 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_station_of_line.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_station_of_line.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStation
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a station of line station of line based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationOfLineStationOfLine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationOfLines(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationOfLineStationOfLine) contextValidateStationOfLines(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StationOfLines); i++ {
+
+ if m.StationOfLines[i] != nil {
+ if err := m.StationOfLines[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StationOfLines" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationOfLineStationOfLine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_station_transfer.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_station_transfer.go
index d1d1d4cc..ac57e081 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_station_transfer.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_station_transfer.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStation
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a station transfer station transfer based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationTransfers(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer) contextValidateStationTransfers(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StationTransfers); i++ {
+
+ if m.StationTransfers[i] != nil {
+ if err := m.StationTransfers[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StationTransfers" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_train_type.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_train_type.go
index bb48cfb9..28d9883b 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_train_type.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_base_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_train_type.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRATrainTy
return nil
}
+// ContextValidate validate this p t x API rail model t r a base wrapper p t x service d t o rail specification v3 t r a train type based on the context it is used
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRATrainType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTrainTypes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRATrainType) contextValidateTrainTypes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TrainTypes); i++ {
+
+ if m.TrainTypes[i] != nil {
+ if err := m.TrainTypes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TrainTypes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRABaseWrapperPTXServiceDTORailSpecificationV3TRATrainType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_general_station_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_general_station_timetable.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_general_station_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_general_station_timetable.go
index 722f19ad..a3fe2eb8 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_general_station_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_general_station_timetable.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_general_station_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_general_station_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -202,6 +203,38 @@ func (m *PTXAPIRailModelTRAGeneralStationWrapperPTXServiceDTORailSpecificationV3
return nil
}
+// ContextValidate validate this p t x API rail model t r a general station wrapper p t x service d t o rail specification v3 t r a general station timetable general station timetable based on the context it is used
+func (m *PTXAPIRailModelTRAGeneralStationWrapperPTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationTimetables(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRAGeneralStationWrapperPTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable) contextValidateStationTimetables(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StationTimetables); i++ {
+
+ if m.StationTimetables[i] != nil {
+ if err := m.StationTimetables[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StationTimetables" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRAGeneralStationWrapperPTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_general_train_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_train_timetable.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_general_train_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_train_timetable.go
index cf43ab82..335ff440 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_general_train_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_train_timetable.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_general_train_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_train_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -202,6 +203,38 @@ func (m *PTXAPIRailModelTRAGeneralTrainWrapperPTXServiceDTORailSpecificationV3TR
return nil
}
+// ContextValidate validate this p t x API rail model t r a general train wrapper p t x service d t o rail specification v3 t r a general train timetable based on the context it is used
+func (m *PTXAPIRailModelTRAGeneralTrainWrapperPTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTrainTimetables(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRAGeneralTrainWrapperPTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable) contextValidateTrainTimetables(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TrainTimetables); i++ {
+
+ if m.TrainTimetables[i] != nil {
+ if err := m.TrainTimetables[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TrainTimetables" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRAGeneralTrainWrapperPTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_o_d_fare_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_o_d_fare.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_o_d_fare_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_o_d_fare.go
index 2d147760..2641e328 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_o_d_fare_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_o_d_fare.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_o_d_fare_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_o_d_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -178,6 +179,38 @@ func (m *PTXAPIRailModelTRAODFareWrapperPTXServiceDTORailSpecificationV3TRAODFar
return nil
}
+// ContextValidate validate this p t x API rail model t r a o d fare wrapper p t x service d t o rail specification v3 t r a o d fare o d fare based on the context it is used
+func (m *PTXAPIRailModelTRAODFareWrapperPTXServiceDTORailSpecificationV3TRAODFareODFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateODFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRAODFareWrapperPTXServiceDTORailSpecificationV3TRAODFareODFare) contextValidateODFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.ODFares); i++ {
+
+ if m.ODFares[i] != nil {
+ if err := m.ODFares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ODFares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRAODFareWrapperPTXServiceDTORailSpecificationV3TRAODFareODFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert.go
index bf3136f6..dc16386d 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRA
return nil
}
+// ContextValidate validate this p t x API rail model t r a real time wrapper p t x service d t o rail specification v3 t r a t r a alert list alert based on the context it is used
+func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRAAlertListAlert) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAlerts(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRAAlertListAlert) contextValidateAlerts(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Alerts); i++ {
+
+ if m.Alerts[i] != nil {
+ if err := m.Alerts[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Alerts" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRAAlertListAlert) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_news_list_news.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_news_list_news.go
index f68ade26..c5c35016 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_news_list_news.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_news_list_news.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRA
return nil
}
+// ContextValidate validate this p t x API rail model t r a real time wrapper p t x service d t o rail specification v3 t r a t r a news list news based on the context it is used
+func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRANewsListNews) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateNewses(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRANewsListNews) contextValidateNewses(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Newses); i++ {
+
+ if m.Newses[i] != nil {
+ if err := m.Newses[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Newses" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRANewsListNews) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_station_live_board_list_station_live_board.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_station_live_board_list_station_live_board.go
index b3952cb5..9251ff97 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_station_live_board_list_station_live_board.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_station_live_board_list_station_live_board.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRA
return nil
}
+// ContextValidate validate this p t x API rail model t r a real time wrapper p t x service d t o rail specification v3 t r a t r a station live board list station live board based on the context it is used
+func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBoard) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationLiveBoards(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBoard) contextValidateStationLiveBoards(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StationLiveBoards); i++ {
+
+ if m.StationLiveBoards[i] != nil {
+ if err := m.StationLiveBoards[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StationLiveBoards" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBoard) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_train_live_board_list_train_live_board.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_train_live_board_list_train_live_board.go
index bf7d1504..6eb06894 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_train_live_board_list_train_live_board.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_real_time_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_train_live_board_list_train_live_board.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -163,6 +164,38 @@ func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRA
return nil
}
+// ContextValidate validate this p t x API rail model t r a real time wrapper p t x service d t o rail specification v3 t r a t r a train live board list train live board based on the context it is used
+func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRATrainLiveBoardListTrainLiveBoard) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTrainLiveBoards(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRATrainLiveBoardListTrainLiveBoard) contextValidateTrainLiveBoards(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TrainLiveBoards); i++ {
+
+ if m.TrainLiveBoards[i] != nil {
+ if err := m.TrainLiveBoards[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TrainLiveBoards" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRARealTimeWrapperPTXServiceDTORailSpecificationV3TRATRATrainLiveBoardListTrainLiveBoard) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_t_r_a_specific_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_specific_train_timetable.go b/rail/v3/models/p_t_x_api_rail_model_t_r_a_specific_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_specific_train_timetable.go
index 156e5501..e4045040 100644
--- a/rail/v3/models/p_t_x_api_rail_model_t_r_a_specific_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_specific_train_timetable.go
+++ b/rail/v3/models/p_t_x_api_rail_model_t_r_a_specific_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_specific_train_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -202,6 +203,38 @@ func (m *PTXAPIRailModelTRASpecificWrapperPTXServiceDTORailSpecificationV3TRASpe
return nil
}
+// ContextValidate validate this p t x API rail model t r a specific wrapper p t x service d t o rail specification v3 t r a specific train timetable based on the context it is used
+func (m *PTXAPIRailModelTRASpecificWrapperPTXServiceDTORailSpecificationV3TRASpecificTrainTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTrainTimetables(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTRASpecificWrapperPTXServiceDTORailSpecificationV3TRASpecificTrainTimetable) contextValidateTrainTimetables(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TrainTimetables); i++ {
+
+ if m.TrainTimetables[i] != nil {
+ if err := m.TrainTimetables[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TrainTimetables" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTRASpecificWrapperPTXServiceDTORailSpecificationV3TRASpecificTrainTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_tra_daily_station_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_station_timetable.go b/rail/v3/models/p_t_x_api_rail_model_tra_daily_station_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_station_timetable.go
index 1aee615a..f11cc327 100644
--- a/rail/v3/models/p_t_x_api_rail_model_tra_daily_station_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_station_timetable.go
+++ b/rail/v3/models/p_t_x_api_rail_model_tra_daily_station_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_station_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -182,6 +183,38 @@ func (m *PTXAPIRailModelTraDailyStationWrapperPTXServiceDTORailSpecificationV3TR
return nil
}
+// ContextValidate validate this p t x API rail model tra daily station wrapper p t x service d t o rail specification v3 t r a daily station time table station timetable based on the context it is used
+func (m *PTXAPIRailModelTraDailyStationWrapperPTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationTimetables(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTraDailyStationWrapperPTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable) contextValidateStationTimetables(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.StationTimetables); i++ {
+
+ if m.StationTimetables[i] != nil {
+ if err := m.StationTimetables[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("StationTimetables" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTraDailyStationWrapperPTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_api_rail_model_tra_daily_train_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_timetable.go b/rail/v3/models/p_t_x_api_rail_model_tra_daily_train_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_timetable.go
index 304a5234..9f29c3e7 100644
--- a/rail/v3/models/p_t_x_api_rail_model_tra_daily_train_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_timetable.go
+++ b/rail/v3/models/p_t_x_api_rail_model_tra_daily_train_wrapper_p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -139,7 +140,6 @@ func (m *PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRAD
}
func (m *PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable) validateTrainTimetables(formats strfmt.Registry) error {
-
if swag.IsZero(m.TrainTimetables) { // not required
return nil
}
@@ -181,6 +181,38 @@ func (m *PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRAD
return nil
}
+// ContextValidate validate this p t x API rail model tra daily train wrapper p t x service d t o rail specification v3 t r a daily train time table train timetable based on the context it is used
+func (m *PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTrainTimetables(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable) contextValidateTrainTimetables(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TrainTimetables); i++ {
+
+ if m.TrainTimetables[i] != nil {
+ if err := m.TrainTimetables[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TrainTimetables" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIRailModelTraDailyTrainWrapperPTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_service_day.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_service_day.go
index 13e5c57b..fa4defa2 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_service_day.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_service_day.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -244,6 +246,11 @@ func (m *PTXServiceDTORailSpecificationV3TRACommonServiceDay) validateWednesday(
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a common service day based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRACommonServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRACommonServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_special_day.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_special_day.go
index 3c405f15..53261e09 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_special_day.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_special_day.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -48,6 +50,11 @@ func (m *PTXServiceDTORailSpecificationV3TRACommonSpecialDay) Validate(formats s
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a common special day based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRACommonSpecialDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRACommonSpecialDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_stop_time.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_stop_time.go
index 10da0f14..6b3c9326 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_stop_time.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_stop_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -123,6 +125,25 @@ func (m *PTXServiceDTORailSpecificationV3TRACommonStopTime) validateStopSequence
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a common stop time based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRACommonStopTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRACommonStopTime) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRACommonStopTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_train_info.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_train_info.go
index 33708df7..acf0a6cf 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_train_info.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_common_train_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -263,7 +265,6 @@ func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) validateDirection(f
}
func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) validateEndingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.EndingStationName) { // not required
return nil
}
@@ -290,7 +291,6 @@ func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) validatePackageServ
}
func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) validateStartingStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StartingStationName) { // not required
return nil
}
@@ -308,7 +308,6 @@ func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) validateTrainNo(for
}
func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) validateTrainTypeName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TrainTypeName) { // not required
return nil
}
@@ -325,6 +324,43 @@ func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) validateWheelChairF
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a common train info based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRACommonTrainInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_station_timetable.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_station_timetable.go
index c3e7470f..a1d3e794 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_station_timetable.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_station_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -67,7 +68,6 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetabl
}
func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable) validateStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StationName) { // not required
return nil
}
@@ -100,6 +100,47 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetabl
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a daily station time table station timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(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 *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable) 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 *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableStationTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_time_table.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_time_table.go
index eb417674..a2f6d664 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_time_table.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_station_time_table_time_table.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -91,7 +93,6 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableTimeTable) Vali
}
func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableTimeTable) validateDestinationStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.DestinationStationName) { // not required
return nil
}
@@ -109,7 +110,6 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableTimeTable) vali
}
func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableTimeTable) validateTrainTypeName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TrainTypeName) { // not required
return nil
}
@@ -117,6 +117,34 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableTimeTable) vali
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a daily station time table time table based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableTimeTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableTimeTable) contextValidateDestinationStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableTimeTable) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRADailyStationTimeTableTimeTable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_dining_flag_section.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_dining_flag_section.go
index 2d90d2e4..df20f1d1 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_dining_flag_section.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_dining_flag_section.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -61,6 +63,34 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableDiningFlagSection
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a daily train time table dining flag section based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableDiningFlagSection) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndSection(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartSection(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableDiningFlagSection) contextValidateEndSection(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableDiningFlagSection) contextValidateStartSection(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableDiningFlagSection) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_section_among.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_section_among.go
index c359f322..31041000 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_section_among.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_section_among.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -66,6 +68,11 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableSectionAmong) val
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a daily train time table section among based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableSectionAmong) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableSectionAmong) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_stop_time.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_stop_time.go
index b64cc5d5..775544b6 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_stop_time.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_stop_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -93,6 +95,25 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableStopTime) validat
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a daily train time table stop time based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableStopTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableStopTime) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableStopTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_info.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_info.go
index f69c7873..8988234d 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_info.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_info.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -257,7 +258,6 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainInfo) valida
}
func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainInfo) validateDiningFlagSections(formats strfmt.Registry) error {
-
if swag.IsZero(m.DiningFlagSections) { // not required
return nil
}
@@ -350,6 +350,65 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainInfo) valida
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a daily train time table train info based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDiningFlagSections(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStartingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainInfo) contextValidateDiningFlagSections(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.DiningFlagSections); i++ {
+
+ if m.DiningFlagSections[i] != nil {
+ if err := m.DiningFlagSections[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("DiningFlagSections" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainInfo) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainInfo) contextValidateStartingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainInfo) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_timetable.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_timetable.go
index f8bed779..77a5f0c5 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_timetable.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_daily_train_time_table_train_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -82,6 +83,47 @@ func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable) v
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a daily train time table train timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStopTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainInfo(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable) 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
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable) contextValidateTrainInfo(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRADailyTrainTimeTableTrainTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_general_station_timetable.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_general_station_timetable.go
index f59530f9..09363b70 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_general_station_timetable.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_general_station_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -114,7 +115,6 @@ func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStatio
}
func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable) validateStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StationName) { // not required
return nil
}
@@ -147,6 +147,56 @@ func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStatio
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a general station timetable general station timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(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 *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable) 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 *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableGeneralStationTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_service_day.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_service_day.go
index 16156cfe..c3e68d24 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_service_day.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_service_day.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -180,6 +182,11 @@ func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableServiceDay) v
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a general station timetable service day based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_timetable.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_timetable.go
index 614be0bc..28c5f65e 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_timetable.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_station_timetable_timetable.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -87,7 +89,6 @@ func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableTimetable) Va
}
func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableTimetable) validateDestinationStationName(formats strfmt.Registry) error {
-
if swag.IsZero(m.DestinationStationName) { // not required
return nil
}
@@ -96,7 +97,6 @@ func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableTimetable) va
}
func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableTimetable) validateTrainTypeName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TrainTypeName) { // not required
return nil
}
@@ -104,6 +104,34 @@ func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableTimetable) va
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a general station timetable timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableTimetable) contextValidateDestinationStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableTimetable) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAGeneralStationTimetableTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_train_timetable.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_train_timetable.go
index 1fe79229..3e332865 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_train_timetable.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_general_train_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -101,6 +102,56 @@ func (m *PTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable) validateTrain
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a general train timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainInfo(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable) 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
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable) contextValidateTrainInfo(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAGeneralTrainTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line.go
index 9cec6a3b..f2a3ab73 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -136,6 +138,34 @@ func (m *PTXServiceDTORailSpecificationV3TRALine) validateLineSectionName(format
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a line based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRALine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateLineSectionName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRALine) contextValidateLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRALine) contextValidateLineSectionName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRALine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_network.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_network.go
index e9aff9e7..617b0f82 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_network.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_network.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -78,7 +79,6 @@ func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork) validateLine
}
func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork) validateLineSegments(formats strfmt.Registry) error {
-
if swag.IsZero(m.LineSegments) { // not required
return nil
}
@@ -102,6 +102,47 @@ func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork) validateLine
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a line network line network based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateLineSegments(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork) contextValidateLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork) contextValidateLineSegments(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.LineSegments); i++ {
+
+ if m.LineSegments[i] != nil {
+ if err := m.LineSegments[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("LineSegments" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineNetwork) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_segment.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_segment.go
index bff604da..8d0d35f3 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_segment.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_network_line_segment.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -142,6 +144,25 @@ func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineSegment) validateToSt
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a line network line segment based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineSegment) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineSegmentName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineSegment) contextValidateLineSegmentName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRALineNetworkLineSegment) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_transfer.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_transfer.go
index b466c177..f776edb0 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_transfer.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_line_transfer.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -212,6 +214,52 @@ func (m *PTXServiceDTORailSpecificationV3TRALineTransfer) validateTransferDescri
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a line transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRALineTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFromLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFromStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateToLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateToStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRALineTransfer) contextValidateFromLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRALineTransfer) contextValidateFromStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRALineTransfer) contextValidateToLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRALineTransfer) contextValidateToStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRALineTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_line.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_line.go
index ef5cd004..a3d6f25b 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_line.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_line.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -68,6 +70,11 @@ func (m *PTXServiceDTORailSpecificationV3TRANetworkLine) validateLineNo(formats
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a network line based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRANetworkLine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRANetworkLine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_map_name_type.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_map_name_type.go
index afcccc03..93e6f9a3 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_map_name_type.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_map_name_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -36,6 +38,11 @@ func (m *PTXServiceDTORailSpecificationV3TRANetworkMapNameType) Validate(formats
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a network map name type based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRANetworkMapNameType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRANetworkMapNameType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_network.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_network.go
index a27ce501..61ec0927 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_network.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_network_network.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -156,6 +157,65 @@ func (m *PTXServiceDTORailSpecificationV3TRANetworkNetwork) validateOperatorName
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a network network based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRANetworkNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLines(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNetworkMapURL(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNetworkName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRANetworkNetwork) contextValidateLines(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Lines); i++ {
+
+ if m.Lines[i] != nil {
+ if err := m.Lines[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Lines" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRANetworkNetwork) contextValidateNetworkMapURL(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRANetworkNetwork) contextValidateNetworkName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRANetworkNetwork) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRANetworkNetwork) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_fare.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_fare.go
index 04063bdb..6221b7a5 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_fare.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_fare.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -104,6 +106,11 @@ func (m *PTXServiceDTORailSpecificationV3TRAODFareFare) validateTicketType(forma
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a o d fare fare based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAODFareFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAODFareFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_o_d_fare.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_o_d_fare.go
index 65d5b280..dcdeedf3 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_o_d_fare.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_o_d_fare_o_d_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -164,6 +165,56 @@ func (m *PTXServiceDTORailSpecificationV3TRAODFareODFare) validateTrainType(form
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a o d fare o d fare based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAODFareODFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAODFareODFare) contextValidateDestinationStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAODFareODFare) contextValidateFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Fares); i++ {
+
+ if m.Fares[i] != nil {
+ if err := m.Fares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Fares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAODFareODFare) contextValidateOriginStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAODFareODFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_operator.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_operator.go
index 0be75d7d..f252d9d3 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_operator.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_operator.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -101,6 +103,25 @@ func (m *PTXServiceDTORailSpecificationV3TRAOperator) validateOperatorName(forma
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a operator based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAOperator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAOperator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAOperator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_shape.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_shape.go
index a2c7f970..0b9c5bb6 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_shape.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_shape.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -123,6 +125,25 @@ func (m *PTXServiceDTORailSpecificationV3TRAShape) validateUpdateTime(formats st
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a shape based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAShape) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAShape) contextValidateLineName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAShape) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_specific_train_timetable.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_specific_train_timetable.go
index 03d74cfb..b9743665 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_specific_train_timetable.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_specific_train_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -101,6 +102,56 @@ func (m *PTXServiceDTORailSpecificationV3TRASpecificTrainTimetable) validateTrai
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a specific train timetable based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRASpecificTrainTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateSpecialDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainInfo(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRASpecificTrainTimetable) contextValidateSpecialDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRASpecificTrainTimetable) 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
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRASpecificTrainTimetable) contextValidateTrainInfo(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRASpecificTrainTimetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station.go
index 7a8ecaef..b92ed2c9 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -127,6 +129,34 @@ func (m *PTXServiceDTORailSpecificationV3TRAStation) validateStationUID(formats
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStation) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStation) contextValidateStationPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_exit.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_exit.go
index b055a204..7aee9cea 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_exit.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_exit.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -127,6 +129,34 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationExitExit) validateExitPositio
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station exit exit based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationExitExit) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateExitName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateExitPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationExitExit) contextValidateExitName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationExitExit) contextValidateExitPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationExitExit) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_exit_map_url.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_exit_map_url.go
index 1a2c24b8..b94e2c67 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_exit_map_url.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_exit_map_url.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -54,6 +56,25 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationExitExitMapURL) validateMapNa
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station exit exit map URL based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationExitExitMapURL) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateMapName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationExitExitMapURL) contextValidateMapName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationExitExitMapURL) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_station_exit.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_station_exit.go
index 9f6d040f..72e97988 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_station_exit.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_exit_station_exit.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -74,7 +75,6 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationExitStationExit) Validate(for
}
func (m *PTXServiceDTORailSpecificationV3TRAStationExitStationExit) validateExitMapURLs(formats strfmt.Registry) error {
-
if swag.IsZero(m.ExitMapURLs) { // not required
return nil
}
@@ -137,6 +137,69 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationExitStationExit) validateStat
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station exit station exit based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationExitStationExit) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateExitMapURLs(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateExits(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationExitStationExit) contextValidateExitMapURLs(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.ExitMapURLs); i++ {
+
+ if m.ExitMapURLs[i] != nil {
+ if err := m.ExitMapURLs[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ExitMapURLs" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationExitStationExit) contextValidateExits(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Exits); i++ {
+
+ if m.Exits[i] != nil {
+ if err := m.Exits[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Exits" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationExitStationExit) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationExitStationExit) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_facility_info.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_facility_info.go
index c35d4a94..15a37bd1 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_facility_info.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_facility_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -52,6 +54,11 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityFacilityInfo) validat
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a station facility facility info based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityFacilityInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityFacilityInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_facility_map_url.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_facility_map_url.go
index 29651c2a..77dde8bf 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_facility_map_url.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_facility_map_url.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -71,6 +73,25 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityFacilityMapURL) valid
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station facility facility map URL based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityFacilityMapURL) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateMapName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityFacilityMapURL) contextValidateMapName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityFacilityMapURL) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_station_facility.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_station_facility.go
index 5e7b9d41..b58ffcef 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_station_facility.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_facility_station_facility.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -243,6 +244,135 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) vali
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station facility station facility based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDrinkingFountains(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateElevators(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFacilityMapURLs(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateInformationSpots(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateToilets(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) contextValidateDrinkingFountains(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.DrinkingFountains); i++ {
+
+ if m.DrinkingFountains[i] != nil {
+ if err := m.DrinkingFountains[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("DrinkingFountains" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) contextValidateElevators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Elevators); i++ {
+
+ if m.Elevators[i] != nil {
+ if err := m.Elevators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Elevators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) contextValidateFacilityMapURLs(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.FacilityMapURLs); i++ {
+
+ if m.FacilityMapURLs[i] != nil {
+ if err := m.FacilityMapURLs[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("FacilityMapURLs" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) contextValidateInformationSpots(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.InformationSpots); i++ {
+
+ if m.InformationSpots[i] != nil {
+ if err := m.InformationSpots[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("InformationSpots" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) contextValidateToilets(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Toilets); i++ {
+
+ if m.Toilets[i] != nil {
+ if err := m.Toilets[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Toilets" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationFacilityStationFacility) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_line_station.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_line_station.go
index 59cfd724..11ecd14c 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_line_station.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_line_station.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -104,6 +106,25 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationOfLineLineStation) validateSt
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station of line line station based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationOfLineLineStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationOfLineLineStation) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationOfLineLineStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_station_of_line.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_station_of_line.go
index 25cc36a0..bf6632bc 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_station_of_line.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_of_line_station_of_line.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -105,6 +106,38 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationOfLineStationOfLine) validate
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station of line station of line based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationOfLineStationOfLine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStations(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationOfLineStationOfLine) contextValidateStations(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Stations); i++ {
+
+ if m.Stations[i] != nil {
+ if err := m.Stations[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Stations" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationOfLineStationOfLine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_airport_transfer.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_airport_transfer.go
index f9d7e5dc..08fcc1d2 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_airport_transfer.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_airport_transfer.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -137,6 +139,34 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationTransferAirportTransfer) vali
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station transfer airport transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferAirportTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAirportName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferAirportTransfer) contextValidateAirportName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferAirportTransfer) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationTransferAirportTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_bike_transfer.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_bike_transfer.go
index 6628aa2f..87311d4e 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_bike_transfer.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_bike_transfer.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -137,6 +139,34 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBikeTransfer) validat
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station transfer bike transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBikeTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBikeTransfer) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBikeTransfer) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBikeTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_bus_transfer.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_bus_transfer.go
index e8bd66a1..5cf3d275 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_bus_transfer.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_bus_transfer.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -197,6 +199,43 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBusTransfer) validate
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station transfer bus transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBusTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBusTransfer) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBusTransfer) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBusTransfer) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationTransferBusTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_ferry_transfer.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_ferry_transfer.go
index e0a242b8..d22728b7 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_ferry_transfer.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_ferry_transfer.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -123,6 +125,34 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationTransferFerryTransfer) valida
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station transfer ferry transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferFerryTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFerryStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferFerryTransfer) contextValidateFerryStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferFerryTransfer) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationTransferFerryTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_map_url.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_map_url.go
index b515b0a3..d190421d 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_map_url.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_map_url.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -73,6 +75,11 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationTransferMapURL) validateMapUR
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a station transfer map URL based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferMapURL) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationTransferMapURL) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_parking_transfer.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_parking_transfer.go
index cf97e4e3..b02cde4a 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_parking_transfer.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_parking_transfer.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -101,6 +103,25 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationTransferParkingTransfer) vali
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station transfer parking transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferParkingTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateCarParkName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferParkingTransfer) contextValidateCarParkName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationTransferParkingTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_rail_transfer.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_rail_transfer.go
index fbc42549..7251c2bc 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_rail_transfer.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_rail_transfer.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -137,6 +139,34 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationTransferRailTransfer) validat
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station transfer rail transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferRailTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferRailTransfer) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferRailTransfer) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationTransferRailTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_station_transfer.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_station_transfer.go
index e41ce3f8..afd0bb4e 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_station_transfer.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_station_transfer.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -178,6 +179,91 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer) vali
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station transfer station transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateExteriorMapURLs(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateInteriorMapURLs(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTransfers(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer) contextValidateExteriorMapURLs(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.ExteriorMapURLs); i++ {
+
+ if m.ExteriorMapURLs[i] != nil {
+ if err := m.ExteriorMapURLs[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ExteriorMapURLs" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer) contextValidateInteriorMapURLs(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.InteriorMapURLs); i++ {
+
+ if m.InteriorMapURLs[i] != nil {
+ if err := m.InteriorMapURLs[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("InteriorMapURLs" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer) contextValidateTransfers(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Transfers); i++ {
+
+ if m.Transfers[i] != nil {
+ if err := m.Transfers[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Transfers" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationTransferStationTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_taxi_transfer.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_taxi_transfer.go
index 6d5089ac..92d4c0d2 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_taxi_transfer.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_taxi_transfer.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -87,6 +89,25 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTaxiTransfer) validat
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station transfer taxi transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTaxiTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTaxiStopName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTaxiTransfer) contextValidateTaxiStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTaxiTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_transfer.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_transfer.go
index e7c9d180..4a324c60 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_transfer.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_station_transfer_transfer.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -315,6 +316,170 @@ func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTransfer) validateTax
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a station transfer transfer based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTransfer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAirportTransfers(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateBikeTransfers(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateBusTransfers(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFerryTransfers(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateParkingTransfers(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRailTransfers(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTaxiTransfers(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTransfer) contextValidateAirportTransfers(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.AirportTransfers); i++ {
+
+ if m.AirportTransfers[i] != nil {
+ if err := m.AirportTransfers[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("AirportTransfers" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTransfer) contextValidateBikeTransfers(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.BikeTransfers); i++ {
+
+ if m.BikeTransfers[i] != nil {
+ if err := m.BikeTransfers[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("BikeTransfers" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTransfer) contextValidateBusTransfers(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.BusTransfers); i++ {
+
+ if m.BusTransfers[i] != nil {
+ if err := m.BusTransfers[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("BusTransfers" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTransfer) contextValidateFerryTransfers(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.FerryTransfers); i++ {
+
+ if m.FerryTransfers[i] != nil {
+ if err := m.FerryTransfers[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("FerryTransfers" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTransfer) contextValidateParkingTransfers(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.ParkingTransfers); i++ {
+
+ if m.ParkingTransfers[i] != nil {
+ if err := m.ParkingTransfers[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ParkingTransfers" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTransfer) contextValidateRailTransfers(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.RailTransfers); i++ {
+
+ if m.RailTransfers[i] != nil {
+ if err := m.RailTransfers[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("RailTransfers" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTransfer) contextValidateTaxiTransfers(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TaxiTransfers); i++ {
+
+ if m.TaxiTransfers[i] != nil {
+ if err := m.TaxiTransfers[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TaxiTransfers" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRAStationTransferTransfer) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert.go
index bd83a6b0..b0c17847 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -180,6 +182,25 @@ func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlert) validateUpdateTim
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a t r a alert list alert based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlert) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateScope(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlert) contextValidateScope(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlert) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope.go
index b2b4e290..979a5216 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -142,7 +143,6 @@ func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) validateLine
}
func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) validateNetworkList(formats strfmt.Registry) error {
-
if swag.IsZero(m.NetworkList) { // not required
return nil
}
@@ -225,6 +225,135 @@ func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) validateTrai
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a t r a alert list alert scope based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLineSections(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateLines(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateNetworkList(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStations(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrains(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) contextValidateLineSections(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.LineSections); i++ {
+
+ if m.LineSections[i] != nil {
+ if err := m.LineSections[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("LineSections" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) contextValidateLines(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Lines); i++ {
+
+ if m.Lines[i] != nil {
+ if err := m.Lines[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Lines" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) contextValidateNetworkList(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) contextValidateRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Routes); i++ {
+
+ if m.Routes[i] != nil {
+ if err := m.Routes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Routes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) contextValidateStations(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Stations); i++ {
+
+ if m.Stations[i] != nil {
+ if err := m.Stations[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Stations" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) contextValidateTrains(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Trains); i++ {
+
+ if m.Trains[i] != nil {
+ if err := m.Trains[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Trains" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScope) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_line.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_line.go
index 8dc27aa6..ff80620f 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_line.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_line.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -31,6 +33,11 @@ func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeLine) Validate
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a t r a alert list alert scope line based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeLine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeLine) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_line_section.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_line_section.go
index bd2b1947..60339866 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_line_section.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_line_section.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -51,6 +53,11 @@ func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeLineSection) V
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a t r a alert list alert scope line section based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeLineSection) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeLineSection) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_network.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_network.go
index 8b906c41..ca2bb983 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_network.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_network.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -31,6 +33,11 @@ func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeNetwork) Valid
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a t r a alert list alert scope network based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeNetwork) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_route.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_route.go
index 92a96778..e8aaa1bd 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_route.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_route.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -31,6 +33,11 @@ func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeRoute) Validat
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a t r a alert list alert scope route based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_station.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_station.go
index cfb38d20..70d99750 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_station.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_station.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -31,6 +33,11 @@ func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeStation) Valid
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a t r a alert list alert scope station based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeStation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeStation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_train.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_train.go
index eaad4bc9..31d74c41 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_train.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_alert_list_alert_scope_train.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -26,6 +28,11 @@ func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeTrain) Validat
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a t r a alert list alert scope train based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeTrain) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRAAlertListAlertScopeTrain) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_news_list_news.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_news_list_news.go
index 7283fb64..e2e89a98 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_news_list_news.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_news_list_news.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -186,6 +188,11 @@ func (m *PTXServiceDTORailSpecificationV3TRATRANewsListNews) validateUpdateTime(
return nil
}
+// ContextValidate validates this p t x service d t o rail specification v3 t r a t r a news list news based on context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRANewsListNews) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRANewsListNews) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_station_live_board_list_station_live_board.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_station_live_board_list_station_live_board.go
index 7d8c135c..78f0d1c4 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_station_live_board_list_station_live_board.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_station_live_board_list_station_live_board.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -200,6 +202,43 @@ func (m *PTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBo
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a t r a station live board list station live board based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBoard) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateEndingStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBoard) contextValidateEndingStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBoard) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBoard) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRAStationLiveBoardListStationLiveBoard) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_train_live_board_list_train_live_board.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_train_live_board_list_train_live_board.go
index 98a7041a..947eac61 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_train_live_board_list_train_live_board.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_t_r_a_train_live_board_list_train_live_board.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -125,6 +127,34 @@ func (m *PTXServiceDTORailSpecificationV3TRATRATrainLiveBoardListTrainLiveBoard)
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a t r a train live board list train live board based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATRATrainLiveBoardListTrainLiveBoard) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateStationName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRATrainLiveBoardListTrainLiveBoard) contextValidateStationName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATRATrainLiveBoardListTrainLiveBoard) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATRATrainLiveBoardListTrainLiveBoard) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_train_type.go b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_train_type.go
index 7799ae0d..24035af1 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_train_type.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_rail_specification_v3_t_r_a_train_type.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -85,6 +87,25 @@ func (m *PTXServiceDTORailSpecificationV3TRATrainType) validateTrainTypeName(for
return nil
}
+// ContextValidate validate this p t x service d t o rail specification v3 t r a train type based on the context it is used
+func (m *PTXServiceDTORailSpecificationV3TRATrainType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTrainTypeName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTORailSpecificationV3TRATrainType) contextValidateTrainTypeName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTORailSpecificationV3TRATrainType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go b/rail/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go
index adc99033..b449af50 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -31,6 +33,11 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseNameType) Validate(formats strfmt
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v3 base name type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BaseNameType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BaseNameType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/rail/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_point_type.go b/rail/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_point_type.go
index 71ace8e7..1dbc03a9 100644
--- a/rail/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_point_type.go
+++ b/rail/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_point_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -29,6 +31,11 @@ func (m *PTXServiceDTOSharedSpecificationV3BasePointType) Validate(formats strfm
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v3 base point type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BasePointType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BasePointType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/client/ship/ship_api_authority_parameters.go b/ship/v3/client/ship/ship_api_authority_parameters.go
index cc649748..119f873e 100644
--- a/ship/v3/client/ship/ship_api_authority_parameters.go
+++ b/ship/v3/client/ship/ship_api_authority_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewShipAPIAuthorityParams creates a new ShipAPIAuthorityParams object
-// with the default values initialized.
+// NewShipAPIAuthorityParams creates a new ShipAPIAuthorityParams 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 NewShipAPIAuthorityParams() *ShipAPIAuthorityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIAuthorityParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewShipAPIAuthorityParamsWithTimeout creates a new ShipAPIAuthorityParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewShipAPIAuthorityParamsWithTimeout(timeout time.Duration) *ShipAPIAuthorityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIAuthorityParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewShipAPIAuthorityParamsWithContext creates a new ShipAPIAuthorityParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewShipAPIAuthorityParamsWithContext(ctx context.Context) *ShipAPIAuthorityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIAuthorityParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewShipAPIAuthorityParamsWithHTTPClient creates a new ShipAPIAuthorityParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewShipAPIAuthorityParamsWithHTTPClient(client *http.Client) *ShipAPIAuthorityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIAuthorityParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ShipAPIAuthorityParams contains all the parameters to send to the API endpoint
-for the ship Api authority operation typically these are written to a http.Request
+/* ShipAPIAuthorityParams contains all the parameters to send to the API endpoint
+ for the ship Api authority operation.
+
+ Typically these are written to a http.Request.
*/
type ShipAPIAuthorityParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type ShipAPIAuthorityParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the ship Api authority params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIAuthorityParams) WithDefaults() *ShipAPIAuthorityParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the ship Api authority params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIAuthorityParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShipAPIAuthorityParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the ship Api authority params
func (o *ShipAPIAuthorityParams) WithTimeout(timeout time.Duration) *ShipAPIAuthorityParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *ShipAPIAuthorityParams) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -277,64 +301,68 @@ func (o *ShipAPIAuthorityParams) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/ship/v3/client/ship/ship_api_authority_responses.go b/ship/v3/client/ship/ship_api_authority_responses.go
index 25781864..13a75cf1 100644
--- a/ship/v3/client/ship/ship_api_authority_responses.go
+++ b/ship/v3/client/ship/ship_api_authority_responses.go
@@ -29,7 +29,12 @@ func (o *ShipAPIAuthorityReader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewShipAPIAuthorityNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewShipAPIAuthorityOK() *ShipAPIAuthorityOK {
return &ShipAPIAuthorityOK{}
}
-/*ShipAPIAuthorityOK handles this case with default header values.
+/* ShipAPIAuthorityOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ShipAPIAuthorityOK struct {
func (o *ShipAPIAuthorityOK) Error() string {
return fmt.Sprintf("[GET /v3/Ship/Authority][%d] shipApiAuthorityOK %+v", 200, o.Payload)
}
-
func (o *ShipAPIAuthorityOK) GetPayload() *models.PTXAPIShipModelShipWrapperPTXServiceDTOSharedSpecificationV3BaseAuthority {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ShipAPIAuthorityOK) readResponse(response runtime.ClientResponse, consu
return nil
}
+
+// NewShipAPIAuthorityNotModified creates a ShipAPIAuthorityNotModified with default headers values
+func NewShipAPIAuthorityNotModified() *ShipAPIAuthorityNotModified {
+ return &ShipAPIAuthorityNotModified{}
+}
+
+/* ShipAPIAuthorityNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShipAPIAuthorityNotModified struct {
+}
+
+func (o *ShipAPIAuthorityNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/Authority][%d] shipApiAuthorityNotModified ", 304)
+}
+
+func (o *ShipAPIAuthorityNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_api_general_schedule1_parameters.go b/ship/v3/client/ship/ship_api_general_schedule1_parameters.go
index b5d2b429..90b22660 100644
--- a/ship/v3/client/ship/ship_api_general_schedule1_parameters.go
+++ b/ship/v3/client/ship/ship_api_general_schedule1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewShipAPIGeneralSchedule1Params creates a new ShipAPIGeneralSchedule1Params object
-// with the default values initialized.
+// NewShipAPIGeneralSchedule1Params creates a new ShipAPIGeneralSchedule1Params 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 NewShipAPIGeneralSchedule1Params() *ShipAPIGeneralSchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIGeneralSchedule1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewShipAPIGeneralSchedule1ParamsWithTimeout creates a new ShipAPIGeneralSchedule1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewShipAPIGeneralSchedule1ParamsWithTimeout(timeout time.Duration) *ShipAPIGeneralSchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIGeneralSchedule1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewShipAPIGeneralSchedule1ParamsWithContext creates a new ShipAPIGeneralSchedule1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewShipAPIGeneralSchedule1ParamsWithContext(ctx context.Context) *ShipAPIGeneralSchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIGeneralSchedule1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewShipAPIGeneralSchedule1ParamsWithHTTPClient creates a new ShipAPIGeneralSchedule1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewShipAPIGeneralSchedule1ParamsWithHTTPClient(client *http.Client) *ShipAPIGeneralSchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIGeneralSchedule1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ShipAPIGeneralSchedule1Params contains all the parameters to send to the API endpoint
-for the ship Api general schedule 1 operation typically these are written to a http.Request
+/* ShipAPIGeneralSchedule1Params contains all the parameters to send to the API endpoint
+ for the ship Api general schedule 1 operation.
+
+ Typically these are written to a http.Request.
*/
type ShipAPIGeneralSchedule1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteID
- 指定航運路線代碼
+ /* RouteID.
+
+ 指定航運路線代碼
*/
RouteID string
@@ -119,6 +115,32 @@ type ShipAPIGeneralSchedule1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the ship Api general schedule 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIGeneralSchedule1Params) WithDefaults() *ShipAPIGeneralSchedule1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the ship Api general schedule 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIGeneralSchedule1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShipAPIGeneralSchedule1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the ship Api general schedule 1 params
func (o *ShipAPIGeneralSchedule1Params) WithTimeout(timeout time.Duration) *ShipAPIGeneralSchedule1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *ShipAPIGeneralSchedule1Params) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -293,64 +318,68 @@ func (o *ShipAPIGeneralSchedule1Params) WriteToRequest(r runtime.ClientRequest,
// 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 RouteID
diff --git a/ship/v3/client/ship/ship_api_general_schedule1_responses.go b/ship/v3/client/ship/ship_api_general_schedule1_responses.go
index 588e60cf..fd876c52 100644
--- a/ship/v3/client/ship/ship_api_general_schedule1_responses.go
+++ b/ship/v3/client/ship/ship_api_general_schedule1_responses.go
@@ -29,7 +29,12 @@ func (o *ShipAPIGeneralSchedule1Reader) ReadResponse(response runtime.ClientResp
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewShipAPIGeneralSchedule1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewShipAPIGeneralSchedule1OK() *ShipAPIGeneralSchedule1OK {
return &ShipAPIGeneralSchedule1OK{}
}
-/*ShipAPIGeneralSchedule1OK handles this case with default header values.
+/* ShipAPIGeneralSchedule1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ShipAPIGeneralSchedule1OK struct {
func (o *ShipAPIGeneralSchedule1OK) Error() string {
return fmt.Sprintf("[GET /v3/Ship/GeneralSchedule/{RouteID}][%d] shipApiGeneralSchedule1OK %+v", 200, o.Payload)
}
-
func (o *ShipAPIGeneralSchedule1OK) GetPayload() *models.PTXAPIShipModelScheduleWrapperPTXServiceDTOShipSpecificationV3GeneralSchedule {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ShipAPIGeneralSchedule1OK) readResponse(response runtime.ClientResponse
return nil
}
+
+// NewShipAPIGeneralSchedule1NotModified creates a ShipAPIGeneralSchedule1NotModified with default headers values
+func NewShipAPIGeneralSchedule1NotModified() *ShipAPIGeneralSchedule1NotModified {
+ return &ShipAPIGeneralSchedule1NotModified{}
+}
+
+/* ShipAPIGeneralSchedule1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShipAPIGeneralSchedule1NotModified struct {
+}
+
+func (o *ShipAPIGeneralSchedule1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/GeneralSchedule/{RouteID}][%d] shipApiGeneralSchedule1NotModified ", 304)
+}
+
+func (o *ShipAPIGeneralSchedule1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_api_general_schedule_parameters.go b/ship/v3/client/ship/ship_api_general_schedule_parameters.go
index 3f27a103..db1af716 100644
--- a/ship/v3/client/ship/ship_api_general_schedule_parameters.go
+++ b/ship/v3/client/ship/ship_api_general_schedule_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewShipAPIGeneralScheduleParams creates a new ShipAPIGeneralScheduleParams object
-// with the default values initialized.
+// NewShipAPIGeneralScheduleParams creates a new ShipAPIGeneralScheduleParams 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 NewShipAPIGeneralScheduleParams() *ShipAPIGeneralScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIGeneralScheduleParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewShipAPIGeneralScheduleParamsWithTimeout creates a new ShipAPIGeneralScheduleParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewShipAPIGeneralScheduleParamsWithTimeout(timeout time.Duration) *ShipAPIGeneralScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIGeneralScheduleParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewShipAPIGeneralScheduleParamsWithContext creates a new ShipAPIGeneralScheduleParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewShipAPIGeneralScheduleParamsWithContext(ctx context.Context) *ShipAPIGeneralScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIGeneralScheduleParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewShipAPIGeneralScheduleParamsWithHTTPClient creates a new ShipAPIGeneralScheduleParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewShipAPIGeneralScheduleParamsWithHTTPClient(client *http.Client) *ShipAPIGeneralScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIGeneralScheduleParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ShipAPIGeneralScheduleParams contains all the parameters to send to the API endpoint
-for the ship Api general schedule operation typically these are written to a http.Request
+/* ShipAPIGeneralScheduleParams contains all the parameters to send to the API endpoint
+ for the ship Api general schedule operation.
+
+ Typically these are written to a http.Request.
*/
type ShipAPIGeneralScheduleParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type ShipAPIGeneralScheduleParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the ship Api general schedule params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIGeneralScheduleParams) WithDefaults() *ShipAPIGeneralScheduleParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the ship Api general schedule params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIGeneralScheduleParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShipAPIGeneralScheduleParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the ship Api general schedule params
func (o *ShipAPIGeneralScheduleParams) WithTimeout(timeout time.Duration) *ShipAPIGeneralScheduleParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *ShipAPIGeneralScheduleParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -277,64 +301,68 @@ func (o *ShipAPIGeneralScheduleParams) WriteToRequest(r runtime.ClientRequest, r
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/ship/v3/client/ship/ship_api_general_schedule_responses.go b/ship/v3/client/ship/ship_api_general_schedule_responses.go
index 0d62b92f..832f17d8 100644
--- a/ship/v3/client/ship/ship_api_general_schedule_responses.go
+++ b/ship/v3/client/ship/ship_api_general_schedule_responses.go
@@ -29,7 +29,12 @@ func (o *ShipAPIGeneralScheduleReader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewShipAPIGeneralScheduleNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewShipAPIGeneralScheduleOK() *ShipAPIGeneralScheduleOK {
return &ShipAPIGeneralScheduleOK{}
}
-/*ShipAPIGeneralScheduleOK handles this case with default header values.
+/* ShipAPIGeneralScheduleOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ShipAPIGeneralScheduleOK struct {
func (o *ShipAPIGeneralScheduleOK) Error() string {
return fmt.Sprintf("[GET /v3/Ship/GeneralSchedule][%d] shipApiGeneralScheduleOK %+v", 200, o.Payload)
}
-
func (o *ShipAPIGeneralScheduleOK) GetPayload() *models.PTXAPIShipModelScheduleWrapperPTXServiceDTOShipSpecificationV3GeneralSchedule {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ShipAPIGeneralScheduleOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewShipAPIGeneralScheduleNotModified creates a ShipAPIGeneralScheduleNotModified with default headers values
+func NewShipAPIGeneralScheduleNotModified() *ShipAPIGeneralScheduleNotModified {
+ return &ShipAPIGeneralScheduleNotModified{}
+}
+
+/* ShipAPIGeneralScheduleNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShipAPIGeneralScheduleNotModified struct {
+}
+
+func (o *ShipAPIGeneralScheduleNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/GeneralSchedule][%d] shipApiGeneralScheduleNotModified ", 304)
+}
+
+func (o *ShipAPIGeneralScheduleNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_api_live_position_parameters.go b/ship/v3/client/ship/ship_api_live_position_parameters.go
new file mode 100644
index 00000000..65ecf48c
--- /dev/null
+++ b/ship/v3/client/ship/ship_api_live_position_parameters.go
@@ -0,0 +1,372 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package ship
+
+// 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"
+)
+
+// NewShipAPILivePositionParams creates a new ShipAPILivePositionParams 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 NewShipAPILivePositionParams() *ShipAPILivePositionParams {
+ return &ShipAPILivePositionParams{
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewShipAPILivePositionParamsWithTimeout creates a new ShipAPILivePositionParams object
+// with the ability to set a timeout on a request.
+func NewShipAPILivePositionParamsWithTimeout(timeout time.Duration) *ShipAPILivePositionParams {
+ return &ShipAPILivePositionParams{
+ timeout: timeout,
+ }
+}
+
+// NewShipAPILivePositionParamsWithContext creates a new ShipAPILivePositionParams object
+// with the ability to set a context for a request.
+func NewShipAPILivePositionParamsWithContext(ctx context.Context) *ShipAPILivePositionParams {
+ return &ShipAPILivePositionParams{
+ Context: ctx,
+ }
+}
+
+// NewShipAPILivePositionParamsWithHTTPClient creates a new ShipAPILivePositionParams object
+// with the ability to set a custom HTTPClient for a request.
+func NewShipAPILivePositionParamsWithHTTPClient(client *http.Client) *ShipAPILivePositionParams {
+ return &ShipAPILivePositionParams{
+ HTTPClient: client,
+ }
+}
+
+/* ShipAPILivePositionParams contains all the parameters to send to the API endpoint
+ for the ship Api live position operation.
+
+ Typically these are written to a http.Request.
+*/
+type ShipAPILivePositionParams struct {
+
+ /* DollarCount.
+
+ 查詢數量
+ */
+ DollarCount *bool
+
+ /* DollarFilter.
+
+ 過濾
+ */
+ DollarFilter *string
+
+ /* DollarFormat.
+
+ 指定來源格式
+ */
+ DollarFormat string
+
+ /* DollarOrderby.
+
+ 排序
+ */
+ DollarOrderby *string
+
+ /* DollarSelect.
+
+ 挑選
+ */
+ DollarSelect *string
+
+ /* DollarSkip.
+
+ 跳過前幾筆
+ */
+ DollarSkip *string
+
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
+ */
+ DollarTop *int64
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithDefaults hydrates default values in the ship Api live position params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPILivePositionParams) WithDefaults() *ShipAPILivePositionParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the ship Api live position params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPILivePositionParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShipAPILivePositionParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
+// WithTimeout adds the timeout to the ship Api live position params
+func (o *ShipAPILivePositionParams) WithTimeout(timeout time.Duration) *ShipAPILivePositionParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the ship Api live position params
+func (o *ShipAPILivePositionParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the ship Api live position params
+func (o *ShipAPILivePositionParams) WithContext(ctx context.Context) *ShipAPILivePositionParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the ship Api live position params
+func (o *ShipAPILivePositionParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the ship Api live position params
+func (o *ShipAPILivePositionParams) WithHTTPClient(client *http.Client) *ShipAPILivePositionParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the ship Api live position params
+func (o *ShipAPILivePositionParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithDollarCount adds the dollarCount to the ship Api live position params
+func (o *ShipAPILivePositionParams) WithDollarCount(dollarCount *bool) *ShipAPILivePositionParams {
+ o.SetDollarCount(dollarCount)
+ return o
+}
+
+// SetDollarCount adds the dollarCount to the ship Api live position params
+func (o *ShipAPILivePositionParams) SetDollarCount(dollarCount *bool) {
+ o.DollarCount = dollarCount
+}
+
+// WithDollarFilter adds the dollarFilter to the ship Api live position params
+func (o *ShipAPILivePositionParams) WithDollarFilter(dollarFilter *string) *ShipAPILivePositionParams {
+ o.SetDollarFilter(dollarFilter)
+ return o
+}
+
+// SetDollarFilter adds the dollarFilter to the ship Api live position params
+func (o *ShipAPILivePositionParams) SetDollarFilter(dollarFilter *string) {
+ o.DollarFilter = dollarFilter
+}
+
+// WithDollarFormat adds the dollarFormat to the ship Api live position params
+func (o *ShipAPILivePositionParams) WithDollarFormat(dollarFormat string) *ShipAPILivePositionParams {
+ o.SetDollarFormat(dollarFormat)
+ return o
+}
+
+// SetDollarFormat adds the dollarFormat to the ship Api live position params
+func (o *ShipAPILivePositionParams) SetDollarFormat(dollarFormat string) {
+ o.DollarFormat = dollarFormat
+}
+
+// WithDollarOrderby adds the dollarOrderby to the ship Api live position params
+func (o *ShipAPILivePositionParams) WithDollarOrderby(dollarOrderby *string) *ShipAPILivePositionParams {
+ o.SetDollarOrderby(dollarOrderby)
+ return o
+}
+
+// SetDollarOrderby adds the dollarOrderby to the ship Api live position params
+func (o *ShipAPILivePositionParams) SetDollarOrderby(dollarOrderby *string) {
+ o.DollarOrderby = dollarOrderby
+}
+
+// WithDollarSelect adds the dollarSelect to the ship Api live position params
+func (o *ShipAPILivePositionParams) WithDollarSelect(dollarSelect *string) *ShipAPILivePositionParams {
+ o.SetDollarSelect(dollarSelect)
+ return o
+}
+
+// SetDollarSelect adds the dollarSelect to the ship Api live position params
+func (o *ShipAPILivePositionParams) SetDollarSelect(dollarSelect *string) {
+ o.DollarSelect = dollarSelect
+}
+
+// WithDollarSkip adds the dollarSkip to the ship Api live position params
+func (o *ShipAPILivePositionParams) WithDollarSkip(dollarSkip *string) *ShipAPILivePositionParams {
+ o.SetDollarSkip(dollarSkip)
+ return o
+}
+
+// SetDollarSkip adds the dollarSkip to the ship Api live position params
+func (o *ShipAPILivePositionParams) SetDollarSkip(dollarSkip *string) {
+ o.DollarSkip = dollarSkip
+}
+
+// WithDollarTop adds the dollarTop to the ship Api live position params
+func (o *ShipAPILivePositionParams) WithDollarTop(dollarTop *int64) *ShipAPILivePositionParams {
+ o.SetDollarTop(dollarTop)
+ return o
+}
+
+// SetDollarTop adds the dollarTop to the ship Api live position params
+func (o *ShipAPILivePositionParams) SetDollarTop(dollarTop *int64) {
+ o.DollarTop = dollarTop
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *ShipAPILivePositionParams) 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
+ }
+ }
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_api_live_position_responses.go b/ship/v3/client/ship/ship_api_live_position_responses.go
new file mode 100644
index 00000000..2ced0576
--- /dev/null
+++ b/ship/v3/client/ship/ship_api_live_position_responses.go
@@ -0,0 +1,94 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package ship
+
+// 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/ship/v3/models"
+)
+
+// ShipAPILivePositionReader is a Reader for the ShipAPILivePosition structure.
+type ShipAPILivePositionReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *ShipAPILivePositionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewShipAPILivePositionOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 304:
+ result := NewShipAPILivePositionNotModified()
+ 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())
+ }
+}
+
+// NewShipAPILivePositionOK creates a ShipAPILivePositionOK with default headers values
+func NewShipAPILivePositionOK() *ShipAPILivePositionOK {
+ return &ShipAPILivePositionOK{}
+}
+
+/* ShipAPILivePositionOK describes a response with status code 200, with default header values.
+
+Success
+*/
+type ShipAPILivePositionOK struct {
+ Payload *models.PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition
+}
+
+func (o *ShipAPILivePositionOK) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/LivePosition][%d] shipApiLivePositionOK %+v", 200, o.Payload)
+}
+func (o *ShipAPILivePositionOK) GetPayload() *models.PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition {
+ return o.Payload
+}
+
+func (o *ShipAPILivePositionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ o.Payload = new(models.PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition)
+
+ // response payload
+ if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
+ return err
+ }
+
+ return nil
+}
+
+// NewShipAPILivePositionNotModified creates a ShipAPILivePositionNotModified with default headers values
+func NewShipAPILivePositionNotModified() *ShipAPILivePositionNotModified {
+ return &ShipAPILivePositionNotModified{}
+}
+
+/* ShipAPILivePositionNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShipAPILivePositionNotModified struct {
+}
+
+func (o *ShipAPILivePositionNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/LivePosition][%d] shipApiLivePositionNotModified ", 304)
+}
+
+func (o *ShipAPILivePositionNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_api_operator_parameters.go b/ship/v3/client/ship/ship_api_operator_parameters.go
index 0fb36279..753d3c80 100644
--- a/ship/v3/client/ship/ship_api_operator_parameters.go
+++ b/ship/v3/client/ship/ship_api_operator_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewShipAPIOperatorParams creates a new ShipAPIOperatorParams object
-// with the default values initialized.
+// NewShipAPIOperatorParams creates a new ShipAPIOperatorParams 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 NewShipAPIOperatorParams() *ShipAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewShipAPIOperatorParamsWithTimeout creates a new ShipAPIOperatorParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewShipAPIOperatorParamsWithTimeout(timeout time.Duration) *ShipAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewShipAPIOperatorParamsWithContext creates a new ShipAPIOperatorParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewShipAPIOperatorParamsWithContext(ctx context.Context) *ShipAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIOperatorParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewShipAPIOperatorParamsWithHTTPClient creates a new ShipAPIOperatorParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewShipAPIOperatorParamsWithHTTPClient(client *http.Client) *ShipAPIOperatorParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIOperatorParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ShipAPIOperatorParams contains all the parameters to send to the API endpoint
-for the ship Api operator operation typically these are written to a http.Request
+/* ShipAPIOperatorParams contains all the parameters to send to the API endpoint
+ for the ship Api operator operation.
+
+ Typically these are written to a http.Request.
*/
type ShipAPIOperatorParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type ShipAPIOperatorParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the ship Api operator params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIOperatorParams) WithDefaults() *ShipAPIOperatorParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the ship Api operator params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIOperatorParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShipAPIOperatorParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the ship Api operator params
func (o *ShipAPIOperatorParams) WithTimeout(timeout time.Duration) *ShipAPIOperatorParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *ShipAPIOperatorParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -277,64 +301,68 @@ func (o *ShipAPIOperatorParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/ship/v3/client/ship/ship_api_operator_responses.go b/ship/v3/client/ship/ship_api_operator_responses.go
index cbe6f574..e66c66ce 100644
--- a/ship/v3/client/ship/ship_api_operator_responses.go
+++ b/ship/v3/client/ship/ship_api_operator_responses.go
@@ -29,7 +29,12 @@ func (o *ShipAPIOperatorReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewShipAPIOperatorNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewShipAPIOperatorOK() *ShipAPIOperatorOK {
return &ShipAPIOperatorOK{}
}
-/*ShipAPIOperatorOK handles this case with default header values.
+/* ShipAPIOperatorOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ShipAPIOperatorOK struct {
func (o *ShipAPIOperatorOK) Error() string {
return fmt.Sprintf("[GET /v3/Ship/Operator][%d] shipApiOperatorOK %+v", 200, o.Payload)
}
-
func (o *ShipAPIOperatorOK) GetPayload() *models.PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Operator {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ShipAPIOperatorOK) readResponse(response runtime.ClientResponse, consum
return nil
}
+
+// NewShipAPIOperatorNotModified creates a ShipAPIOperatorNotModified with default headers values
+func NewShipAPIOperatorNotModified() *ShipAPIOperatorNotModified {
+ return &ShipAPIOperatorNotModified{}
+}
+
+/* ShipAPIOperatorNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShipAPIOperatorNotModified struct {
+}
+
+func (o *ShipAPIOperatorNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/Operator][%d] shipApiOperatorNotModified ", 304)
+}
+
+func (o *ShipAPIOperatorNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_api_port_parameters.go b/ship/v3/client/ship/ship_api_port_parameters.go
index 182aadad..a15471b8 100644
--- a/ship/v3/client/ship/ship_api_port_parameters.go
+++ b/ship/v3/client/ship/ship_api_port_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewShipAPIPortParams creates a new ShipAPIPortParams object
-// with the default values initialized.
+// NewShipAPIPortParams creates a new ShipAPIPortParams 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 NewShipAPIPortParams() *ShipAPIPortParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIPortParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewShipAPIPortParamsWithTimeout creates a new ShipAPIPortParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewShipAPIPortParamsWithTimeout(timeout time.Duration) *ShipAPIPortParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIPortParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewShipAPIPortParamsWithContext creates a new ShipAPIPortParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewShipAPIPortParamsWithContext(ctx context.Context) *ShipAPIPortParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIPortParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewShipAPIPortParamsWithHTTPClient creates a new ShipAPIPortParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewShipAPIPortParamsWithHTTPClient(client *http.Client) *ShipAPIPortParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIPortParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ShipAPIPortParams contains all the parameters to send to the API endpoint
-for the ship Api port operation typically these are written to a http.Request
+/* ShipAPIPortParams contains all the parameters to send to the API endpoint
+ for the ship Api port operation.
+
+ Typically these are written to a http.Request.
*/
type ShipAPIPortParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type ShipAPIPortParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the ship Api port params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIPortParams) WithDefaults() *ShipAPIPortParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the ship Api port params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIPortParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShipAPIPortParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the ship Api port params
func (o *ShipAPIPortParams) WithTimeout(timeout time.Duration) *ShipAPIPortParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *ShipAPIPortParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// 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
}
@@ -277,64 +301,68 @@ func (o *ShipAPIPortParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/ship/v3/client/ship/ship_api_port_responses.go b/ship/v3/client/ship/ship_api_port_responses.go
index 0f87604f..d2485249 100644
--- a/ship/v3/client/ship/ship_api_port_responses.go
+++ b/ship/v3/client/ship/ship_api_port_responses.go
@@ -29,7 +29,12 @@ func (o *ShipAPIPortReader) ReadResponse(response runtime.ClientResponse, consum
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewShipAPIPortNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewShipAPIPortOK() *ShipAPIPortOK {
return &ShipAPIPortOK{}
}
-/*ShipAPIPortOK handles this case with default header values.
+/* ShipAPIPortOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ShipAPIPortOK struct {
func (o *ShipAPIPortOK) Error() string {
return fmt.Sprintf("[GET /v3/Ship/Port][%d] shipApiPortOK %+v", 200, o.Payload)
}
-
func (o *ShipAPIPortOK) GetPayload() *models.PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Port {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ShipAPIPortOK) readResponse(response runtime.ClientResponse, consumer r
return nil
}
+
+// NewShipAPIPortNotModified creates a ShipAPIPortNotModified with default headers values
+func NewShipAPIPortNotModified() *ShipAPIPortNotModified {
+ return &ShipAPIPortNotModified{}
+}
+
+/* ShipAPIPortNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShipAPIPortNotModified struct {
+}
+
+func (o *ShipAPIPortNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/Port][%d] shipApiPortNotModified ", 304)
+}
+
+func (o *ShipAPIPortNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_api_route1_parameters.go b/ship/v3/client/ship/ship_api_route1_parameters.go
index 1b5edea2..91ccb32d 100644
--- a/ship/v3/client/ship/ship_api_route1_parameters.go
+++ b/ship/v3/client/ship/ship_api_route1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewShipAPIRoute1Params creates a new ShipAPIRoute1Params object
-// with the default values initialized.
+// NewShipAPIRoute1Params creates a new ShipAPIRoute1Params 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 NewShipAPIRoute1Params() *ShipAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewShipAPIRoute1ParamsWithTimeout creates a new ShipAPIRoute1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewShipAPIRoute1ParamsWithTimeout(timeout time.Duration) *ShipAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewShipAPIRoute1ParamsWithContext creates a new ShipAPIRoute1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewShipAPIRoute1ParamsWithContext(ctx context.Context) *ShipAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewShipAPIRoute1ParamsWithHTTPClient creates a new ShipAPIRoute1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewShipAPIRoute1ParamsWithHTTPClient(client *http.Client) *ShipAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRoute1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ShipAPIRoute1Params contains all the parameters to send to the API endpoint
-for the ship Api route 1 operation typically these are written to a http.Request
+/* ShipAPIRoute1Params contains all the parameters to send to the API endpoint
+ for the ship Api route 1 operation.
+
+ Typically these are written to a http.Request.
*/
type ShipAPIRoute1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteID
- 指定航運路線代碼
+ /* RouteID.
+
+ 指定航運路線代碼
*/
RouteID string
@@ -119,6 +115,32 @@ type ShipAPIRoute1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the ship Api route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIRoute1Params) WithDefaults() *ShipAPIRoute1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the ship Api route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIRoute1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShipAPIRoute1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the ship Api route 1 params
func (o *ShipAPIRoute1Params) WithTimeout(timeout time.Duration) *ShipAPIRoute1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *ShipAPIRoute1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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
}
@@ -293,64 +318,68 @@ func (o *ShipAPIRoute1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt
// 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 RouteID
diff --git a/ship/v3/client/ship/ship_api_route1_responses.go b/ship/v3/client/ship/ship_api_route1_responses.go
index c19bc183..864b53c1 100644
--- a/ship/v3/client/ship/ship_api_route1_responses.go
+++ b/ship/v3/client/ship/ship_api_route1_responses.go
@@ -29,7 +29,12 @@ func (o *ShipAPIRoute1Reader) ReadResponse(response runtime.ClientResponse, cons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewShipAPIRoute1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewShipAPIRoute1OK() *ShipAPIRoute1OK {
return &ShipAPIRoute1OK{}
}
-/*ShipAPIRoute1OK handles this case with default header values.
+/* ShipAPIRoute1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ShipAPIRoute1OK struct {
func (o *ShipAPIRoute1OK) Error() string {
return fmt.Sprintf("[GET /v3/Ship/Route/{RouteID}][%d] shipApiRoute1OK %+v", 200, o.Payload)
}
-
func (o *ShipAPIRoute1OK) GetPayload() *models.PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Route {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ShipAPIRoute1OK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewShipAPIRoute1NotModified creates a ShipAPIRoute1NotModified with default headers values
+func NewShipAPIRoute1NotModified() *ShipAPIRoute1NotModified {
+ return &ShipAPIRoute1NotModified{}
+}
+
+/* ShipAPIRoute1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShipAPIRoute1NotModified struct {
+}
+
+func (o *ShipAPIRoute1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/Route/{RouteID}][%d] shipApiRoute1NotModified ", 304)
+}
+
+func (o *ShipAPIRoute1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_api_route_fare1_parameters.go b/ship/v3/client/ship/ship_api_route_fare1_parameters.go
index 4f8a3c84..61a9d98b 100644
--- a/ship/v3/client/ship/ship_api_route_fare1_parameters.go
+++ b/ship/v3/client/ship/ship_api_route_fare1_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewShipAPIRouteFare1Params creates a new ShipAPIRouteFare1Params object
-// with the default values initialized.
+// NewShipAPIRouteFare1Params creates a new ShipAPIRouteFare1Params 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 NewShipAPIRouteFare1Params() *ShipAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewShipAPIRouteFare1ParamsWithTimeout creates a new ShipAPIRouteFare1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewShipAPIRouteFare1ParamsWithTimeout(timeout time.Duration) *ShipAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewShipAPIRouteFare1ParamsWithContext creates a new ShipAPIRouteFare1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewShipAPIRouteFare1ParamsWithContext(ctx context.Context) *ShipAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewShipAPIRouteFare1ParamsWithHTTPClient creates a new ShipAPIRouteFare1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewShipAPIRouteFare1ParamsWithHTTPClient(client *http.Client) *ShipAPIRouteFare1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteFare1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ShipAPIRouteFare1Params contains all the parameters to send to the API endpoint
-for the ship Api route fare 1 operation typically these are written to a http.Request
+/* ShipAPIRouteFare1Params contains all the parameters to send to the API endpoint
+ for the ship Api route fare 1 operation.
+
+ Typically these are written to a http.Request.
*/
type ShipAPIRouteFare1Params struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*RouteID
- 指定航運路線代碼
+ /* RouteID.
+
+ 指定航運路線代碼
*/
RouteID string
@@ -119,6 +115,32 @@ type ShipAPIRouteFare1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the ship Api route fare 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIRouteFare1Params) WithDefaults() *ShipAPIRouteFare1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the ship Api route fare 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIRouteFare1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShipAPIRouteFare1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the ship Api route fare 1 params
func (o *ShipAPIRouteFare1Params) WithTimeout(timeout time.Duration) *ShipAPIRouteFare1Params {
o.SetTimeout(timeout)
@@ -252,38 +274,41 @@ func (o *ShipAPIRouteFare1Params) WriteToRequest(r runtime.ClientRequest, reg st
// 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
}
@@ -293,64 +318,68 @@ func (o *ShipAPIRouteFare1Params) WriteToRequest(r runtime.ClientRequest, reg st
// 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 RouteID
diff --git a/ship/v3/client/ship/ship_api_route_fare1_responses.go b/ship/v3/client/ship/ship_api_route_fare1_responses.go
index 3cc301af..17e1f904 100644
--- a/ship/v3/client/ship/ship_api_route_fare1_responses.go
+++ b/ship/v3/client/ship/ship_api_route_fare1_responses.go
@@ -29,7 +29,12 @@ func (o *ShipAPIRouteFare1Reader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewShipAPIRouteFare1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewShipAPIRouteFare1OK() *ShipAPIRouteFare1OK {
return &ShipAPIRouteFare1OK{}
}
-/*ShipAPIRouteFare1OK handles this case with default header values.
+/* ShipAPIRouteFare1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ShipAPIRouteFare1OK struct {
func (o *ShipAPIRouteFare1OK) Error() string {
return fmt.Sprintf("[GET /v3/Ship/RouteFare/{RouteID}][%d] shipApiRouteFare1OK %+v", 200, o.Payload)
}
-
func (o *ShipAPIRouteFare1OK) GetPayload() *models.PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3RouteFare {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ShipAPIRouteFare1OK) readResponse(response runtime.ClientResponse, cons
return nil
}
+
+// NewShipAPIRouteFare1NotModified creates a ShipAPIRouteFare1NotModified with default headers values
+func NewShipAPIRouteFare1NotModified() *ShipAPIRouteFare1NotModified {
+ return &ShipAPIRouteFare1NotModified{}
+}
+
+/* ShipAPIRouteFare1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShipAPIRouteFare1NotModified struct {
+}
+
+func (o *ShipAPIRouteFare1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/RouteFare/{RouteID}][%d] shipApiRouteFare1NotModified ", 304)
+}
+
+func (o *ShipAPIRouteFare1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_api_route_fare_parameters.go b/ship/v3/client/ship/ship_api_route_fare_parameters.go
index f185c6bf..3a80ea50 100644
--- a/ship/v3/client/ship/ship_api_route_fare_parameters.go
+++ b/ship/v3/client/ship/ship_api_route_fare_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewShipAPIRouteFareParams creates a new ShipAPIRouteFareParams object
-// with the default values initialized.
+// NewShipAPIRouteFareParams creates a new ShipAPIRouteFareParams 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 NewShipAPIRouteFareParams() *ShipAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewShipAPIRouteFareParamsWithTimeout creates a new ShipAPIRouteFareParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewShipAPIRouteFareParamsWithTimeout(timeout time.Duration) *ShipAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewShipAPIRouteFareParamsWithContext creates a new ShipAPIRouteFareParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewShipAPIRouteFareParamsWithContext(ctx context.Context) *ShipAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewShipAPIRouteFareParamsWithHTTPClient creates a new ShipAPIRouteFareParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewShipAPIRouteFareParamsWithHTTPClient(client *http.Client) *ShipAPIRouteFareParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteFareParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ShipAPIRouteFareParams contains all the parameters to send to the API endpoint
-for the ship Api route fare operation typically these are written to a http.Request
+/* ShipAPIRouteFareParams contains all the parameters to send to the API endpoint
+ for the ship Api route fare operation.
+
+ Typically these are written to a http.Request.
*/
type ShipAPIRouteFareParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type ShipAPIRouteFareParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the ship Api route fare params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIRouteFareParams) WithDefaults() *ShipAPIRouteFareParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the ship Api route fare params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIRouteFareParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShipAPIRouteFareParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the ship Api route fare params
func (o *ShipAPIRouteFareParams) WithTimeout(timeout time.Duration) *ShipAPIRouteFareParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *ShipAPIRouteFareParams) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -277,64 +301,68 @@ func (o *ShipAPIRouteFareParams) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/ship/v3/client/ship/ship_api_route_fare_responses.go b/ship/v3/client/ship/ship_api_route_fare_responses.go
index e138598b..c259eb17 100644
--- a/ship/v3/client/ship/ship_api_route_fare_responses.go
+++ b/ship/v3/client/ship/ship_api_route_fare_responses.go
@@ -29,7 +29,12 @@ func (o *ShipAPIRouteFareReader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewShipAPIRouteFareNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewShipAPIRouteFareOK() *ShipAPIRouteFareOK {
return &ShipAPIRouteFareOK{}
}
-/*ShipAPIRouteFareOK handles this case with default header values.
+/* ShipAPIRouteFareOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ShipAPIRouteFareOK struct {
func (o *ShipAPIRouteFareOK) Error() string {
return fmt.Sprintf("[GET /v3/Ship/RouteFare][%d] shipApiRouteFareOK %+v", 200, o.Payload)
}
-
func (o *ShipAPIRouteFareOK) GetPayload() *models.PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3RouteFare {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ShipAPIRouteFareOK) readResponse(response runtime.ClientResponse, consu
return nil
}
+
+// NewShipAPIRouteFareNotModified creates a ShipAPIRouteFareNotModified with default headers values
+func NewShipAPIRouteFareNotModified() *ShipAPIRouteFareNotModified {
+ return &ShipAPIRouteFareNotModified{}
+}
+
+/* ShipAPIRouteFareNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShipAPIRouteFareNotModified struct {
+}
+
+func (o *ShipAPIRouteFareNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/RouteFare][%d] shipApiRouteFareNotModified ", 304)
+}
+
+func (o *ShipAPIRouteFareNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_api_route_parameters.go b/ship/v3/client/ship/ship_api_route_parameters.go
index 1ecee2b9..018c693f 100644
--- a/ship/v3/client/ship/ship_api_route_parameters.go
+++ b/ship/v3/client/ship/ship_api_route_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewShipAPIRouteParams creates a new ShipAPIRouteParams object
-// with the default values initialized.
+// NewShipAPIRouteParams creates a new ShipAPIRouteParams 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 NewShipAPIRouteParams() *ShipAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewShipAPIRouteParamsWithTimeout creates a new ShipAPIRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewShipAPIRouteParamsWithTimeout(timeout time.Duration) *ShipAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewShipAPIRouteParamsWithContext creates a new ShipAPIRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewShipAPIRouteParamsWithContext(ctx context.Context) *ShipAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewShipAPIRouteParamsWithHTTPClient creates a new ShipAPIRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewShipAPIRouteParamsWithHTTPClient(client *http.Client) *ShipAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &ShipAPIRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*ShipAPIRouteParams contains all the parameters to send to the API endpoint
-for the ship Api route operation typically these are written to a http.Request
+/* ShipAPIRouteParams contains all the parameters to send to the API endpoint
+ for the ship Api route operation.
+
+ Typically these are written to a http.Request.
*/
type ShipAPIRouteParams struct {
- /*DollarCount
- 查詢數量
+ /* DollarCount.
+ 查詢數量
*/
DollarCount *bool
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type ShipAPIRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the ship Api route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIRouteParams) WithDefaults() *ShipAPIRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the ship Api route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *ShipAPIRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := ShipAPIRouteParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the ship Api route params
func (o *ShipAPIRouteParams) WithTimeout(timeout time.Duration) *ShipAPIRouteParams {
o.SetTimeout(timeout)
@@ -236,38 +257,41 @@ func (o *ShipAPIRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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
}
@@ -277,64 +301,68 @@ func (o *ShipAPIRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/ship/v3/client/ship/ship_api_route_responses.go b/ship/v3/client/ship/ship_api_route_responses.go
index 3bb6c9f7..ffef46cc 100644
--- a/ship/v3/client/ship/ship_api_route_responses.go
+++ b/ship/v3/client/ship/ship_api_route_responses.go
@@ -29,7 +29,12 @@ func (o *ShipAPIRouteReader) ReadResponse(response runtime.ClientResponse, consu
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewShipAPIRouteNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewShipAPIRouteOK() *ShipAPIRouteOK {
return &ShipAPIRouteOK{}
}
-/*ShipAPIRouteOK handles this case with default header values.
+/* ShipAPIRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type ShipAPIRouteOK struct {
func (o *ShipAPIRouteOK) Error() string {
return fmt.Sprintf("[GET /v3/Ship/Route][%d] shipApiRouteOK %+v", 200, o.Payload)
}
-
func (o *ShipAPIRouteOK) GetPayload() *models.PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Route {
return o.Payload
}
@@ -67,3 +71,24 @@ func (o *ShipAPIRouteOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
+
+// NewShipAPIRouteNotModified creates a ShipAPIRouteNotModified with default headers values
+func NewShipAPIRouteNotModified() *ShipAPIRouteNotModified {
+ return &ShipAPIRouteNotModified{}
+}
+
+/* ShipAPIRouteNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type ShipAPIRouteNotModified struct {
+}
+
+func (o *ShipAPIRouteNotModified) Error() string {
+ return fmt.Sprintf("[GET /v3/Ship/Route][%d] shipApiRouteNotModified ", 304)
+}
+
+func (o *ShipAPIRouteNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/ship/v3/client/ship/ship_client.go b/ship/v3/client/ship/ship_client.go
index 5d5a7311..4f1534ec 100644
--- a/ship/v3/client/ship/ship_client.go
+++ b/ship/v3/client/ship/ship_client.go
@@ -33,6 +33,8 @@ type ClientService interface {
ShipAPIGeneralSchedule1(params *ShipAPIGeneralSchedule1Params) (*ShipAPIGeneralSchedule1OK, error)
+ ShipAPILivePosition(params *ShipAPILivePositionParams) (*ShipAPILivePositionOK, error)
+
ShipAPIOperator(params *ShipAPIOperatorParams) (*ShipAPIOperatorOK, error)
ShipAPIPort(params *ShipAPIPortParams) (*ShipAPIPortOK, error)
@@ -150,6 +152,40 @@ func (a *Client) ShipAPIGeneralSchedule1(params *ShipAPIGeneralSchedule1Params)
panic(msg)
}
+/*
+ ShipAPILivePosition 取得航運船舶即時位置資料s
+*/
+func (a *Client) ShipAPILivePosition(params *ShipAPILivePositionParams) (*ShipAPILivePositionOK, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewShipAPILivePositionParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "ShipApi_LivePosition",
+ Method: "GET",
+ PathPattern: "/v3/Ship/LivePosition",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"https"},
+ Params: params,
+ Reader: &ShipAPILivePositionReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, err
+ }
+ success, ok := result.(*ShipAPILivePositionOK)
+ if ok {
+ return success, nil
+ }
+ // unexpected success response
+ // 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 ShipApi_LivePosition: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
/*
ShipAPIOperator 取得營運業者資料s
*/
diff --git a/ship/v3/models/p_t_x_api_ship_model_schedule_wrapper_p_t_x_service_d_t_o_ship_specification_v3_general_schedule.go b/ship/v3/models/p_t_x_api_ship_model_schedule_wrapper_p_t_x_service_d_t_o_ship_specification_v3_general_schedule.go
index 528cfa85..c28f8aef 100644
--- a/ship/v3/models/p_t_x_api_ship_model_schedule_wrapper_p_t_x_service_d_t_o_ship_specification_v3_general_schedule.go
+++ b/ship/v3/models/p_t_x_api_ship_model_schedule_wrapper_p_t_x_service_d_t_o_ship_specification_v3_general_schedule.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -83,7 +84,6 @@ func (m *PTXAPIShipModelScheduleWrapperPTXServiceDTOShipSpecificationV3GeneralSc
}
func (m *PTXAPIShipModelScheduleWrapperPTXServiceDTOShipSpecificationV3GeneralSchedule) validateGeneralSchedules(formats strfmt.Registry) error {
-
if swag.IsZero(m.GeneralSchedules) { // not required
return nil
}
@@ -125,6 +125,38 @@ func (m *PTXAPIShipModelScheduleWrapperPTXServiceDTOShipSpecificationV3GeneralSc
return nil
}
+// ContextValidate validate this p t x API ship model schedule wrapper p t x service d t o ship specification v3 general schedule based on the context it is used
+func (m *PTXAPIShipModelScheduleWrapperPTXServiceDTOShipSpecificationV3GeneralSchedule) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateGeneralSchedules(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIShipModelScheduleWrapperPTXServiceDTOShipSpecificationV3GeneralSchedule) contextValidateGeneralSchedules(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.GeneralSchedules); i++ {
+
+ if m.GeneralSchedules[i] != nil {
+ if err := m.GeneralSchedules[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("GeneralSchedules" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIShipModelScheduleWrapperPTXServiceDTOShipSpecificationV3GeneralSchedule) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_api_ship_model_ship_live_wrapper_p_t_x_service_d_t_o_ship_specification_v3_live_position.go b/ship/v3/models/p_t_x_api_ship_model_ship_live_wrapper_p_t_x_service_d_t_o_ship_specification_v3_live_position.go
new file mode 100644
index 00000000..474f9aad
--- /dev/null
+++ b/ship/v3/models/p_t_x_api_ship_model_ship_live_wrapper_p_t_x_service_d_t_o_ship_specification_v3_live_position.go
@@ -0,0 +1,215 @@
+// 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"
+)
+
+// PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition ShipLivePositionList
+//
+// swagger:model PTX.API.Ship.Model.ShipLiveWrapper[PTX.Service.DTO.Ship.Specification.V3.LivePosition]
+type PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition struct {
+
+ // String
+ //
+ // 業管機關簡碼
+ // Required: true
+ AuthorityCode *string `json:"AuthorityCode"`
+
+ // 資料總筆數
+ Count int64 `json:"Count,omitempty"`
+
+ // Array
+ //
+ // 資料(陣列)
+ // Required: true
+ LivePositions []*PTXServiceDTOShipSpecificationV3LivePosition `json:"LivePositions"`
+
+ // Int32
+ //
+ // [來源端平臺]資料更新週期(秒)['-1: 不定期更新']
+ // Required: true
+ SrcUpdateInterval *int32 `json:"SrcUpdateInterval"`
+
+ // DateTime
+ //
+ // [來源端平臺]資料更新時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
+ // Required: true
+ SrcUpdateTime *string `json:"SrcUpdateTime"`
+
+ // Int32
+ //
+ // [平臺]資料更新週期(秒)
+ // Required: true
+ UpdateInterval *int32 `json:"UpdateInterval"`
+
+ // DateTime
+ //
+ // [平臺]資料更新日期時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
+ // Required: true
+ UpdateTime *string `json:"UpdateTime"`
+}
+
+// Validate validates this p t x API ship model ship live wrapper p t x service d t o ship specification v3 live position
+func (m *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateAuthorityCode(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateLivePositions(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateSrcUpdateInterval(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateSrcUpdateTime(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateUpdateInterval(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 *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) validateAuthorityCode(formats strfmt.Registry) error {
+
+ if err := validate.Required("AuthorityCode", "body", m.AuthorityCode); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) validateLivePositions(formats strfmt.Registry) error {
+
+ if err := validate.Required("LivePositions", "body", m.LivePositions); err != nil {
+ return err
+ }
+
+ for i := 0; i < len(m.LivePositions); i++ {
+ if swag.IsZero(m.LivePositions[i]) { // not required
+ continue
+ }
+
+ if m.LivePositions[i] != nil {
+ if err := m.LivePositions[i].Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("LivePositions" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) validateSrcUpdateInterval(formats strfmt.Registry) error {
+
+ if err := validate.Required("SrcUpdateInterval", "body", m.SrcUpdateInterval); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) validateSrcUpdateTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("SrcUpdateTime", "body", m.SrcUpdateTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) validateUpdateInterval(formats strfmt.Registry) error {
+
+ if err := validate.Required("UpdateInterval", "body", m.UpdateInterval); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) validateUpdateTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("UpdateTime", "body", m.UpdateTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validate this p t x API ship model ship live wrapper p t x service d t o ship specification v3 live position based on the context it is used
+func (m *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateLivePositions(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) contextValidateLivePositions(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.LivePositions); i++ {
+
+ if m.LivePositions[i] != nil {
+ if err := m.LivePositions[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("LivePositions" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition) UnmarshalBinary(b []byte) error {
+ var res PTXAPIShipModelShipLiveWrapperPTXServiceDTOShipSpecificationV3LivePosition
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_shared_specification_v3_base_authority.go b/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_shared_specification_v3_base_authority.go
index ce70bc0a..be5d45d7 100644
--- a/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_shared_specification_v3_base_authority.go
+++ b/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_shared_specification_v3_base_authority.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -73,7 +74,6 @@ func (m *PTXAPIShipModelShipWrapperPTXServiceDTOSharedSpecificationV3BaseAuthori
}
func (m *PTXAPIShipModelShipWrapperPTXServiceDTOSharedSpecificationV3BaseAuthority) validateAuthorities(formats strfmt.Registry) error {
-
if swag.IsZero(m.Authorities) { // not required
return nil
}
@@ -115,6 +115,38 @@ func (m *PTXAPIShipModelShipWrapperPTXServiceDTOSharedSpecificationV3BaseAuthori
return nil
}
+// ContextValidate validate this p t x API ship model ship wrapper p t x service d t o shared specification v3 base authority based on the context it is used
+func (m *PTXAPIShipModelShipWrapperPTXServiceDTOSharedSpecificationV3BaseAuthority) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAuthorities(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIShipModelShipWrapperPTXServiceDTOSharedSpecificationV3BaseAuthority) contextValidateAuthorities(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Authorities); i++ {
+
+ if m.Authorities[i] != nil {
+ if err := m.Authorities[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Authorities" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIShipModelShipWrapperPTXServiceDTOSharedSpecificationV3BaseAuthority) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_operator.go b/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_operator.go
index 5a6bec1f..6596d90e 100644
--- a/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_operator.go
+++ b/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_operator.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -73,7 +74,6 @@ func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Operator) Val
}
func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Operator) validateOperators(formats strfmt.Registry) error {
-
if swag.IsZero(m.Operators) { // not required
return nil
}
@@ -115,6 +115,38 @@ func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Operator) val
return nil
}
+// ContextValidate validate this p t x API ship model ship wrapper p t x service d t o ship specification v3 operator based on the context it is used
+func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Operator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperators(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Operator) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Operators); i++ {
+
+ if m.Operators[i] != nil {
+ if err := m.Operators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Operators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Operator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_port.go b/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_port.go
index b5b656d4..10fc7e8a 100644
--- a/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_port.go
+++ b/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_port.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -73,7 +74,6 @@ func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Port) Validat
}
func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Port) validatePorts(formats strfmt.Registry) error {
-
if swag.IsZero(m.Ports) { // not required
return nil
}
@@ -115,6 +115,38 @@ func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Port) validat
return nil
}
+// ContextValidate validate this p t x API ship model ship wrapper p t x service d t o ship specification v3 port based on the context it is used
+func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Port) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidatePorts(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Port) contextValidatePorts(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Ports); i++ {
+
+ if m.Ports[i] != nil {
+ if err := m.Ports[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Ports" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Port) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_route.go b/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_route.go
index b4d6053a..ae8bb3f7 100644
--- a/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_route.go
+++ b/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -73,7 +74,6 @@ func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Route) Valida
}
func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Route) validateRoutes(formats strfmt.Registry) error {
-
if swag.IsZero(m.Routes) { // not required
return nil
}
@@ -115,6 +115,38 @@ func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Route) valida
return nil
}
+// ContextValidate validate this p t x API ship model ship wrapper p t x service d t o ship specification v3 route based on the context it is used
+func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Route) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Route) contextValidateRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Routes); i++ {
+
+ if m.Routes[i] != nil {
+ if err := m.Routes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Routes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3Route) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_route_fare.go b/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_route_fare.go
index f5e893c7..ef690f69 100644
--- a/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_route_fare.go
+++ b/ship/v3/models/p_t_x_api_ship_model_ship_wrapper_p_t_x_service_d_t_o_ship_specification_v3_route_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -73,7 +74,6 @@ func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3RouteFare) Va
}
func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3RouteFare) validateRouteFares(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteFares) { // not required
return nil
}
@@ -115,6 +115,38 @@ func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3RouteFare) va
return nil
}
+// ContextValidate validate this p t x API ship model ship wrapper p t x service d t o ship specification v3 route fare based on the context it is used
+func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3RouteFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateRouteFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3RouteFare) contextValidateRouteFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.RouteFares); i++ {
+
+ if m.RouteFares[i] != nil {
+ if err := m.RouteFares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("RouteFares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXAPIShipModelShipWrapperPTXServiceDTOShipSpecificationV3RouteFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_authority.go b/ship/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_authority.go
index 2e4a6e56..d70a2744 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_authority.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_authority.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -171,6 +173,25 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseAuthority) validateUpdateTime(for
return nil
}
+// ContextValidate validate this p t x service d t o shared specification v3 base authority based on the context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BaseAuthority) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateAuthorityName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOSharedSpecificationV3BaseAuthority) contextValidateAuthorityName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BaseAuthority) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go b/ship/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go
index adc99033..b449af50 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_shared_specification_v3_base_name_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -31,6 +33,11 @@ func (m *PTXServiceDTOSharedSpecificationV3BaseNameType) Validate(formats strfmt
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v3 base name type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV3BaseNameType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV3BaseNameType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_fare.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_fare.go
index 66ab3e8f..9c7aedda 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_fare.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_fare.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -46,6 +48,11 @@ func (m *PTXServiceDTOShipSpecificationV3Fare) Validate(formats strfmt.Registry)
return nil
}
+// ContextValidate validates this p t x service d t o ship specification v3 fare based on context it is used
+func (m *PTXServiceDTOShipSpecificationV3Fare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOShipSpecificationV3Fare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_general_schedule.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_general_schedule.go
index 99c73195..bb69068c 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_general_schedule.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_general_schedule.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -72,7 +73,6 @@ func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) Validate(formats strfm
}
func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -81,7 +81,6 @@ func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) validateRouteName(form
}
func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) validateTimetables(formats strfmt.Registry) error {
-
if swag.IsZero(m.Timetables) { // not required
return nil
}
@@ -106,7 +105,6 @@ func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) validateTimetables(for
}
func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) validateVessels(formats strfmt.Registry) error {
-
if swag.IsZero(m.Vessels) { // not required
return nil
}
@@ -130,6 +128,69 @@ func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) validateVessels(format
return nil
}
+// ContextValidate validate this p t x service d t o ship specification v3 general schedule based on the context it is used
+func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) 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.contextValidateTimetables(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateVessels(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) 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
+}
+
+func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) contextValidateVessels(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Vessels); i++ {
+
+ if m.Vessels[i] != nil {
+ if err := m.Vessels[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Vessels" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOShipSpecificationV3GeneralSchedule) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_live_position.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_live_position.go
new file mode 100644
index 00000000..bb65d86c
--- /dev/null
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_live_position.go
@@ -0,0 +1,204 @@
+// 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"
+)
+
+// PTXServiceDTOShipSpecificationV3LivePosition LivePosition
+//
+// swagger:model PTX.Service.DTO.Ship.Specification.V3.LivePosition
+type PTXServiceDTOShipSpecificationV3LivePosition struct {
+
+ // Single
+ //
+ // 對地航向(Course Over Ground,單位: degree(度,真北為零)),精度至 1/10 degree
+ COG float32 `json:"COG,omitempty"`
+
+ // DateTime
+ //
+ // GPS 記錄時間(ISO8601格式:yyyy-MM-ddTHH:mm:sszzz)
+ // Required: true
+ GPSTime *string `json:"GPSTime"`
+
+ // String
+ //
+ // AIS 船舶編號
+ // Required: true
+ MMSI *string `json:"MMSI"`
+
+ // integer
+ //
+ // 航行狀態 : [0:'under way using engine',1:'at anchor',2:'not under command',3:'restricted maneuverability',4:'constrained by her draught',5:'moored',6:'aground',7:'engaged in fishing',8:'under way sailing',9:'reserved for future amendment of navigational status for ships carrying DG, HS, or MP, or IMO hazard or pollutant category C, high speed craft (HSC)',10:'reserved for future amendment of navigational status for ships carrying dangerous goods (DG), harmful substances (HS) or marine pollutants (MP), or IMO hazard or pollutant category A, wing in ground (WIG)',11:'power-driven vessel towing astern (regional use)',12:'power-driven vessel pushing ahead or towing alongside (regional use)',13:'reserved for future use',14:'AIS-SART (active), MOB-AIS, EPIRB-AIS',15:'undefined = default (also used by AIS-SART, MOB-AIS and EPIRB-AIS under test)']
+ // Required: true
+ NAVSTAT *int32 `json:"NAVSTAT"`
+
+ // Single
+ //
+ // 對地航速(Speed Over Ground,單位: knot(節,海里/小時)),精度至 1/10 knot
+ SOG float32 `json:"SOG,omitempty"`
+
+ // String
+ //
+ // 船舶代碼
+ // Required: true
+ VesselID *string `json:"VesselID"`
+
+ // NameType
+ //
+ // 船舶名稱
+ VesselName struct {
+ PTXServiceDTOSharedSpecificationV3BaseNameType
+ } `json:"VesselName,omitempty"`
+
+ // PointType
+ //
+ // 船舶位置資訊
+ // Required: true
+ VesselPosition struct {
+ PTXServiceDTOShipSpecificationV3PointType
+ } `json:"VesselPosition"`
+
+ // integer
+ //
+ // 船舶種類 : [0:'N/A',20:'WIG',30:'Vessel-Fishing',31:'not under command',32:'Vessel-Tow>200m,breadth>25m',33:'Vessel-Dredge,Underwater OP',34:'Vessel-Diving OP',35:'Vessel-Military OP',36:'Vessel-Sailing',37:'Vessel-Pleasure craft',40:'HSC',50:'Pilot vessel',51:'Search & rescue vessel',52:'Tug',53:'Port tender',54:'Anti-pollution vessel',55:'Law enforcement vessel',58:'Medical transport',59:'Resolution 18(Mob-83)',60:'Passenger ship',70:'Cargo ship',80:'Tanker',90:'Other',101:'Undefined']
+ VesselType int32 `json:"VesselType,omitempty"`
+}
+
+// Validate validates this p t x service d t o ship specification v3 live position
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateGPSTime(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateMMSI(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateNAVSTAT(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateVesselID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateVesselName(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateVesselPosition(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) validateGPSTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("GPSTime", "body", m.GPSTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) validateMMSI(formats strfmt.Registry) error {
+
+ if err := validate.Required("MMSI", "body", m.MMSI); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) validateNAVSTAT(formats strfmt.Registry) error {
+
+ if err := validate.Required("NAVSTAT", "body", m.NAVSTAT); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) validateVesselID(formats strfmt.Registry) error {
+
+ if err := validate.Required("VesselID", "body", m.VesselID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) validateVesselName(formats strfmt.Registry) error {
+ if swag.IsZero(m.VesselName) { // not required
+ return nil
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) validateVesselPosition(formats strfmt.Registry) error {
+
+ return nil
+}
+
+// ContextValidate validate this p t x service d t o ship specification v3 live position based on the context it is used
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateVesselName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateVesselPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) contextValidateVesselName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) contextValidateVesselPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOShipSpecificationV3LivePosition) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOShipSpecificationV3LivePosition
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_operator.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_operator.go
index 2fb1602e..04c1c326 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_operator.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_operator.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -89,7 +91,6 @@ func (m *PTXServiceDTOShipSpecificationV3Operator) Validate(formats strfmt.Regis
}
func (m *PTXServiceDTOShipSpecificationV3Operator) validateOperatorName(formats strfmt.Registry) error {
-
if swag.IsZero(m.OperatorName) { // not required
return nil
}
@@ -97,6 +98,25 @@ func (m *PTXServiceDTOShipSpecificationV3Operator) validateOperatorName(formats
return nil
}
+// ContextValidate validate this p t x service d t o ship specification v3 operator based on the context it is used
+func (m *PTXServiceDTOShipSpecificationV3Operator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Operator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOShipSpecificationV3Operator) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_operators.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_operators.go
index ece66223..012485cc 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_operators.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_operators.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -26,6 +28,11 @@ func (m *PTXServiceDTOShipSpecificationV3Operators) Validate(formats strfmt.Regi
return nil
}
+// ContextValidate validates this p t x service d t o ship specification v3 operators based on context it is used
+func (m *PTXServiceDTOShipSpecificationV3Operators) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOShipSpecificationV3Operators) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_point_type.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_point_type.go
index c65408c8..0a748e5e 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_point_type.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_point_type.go
@@ -6,8 +6,12 @@ package models
// 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"
)
// PTXServiceDTOShipSpecificationV3PointType PointType
@@ -18,16 +22,54 @@ type PTXServiceDTOShipSpecificationV3PointType struct {
// Double
//
// 位置緯度
- PositionLat float64 `json:"PositionLat,omitempty"`
+ // Required: true
+ PositionLat *float64 `json:"PositionLat"`
// Double
//
// 位置經度
- PositionLon float64 `json:"PositionLon,omitempty"`
+ // Required: true
+ PositionLon *float64 `json:"PositionLon"`
}
// Validate validates this p t x service d t o ship specification v3 point type
func (m *PTXServiceDTOShipSpecificationV3PointType) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validatePositionLat(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validatePositionLon(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3PointType) validatePositionLat(formats strfmt.Registry) error {
+
+ if err := validate.Required("PositionLat", "body", m.PositionLat); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3PointType) validatePositionLon(formats strfmt.Registry) error {
+
+ if err := validate.Required("PositionLon", "body", m.PositionLon); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validates this p t x service d t o ship specification v3 point type based on context it is used
+func (m *PTXServiceDTOShipSpecificationV3PointType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_port.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_port.go
index dd7715bd..795cd7d2 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_port.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_port.go
@@ -6,9 +6,12 @@ package models
// 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"
)
// PTXServiceDTOShipSpecificationV3Port Port
@@ -19,22 +22,26 @@ type PTXServiceDTOShipSpecificationV3Port struct {
// String
//
// 港口所屬城市
- City string `json:"City,omitempty"`
+ // Required: true
+ City *string `json:"City"`
// String
//
// 城市簡碼
- CityCode string `json:"CityCode,omitempty"`
+ // Required: true
+ CityCode *string `json:"CityCode"`
// String
//
// 港口所屬國家
- Country string `json:"Country,omitempty"`
+ // Required: true
+ Country *string `json:"Country"`
// String
//
// 國家簡碼
- CountryCode string `json:"CountryCode,omitempty"`
+ // Required: true
+ CountryCode *string `json:"CountryCode"`
// String
//
@@ -49,14 +56,16 @@ type PTXServiceDTOShipSpecificationV3Port struct {
// String
//
// 港口代碼
- PortID string `json:"PortID,omitempty"`
+ // Required: true
+ PortID *string `json:"PortID"`
// NameType
//
// 港口名稱
+ // Required: true
PortName struct {
PTXServiceDTOSharedSpecificationV3BaseNameType
- } `json:"PortName,omitempty"`
+ } `json:"PortName"`
// String
//
@@ -66,9 +75,10 @@ type PTXServiceDTOShipSpecificationV3Port struct {
// PointType
//
// 港口位置座標
+ // Required: true
PortPosition struct {
PTXServiceDTOShipSpecificationV3PointType
- } `json:"PortPosition,omitempty"`
+ } `json:"PortPosition"`
// String
//
@@ -80,6 +90,26 @@ type PTXServiceDTOShipSpecificationV3Port struct {
func (m *PTXServiceDTOShipSpecificationV3Port) Validate(formats strfmt.Registry) error {
var res []error
+ if err := m.validateCity(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateCityCode(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateCountry(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateCountryCode(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validatePortID(formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.validatePortName(formats); err != nil {
res = append(res, err)
}
@@ -94,21 +124,86 @@ func (m *PTXServiceDTOShipSpecificationV3Port) Validate(formats strfmt.Registry)
return nil
}
-func (m *PTXServiceDTOShipSpecificationV3Port) validatePortName(formats strfmt.Registry) error {
+func (m *PTXServiceDTOShipSpecificationV3Port) validateCity(formats strfmt.Registry) error {
+
+ if err := validate.Required("City", "body", m.City); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Port) validateCityCode(formats strfmt.Registry) error {
+
+ if err := validate.Required("CityCode", "body", m.CityCode); err != nil {
+ return err
+ }
- if swag.IsZero(m.PortName) { // not required
- return nil
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Port) validateCountry(formats strfmt.Registry) error {
+
+ if err := validate.Required("Country", "body", m.Country); err != nil {
+ return err
}
return nil
}
+func (m *PTXServiceDTOShipSpecificationV3Port) validateCountryCode(formats strfmt.Registry) error {
+
+ if err := validate.Required("CountryCode", "body", m.CountryCode); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Port) validatePortID(formats strfmt.Registry) error {
+
+ if err := validate.Required("PortID", "body", m.PortID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Port) validatePortName(formats strfmt.Registry) error {
+
+ return nil
+}
+
func (m *PTXServiceDTOShipSpecificationV3Port) validatePortPosition(formats strfmt.Registry) error {
- if swag.IsZero(m.PortPosition) { // not required
- return nil
+ return nil
+}
+
+// ContextValidate validate this p t x service d t o ship specification v3 port based on the context it is used
+func (m *PTXServiceDTOShipSpecificationV3Port) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidatePortName(ctx, formats); err != nil {
+ res = append(res, err)
}
+ if err := m.contextValidatePortPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Port) contextValidatePortName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Port) contextValidatePortPosition(ctx context.Context, formats strfmt.Registry) error {
+
return nil
}
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_port_infomation.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_port_infomation.go
index 63789702..4c3e1b3f 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_port_infomation.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_port_infomation.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -29,6 +31,11 @@ func (m *PTXServiceDTOShipSpecificationV3PortInfomation) Validate(formats strfmt
return nil
}
+// ContextValidate validates this p t x service d t o ship specification v3 port infomation based on context it is used
+func (m *PTXServiceDTOShipSpecificationV3PortInfomation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOShipSpecificationV3PortInfomation) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_route.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_route.go
index 14751baf..7d3ff842 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_route.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -111,7 +112,6 @@ func (m *PTXServiceDTOShipSpecificationV3Route) Validate(formats strfmt.Registry
}
func (m *PTXServiceDTOShipSpecificationV3Route) validateOperators(formats strfmt.Registry) error {
-
if swag.IsZero(m.Operators) { // not required
return nil
}
@@ -136,7 +136,6 @@ func (m *PTXServiceDTOShipSpecificationV3Route) validateOperators(formats strfmt
}
func (m *PTXServiceDTOShipSpecificationV3Route) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -145,7 +144,6 @@ func (m *PTXServiceDTOShipSpecificationV3Route) validateRouteName(formats strfmt
}
func (m *PTXServiceDTOShipSpecificationV3Route) validateTicketPriceDescription(formats strfmt.Registry) error {
-
if swag.IsZero(m.TicketPriceDescription) { // not required
return nil
}
@@ -153,6 +151,56 @@ func (m *PTXServiceDTOShipSpecificationV3Route) validateTicketPriceDescription(f
return nil
}
+// ContextValidate validate this p t x service d t o ship specification v3 route based on the context it is used
+func (m *PTXServiceDTOShipSpecificationV3Route) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperators(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTicketPriceDescription(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Route) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Operators); i++ {
+
+ if m.Operators[i] != nil {
+ if err := m.Operators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Operators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Route) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Route) contextValidateTicketPriceDescription(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOShipSpecificationV3Route) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_route_fare.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_route_fare.go
index 368efd0c..cdcef85a 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_route_fare.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_route_fare.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -82,7 +83,6 @@ func (m *PTXServiceDTOShipSpecificationV3RouteFare) Validate(formats strfmt.Regi
}
func (m *PTXServiceDTOShipSpecificationV3RouteFare) validateDestinationPort(formats strfmt.Registry) error {
-
if swag.IsZero(m.DestinationPort) { // not required
return nil
}
@@ -91,7 +91,6 @@ func (m *PTXServiceDTOShipSpecificationV3RouteFare) validateDestinationPort(form
}
func (m *PTXServiceDTOShipSpecificationV3RouteFare) validateFares(formats strfmt.Registry) error {
-
if swag.IsZero(m.Fares) { // not required
return nil
}
@@ -116,7 +115,6 @@ func (m *PTXServiceDTOShipSpecificationV3RouteFare) validateFares(formats strfmt
}
func (m *PTXServiceDTOShipSpecificationV3RouteFare) validateOriginPort(formats strfmt.Registry) error {
-
if swag.IsZero(m.OriginPort) { // not required
return nil
}
@@ -125,7 +123,6 @@ func (m *PTXServiceDTOShipSpecificationV3RouteFare) validateOriginPort(formats s
}
func (m *PTXServiceDTOShipSpecificationV3RouteFare) validateRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.RouteName) { // not required
return nil
}
@@ -133,6 +130,65 @@ func (m *PTXServiceDTOShipSpecificationV3RouteFare) validateRouteName(formats st
return nil
}
+// ContextValidate validate this p t x service d t o ship specification v3 route fare based on the context it is used
+func (m *PTXServiceDTOShipSpecificationV3RouteFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDestinationPort(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateFares(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateOriginPort(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3RouteFare) contextValidateDestinationPort(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3RouteFare) contextValidateFares(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Fares); i++ {
+
+ if m.Fares[i] != nil {
+ if err := m.Fares[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Fares" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3RouteFare) contextValidateOriginPort(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3RouteFare) contextValidateRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOShipSpecificationV3RouteFare) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_service_day.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_service_day.go
index 1119fb0d..75cdb687 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_service_day.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_service_day.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -66,6 +68,11 @@ func (m *PTXServiceDTOShipSpecificationV3ServiceDay) Validate(formats strfmt.Reg
return nil
}
+// ContextValidate validates this p t x service d t o ship specification v3 service day based on context it is used
+func (m *PTXServiceDTOShipSpecificationV3ServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOShipSpecificationV3ServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_stoptime.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_stoptime.go
index a76c9686..5571d538 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_stoptime.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_stoptime.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -64,7 +66,6 @@ func (m *PTXServiceDTOShipSpecificationV3Stoptime) Validate(formats strfmt.Regis
}
func (m *PTXServiceDTOShipSpecificationV3Stoptime) validatePortName(formats strfmt.Registry) error {
-
if swag.IsZero(m.PortName) { // not required
return nil
}
@@ -72,6 +73,25 @@ func (m *PTXServiceDTOShipSpecificationV3Stoptime) validatePortName(formats strf
return nil
}
+// ContextValidate validate this p t x service d t o ship specification v3 stoptime based on the context it is used
+func (m *PTXServiceDTOShipSpecificationV3Stoptime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidatePortName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Stoptime) contextValidatePortName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOShipSpecificationV3Stoptime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_timetable.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_timetable.go
index 0aa0e1c1..ce2f3752 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_timetable.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_timetable.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -53,7 +54,6 @@ func (m *PTXServiceDTOShipSpecificationV3Timetable) Validate(formats strfmt.Regi
}
func (m *PTXServiceDTOShipSpecificationV3Timetable) validateServiceDay(formats strfmt.Registry) error {
-
if swag.IsZero(m.ServiceDay) { // not required
return nil
}
@@ -62,7 +62,6 @@ func (m *PTXServiceDTOShipSpecificationV3Timetable) validateServiceDay(formats s
}
func (m *PTXServiceDTOShipSpecificationV3Timetable) validateStoptimes(formats strfmt.Registry) error {
-
if swag.IsZero(m.Stoptimes) { // not required
return nil
}
@@ -86,6 +85,47 @@ func (m *PTXServiceDTOShipSpecificationV3Timetable) validateStoptimes(formats st
return nil
}
+// ContextValidate validate this p t x service d t o ship specification v3 timetable based on the context it is used
+func (m *PTXServiceDTOShipSpecificationV3Timetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStoptimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Timetable) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOShipSpecificationV3Timetable) 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 *PTXServiceDTOShipSpecificationV3Timetable) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_vessel.go b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_vessel.go
index 2c32f043..75edff5d 100644
--- a/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_vessel.go
+++ b/ship/v3/models/p_t_x_service_d_t_o_ship_specification_v3_vessel.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -31,6 +33,11 @@ func (m *PTXServiceDTOShipSpecificationV3Vessel) Validate(formats strfmt.Registr
return nil
}
+// ContextValidate validates this p t x service d t o ship specification v3 vessel based on context it is used
+func (m *PTXServiceDTOShipSpecificationV3Vessel) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOShipSpecificationV3Vessel) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival1_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival1_parameters.go
index 62f8906f..2e74068e 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival1_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIEstimatedTimeOfArrival1Params creates a new TaiwanTripBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized.
+// NewTaiwanTripBusAPIEstimatedTimeOfArrival1Params creates a new TaiwanTripBusAPIEstimatedTimeOfArrival1Params 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 NewTaiwanTripBusAPIEstimatedTimeOfArrival1Params() *TaiwanTripBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIEstimatedTimeOfArrival1ParamsWithTimeout creates a new TaiwanTripBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIEstimatedTimeOfArrival1ParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIEstimatedTimeOfArrival1ParamsWithContext creates a new TaiwanTripBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIEstimatedTimeOfArrival1ParamsWithContext(ctx context.Context) *TaiwanTripBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIEstimatedTimeOfArrival1ParamsWithHTTPClient creates a new TaiwanTripBusAPIEstimatedTimeOfArrival1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIEstimatedTimeOfArrival1ParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIEstimatedTimeOfArrival1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIEstimatedTimeOfArrival1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIEstimatedTimeOfArrival1Params contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api estimated time of arrival 1 operation typically these are written to a http.Request
+/* TaiwanTripBusAPIEstimatedTimeOfArrival1Params contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api estimated time of arrival 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIEstimatedTimeOfArrival1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TaiwanTripName
- 台灣好行繁體中文路線名稱,如'黃金福隆線'
+ /* TaiwanTripName.
+
+ 台灣好行繁體中文路線名稱,如'黃金福隆線'
*/
TaiwanTripName string
@@ -114,6 +109,32 @@ type TaiwanTripBusAPIEstimatedTimeOfArrival1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api estimated time of arrival 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIEstimatedTimeOfArrival1Params) WithDefaults() *TaiwanTripBusAPIEstimatedTimeOfArrival1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api estimated time of arrival 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIEstimatedTimeOfArrival1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIEstimatedTimeOfArrival1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api estimated time of arrival 1 params
func (o *TaiwanTripBusAPIEstimatedTimeOfArrival1Params) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIEstimatedTimeOfArrival1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TaiwanTripBusAPIEstimatedTimeOfArrival1Params) WriteToRequest(r runtime
// 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
}
@@ -261,64 +284,68 @@ func (o *TaiwanTripBusAPIEstimatedTimeOfArrival1Params) WriteToRequest(r runtime
// 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 TaiwanTripName
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival1_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival1_responses.go
index 8b9b7a32..bb3133bc 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival1_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival1_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIEstimatedTimeOfArrival1Reader) ReadResponse(response ru
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIEstimatedTimeOfArrival1OK() *TaiwanTripBusAPIEstimatedTi
return &TaiwanTripBusAPIEstimatedTimeOfArrival1OK{}
}
-/*TaiwanTripBusAPIEstimatedTimeOfArrival1OK handles this case with default header values.
+/* TaiwanTripBusAPIEstimatedTimeOfArrival1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIEstimatedTimeOfArrival1OK struct {
func (o *TaiwanTripBusAPIEstimatedTimeOfArrival1OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/EstimatedTimeOfArrival/TaiwanTrip/{TaiwanTripName}][%d] taiwanTripBusApiEstimatedTimeOfArrival1OK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIEstimatedTimeOfArrival1OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusN1EstimateTime {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival_parameters.go
index 7ae85b99..be70a1e4 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIEstimatedTimeOfArrivalParams creates a new TaiwanTripBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized.
+// NewTaiwanTripBusAPIEstimatedTimeOfArrivalParams creates a new TaiwanTripBusAPIEstimatedTimeOfArrivalParams 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 NewTaiwanTripBusAPIEstimatedTimeOfArrivalParams() *TaiwanTripBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIEstimatedTimeOfArrivalParamsWithTimeout creates a new TaiwanTripBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIEstimatedTimeOfArrivalParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIEstimatedTimeOfArrivalParamsWithContext creates a new TaiwanTripBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIEstimatedTimeOfArrivalParamsWithContext(ctx context.Context) *TaiwanTripBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIEstimatedTimeOfArrivalParamsWithHTTPClient creates a new TaiwanTripBusAPIEstimatedTimeOfArrivalParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIEstimatedTimeOfArrivalParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIEstimatedTimeOfArrivalParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIEstimatedTimeOfArrivalParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIEstimatedTimeOfArrivalParams contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api estimated time of arrival operation typically these are written to a http.Request
+/* TaiwanTripBusAPIEstimatedTimeOfArrivalParams contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api estimated time of arrival operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIEstimatedTimeOfArrivalParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TaiwanTripBusAPIEstimatedTimeOfArrivalParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api estimated time of arrival params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIEstimatedTimeOfArrivalParams) WithDefaults() *TaiwanTripBusAPIEstimatedTimeOfArrivalParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api estimated time of arrival params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIEstimatedTimeOfArrivalParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIEstimatedTimeOfArrivalParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api estimated time of arrival params
func (o *TaiwanTripBusAPIEstimatedTimeOfArrivalParams) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIEstimatedTimeOfArrivalParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TaiwanTripBusAPIEstimatedTimeOfArrivalParams) WriteToRequest(r runtime.
// 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
}
@@ -245,64 +267,68 @@ func (o *TaiwanTripBusAPIEstimatedTimeOfArrivalParams) WriteToRequest(r runtime.
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival_responses.go
index 47ee079e..48113eb0 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_estimated_time_of_arrival_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIEstimatedTimeOfArrivalReader) ReadResponse(response run
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIEstimatedTimeOfArrivalOK() *TaiwanTripBusAPIEstimatedTim
return &TaiwanTripBusAPIEstimatedTimeOfArrivalOK{}
}
-/*TaiwanTripBusAPIEstimatedTimeOfArrivalOK handles this case with default header values.
+/* TaiwanTripBusAPIEstimatedTimeOfArrivalOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIEstimatedTimeOfArrivalOK struct {
func (o *TaiwanTripBusAPIEstimatedTimeOfArrivalOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/EstimatedTimeOfArrival/TaiwanTrip][%d] taiwanTripBusApiEstimatedTimeOfArrivalOK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIEstimatedTimeOfArrivalOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusN1EstimateTime {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_news_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_news_parameters.go
index 6eae9a29..8c5d7296 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_news_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_news_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPINewsParams creates a new TaiwanTripBusAPINewsParams object
-// with the default values initialized.
+// NewTaiwanTripBusAPINewsParams creates a new TaiwanTripBusAPINewsParams 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 NewTaiwanTripBusAPINewsParams() *TaiwanTripBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPINewsParamsWithTimeout creates a new TaiwanTripBusAPINewsParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPINewsParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPINewsParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPINewsParamsWithContext creates a new TaiwanTripBusAPINewsParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPINewsParamsWithContext(ctx context.Context) *TaiwanTripBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPINewsParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPINewsParamsWithHTTPClient creates a new TaiwanTripBusAPINewsParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPINewsParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPINewsParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPINewsParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPINewsParams contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api news operation typically these are written to a http.Request
+/* TaiwanTripBusAPINewsParams contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api news operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPINewsParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TaiwanTripBusAPINewsParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPINewsParams) WithDefaults() *TaiwanTripBusAPINewsParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api news params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPINewsParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPINewsParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api news params
func (o *TaiwanTripBusAPINewsParams) WithTimeout(timeout time.Duration) *TaiwanTripBusAPINewsParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TaiwanTripBusAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -245,64 +267,68 @@ func (o *TaiwanTripBusAPINewsParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_news_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_news_responses.go
index d9b2ea32..6cc18f7b 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_news_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_news_responses.go
@@ -29,7 +29,12 @@ func (o *TaiwanTripBusAPINewsReader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTaiwanTripBusAPINewsNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTaiwanTripBusAPINewsOK() *TaiwanTripBusAPINewsOK {
return &TaiwanTripBusAPINewsOK{}
}
-/*TaiwanTripBusAPINewsOK handles this case with default header values.
+/* TaiwanTripBusAPINewsOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TaiwanTripBusAPINewsOK struct {
func (o *TaiwanTripBusAPINewsOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/News/TaiwanTrip][%d] taiwanTripBusApiNewsOK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPINewsOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusTaiwanTripNews {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TaiwanTripBusAPINewsOK) readResponse(response runtime.ClientResponse, c
return nil
}
+
+// NewTaiwanTripBusAPINewsNotModified creates a TaiwanTripBusAPINewsNotModified with default headers values
+func NewTaiwanTripBusAPINewsNotModified() *TaiwanTripBusAPINewsNotModified {
+ return &TaiwanTripBusAPINewsNotModified{}
+}
+
+/* TaiwanTripBusAPINewsNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TaiwanTripBusAPINewsNotModified struct {
+}
+
+func (o *TaiwanTripBusAPINewsNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/Bus/News/TaiwanTrip][%d] taiwanTripBusApiNewsNotModified ", 304)
+}
+
+func (o *TaiwanTripBusAPINewsNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency1_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency1_parameters.go
index 6bd46fc3..bce84063 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency1_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency1_parameters.go
@@ -17,100 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIRealTimeByFrequency1Params creates a new TaiwanTripBusAPIRealTimeByFrequency1Params object
-// with the default values initialized.
+// NewTaiwanTripBusAPIRealTimeByFrequency1Params creates a new TaiwanTripBusAPIRealTimeByFrequency1Params 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 NewTaiwanTripBusAPIRealTimeByFrequency1Params() *TaiwanTripBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIRealTimeByFrequency1ParamsWithTimeout creates a new TaiwanTripBusAPIRealTimeByFrequency1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIRealTimeByFrequency1ParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIRealTimeByFrequency1ParamsWithContext creates a new TaiwanTripBusAPIRealTimeByFrequency1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIRealTimeByFrequency1ParamsWithContext(ctx context.Context) *TaiwanTripBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIRealTimeByFrequency1ParamsWithHTTPClient creates a new TaiwanTripBusAPIRealTimeByFrequency1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIRealTimeByFrequency1ParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIRealTimeByFrequency1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeByFrequency1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIRealTimeByFrequency1Params contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api real time by frequency 1 operation typically these are written to a http.Request
+/* TaiwanTripBusAPIRealTimeByFrequency1Params contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api real time by frequency 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIRealTimeByFrequency1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
- */
- DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TaiwanTripName
- 台灣好行繁體中文路線名稱,如'黃金福隆線'
+ /* TaiwanTripName.
+
+ 台灣好行繁體中文路線名稱,如'黃金福隆線'
*/
TaiwanTripName string
@@ -119,6 +109,32 @@ type TaiwanTripBusAPIRealTimeByFrequency1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api real time by frequency 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRealTimeByFrequency1Params) WithDefaults() *TaiwanTripBusAPIRealTimeByFrequency1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api real time by frequency 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRealTimeByFrequency1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIRealTimeByFrequency1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api real time by frequency 1 params
func (o *TaiwanTripBusAPIRealTimeByFrequency1Params) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIRealTimeByFrequency1Params {
o.SetTimeout(timeout)
@@ -207,17 +223,6 @@ func (o *TaiwanTripBusAPIRealTimeByFrequency1Params) SetDollarSkip(dollarSkip *s
o.DollarSkip = dollarSkip
}
-// WithDollarSpatialFilter adds the dollarSpatialFilter to the taiwan trip bus Api real time by frequency 1 params
-func (o *TaiwanTripBusAPIRealTimeByFrequency1Params) WithDollarSpatialFilter(dollarSpatialFilter *string) *TaiwanTripBusAPIRealTimeByFrequency1Params {
- o.SetDollarSpatialFilter(dollarSpatialFilter)
- return o
-}
-
-// SetDollarSpatialFilter adds the dollarSpatialFilter to the taiwan trip bus Api real time by frequency 1 params
-func (o *TaiwanTripBusAPIRealTimeByFrequency1Params) SetDollarSpatialFilter(dollarSpatialFilter *string) {
- o.DollarSpatialFilter = dollarSpatialFilter
-}
-
// WithDollarTop adds the dollarTop to the taiwan trip bus Api real time by frequency 1 params
func (o *TaiwanTripBusAPIRealTimeByFrequency1Params) WithDollarTop(dollarTop *int64) *TaiwanTripBusAPIRealTimeByFrequency1Params {
o.SetDollarTop(dollarTop)
@@ -252,22 +257,24 @@ func (o *TaiwanTripBusAPIRealTimeByFrequency1Params) WriteToRequest(r runtime.Cl
// 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
}
@@ -277,80 +284,68 @@ func (o *TaiwanTripBusAPIRealTimeByFrequency1Params) WriteToRequest(r runtime.Cl
// 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.DollarSpatialFilter != nil {
- // query param $spatialFilter
- var qrDollarSpatialFilter string
- if o.DollarSpatialFilter != nil {
- qrDollarSpatialFilter = *o.DollarSpatialFilter
- }
- qDollarSpatialFilter := qrDollarSpatialFilter
- if qDollarSpatialFilter != "" {
- if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); err != nil {
+ 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 TaiwanTripName
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency1_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency1_responses.go
index f8399313..81607f54 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency1_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency1_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIRealTimeByFrequency1Reader) ReadResponse(response runti
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIRealTimeByFrequency1OK() *TaiwanTripBusAPIRealTimeByFreq
return &TaiwanTripBusAPIRealTimeByFrequency1OK{}
}
-/*TaiwanTripBusAPIRealTimeByFrequency1OK handles this case with default header values.
+/* TaiwanTripBusAPIRealTimeByFrequency1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIRealTimeByFrequency1OK struct {
func (o *TaiwanTripBusAPIRealTimeByFrequency1OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/RealTimeByFrequency/TaiwanTrip/{TaiwanTripName}][%d] taiwanTripBusApiRealTimeByFrequency1OK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIRealTimeByFrequency1OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusA1Data {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency_parameters.go
index 2a74788d..0578993c 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency_parameters.go
@@ -17,95 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIRealTimeByFrequencyParams creates a new TaiwanTripBusAPIRealTimeByFrequencyParams object
-// with the default values initialized.
+// NewTaiwanTripBusAPIRealTimeByFrequencyParams creates a new TaiwanTripBusAPIRealTimeByFrequencyParams 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 NewTaiwanTripBusAPIRealTimeByFrequencyParams() *TaiwanTripBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIRealTimeByFrequencyParamsWithTimeout creates a new TaiwanTripBusAPIRealTimeByFrequencyParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIRealTimeByFrequencyParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIRealTimeByFrequencyParamsWithContext creates a new TaiwanTripBusAPIRealTimeByFrequencyParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIRealTimeByFrequencyParamsWithContext(ctx context.Context) *TaiwanTripBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIRealTimeByFrequencyParamsWithHTTPClient creates a new TaiwanTripBusAPIRealTimeByFrequencyParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIRealTimeByFrequencyParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIRealTimeByFrequencyParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeByFrequencyParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIRealTimeByFrequencyParams contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api real time by frequency operation typically these are written to a http.Request
+/* TaiwanTripBusAPIRealTimeByFrequencyParams contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api real time by frequency operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIRealTimeByFrequencyParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
- */
- DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +103,32 @@ type TaiwanTripBusAPIRealTimeByFrequencyParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api real time by frequency params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRealTimeByFrequencyParams) WithDefaults() *TaiwanTripBusAPIRealTimeByFrequencyParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api real time by frequency params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRealTimeByFrequencyParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIRealTimeByFrequencyParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api real time by frequency params
func (o *TaiwanTripBusAPIRealTimeByFrequencyParams) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIRealTimeByFrequencyParams {
o.SetTimeout(timeout)
@@ -202,17 +217,6 @@ func (o *TaiwanTripBusAPIRealTimeByFrequencyParams) SetDollarSkip(dollarSkip *st
o.DollarSkip = dollarSkip
}
-// WithDollarSpatialFilter adds the dollarSpatialFilter to the taiwan trip bus Api real time by frequency params
-func (o *TaiwanTripBusAPIRealTimeByFrequencyParams) WithDollarSpatialFilter(dollarSpatialFilter *string) *TaiwanTripBusAPIRealTimeByFrequencyParams {
- o.SetDollarSpatialFilter(dollarSpatialFilter)
- return o
-}
-
-// SetDollarSpatialFilter adds the dollarSpatialFilter to the taiwan trip bus Api real time by frequency params
-func (o *TaiwanTripBusAPIRealTimeByFrequencyParams) SetDollarSpatialFilter(dollarSpatialFilter *string) {
- o.DollarSpatialFilter = dollarSpatialFilter
-}
-
// WithDollarTop adds the dollarTop to the taiwan trip bus Api real time by frequency params
func (o *TaiwanTripBusAPIRealTimeByFrequencyParams) WithDollarTop(dollarTop *int64) *TaiwanTripBusAPIRealTimeByFrequencyParams {
o.SetDollarTop(dollarTop)
@@ -236,22 +240,24 @@ func (o *TaiwanTripBusAPIRealTimeByFrequencyParams) WriteToRequest(r runtime.Cli
// 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
}
@@ -261,80 +267,68 @@ func (o *TaiwanTripBusAPIRealTimeByFrequencyParams) WriteToRequest(r runtime.Cli
// 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.DollarSpatialFilter != nil {
- // query param $spatialFilter
- var qrDollarSpatialFilter string
- if o.DollarSpatialFilter != nil {
- qrDollarSpatialFilter = *o.DollarSpatialFilter
- }
- qDollarSpatialFilter := qrDollarSpatialFilter
- if qDollarSpatialFilter != "" {
- if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); err != nil {
+ 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency_responses.go
index 78d032e2..31f6cea2 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_by_frequency_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIRealTimeByFrequencyReader) ReadResponse(response runtim
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIRealTimeByFrequencyOK() *TaiwanTripBusAPIRealTimeByFrequ
return &TaiwanTripBusAPIRealTimeByFrequencyOK{}
}
-/*TaiwanTripBusAPIRealTimeByFrequencyOK handles this case with default header values.
+/* TaiwanTripBusAPIRealTimeByFrequencyOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIRealTimeByFrequencyOK struct {
func (o *TaiwanTripBusAPIRealTimeByFrequencyOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/RealTimeByFrequency/TaiwanTrip][%d] taiwanTripBusApiRealTimeByFrequencyOK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIRealTimeByFrequencyOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusA1Data {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop1_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop1_parameters.go
index 3ae79a7e..8a129507 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop1_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIRealTimeNearStop1Params creates a new TaiwanTripBusAPIRealTimeNearStop1Params object
-// with the default values initialized.
+// NewTaiwanTripBusAPIRealTimeNearStop1Params creates a new TaiwanTripBusAPIRealTimeNearStop1Params 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 NewTaiwanTripBusAPIRealTimeNearStop1Params() *TaiwanTripBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIRealTimeNearStop1ParamsWithTimeout creates a new TaiwanTripBusAPIRealTimeNearStop1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIRealTimeNearStop1ParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIRealTimeNearStop1ParamsWithContext creates a new TaiwanTripBusAPIRealTimeNearStop1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIRealTimeNearStop1ParamsWithContext(ctx context.Context) *TaiwanTripBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIRealTimeNearStop1ParamsWithHTTPClient creates a new TaiwanTripBusAPIRealTimeNearStop1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIRealTimeNearStop1ParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIRealTimeNearStop1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeNearStop1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIRealTimeNearStop1Params contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api real time near stop 1 operation typically these are written to a http.Request
+/* TaiwanTripBusAPIRealTimeNearStop1Params contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api real time near stop 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIRealTimeNearStop1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TaiwanTripName
- 台灣好行繁體中文路線名稱,如'黃金福隆線'
+ /* TaiwanTripName.
+
+ 台灣好行繁體中文路線名稱,如'黃金福隆線'
*/
TaiwanTripName string
@@ -114,6 +109,32 @@ type TaiwanTripBusAPIRealTimeNearStop1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api real time near stop 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRealTimeNearStop1Params) WithDefaults() *TaiwanTripBusAPIRealTimeNearStop1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api real time near stop 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRealTimeNearStop1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIRealTimeNearStop1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api real time near stop 1 params
func (o *TaiwanTripBusAPIRealTimeNearStop1Params) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIRealTimeNearStop1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TaiwanTripBusAPIRealTimeNearStop1Params) WriteToRequest(r runtime.Clien
// 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
}
@@ -261,64 +284,68 @@ func (o *TaiwanTripBusAPIRealTimeNearStop1Params) WriteToRequest(r runtime.Clien
// 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 TaiwanTripName
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop1_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop1_responses.go
index 7de7453d..d6b27016 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop1_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop1_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIRealTimeNearStop1Reader) ReadResponse(response runtime.
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIRealTimeNearStop1OK() *TaiwanTripBusAPIRealTimeNearStop1
return &TaiwanTripBusAPIRealTimeNearStop1OK{}
}
-/*TaiwanTripBusAPIRealTimeNearStop1OK handles this case with default header values.
+/* TaiwanTripBusAPIRealTimeNearStop1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIRealTimeNearStop1OK struct {
func (o *TaiwanTripBusAPIRealTimeNearStop1OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/RealTimeNearStop/TaiwanTrip/{TaiwanTripName}][%d] taiwanTripBusApiRealTimeNearStop1OK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIRealTimeNearStop1OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusA2Data {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop_parameters.go
index e1a9658e..f01d3d0e 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIRealTimeNearStopParams creates a new TaiwanTripBusAPIRealTimeNearStopParams object
-// with the default values initialized.
+// NewTaiwanTripBusAPIRealTimeNearStopParams creates a new TaiwanTripBusAPIRealTimeNearStopParams 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 NewTaiwanTripBusAPIRealTimeNearStopParams() *TaiwanTripBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIRealTimeNearStopParamsWithTimeout creates a new TaiwanTripBusAPIRealTimeNearStopParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIRealTimeNearStopParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIRealTimeNearStopParamsWithContext creates a new TaiwanTripBusAPIRealTimeNearStopParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIRealTimeNearStopParamsWithContext(ctx context.Context) *TaiwanTripBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIRealTimeNearStopParamsWithHTTPClient creates a new TaiwanTripBusAPIRealTimeNearStopParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIRealTimeNearStopParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIRealTimeNearStopParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRealTimeNearStopParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIRealTimeNearStopParams contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api real time near stop operation typically these are written to a http.Request
+/* TaiwanTripBusAPIRealTimeNearStopParams contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api real time near stop operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIRealTimeNearStopParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TaiwanTripBusAPIRealTimeNearStopParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api real time near stop params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRealTimeNearStopParams) WithDefaults() *TaiwanTripBusAPIRealTimeNearStopParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api real time near stop params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRealTimeNearStopParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIRealTimeNearStopParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api real time near stop params
func (o *TaiwanTripBusAPIRealTimeNearStopParams) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIRealTimeNearStopParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TaiwanTripBusAPIRealTimeNearStopParams) WriteToRequest(r runtime.Client
// 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
}
@@ -245,64 +267,68 @@ func (o *TaiwanTripBusAPIRealTimeNearStopParams) WriteToRequest(r runtime.Client
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop_responses.go
index a04633f6..7dc3f178 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_real_time_near_stop_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIRealTimeNearStopReader) ReadResponse(response runtime.C
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIRealTimeNearStopOK() *TaiwanTripBusAPIRealTimeNearStopOK
return &TaiwanTripBusAPIRealTimeNearStopOK{}
}
-/*TaiwanTripBusAPIRealTimeNearStopOK handles this case with default header values.
+/* TaiwanTripBusAPIRealTimeNearStopOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIRealTimeNearStopOK struct {
func (o *TaiwanTripBusAPIRealTimeNearStopOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/RealTimeNearStop/TaiwanTrip][%d] taiwanTripBusApiRealTimeNearStopOK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIRealTimeNearStopOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusA2Data {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_route1_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_route1_parameters.go
index 743b6fab..71aa517f 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_route1_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_route1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIRoute1Params creates a new TaiwanTripBusAPIRoute1Params object
-// with the default values initialized.
+// NewTaiwanTripBusAPIRoute1Params creates a new TaiwanTripBusAPIRoute1Params 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 NewTaiwanTripBusAPIRoute1Params() *TaiwanTripBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIRoute1ParamsWithTimeout creates a new TaiwanTripBusAPIRoute1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIRoute1ParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIRoute1ParamsWithContext creates a new TaiwanTripBusAPIRoute1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIRoute1ParamsWithContext(ctx context.Context) *TaiwanTripBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIRoute1ParamsWithHTTPClient creates a new TaiwanTripBusAPIRoute1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIRoute1ParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRoute1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIRoute1Params contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api route 1 operation typically these are written to a http.Request
+/* TaiwanTripBusAPIRoute1Params contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api route 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIRoute1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TaiwanTripName
- 台灣好行繁體中文路線名稱,如'黃金福隆線'
+ /* TaiwanTripName.
+
+ 台灣好行繁體中文路線名稱,如'黃金福隆線'
*/
TaiwanTripName string
@@ -114,6 +109,32 @@ type TaiwanTripBusAPIRoute1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRoute1Params) WithDefaults() *TaiwanTripBusAPIRoute1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRoute1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIRoute1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api route 1 params
func (o *TaiwanTripBusAPIRoute1Params) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIRoute1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TaiwanTripBusAPIRoute1Params) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -261,64 +284,68 @@ func (o *TaiwanTripBusAPIRoute1Params) WriteToRequest(r runtime.ClientRequest, r
// 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 TaiwanTripName
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_route1_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_route1_responses.go
index d2373ea3..8f57684f 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_route1_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_route1_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIRoute1Reader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIRoute1OK() *TaiwanTripBusAPIRoute1OK {
return &TaiwanTripBusAPIRoute1OK{}
}
-/*TaiwanTripBusAPIRoute1OK handles this case with default header values.
+/* TaiwanTripBusAPIRoute1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIRoute1OK struct {
func (o *TaiwanTripBusAPIRoute1OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/Route/TaiwanTrip/{TaiwanTripName}][%d] taiwanTripBusApiRoute1OK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIRoute1OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusRoute {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_route_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_route_parameters.go
index c8022760..e7ec9e09 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_route_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_route_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIRouteParams creates a new TaiwanTripBusAPIRouteParams object
-// with the default values initialized.
+// NewTaiwanTripBusAPIRouteParams creates a new TaiwanTripBusAPIRouteParams 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 NewTaiwanTripBusAPIRouteParams() *TaiwanTripBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIRouteParamsWithTimeout creates a new TaiwanTripBusAPIRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIRouteParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIRouteParamsWithContext creates a new TaiwanTripBusAPIRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIRouteParamsWithContext(ctx context.Context) *TaiwanTripBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIRouteParamsWithHTTPClient creates a new TaiwanTripBusAPIRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIRouteParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIRouteParams contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api route operation typically these are written to a http.Request
+/* TaiwanTripBusAPIRouteParams contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api route operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIRouteParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TaiwanTripBusAPIRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRouteParams) WithDefaults() *TaiwanTripBusAPIRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIRouteParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api route params
func (o *TaiwanTripBusAPIRouteParams) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIRouteParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TaiwanTripBusAPIRouteParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -245,64 +267,68 @@ func (o *TaiwanTripBusAPIRouteParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_route_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_route_responses.go
index d9b84038..48446cb4 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_route_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_route_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIRouteReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIRouteOK() *TaiwanTripBusAPIRouteOK {
return &TaiwanTripBusAPIRouteOK{}
}
-/*TaiwanTripBusAPIRouteOK handles this case with default header values.
+/* TaiwanTripBusAPIRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIRouteOK struct {
func (o *TaiwanTripBusAPIRouteOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/Route/TaiwanTrip][%d] taiwanTripBusApiRouteOK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIRouteOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusRoute {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_s2_travel_time_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_s2_travel_time_parameters.go
index b152a07f..cec6c38e 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_s2_travel_time_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_s2_travel_time_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIS2TravelTimeParams creates a new TaiwanTripBusAPIS2TravelTimeParams object
-// with the default values initialized.
+// NewTaiwanTripBusAPIS2TravelTimeParams creates a new TaiwanTripBusAPIS2TravelTimeParams 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 NewTaiwanTripBusAPIS2TravelTimeParams() *TaiwanTripBusAPIS2TravelTimeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIS2TravelTimeParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIS2TravelTimeParamsWithTimeout creates a new TaiwanTripBusAPIS2TravelTimeParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIS2TravelTimeParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIS2TravelTimeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIS2TravelTimeParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIS2TravelTimeParamsWithContext creates a new TaiwanTripBusAPIS2TravelTimeParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIS2TravelTimeParamsWithContext(ctx context.Context) *TaiwanTripBusAPIS2TravelTimeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIS2TravelTimeParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIS2TravelTimeParamsWithHTTPClient creates a new TaiwanTripBusAPIS2TravelTimeParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIS2TravelTimeParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIS2TravelTimeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIS2TravelTimeParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIS2TravelTimeParams contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api s2 travel time operation typically these are written to a http.Request
+/* TaiwanTripBusAPIS2TravelTimeParams contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api s2 travel time operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIS2TravelTimeParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TaiwanTripBusAPIS2TravelTimeParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api s2 travel time params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIS2TravelTimeParams) WithDefaults() *TaiwanTripBusAPIS2TravelTimeParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api s2 travel time params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIS2TravelTimeParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIS2TravelTimeParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api s2 travel time params
func (o *TaiwanTripBusAPIS2TravelTimeParams) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIS2TravelTimeParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TaiwanTripBusAPIS2TravelTimeParams) WriteToRequest(r runtime.ClientRequ
// 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
}
@@ -245,64 +267,68 @@ func (o *TaiwanTripBusAPIS2TravelTimeParams) WriteToRequest(r runtime.ClientRequ
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_s2_travel_time_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_s2_travel_time_responses.go
index 249d4818..33def78e 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_s2_travel_time_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_s2_travel_time_responses.go
@@ -29,7 +29,12 @@ func (o *TaiwanTripBusAPIS2TravelTimeReader) ReadResponse(response runtime.Clien
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTaiwanTripBusAPIS2TravelTimeNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTaiwanTripBusAPIS2TravelTimeOK() *TaiwanTripBusAPIS2TravelTimeOK {
return &TaiwanTripBusAPIS2TravelTimeOK{}
}
-/*TaiwanTripBusAPIS2TravelTimeOK handles this case with default header values.
+/* TaiwanTripBusAPIS2TravelTimeOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TaiwanTripBusAPIS2TravelTimeOK struct {
func (o *TaiwanTripBusAPIS2TravelTimeOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/S2TravelTime/TaiwanTrip][%d] taiwanTripBusApiS2TravelTimeOK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIS2TravelTimeOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusTaiwanTripS2STravelTime {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TaiwanTripBusAPIS2TravelTimeOK) readResponse(response runtime.ClientRes
return nil
}
+
+// NewTaiwanTripBusAPIS2TravelTimeNotModified creates a TaiwanTripBusAPIS2TravelTimeNotModified with default headers values
+func NewTaiwanTripBusAPIS2TravelTimeNotModified() *TaiwanTripBusAPIS2TravelTimeNotModified {
+ return &TaiwanTripBusAPIS2TravelTimeNotModified{}
+}
+
+/* TaiwanTripBusAPIS2TravelTimeNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TaiwanTripBusAPIS2TravelTimeNotModified struct {
+}
+
+func (o *TaiwanTripBusAPIS2TravelTimeNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/Bus/S2TravelTime/TaiwanTrip][%d] taiwanTripBusApiS2TravelTimeNotModified ", 304)
+}
+
+func (o *TaiwanTripBusAPIS2TravelTimeNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule1_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule1_parameters.go
index ea9415d4..8e1ca460 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule1_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPISchedule1Params creates a new TaiwanTripBusAPISchedule1Params object
-// with the default values initialized.
+// NewTaiwanTripBusAPISchedule1Params creates a new TaiwanTripBusAPISchedule1Params 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 NewTaiwanTripBusAPISchedule1Params() *TaiwanTripBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPISchedule1ParamsWithTimeout creates a new TaiwanTripBusAPISchedule1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPISchedule1ParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPISchedule1ParamsWithContext creates a new TaiwanTripBusAPISchedule1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPISchedule1ParamsWithContext(ctx context.Context) *TaiwanTripBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPISchedule1ParamsWithHTTPClient creates a new TaiwanTripBusAPISchedule1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPISchedule1ParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPISchedule1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPISchedule1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPISchedule1Params contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api schedule 1 operation typically these are written to a http.Request
+/* TaiwanTripBusAPISchedule1Params contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api schedule 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPISchedule1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TaiwanTripName
- 台灣好行繁體中文路線名稱,如'黃金福隆線'
+ /* TaiwanTripName.
+
+ 台灣好行繁體中文路線名稱,如'黃金福隆線'
*/
TaiwanTripName string
@@ -114,6 +109,32 @@ type TaiwanTripBusAPISchedule1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api schedule 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPISchedule1Params) WithDefaults() *TaiwanTripBusAPISchedule1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api schedule 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPISchedule1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPISchedule1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api schedule 1 params
func (o *TaiwanTripBusAPISchedule1Params) WithTimeout(timeout time.Duration) *TaiwanTripBusAPISchedule1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TaiwanTripBusAPISchedule1Params) WriteToRequest(r runtime.ClientRequest
// 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
}
@@ -261,64 +284,68 @@ func (o *TaiwanTripBusAPISchedule1Params) WriteToRequest(r runtime.ClientRequest
// 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 TaiwanTripName
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule1_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule1_responses.go
index ced5fe31..b201d615 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule1_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule1_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPISchedule1Reader) ReadResponse(response runtime.ClientRe
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPISchedule1OK() *TaiwanTripBusAPISchedule1OK {
return &TaiwanTripBusAPISchedule1OK{}
}
-/*TaiwanTripBusAPISchedule1OK handles this case with default header values.
+/* TaiwanTripBusAPISchedule1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPISchedule1OK struct {
func (o *TaiwanTripBusAPISchedule1OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/Schedule/TaiwanTrip/{TaiwanTripName}][%d] taiwanTripBusApiSchedule1OK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPISchedule1OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusSchedule {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule_parameters.go
index d80ef148..e80f382b 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIScheduleParams creates a new TaiwanTripBusAPIScheduleParams object
-// with the default values initialized.
+// NewTaiwanTripBusAPIScheduleParams creates a new TaiwanTripBusAPIScheduleParams 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 NewTaiwanTripBusAPIScheduleParams() *TaiwanTripBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIScheduleParamsWithTimeout creates a new TaiwanTripBusAPIScheduleParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIScheduleParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIScheduleParamsWithContext creates a new TaiwanTripBusAPIScheduleParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIScheduleParamsWithContext(ctx context.Context) *TaiwanTripBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIScheduleParamsWithHTTPClient creates a new TaiwanTripBusAPIScheduleParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIScheduleParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIScheduleParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIScheduleParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIScheduleParams contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api schedule operation typically these are written to a http.Request
+/* TaiwanTripBusAPIScheduleParams contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api schedule operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIScheduleParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TaiwanTripBusAPIScheduleParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api schedule params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIScheduleParams) WithDefaults() *TaiwanTripBusAPIScheduleParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api schedule params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIScheduleParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIScheduleParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api schedule params
func (o *TaiwanTripBusAPIScheduleParams) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIScheduleParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TaiwanTripBusAPIScheduleParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
@@ -245,64 +267,68 @@ func (o *TaiwanTripBusAPIScheduleParams) WriteToRequest(r runtime.ClientRequest,
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule_responses.go
index 7dcdee4c..25903f2a 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_schedule_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIScheduleReader) ReadResponse(response runtime.ClientRes
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIScheduleOK() *TaiwanTripBusAPIScheduleOK {
return &TaiwanTripBusAPIScheduleOK{}
}
-/*TaiwanTripBusAPIScheduleOK handles this case with default header values.
+/* TaiwanTripBusAPIScheduleOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIScheduleOK struct {
func (o *TaiwanTripBusAPIScheduleOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/Schedule/TaiwanTrip][%d] taiwanTripBusApiScheduleOK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIScheduleOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusSchedule {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_shape1_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_shape1_parameters.go
index cf424cb4..2fb98e16 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_shape1_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_shape1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIShape1Params creates a new TaiwanTripBusAPIShape1Params object
-// with the default values initialized.
+// NewTaiwanTripBusAPIShape1Params creates a new TaiwanTripBusAPIShape1Params 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 NewTaiwanTripBusAPIShape1Params() *TaiwanTripBusAPIShape1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIShape1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIShape1ParamsWithTimeout creates a new TaiwanTripBusAPIShape1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIShape1ParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIShape1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIShape1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIShape1ParamsWithContext creates a new TaiwanTripBusAPIShape1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIShape1ParamsWithContext(ctx context.Context) *TaiwanTripBusAPIShape1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIShape1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIShape1ParamsWithHTTPClient creates a new TaiwanTripBusAPIShape1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIShape1ParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIShape1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIShape1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIShape1Params contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api shape 1 operation typically these are written to a http.Request
+/* TaiwanTripBusAPIShape1Params contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api shape 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIShape1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TaiwanTripName
- 台灣好行繁體中文路線名稱,如'黃金福隆線'
+ /* TaiwanTripName.
+
+ 台灣好行繁體中文路線名稱,如'黃金福隆線'
*/
TaiwanTripName string
@@ -114,6 +109,32 @@ type TaiwanTripBusAPIShape1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api shape 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIShape1Params) WithDefaults() *TaiwanTripBusAPIShape1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api shape 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIShape1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIShape1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api shape 1 params
func (o *TaiwanTripBusAPIShape1Params) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIShape1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TaiwanTripBusAPIShape1Params) WriteToRequest(r runtime.ClientRequest, r
// 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
}
@@ -261,64 +284,68 @@ func (o *TaiwanTripBusAPIShape1Params) WriteToRequest(r runtime.ClientRequest, r
// 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 TaiwanTripName
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_shape1_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_shape1_responses.go
index 2f249c48..b7ebe1a4 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_shape1_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_shape1_responses.go
@@ -29,7 +29,12 @@ func (o *TaiwanTripBusAPIShape1Reader) ReadResponse(response runtime.ClientRespo
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTaiwanTripBusAPIShape1NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTaiwanTripBusAPIShape1OK() *TaiwanTripBusAPIShape1OK {
return &TaiwanTripBusAPIShape1OK{}
}
-/*TaiwanTripBusAPIShape1OK handles this case with default header values.
+/* TaiwanTripBusAPIShape1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TaiwanTripBusAPIShape1OK struct {
func (o *TaiwanTripBusAPIShape1OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/Shape/TaiwanTrip/{TaiwanTripName}][%d] taiwanTripBusApiShape1OK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIShape1OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusTaiwanTripShape {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TaiwanTripBusAPIShape1OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTaiwanTripBusAPIShape1NotModified creates a TaiwanTripBusAPIShape1NotModified with default headers values
+func NewTaiwanTripBusAPIShape1NotModified() *TaiwanTripBusAPIShape1NotModified {
+ return &TaiwanTripBusAPIShape1NotModified{}
+}
+
+/* TaiwanTripBusAPIShape1NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TaiwanTripBusAPIShape1NotModified struct {
+}
+
+func (o *TaiwanTripBusAPIShape1NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/Bus/Shape/TaiwanTrip/{TaiwanTripName}][%d] taiwanTripBusApiShape1NotModified ", 304)
+}
+
+func (o *TaiwanTripBusAPIShape1NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_shape_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_shape_parameters.go
index a5ee4b88..7459ffc1 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_shape_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_shape_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIShapeParams creates a new TaiwanTripBusAPIShapeParams object
-// with the default values initialized.
+// NewTaiwanTripBusAPIShapeParams creates a new TaiwanTripBusAPIShapeParams 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 NewTaiwanTripBusAPIShapeParams() *TaiwanTripBusAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIShapeParamsWithTimeout creates a new TaiwanTripBusAPIShapeParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIShapeParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIShapeParamsWithContext creates a new TaiwanTripBusAPIShapeParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIShapeParamsWithContext(ctx context.Context) *TaiwanTripBusAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIShapeParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIShapeParamsWithHTTPClient creates a new TaiwanTripBusAPIShapeParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIShapeParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIShapeParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIShapeParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIShapeParams contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api shape operation typically these are written to a http.Request
+/* TaiwanTripBusAPIShapeParams contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api shape operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIShapeParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TaiwanTripBusAPIShapeParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIShapeParams) WithDefaults() *TaiwanTripBusAPIShapeParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api shape params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIShapeParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIShapeParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api shape params
func (o *TaiwanTripBusAPIShapeParams) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIShapeParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TaiwanTripBusAPIShapeParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -245,64 +267,68 @@ func (o *TaiwanTripBusAPIShapeParams) WriteToRequest(r runtime.ClientRequest, re
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_shape_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_shape_responses.go
index f2581cf8..e66cdb8b 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_shape_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_shape_responses.go
@@ -29,7 +29,12 @@ func (o *TaiwanTripBusAPIShapeReader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTaiwanTripBusAPIShapeNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTaiwanTripBusAPIShapeOK() *TaiwanTripBusAPIShapeOK {
return &TaiwanTripBusAPIShapeOK{}
}
-/*TaiwanTripBusAPIShapeOK handles this case with default header values.
+/* TaiwanTripBusAPIShapeOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TaiwanTripBusAPIShapeOK struct {
func (o *TaiwanTripBusAPIShapeOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/Shape/TaiwanTrip][%d] taiwanTripBusApiShapeOK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIShapeOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusTaiwanTripShape {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TaiwanTripBusAPIShapeOK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTaiwanTripBusAPIShapeNotModified creates a TaiwanTripBusAPIShapeNotModified with default headers values
+func NewTaiwanTripBusAPIShapeNotModified() *TaiwanTripBusAPIShapeNotModified {
+ return &TaiwanTripBusAPIShapeNotModified{}
+}
+
+/* TaiwanTripBusAPIShapeNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TaiwanTripBusAPIShapeNotModified struct {
+}
+
+func (o *TaiwanTripBusAPIShapeNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/Bus/Shape/TaiwanTrip][%d] taiwanTripBusApiShapeNotModified ", 304)
+}
+
+func (o *TaiwanTripBusAPIShapeNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route1_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route1_parameters.go
index 562116e7..1a7418a0 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route1_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route1_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIStopOfRoute1Params creates a new TaiwanTripBusAPIStopOfRoute1Params object
-// with the default values initialized.
+// NewTaiwanTripBusAPIStopOfRoute1Params creates a new TaiwanTripBusAPIStopOfRoute1Params 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 NewTaiwanTripBusAPIStopOfRoute1Params() *TaiwanTripBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIStopOfRoute1ParamsWithTimeout creates a new TaiwanTripBusAPIStopOfRoute1Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIStopOfRoute1ParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIStopOfRoute1ParamsWithContext creates a new TaiwanTripBusAPIStopOfRoute1Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIStopOfRoute1ParamsWithContext(ctx context.Context) *TaiwanTripBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIStopOfRoute1ParamsWithHTTPClient creates a new TaiwanTripBusAPIStopOfRoute1Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIStopOfRoute1ParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIStopOfRoute1Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIStopOfRoute1Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIStopOfRoute1Params contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api stop of route 1 operation typically these are written to a http.Request
+/* TaiwanTripBusAPIStopOfRoute1Params contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api stop of route 1 operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIStopOfRoute1Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*TaiwanTripName
- 台灣好行繁體中文路線名稱,如'黃金福隆線'
+ /* TaiwanTripName.
+
+ 台灣好行繁體中文路線名稱,如'黃金福隆線'
*/
TaiwanTripName string
@@ -114,6 +109,32 @@ type TaiwanTripBusAPIStopOfRoute1Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api stop of route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIStopOfRoute1Params) WithDefaults() *TaiwanTripBusAPIStopOfRoute1Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api stop of route 1 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIStopOfRoute1Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIStopOfRoute1Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api stop of route 1 params
func (o *TaiwanTripBusAPIStopOfRoute1Params) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIStopOfRoute1Params {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TaiwanTripBusAPIStopOfRoute1Params) WriteToRequest(r runtime.ClientRequ
// 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
}
@@ -261,64 +284,68 @@ func (o *TaiwanTripBusAPIStopOfRoute1Params) WriteToRequest(r runtime.ClientRequ
// 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 TaiwanTripName
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route1_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route1_responses.go
index 250c2253..e00394e6 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route1_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route1_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIStopOfRoute1Reader) ReadResponse(response runtime.Clien
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIStopOfRoute1OK() *TaiwanTripBusAPIStopOfRoute1OK {
return &TaiwanTripBusAPIStopOfRoute1OK{}
}
-/*TaiwanTripBusAPIStopOfRoute1OK handles this case with default header values.
+/* TaiwanTripBusAPIStopOfRoute1OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIStopOfRoute1OK struct {
func (o *TaiwanTripBusAPIStopOfRoute1OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/StopOfRoute/TaiwanTrip/{TaiwanTripName}][%d] taiwanTripBusApiStopOfRoute1OK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIStopOfRoute1OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusStopOfRoute {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route_parameters.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route_parameters.go
index f9a825eb..08fa509c 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route_parameters.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route_parameters.go
@@ -17,90 +17,84 @@ import (
"github.com/go-openapi/swag"
)
-// NewTaiwanTripBusAPIStopOfRouteParams creates a new TaiwanTripBusAPIStopOfRouteParams object
-// with the default values initialized.
+// NewTaiwanTripBusAPIStopOfRouteParams creates a new TaiwanTripBusAPIStopOfRouteParams 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 NewTaiwanTripBusAPIStopOfRouteParams() *TaiwanTripBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTaiwanTripBusAPIStopOfRouteParamsWithTimeout creates a new TaiwanTripBusAPIStopOfRouteParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTaiwanTripBusAPIStopOfRouteParamsWithTimeout(timeout time.Duration) *TaiwanTripBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTaiwanTripBusAPIStopOfRouteParamsWithContext creates a new TaiwanTripBusAPIStopOfRouteParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTaiwanTripBusAPIStopOfRouteParamsWithContext(ctx context.Context) *TaiwanTripBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTaiwanTripBusAPIStopOfRouteParamsWithHTTPClient creates a new TaiwanTripBusAPIStopOfRouteParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTaiwanTripBusAPIStopOfRouteParamsWithHTTPClient(client *http.Client) *TaiwanTripBusAPIStopOfRouteParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TaiwanTripBusAPIStopOfRouteParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TaiwanTripBusAPIStopOfRouteParams contains all the parameters to send to the API endpoint
-for the taiwan trip bus Api stop of route operation typically these are written to a http.Request
+/* TaiwanTripBusAPIStopOfRouteParams contains all the parameters to send to the API endpoint
+ for the taiwan trip bus Api stop of route operation.
+
+ Typically these are written to a http.Request.
*/
type TaiwanTripBusAPIStopOfRouteParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -109,6 +103,32 @@ type TaiwanTripBusAPIStopOfRouteParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the taiwan trip bus Api stop of route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIStopOfRouteParams) WithDefaults() *TaiwanTripBusAPIStopOfRouteParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the taiwan trip bus Api stop of route params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TaiwanTripBusAPIStopOfRouteParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TaiwanTripBusAPIStopOfRouteParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the taiwan trip bus Api stop of route params
func (o *TaiwanTripBusAPIStopOfRouteParams) WithTimeout(timeout time.Duration) *TaiwanTripBusAPIStopOfRouteParams {
o.SetTimeout(timeout)
@@ -220,22 +240,24 @@ func (o *TaiwanTripBusAPIStopOfRouteParams) WriteToRequest(r runtime.ClientReque
// 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
}
@@ -245,64 +267,68 @@ func (o *TaiwanTripBusAPIStopOfRouteParams) WriteToRequest(r runtime.ClientReque
// 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route_responses.go b/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route_responses.go
index c4b1fd95..fb0b96fe 100644
--- a/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route_responses.go
+++ b/tourism/v2/client/tourism/taiwan_trip_bus_api_stop_of_route_responses.go
@@ -29,7 +29,6 @@ func (o *TaiwanTripBusAPIStopOfRouteReader) ReadResponse(response runtime.Client
return nil, err
}
return result, nil
-
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())
}
@@ -40,7 +39,7 @@ func NewTaiwanTripBusAPIStopOfRouteOK() *TaiwanTripBusAPIStopOfRouteOK {
return &TaiwanTripBusAPIStopOfRouteOK{}
}
-/*TaiwanTripBusAPIStopOfRouteOK handles this case with default header values.
+/* TaiwanTripBusAPIStopOfRouteOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +50,6 @@ type TaiwanTripBusAPIStopOfRouteOK struct {
func (o *TaiwanTripBusAPIStopOfRouteOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Bus/StopOfRoute/TaiwanTrip][%d] taiwanTripBusApiStopOfRouteOK %+v", 200, o.Payload)
}
-
func (o *TaiwanTripBusAPIStopOfRouteOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2BusStopOfRoute {
return o.Payload
}
diff --git a/tourism/v2/client/tourism/tourism_api_activity0_parameters.go b/tourism/v2/client/tourism/tourism_api_activity0_parameters.go
index 3956832b..2929575f 100644
--- a/tourism/v2/client/tourism/tourism_api_activity0_parameters.go
+++ b/tourism/v2/client/tourism/tourism_api_activity0_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTourismAPIActivity0Params creates a new TourismAPIActivity0Params object
-// with the default values initialized.
+// NewTourismAPIActivity0Params creates a new TourismAPIActivity0Params 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 NewTourismAPIActivity0Params() *TourismAPIActivity0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIActivity0Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTourismAPIActivity0ParamsWithTimeout creates a new TourismAPIActivity0Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTourismAPIActivity0ParamsWithTimeout(timeout time.Duration) *TourismAPIActivity0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIActivity0Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTourismAPIActivity0ParamsWithContext creates a new TourismAPIActivity0Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTourismAPIActivity0ParamsWithContext(ctx context.Context) *TourismAPIActivity0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIActivity0Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTourismAPIActivity0ParamsWithHTTPClient creates a new TourismAPIActivity0Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTourismAPIActivity0ParamsWithHTTPClient(client *http.Client) *TourismAPIActivity0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIActivity0Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TourismAPIActivity0Params contains all the parameters to send to the API endpoint
-for the tourism Api activity 0 operation typically these are written to a http.Request
+/* TourismAPIActivity0Params contains all the parameters to send to the API endpoint
+ for the tourism Api activity 0 operation.
+
+ Typically these are written to a http.Request.
*/
type TourismAPIActivity0Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市名稱
+ /* City.
+
+ 縣市名稱
*/
City string
@@ -119,6 +115,32 @@ type TourismAPIActivity0Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the tourism Api activity 0 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIActivity0Params) WithDefaults() *TourismAPIActivity0Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the tourism Api activity 0 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIActivity0Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TourismAPIActivity0Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the tourism Api activity 0 params
func (o *TourismAPIActivity0Params) WithTimeout(timeout time.Duration) *TourismAPIActivity0Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *TourismAPIActivity0Params) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -277,80 +301,85 @@ func (o *TourismAPIActivity0Params) WriteToRequest(r runtime.ClientRequest, reg
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
diff --git a/tourism/v2/client/tourism/tourism_api_activity0_responses.go b/tourism/v2/client/tourism/tourism_api_activity0_responses.go
index fcae5803..12023846 100644
--- a/tourism/v2/client/tourism/tourism_api_activity0_responses.go
+++ b/tourism/v2/client/tourism/tourism_api_activity0_responses.go
@@ -29,7 +29,12 @@ func (o *TourismAPIActivity0Reader) ReadResponse(response runtime.ClientResponse
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTourismAPIActivity0NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTourismAPIActivity0OK() *TourismAPIActivity0OK {
return &TourismAPIActivity0OK{}
}
-/*TourismAPIActivity0OK handles this case with default header values.
+/* TourismAPIActivity0OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TourismAPIActivity0OK struct {
func (o *TourismAPIActivity0OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Activity/{City}][%d] tourismApiActivity0OK %+v", 200, o.Payload)
}
-
func (o *TourismAPIActivity0OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2ActivityTourismInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TourismAPIActivity0OK) readResponse(response runtime.ClientResponse, co
return nil
}
+
+// NewTourismAPIActivity0NotModified creates a TourismAPIActivity0NotModified with default headers values
+func NewTourismAPIActivity0NotModified() *TourismAPIActivity0NotModified {
+ return &TourismAPIActivity0NotModified{}
+}
+
+/* TourismAPIActivity0NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TourismAPIActivity0NotModified struct {
+}
+
+func (o *TourismAPIActivity0NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/Activity/{City}][%d] tourismApiActivity0NotModified ", 304)
+}
+
+func (o *TourismAPIActivity0NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/tourism_api_activity_parameters.go b/tourism/v2/client/tourism/tourism_api_activity_parameters.go
index 4c85fb64..3e892cb1 100644
--- a/tourism/v2/client/tourism/tourism_api_activity_parameters.go
+++ b/tourism/v2/client/tourism/tourism_api_activity_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTourismAPIActivityParams creates a new TourismAPIActivityParams object
-// with the default values initialized.
+// NewTourismAPIActivityParams creates a new TourismAPIActivityParams 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 NewTourismAPIActivityParams() *TourismAPIActivityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIActivityParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTourismAPIActivityParamsWithTimeout creates a new TourismAPIActivityParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTourismAPIActivityParamsWithTimeout(timeout time.Duration) *TourismAPIActivityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIActivityParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTourismAPIActivityParamsWithContext creates a new TourismAPIActivityParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTourismAPIActivityParamsWithContext(ctx context.Context) *TourismAPIActivityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIActivityParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTourismAPIActivityParamsWithHTTPClient creates a new TourismAPIActivityParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTourismAPIActivityParamsWithHTTPClient(client *http.Client) *TourismAPIActivityParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIActivityParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TourismAPIActivityParams contains all the parameters to send to the API endpoint
-for the tourism Api activity operation typically these are written to a http.Request
+/* TourismAPIActivityParams contains all the parameters to send to the API endpoint
+ for the tourism Api activity operation.
+
+ Typically these are written to a http.Request.
*/
type TourismAPIActivityParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type TourismAPIActivityParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the tourism Api activity params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIActivityParams) WithDefaults() *TourismAPIActivityParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the tourism Api activity params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIActivityParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TourismAPIActivityParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the tourism Api activity params
func (o *TourismAPIActivityParams) WithTimeout(timeout time.Duration) *TourismAPIActivityParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TourismAPIActivityParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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
}
@@ -261,80 +284,85 @@ func (o *TourismAPIActivityParams) WriteToRequest(r runtime.ClientRequest, reg s
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/tourism_api_activity_responses.go b/tourism/v2/client/tourism/tourism_api_activity_responses.go
index dc40a120..b5168551 100644
--- a/tourism/v2/client/tourism/tourism_api_activity_responses.go
+++ b/tourism/v2/client/tourism/tourism_api_activity_responses.go
@@ -29,7 +29,12 @@ func (o *TourismAPIActivityReader) ReadResponse(response runtime.ClientResponse,
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTourismAPIActivityNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTourismAPIActivityOK() *TourismAPIActivityOK {
return &TourismAPIActivityOK{}
}
-/*TourismAPIActivityOK handles this case with default header values.
+/* TourismAPIActivityOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TourismAPIActivityOK struct {
func (o *TourismAPIActivityOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Activity][%d] tourismApiActivityOK %+v", 200, o.Payload)
}
-
func (o *TourismAPIActivityOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2ActivityTourismInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TourismAPIActivityOK) readResponse(response runtime.ClientResponse, con
return nil
}
+
+// NewTourismAPIActivityNotModified creates a TourismAPIActivityNotModified with default headers values
+func NewTourismAPIActivityNotModified() *TourismAPIActivityNotModified {
+ return &TourismAPIActivityNotModified{}
+}
+
+/* TourismAPIActivityNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TourismAPIActivityNotModified struct {
+}
+
+func (o *TourismAPIActivityNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/Activity][%d] tourismApiActivityNotModified ", 304)
+}
+
+func (o *TourismAPIActivityNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/tourism_api_hotel0_parameters.go b/tourism/v2/client/tourism/tourism_api_hotel0_parameters.go
index 573330d6..3ccd3ef9 100644
--- a/tourism/v2/client/tourism/tourism_api_hotel0_parameters.go
+++ b/tourism/v2/client/tourism/tourism_api_hotel0_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTourismAPIHotel0Params creates a new TourismAPIHotel0Params object
-// with the default values initialized.
+// NewTourismAPIHotel0Params creates a new TourismAPIHotel0Params 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 NewTourismAPIHotel0Params() *TourismAPIHotel0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIHotel0Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTourismAPIHotel0ParamsWithTimeout creates a new TourismAPIHotel0Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTourismAPIHotel0ParamsWithTimeout(timeout time.Duration) *TourismAPIHotel0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIHotel0Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTourismAPIHotel0ParamsWithContext creates a new TourismAPIHotel0Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTourismAPIHotel0ParamsWithContext(ctx context.Context) *TourismAPIHotel0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIHotel0Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTourismAPIHotel0ParamsWithHTTPClient creates a new TourismAPIHotel0Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTourismAPIHotel0ParamsWithHTTPClient(client *http.Client) *TourismAPIHotel0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIHotel0Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TourismAPIHotel0Params contains all the parameters to send to the API endpoint
-for the tourism Api hotel 0 operation typically these are written to a http.Request
+/* TourismAPIHotel0Params contains all the parameters to send to the API endpoint
+ for the tourism Api hotel 0 operation.
+
+ Typically these are written to a http.Request.
*/
type TourismAPIHotel0Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市名稱
+ /* City.
+
+ 縣市名稱
*/
City string
@@ -119,6 +115,32 @@ type TourismAPIHotel0Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the tourism Api hotel 0 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIHotel0Params) WithDefaults() *TourismAPIHotel0Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the tourism Api hotel 0 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIHotel0Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TourismAPIHotel0Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the tourism Api hotel 0 params
func (o *TourismAPIHotel0Params) WithTimeout(timeout time.Duration) *TourismAPIHotel0Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *TourismAPIHotel0Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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
}
@@ -277,80 +301,85 @@ func (o *TourismAPIHotel0Params) WriteToRequest(r runtime.ClientRequest, reg str
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
diff --git a/tourism/v2/client/tourism/tourism_api_hotel0_responses.go b/tourism/v2/client/tourism/tourism_api_hotel0_responses.go
index ec802f3e..e4ed81a5 100644
--- a/tourism/v2/client/tourism/tourism_api_hotel0_responses.go
+++ b/tourism/v2/client/tourism/tourism_api_hotel0_responses.go
@@ -29,7 +29,12 @@ func (o *TourismAPIHotel0Reader) ReadResponse(response runtime.ClientResponse, c
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTourismAPIHotel0NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTourismAPIHotel0OK() *TourismAPIHotel0OK {
return &TourismAPIHotel0OK{}
}
-/*TourismAPIHotel0OK handles this case with default header values.
+/* TourismAPIHotel0OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TourismAPIHotel0OK struct {
func (o *TourismAPIHotel0OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Hotel/{City}][%d] tourismApiHotel0OK %+v", 200, o.Payload)
}
-
func (o *TourismAPIHotel0OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2HotelTourismInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TourismAPIHotel0OK) readResponse(response runtime.ClientResponse, consu
return nil
}
+
+// NewTourismAPIHotel0NotModified creates a TourismAPIHotel0NotModified with default headers values
+func NewTourismAPIHotel0NotModified() *TourismAPIHotel0NotModified {
+ return &TourismAPIHotel0NotModified{}
+}
+
+/* TourismAPIHotel0NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TourismAPIHotel0NotModified struct {
+}
+
+func (o *TourismAPIHotel0NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/Hotel/{City}][%d] tourismApiHotel0NotModified ", 304)
+}
+
+func (o *TourismAPIHotel0NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/tourism_api_hotel_parameters.go b/tourism/v2/client/tourism/tourism_api_hotel_parameters.go
index c9fe82a4..cc11d499 100644
--- a/tourism/v2/client/tourism/tourism_api_hotel_parameters.go
+++ b/tourism/v2/client/tourism/tourism_api_hotel_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTourismAPIHotelParams creates a new TourismAPIHotelParams object
-// with the default values initialized.
+// NewTourismAPIHotelParams creates a new TourismAPIHotelParams 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 NewTourismAPIHotelParams() *TourismAPIHotelParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIHotelParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTourismAPIHotelParamsWithTimeout creates a new TourismAPIHotelParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTourismAPIHotelParamsWithTimeout(timeout time.Duration) *TourismAPIHotelParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIHotelParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTourismAPIHotelParamsWithContext creates a new TourismAPIHotelParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTourismAPIHotelParamsWithContext(ctx context.Context) *TourismAPIHotelParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIHotelParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTourismAPIHotelParamsWithHTTPClient creates a new TourismAPIHotelParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTourismAPIHotelParamsWithHTTPClient(client *http.Client) *TourismAPIHotelParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIHotelParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TourismAPIHotelParams contains all the parameters to send to the API endpoint
-for the tourism Api hotel operation typically these are written to a http.Request
+/* TourismAPIHotelParams contains all the parameters to send to the API endpoint
+ for the tourism Api hotel operation.
+
+ Typically these are written to a http.Request.
*/
type TourismAPIHotelParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type TourismAPIHotelParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the tourism Api hotel params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIHotelParams) WithDefaults() *TourismAPIHotelParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the tourism Api hotel params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIHotelParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TourismAPIHotelParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the tourism Api hotel params
func (o *TourismAPIHotelParams) WithTimeout(timeout time.Duration) *TourismAPIHotelParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TourismAPIHotelParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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
}
@@ -261,80 +284,85 @@ func (o *TourismAPIHotelParams) WriteToRequest(r runtime.ClientRequest, reg strf
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/tourism_api_hotel_responses.go b/tourism/v2/client/tourism/tourism_api_hotel_responses.go
index 2163b098..d9b03c5a 100644
--- a/tourism/v2/client/tourism/tourism_api_hotel_responses.go
+++ b/tourism/v2/client/tourism/tourism_api_hotel_responses.go
@@ -29,7 +29,12 @@ func (o *TourismAPIHotelReader) ReadResponse(response runtime.ClientResponse, co
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTourismAPIHotelNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTourismAPIHotelOK() *TourismAPIHotelOK {
return &TourismAPIHotelOK{}
}
-/*TourismAPIHotelOK handles this case with default header values.
+/* TourismAPIHotelOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TourismAPIHotelOK struct {
func (o *TourismAPIHotelOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Hotel][%d] tourismApiHotelOK %+v", 200, o.Payload)
}
-
func (o *TourismAPIHotelOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2HotelTourismInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TourismAPIHotelOK) readResponse(response runtime.ClientResponse, consum
return nil
}
+
+// NewTourismAPIHotelNotModified creates a TourismAPIHotelNotModified with default headers values
+func NewTourismAPIHotelNotModified() *TourismAPIHotelNotModified {
+ return &TourismAPIHotelNotModified{}
+}
+
+/* TourismAPIHotelNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TourismAPIHotelNotModified struct {
+}
+
+func (o *TourismAPIHotelNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/Hotel][%d] tourismApiHotelNotModified ", 304)
+}
+
+func (o *TourismAPIHotelNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/tourism_api_restaurant0_parameters.go b/tourism/v2/client/tourism/tourism_api_restaurant0_parameters.go
index 331320d7..097926c1 100644
--- a/tourism/v2/client/tourism/tourism_api_restaurant0_parameters.go
+++ b/tourism/v2/client/tourism/tourism_api_restaurant0_parameters.go
@@ -17,100 +17,96 @@ import (
"github.com/go-openapi/swag"
)
-// NewTourismAPIRestaurant0Params creates a new TourismAPIRestaurant0Params object
-// with the default values initialized.
+// NewTourismAPIRestaurant0Params creates a new TourismAPIRestaurant0Params 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 NewTourismAPIRestaurant0Params() *TourismAPIRestaurant0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIRestaurant0Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTourismAPIRestaurant0ParamsWithTimeout creates a new TourismAPIRestaurant0Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTourismAPIRestaurant0ParamsWithTimeout(timeout time.Duration) *TourismAPIRestaurant0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIRestaurant0Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTourismAPIRestaurant0ParamsWithContext creates a new TourismAPIRestaurant0Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTourismAPIRestaurant0ParamsWithContext(ctx context.Context) *TourismAPIRestaurant0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIRestaurant0Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTourismAPIRestaurant0ParamsWithHTTPClient creates a new TourismAPIRestaurant0Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTourismAPIRestaurant0ParamsWithHTTPClient(client *http.Client) *TourismAPIRestaurant0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIRestaurant0Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TourismAPIRestaurant0Params contains all the parameters to send to the API endpoint
-for the tourism Api restaurant 0 operation typically these are written to a http.Request
+/* TourismAPIRestaurant0Params contains all the parameters to send to the API endpoint
+ for the tourism Api restaurant 0 operation.
+
+ Typically these are written to a http.Request.
*/
type TourismAPIRestaurant0Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City
- 縣市名稱
+ /* City.
+
+ 縣市名稱
*/
City string
@@ -119,6 +115,32 @@ type TourismAPIRestaurant0Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the tourism Api restaurant 0 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIRestaurant0Params) WithDefaults() *TourismAPIRestaurant0Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the tourism Api restaurant 0 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIRestaurant0Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TourismAPIRestaurant0Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the tourism Api restaurant 0 params
func (o *TourismAPIRestaurant0Params) WithTimeout(timeout time.Duration) *TourismAPIRestaurant0Params {
o.SetTimeout(timeout)
@@ -252,22 +274,24 @@ func (o *TourismAPIRestaurant0Params) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -277,80 +301,85 @@ func (o *TourismAPIRestaurant0Params) WriteToRequest(r runtime.ClientRequest, re
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
diff --git a/tourism/v2/client/tourism/tourism_api_restaurant0_responses.go b/tourism/v2/client/tourism/tourism_api_restaurant0_responses.go
index 19e80dca..6b6453b2 100644
--- a/tourism/v2/client/tourism/tourism_api_restaurant0_responses.go
+++ b/tourism/v2/client/tourism/tourism_api_restaurant0_responses.go
@@ -29,7 +29,12 @@ func (o *TourismAPIRestaurant0Reader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTourismAPIRestaurant0NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTourismAPIRestaurant0OK() *TourismAPIRestaurant0OK {
return &TourismAPIRestaurant0OK{}
}
-/*TourismAPIRestaurant0OK handles this case with default header values.
+/* TourismAPIRestaurant0OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TourismAPIRestaurant0OK struct {
func (o *TourismAPIRestaurant0OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Restaurant/{City}][%d] tourismApiRestaurant0OK %+v", 200, o.Payload)
}
-
func (o *TourismAPIRestaurant0OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TourismAPIRestaurant0OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTourismAPIRestaurant0NotModified creates a TourismAPIRestaurant0NotModified with default headers values
+func NewTourismAPIRestaurant0NotModified() *TourismAPIRestaurant0NotModified {
+ return &TourismAPIRestaurant0NotModified{}
+}
+
+/* TourismAPIRestaurant0NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TourismAPIRestaurant0NotModified struct {
+}
+
+func (o *TourismAPIRestaurant0NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/Restaurant/{City}][%d] tourismApiRestaurant0NotModified ", 304)
+}
+
+func (o *TourismAPIRestaurant0NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/tourism_api_restaurant_parameters.go b/tourism/v2/client/tourism/tourism_api_restaurant_parameters.go
index 8baeb38a..1e42f1d8 100644
--- a/tourism/v2/client/tourism/tourism_api_restaurant_parameters.go
+++ b/tourism/v2/client/tourism/tourism_api_restaurant_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTourismAPIRestaurantParams creates a new TourismAPIRestaurantParams object
-// with the default values initialized.
+// NewTourismAPIRestaurantParams creates a new TourismAPIRestaurantParams 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 NewTourismAPIRestaurantParams() *TourismAPIRestaurantParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIRestaurantParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTourismAPIRestaurantParamsWithTimeout creates a new TourismAPIRestaurantParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTourismAPIRestaurantParamsWithTimeout(timeout time.Duration) *TourismAPIRestaurantParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIRestaurantParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTourismAPIRestaurantParamsWithContext creates a new TourismAPIRestaurantParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTourismAPIRestaurantParamsWithContext(ctx context.Context) *TourismAPIRestaurantParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIRestaurantParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTourismAPIRestaurantParamsWithHTTPClient creates a new TourismAPIRestaurantParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTourismAPIRestaurantParamsWithHTTPClient(client *http.Client) *TourismAPIRestaurantParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIRestaurantParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TourismAPIRestaurantParams contains all the parameters to send to the API endpoint
-for the tourism Api restaurant operation typically these are written to a http.Request
+/* TourismAPIRestaurantParams contains all the parameters to send to the API endpoint
+ for the tourism Api restaurant operation.
+
+ Typically these are written to a http.Request.
*/
type TourismAPIRestaurantParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type TourismAPIRestaurantParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the tourism Api restaurant params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIRestaurantParams) WithDefaults() *TourismAPIRestaurantParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the tourism Api restaurant params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIRestaurantParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TourismAPIRestaurantParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the tourism Api restaurant params
func (o *TourismAPIRestaurantParams) WithTimeout(timeout time.Duration) *TourismAPIRestaurantParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TourismAPIRestaurantParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -261,80 +284,85 @@ func (o *TourismAPIRestaurantParams) WriteToRequest(r runtime.ClientRequest, reg
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/tourism_api_restaurant_responses.go b/tourism/v2/client/tourism/tourism_api_restaurant_responses.go
index 3f718016..68bd341d 100644
--- a/tourism/v2/client/tourism/tourism_api_restaurant_responses.go
+++ b/tourism/v2/client/tourism/tourism_api_restaurant_responses.go
@@ -29,7 +29,12 @@ func (o *TourismAPIRestaurantReader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTourismAPIRestaurantNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTourismAPIRestaurantOK() *TourismAPIRestaurantOK {
return &TourismAPIRestaurantOK{}
}
-/*TourismAPIRestaurantOK handles this case with default header values.
+/* TourismAPIRestaurantOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TourismAPIRestaurantOK struct {
func (o *TourismAPIRestaurantOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/Restaurant][%d] tourismApiRestaurantOK %+v", 200, o.Payload)
}
-
func (o *TourismAPIRestaurantOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TourismAPIRestaurantOK) readResponse(response runtime.ClientResponse, c
return nil
}
+
+// NewTourismAPIRestaurantNotModified creates a TourismAPIRestaurantNotModified with default headers values
+func NewTourismAPIRestaurantNotModified() *TourismAPIRestaurantNotModified {
+ return &TourismAPIRestaurantNotModified{}
+}
+
+/* TourismAPIRestaurantNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TourismAPIRestaurantNotModified struct {
+}
+
+func (o *TourismAPIRestaurantNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/Restaurant][%d] tourismApiRestaurantNotModified ", 304)
+}
+
+func (o *TourismAPIRestaurantNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/tourism_api_scenic_spot0_parameters.go b/tourism/v2/client/tourism/tourism_api_scenic_spot0_parameters.go
index 4e064b9d..e22c75c3 100644
--- a/tourism/v2/client/tourism/tourism_api_scenic_spot0_parameters.go
+++ b/tourism/v2/client/tourism/tourism_api_scenic_spot0_parameters.go
@@ -17,98 +17,94 @@ import (
"github.com/go-openapi/swag"
)
-// NewTourismAPIScenicSpot0Params creates a new TourismAPIScenicSpot0Params object
-// with the default values initialized.
+// NewTourismAPIScenicSpot0Params creates a new TourismAPIScenicSpot0Params 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 NewTourismAPIScenicSpot0Params() *TourismAPIScenicSpot0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIScenicSpot0Params{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTourismAPIScenicSpot0ParamsWithTimeout creates a new TourismAPIScenicSpot0Params object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTourismAPIScenicSpot0ParamsWithTimeout(timeout time.Duration) *TourismAPIScenicSpot0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIScenicSpot0Params{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTourismAPIScenicSpot0ParamsWithContext creates a new TourismAPIScenicSpot0Params object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTourismAPIScenicSpot0ParamsWithContext(ctx context.Context) *TourismAPIScenicSpot0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIScenicSpot0Params{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTourismAPIScenicSpot0ParamsWithHTTPClient creates a new TourismAPIScenicSpot0Params object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTourismAPIScenicSpot0ParamsWithHTTPClient(client *http.Client) *TourismAPIScenicSpot0Params {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIScenicSpot0Params{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TourismAPIScenicSpot0Params contains all the parameters to send to the API endpoint
-for the tourism Api scenic spot 0 operation typically these are written to a http.Request
+/* TourismAPIScenicSpot0Params contains all the parameters to send to the API endpoint
+ for the tourism Api scenic spot 0 operation.
+
+ Typically these are written to a http.Request.
*/
type TourismAPIScenicSpot0Params struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
- /*City*/
+
+ // City.
City string
timeout time.Duration
@@ -116,6 +112,32 @@ type TourismAPIScenicSpot0Params struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the tourism Api scenic spot 0 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIScenicSpot0Params) WithDefaults() *TourismAPIScenicSpot0Params {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the tourism Api scenic spot 0 params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIScenicSpot0Params) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TourismAPIScenicSpot0Params{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the tourism Api scenic spot 0 params
func (o *TourismAPIScenicSpot0Params) WithTimeout(timeout time.Duration) *TourismAPIScenicSpot0Params {
o.SetTimeout(timeout)
@@ -249,22 +271,24 @@ func (o *TourismAPIScenicSpot0Params) WriteToRequest(r runtime.ClientRequest, re
// 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
}
@@ -274,80 +298,85 @@ func (o *TourismAPIScenicSpot0Params) WriteToRequest(r runtime.ClientRequest, re
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
diff --git a/tourism/v2/client/tourism/tourism_api_scenic_spot0_responses.go b/tourism/v2/client/tourism/tourism_api_scenic_spot0_responses.go
index 7f4072df..fb62f556 100644
--- a/tourism/v2/client/tourism/tourism_api_scenic_spot0_responses.go
+++ b/tourism/v2/client/tourism/tourism_api_scenic_spot0_responses.go
@@ -29,7 +29,12 @@ func (o *TourismAPIScenicSpot0Reader) ReadResponse(response runtime.ClientRespon
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTourismAPIScenicSpot0NotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTourismAPIScenicSpot0OK() *TourismAPIScenicSpot0OK {
return &TourismAPIScenicSpot0OK{}
}
-/*TourismAPIScenicSpot0OK handles this case with default header values.
+/* TourismAPIScenicSpot0OK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TourismAPIScenicSpot0OK struct {
func (o *TourismAPIScenicSpot0OK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/ScenicSpot/{City}][%d] tourismApiScenicSpot0OK %+v", 200, o.Payload)
}
-
func (o *TourismAPIScenicSpot0OK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TourismAPIScenicSpot0OK) readResponse(response runtime.ClientResponse,
return nil
}
+
+// NewTourismAPIScenicSpot0NotModified creates a TourismAPIScenicSpot0NotModified with default headers values
+func NewTourismAPIScenicSpot0NotModified() *TourismAPIScenicSpot0NotModified {
+ return &TourismAPIScenicSpot0NotModified{}
+}
+
+/* TourismAPIScenicSpot0NotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TourismAPIScenicSpot0NotModified struct {
+}
+
+func (o *TourismAPIScenicSpot0NotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/ScenicSpot/{City}][%d] tourismApiScenicSpot0NotModified ", 304)
+}
+
+func (o *TourismAPIScenicSpot0NotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/client/tourism/tourism_api_scenic_spot_parameters.go b/tourism/v2/client/tourism/tourism_api_scenic_spot_parameters.go
index 5942da31..744c8210 100644
--- a/tourism/v2/client/tourism/tourism_api_scenic_spot_parameters.go
+++ b/tourism/v2/client/tourism/tourism_api_scenic_spot_parameters.go
@@ -17,95 +17,90 @@ import (
"github.com/go-openapi/swag"
)
-// NewTourismAPIScenicSpotParams creates a new TourismAPIScenicSpotParams object
-// with the default values initialized.
+// NewTourismAPIScenicSpotParams creates a new TourismAPIScenicSpotParams 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 NewTourismAPIScenicSpotParams() *TourismAPIScenicSpotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIScenicSpotParams{
- DollarTop: &dollarTopDefault,
-
timeout: cr.DefaultTimeout,
}
}
// NewTourismAPIScenicSpotParamsWithTimeout creates a new TourismAPIScenicSpotParams object
-// with the default values initialized, and the ability to set a timeout on a request
+// with the ability to set a timeout on a request.
func NewTourismAPIScenicSpotParamsWithTimeout(timeout time.Duration) *TourismAPIScenicSpotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIScenicSpotParams{
- DollarTop: &dollarTopDefault,
-
timeout: timeout,
}
}
// NewTourismAPIScenicSpotParamsWithContext creates a new TourismAPIScenicSpotParams object
-// with the default values initialized, and the ability to set a context for a request
+// with the ability to set a context for a request.
func NewTourismAPIScenicSpotParamsWithContext(ctx context.Context) *TourismAPIScenicSpotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIScenicSpotParams{
- DollarTop: &dollarTopDefault,
-
Context: ctx,
}
}
// NewTourismAPIScenicSpotParamsWithHTTPClient creates a new TourismAPIScenicSpotParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
+// with the ability to set a custom HTTPClient for a request.
func NewTourismAPIScenicSpotParamsWithHTTPClient(client *http.Client) *TourismAPIScenicSpotParams {
- var (
- dollarTopDefault = int64(30)
- )
return &TourismAPIScenicSpotParams{
- DollarTop: &dollarTopDefault,
HTTPClient: client,
}
}
-/*TourismAPIScenicSpotParams contains all the parameters to send to the API endpoint
-for the tourism Api scenic spot operation typically these are written to a http.Request
+/* TourismAPIScenicSpotParams contains all the parameters to send to the API endpoint
+ for the tourism Api scenic spot operation.
+
+ Typically these are written to a http.Request.
*/
type TourismAPIScenicSpotParams struct {
- /*DollarFilter
- 過濾
+ /* DollarFilter.
+ 過濾
*/
DollarFilter *string
- /*DollarFormat
- 指定來源格式
+ /* DollarFormat.
+
+ 指定來源格式
*/
DollarFormat string
- /*DollarOrderby
- 排序
+ /* DollarOrderby.
+
+ 排序
*/
DollarOrderby *string
- /*DollarSelect
- 挑選
+ /* DollarSelect.
+
+ 挑選
*/
DollarSelect *string
- /*DollarSkip
- 跳過前幾筆
+ /* DollarSkip.
+
+ 跳過前幾筆
*/
DollarSkip *string
- /*DollarSpatialFilter
- 空間過濾
+ /* DollarSpatialFilter.
+
+ 空間過濾
*/
DollarSpatialFilter *string
- /*DollarTop
- 取前幾筆
+ /* DollarTop.
+
+ 取前幾筆
+
+ Default: 30
*/
DollarTop *int64
@@ -114,6 +109,32 @@ type TourismAPIScenicSpotParams struct {
HTTPClient *http.Client
}
+// WithDefaults hydrates default values in the tourism Api scenic spot params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIScenicSpotParams) WithDefaults() *TourismAPIScenicSpotParams {
+ o.SetDefaults()
+ return o
+}
+
+// SetDefaults hydrates default values in the tourism Api scenic spot params (not the query body).
+//
+// All values with no default are reset to their zero value.
+func (o *TourismAPIScenicSpotParams) SetDefaults() {
+ var (
+ dollarTopDefault = int64(30)
+ )
+
+ val := TourismAPIScenicSpotParams{
+ DollarTop: &dollarTopDefault,
+ }
+
+ val.timeout = o.timeout
+ val.Context = o.Context
+ val.HTTPClient = o.HTTPClient
+ *o = val
+}
+
// WithTimeout adds the timeout to the tourism Api scenic spot params
func (o *TourismAPIScenicSpotParams) WithTimeout(timeout time.Duration) *TourismAPIScenicSpotParams {
o.SetTimeout(timeout)
@@ -236,22 +257,24 @@ func (o *TourismAPIScenicSpotParams) WriteToRequest(r runtime.ClientRequest, reg
// 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
}
@@ -261,80 +284,85 @@ func (o *TourismAPIScenicSpotParams) WriteToRequest(r runtime.ClientRequest, reg
// 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.DollarSpatialFilter != nil {
// query param $spatialFilter
var qrDollarSpatialFilter string
+
if o.DollarSpatialFilter != nil {
qrDollarSpatialFilter = *o.DollarSpatialFilter
}
qDollarSpatialFilter := qrDollarSpatialFilter
if qDollarSpatialFilter != "" {
+
if err := r.SetQueryParam("$spatialFilter", qDollarSpatialFilter); 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
}
}
-
}
if len(res) > 0 {
diff --git a/tourism/v2/client/tourism/tourism_api_scenic_spot_responses.go b/tourism/v2/client/tourism/tourism_api_scenic_spot_responses.go
index 72469ff0..3cd3fc6b 100644
--- a/tourism/v2/client/tourism/tourism_api_scenic_spot_responses.go
+++ b/tourism/v2/client/tourism/tourism_api_scenic_spot_responses.go
@@ -29,7 +29,12 @@ func (o *TourismAPIScenicSpotReader) ReadResponse(response runtime.ClientRespons
return nil, err
}
return result, nil
-
+ case 304:
+ result := NewTourismAPIScenicSpotNotModified()
+ 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())
}
@@ -40,7 +45,7 @@ func NewTourismAPIScenicSpotOK() *TourismAPIScenicSpotOK {
return &TourismAPIScenicSpotOK{}
}
-/*TourismAPIScenicSpotOK handles this case with default header values.
+/* TourismAPIScenicSpotOK describes a response with status code 200, with default header values.
Success
*/
@@ -51,7 +56,6 @@ type TourismAPIScenicSpotOK struct {
func (o *TourismAPIScenicSpotOK) Error() string {
return fmt.Sprintf("[GET /v2/Tourism/ScenicSpot][%d] tourismApiScenicSpotOK %+v", 200, o.Payload)
}
-
func (o *TourismAPIScenicSpotOK) GetPayload() []*models.PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo {
return o.Payload
}
@@ -65,3 +69,24 @@ func (o *TourismAPIScenicSpotOK) readResponse(response runtime.ClientResponse, c
return nil
}
+
+// NewTourismAPIScenicSpotNotModified creates a TourismAPIScenicSpotNotModified with default headers values
+func NewTourismAPIScenicSpotNotModified() *TourismAPIScenicSpotNotModified {
+ return &TourismAPIScenicSpotNotModified{}
+}
+
+/* TourismAPIScenicSpotNotModified describes a response with status code 304, with default header values.
+
+服務端會在Response加上Last-Modified header,表示最近的更新時間。客戶端能利用此時間,於Request加上If-Modified-Since header,若沒有更新,服務端會回應304 StatusCode且空值Content
+*/
+type TourismAPIScenicSpotNotModified struct {
+}
+
+func (o *TourismAPIScenicSpotNotModified) Error() string {
+ return fmt.Sprintf("[GET /v2/Tourism/ScenicSpot][%d] tourismApiScenicSpotNotModified ", 304)
+}
+
+func (o *TourismAPIScenicSpotNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_frequency.go b/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_frequency.go
deleted file mode 100644
index 43de003a..00000000
--- a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_frequency.go
+++ /dev/null
@@ -1,167 +0,0 @@
-// 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 (
- "strconv"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// PTXServiceDTOBusSpecificationV2BusFrequency BusFrequency
-//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusFrequency
-type PTXServiceDTOBusSpecificationV2BusFrequency struct {
-
- // String
- // Required: true
- EndTime *string `json:"EndTime"`
-
- // Int32
- // Required: true
- MaxHeadwayMins *int32 `json:"MaxHeadwayMins"`
-
- // Int32
- // Required: true
- MinHeadwayMins *int32 `json:"MinHeadwayMins"`
-
- // ServiceDay
- ServiceDay struct {
- PTXServiceDTOBusSpecificationV2ServiceDay
- } `json:"ServiceDay,omitempty"`
-
- // Array
- SpecialDays []*PTXServiceDTOBusSpecificationV2SpecialDay `json:"SpecialDays"`
-
- // String
- // Required: true
- StartTime *string `json:"StartTime"`
-}
-
-// Validate validates this p t x service d t o bus specification v2 bus frequency
-func (m *PTXServiceDTOBusSpecificationV2BusFrequency) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateEndTime(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateMaxHeadwayMins(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateMinHeadwayMins(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateServiceDay(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpecialDays(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateStartTime(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateEndTime(formats strfmt.Registry) error {
-
- if err := validate.Required("EndTime", "body", m.EndTime); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateMaxHeadwayMins(formats strfmt.Registry) error {
-
- if err := validate.Required("MaxHeadwayMins", "body", m.MaxHeadwayMins); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateMinHeadwayMins(formats strfmt.Registry) error {
-
- if err := validate.Required("MinHeadwayMins", "body", m.MinHeadwayMins); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateServiceDay(formats strfmt.Registry) error {
-
- if swag.IsZero(m.ServiceDay) { // not required
- return nil
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateSpecialDays(formats strfmt.Registry) error {
-
- if swag.IsZero(m.SpecialDays) { // not required
- return nil
- }
-
- for i := 0; i < len(m.SpecialDays); i++ {
- if swag.IsZero(m.SpecialDays[i]) { // not required
- continue
- }
-
- if m.SpecialDays[i] != nil {
- if err := m.SpecialDays[i].Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("SpecialDays" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusFrequency) validateStartTime(formats strfmt.Registry) error {
-
- if err := validate.Required("StartTime", "body", m.StartTime); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2BusFrequency) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2BusFrequency) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2BusFrequency
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_time.go b/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_time.go
deleted file mode 100644
index d0112af2..00000000
--- a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_stop_time.go
+++ /dev/null
@@ -1,149 +0,0 @@
-// 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 (
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// PTXServiceDTOBusSpecificationV2BusStopTime BusStopTime
-//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusStopTime
-type PTXServiceDTOBusSpecificationV2BusStopTime struct {
-
- // String
- // Required: true
- ArrivalTime *string `json:"ArrivalTime"`
-
- // String
- // Required: true
- DepartureTime *string `json:"DepartureTime"`
-
- // String
- // Required: true
- StopID *string `json:"StopID"`
-
- // NameType
- //
- // 名稱資料型別
- // Required: true
- StopName struct {
- PTXServiceDTOSharedSpecificationV2BaseNameType
- } `json:"StopName"`
-
- // Int32
- // Required: true
- StopSequence *int32 `json:"StopSequence"`
-
- // String
- // Required: true
- StopUID *string `json:"StopUID"`
-}
-
-// Validate validates this p t x service d t o bus specification v2 bus stop time
-func (m *PTXServiceDTOBusSpecificationV2BusStopTime) 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 len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusStopTime) validateArrivalTime(formats strfmt.Registry) error {
-
- if err := validate.Required("ArrivalTime", "body", m.ArrivalTime); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusStopTime) validateDepartureTime(formats strfmt.Registry) error {
-
- if err := validate.Required("DepartureTime", "body", m.DepartureTime); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusStopTime) validateStopID(formats strfmt.Registry) error {
-
- if err := validate.Required("StopID", "body", m.StopID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusStopTime) validateStopName(formats strfmt.Registry) error {
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusStopTime) validateStopSequence(formats strfmt.Registry) error {
-
- if err := validate.Required("StopSequence", "body", m.StopSequence); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusStopTime) validateStopUID(formats strfmt.Registry) error {
-
- if err := validate.Required("StopUID", "body", m.StopUID); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2BusStopTime) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2BusStopTime) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2BusStopTime
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_timetable.go b/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_timetable.go
deleted file mode 100644
index 592e2433..00000000
--- a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_timetable.go
+++ /dev/null
@@ -1,135 +0,0 @@
-// 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 (
- "strconv"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// PTXServiceDTOBusSpecificationV2BusTimetable BusTimetable
-//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusTimetable
-type PTXServiceDTOBusSpecificationV2BusTimetable struct {
-
- // ServiceDay
- ServiceDay struct {
- PTXServiceDTOBusSpecificationV2ServiceDay
- } `json:"ServiceDay,omitempty"`
-
- // Array
- SpecialDays []*PTXServiceDTOBusSpecificationV2SpecialDay `json:"SpecialDays"`
-
- // Array
- // Required: true
- StopTimes []*PTXServiceDTOBusSpecificationV2BusStopTime `json:"StopTimes"`
-
- // String
- TripID string `json:"TripID,omitempty"`
-}
-
-// Validate validates this p t x service d t o bus specification v2 bus timetable
-func (m *PTXServiceDTOBusSpecificationV2BusTimetable) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateServiceDay(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpecialDays(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateStopTimes(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusTimetable) validateServiceDay(formats strfmt.Registry) error {
-
- if swag.IsZero(m.ServiceDay) { // not required
- return nil
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusTimetable) validateSpecialDays(formats strfmt.Registry) error {
-
- if swag.IsZero(m.SpecialDays) { // not required
- return nil
- }
-
- for i := 0; i < len(m.SpecialDays); i++ {
- if swag.IsZero(m.SpecialDays[i]) { // not required
- continue
- }
-
- if m.SpecialDays[i] != nil {
- if err := m.SpecialDays[i].Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("SpecialDays" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2BusTimetable) 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
-}
-
-// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2BusTimetable) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2BusTimetable) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2BusTimetable
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_date_period.go b/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_date_period.go
deleted file mode 100644
index 39d7883b..00000000
--- a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_date_period.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// 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 (
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
-)
-
-// PTXServiceDTOBusSpecificationV2DatePeriod DatePeriod
-//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.DatePeriod
-type PTXServiceDTOBusSpecificationV2DatePeriod struct {
-
- // String
- EndDate string `json:"EndDate,omitempty"`
-
- // String
- StartDate string `json:"StartDate,omitempty"`
-}
-
-// Validate validates this p t x service d t o bus specification v2 date period
-func (m *PTXServiceDTOBusSpecificationV2DatePeriod) Validate(formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2DatePeriod) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2DatePeriod) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2DatePeriod
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_route_operator.go b/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_route_operator.go
deleted file mode 100644
index bc9ba6e2..00000000
--- a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_route_operator.go
+++ /dev/null
@@ -1,115 +0,0 @@
-// 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 (
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// PTXServiceDTOBusSpecificationV2RouteOperator RouteOperator
-//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.RouteOperator
-type PTXServiceDTOBusSpecificationV2RouteOperator struct {
-
- // String
- // Required: true
- OperatorCode *string `json:"OperatorCode"`
-
- // String
- // Required: true
- OperatorID *string `json:"OperatorID"`
-
- // NameType
- //
- // 名稱資料型別
- // Required: true
- OperatorName struct {
- PTXServiceDTOSharedSpecificationV2BaseNameType
- } `json:"OperatorName"`
-
- // String
- // Required: true
- OperatorNo *string `json:"OperatorNo"`
-}
-
-// Validate validates this p t x service d t o bus specification v2 route operator
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) Validate(formats strfmt.Registry) error {
- var res []error
-
- 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.validateOperatorName(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateOperatorNo(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorCode(formats strfmt.Registry) error {
-
- if err := validate.Required("OperatorCode", "body", m.OperatorCode); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorID(formats strfmt.Registry) error {
-
- if err := validate.Required("OperatorID", "body", m.OperatorID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorName(formats strfmt.Registry) error {
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) validateOperatorNo(formats strfmt.Registry) error {
-
- if err := validate.Required("OperatorNo", "body", m.OperatorNo); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2RouteOperator) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2RouteOperator
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_special_day.go b/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_special_day.go
deleted file mode 100644
index baba36f1..00000000
--- a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_special_day.go
+++ /dev/null
@@ -1,75 +0,0 @@
-// 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 (
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
-)
-
-// PTXServiceDTOBusSpecificationV2SpecialDay SpecialDay
-//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.SpecialDay
-type PTXServiceDTOBusSpecificationV2SpecialDay struct {
-
- // DatePeriod
- DatePeriod struct {
- PTXServiceDTOBusSpecificationV2DatePeriod
- } `json:"DatePeriod,omitempty"`
-
- // Array
- Dates []string `json:"Dates"`
-
- // String
- Description string `json:"Description,omitempty"`
-
- // integer
- //
- // [0:'正常營運',1:'加班營運',2:'取消/停駛營運']
- ServiceStatus int32 `json:"ServiceStatus,omitempty"`
-}
-
-// Validate validates this p t x service d t o bus specification v2 special day
-func (m *PTXServiceDTOBusSpecificationV2SpecialDay) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateDatePeriod(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2SpecialDay) validateDatePeriod(formats strfmt.Registry) error {
-
- if swag.IsZero(m.DatePeriod) { // not required
- return nil
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2SpecialDay) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2SpecialDay) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2SpecialDay
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_stop.go b/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_stop.go
deleted file mode 100644
index 229ebe98..00000000
--- a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_stop.go
+++ /dev/null
@@ -1,160 +0,0 @@
-// 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 (
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// PTXServiceDTOBusSpecificationV2Stop Stop
-//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.Stop
-type PTXServiceDTOBusSpecificationV2Stop struct {
-
- // String
- LocationCityCode string `json:"LocationCityCode,omitempty"`
-
- // String
- // Required: true
- StationGroupID *string `json:"StationGroupID"`
-
- // String
- StationID string `json:"StationID,omitempty"`
-
- // integer
- //
- // [-1:'可下車',0:'可上下車',1:'可上車']
- StopBoarding int32 `json:"StopBoarding,omitempty"`
-
- // String
- // Required: true
- StopID *string `json:"StopID"`
-
- // NameType
- //
- // 名稱資料型別
- // Required: true
- StopName struct {
- PTXServiceDTOSharedSpecificationV2BaseNameType
- } `json:"StopName"`
-
- // PointType
- //
- // 座標資料型別
- // Required: true
- StopPosition struct {
- PTXServiceDTOSharedSpecificationV2BasePointType
- } `json:"StopPosition"`
-
- // Int32
- // Required: true
- StopSequence *int32 `json:"StopSequence"`
-
- // String
- // Required: true
- StopUID *string `json:"StopUID"`
-}
-
-// Validate validates this p t x service d t o bus specification v2 stop
-func (m *PTXServiceDTOBusSpecificationV2Stop) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateStationGroupID(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.validateStopPosition(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 len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStationGroupID(formats strfmt.Registry) error {
-
- if err := validate.Required("StationGroupID", "body", m.StationGroupID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopID(formats strfmt.Registry) error {
-
- if err := validate.Required("StopID", "body", m.StopID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopName(formats strfmt.Registry) error {
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopPosition(formats strfmt.Registry) error {
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopSequence(formats strfmt.Registry) error {
-
- if err := validate.Required("StopSequence", "body", m.StopSequence); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PTXServiceDTOBusSpecificationV2Stop) validateStopUID(formats strfmt.Registry) error {
-
- if err := validate.Required("StopUID", "body", m.StopUID); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2Stop) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2Stop) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2Stop
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go b/tourism/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
index ae2f0ea5..b757afa0 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_name_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -33,6 +35,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) Validate(formats strfmt
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base name type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BaseNameType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go b/tourism/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
index 33cfe90a..02645203 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_shared_specification_v2_base_point_type.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -34,6 +36,11 @@ func (m *PTXServiceDTOSharedSpecificationV2BasePointType) Validate(formats strfm
return nil
}
+// ContextValidate validates this p t x service d t o shared specification v2 base point type based on context it is used
+func (m *PTXServiceDTOSharedSpecificationV2BasePointType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOSharedSpecificationV2BasePointType) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_activity_tourism_info.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_activity_tourism_info.go
index 29064cb5..cb0832c9 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_activity_tourism_info.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_activity_tourism_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -192,7 +194,6 @@ func (m *PTXServiceDTOTourismSpecificationV2ActivityTourismInfo) validateID(form
}
func (m *PTXServiceDTOTourismSpecificationV2ActivityTourismInfo) validatePicture(formats strfmt.Registry) error {
-
if swag.IsZero(m.Picture) { // not required
return nil
}
@@ -201,7 +202,6 @@ func (m *PTXServiceDTOTourismSpecificationV2ActivityTourismInfo) validatePicture
}
func (m *PTXServiceDTOTourismSpecificationV2ActivityTourismInfo) validatePosition(formats strfmt.Registry) error {
-
if swag.IsZero(m.Position) { // not required
return nil
}
@@ -227,6 +227,34 @@ func (m *PTXServiceDTOTourismSpecificationV2ActivityTourismInfo) validateUpdateT
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 activity tourism info based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2ActivityTourismInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidatePicture(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidatePosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2ActivityTourismInfo) contextValidatePicture(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2ActivityTourismInfo) contextValidatePosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2ActivityTourismInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_a1_data.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_a1_data.go
index 92d7609a..b50941b6 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_a1_data.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_a1_data.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -189,7 +191,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) validateAzimuth(formats s
}
func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) validateBusPosition(formats strfmt.Registry) error {
-
if swag.IsZero(m.BusPosition) { // not required
return nil
}
@@ -243,7 +244,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) validateSpeed(formats str
}
func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -252,7 +252,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) validateSubRouteName(form
}
func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) validateTaiwanTripName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TaiwanTripName) { // not required
return nil
}
@@ -269,6 +268,43 @@ func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) validateUpdateTime(format
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 bus a1 data based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateBusPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSubRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTaiwanTripName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) contextValidateBusPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) contextValidateTaiwanTripName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2BusA1Data) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_a2_data.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_a2_data.go
index 2114ddf1..d825a909 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_a2_data.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_a2_data.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -201,7 +203,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) validatePlateNumb(formats
}
func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -210,7 +211,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) validateStopName(formats
}
func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -219,7 +219,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) validateSubRouteName(form
}
func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) validateTaiwanTripName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TaiwanTripName) { // not required
return nil
}
@@ -236,6 +235,43 @@ func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) validateUpdateTime(format
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 bus a2 data based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) 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.contextValidateSubRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTaiwanTripName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) contextValidateTaiwanTripName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2BusA2Data) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_frequency.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_frequency.go
new file mode 100644
index 00000000..d48fb882
--- /dev/null
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_frequency.go
@@ -0,0 +1,221 @@
+// 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"
+)
+
+// PTXServiceDTOTourismSpecificationV2BusFrequency BusFrequency
+//
+// 發車班距資料
+//
+// swagger:model PTX.Service.DTO.Tourism.Specification.V2.BusFrequency
+type PTXServiceDTOTourismSpecificationV2BusFrequency struct {
+
+ // String
+ //
+ // 發車班距結束適用時間,格式為: HH:mm
+ // Required: true
+ EndTime *string `json:"EndTime"`
+
+ // Int32
+ //
+ // 最大班距時間(分鐘)
+ // Required: true
+ MaxHeadwayMins *int32 `json:"MaxHeadwayMins"`
+
+ // Int32
+ //
+ // 最小班距時間(分鐘)
+ // Required: true
+ MinHeadwayMins *int32 `json:"MinHeadwayMins"`
+
+ // ServiceDay
+ //
+ // 週內營運日
+ ServiceDay struct {
+ PTXServiceDTOTourismSpecificationV2ServiceDay
+ } `json:"ServiceDay,omitempty"`
+
+ // Array
+ //
+ // 特殊營運日
+ SpecialDays []*PTXServiceDTOTourismSpecificationV2SpecialDay `json:"SpecialDays"`
+
+ // String
+ //
+ // 發車班距起始適用時間,格式為: HH:mm
+ // Required: true
+ StartTime *string `json:"StartTime"`
+}
+
+// Validate validates this p t x service d t o tourism specification v2 bus frequency
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateEndTime(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateMaxHeadwayMins(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateMinHeadwayMins(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateServiceDay(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateSpecialDays(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateStartTime(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) validateEndTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("EndTime", "body", m.EndTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) validateMaxHeadwayMins(formats strfmt.Registry) error {
+
+ if err := validate.Required("MaxHeadwayMins", "body", m.MaxHeadwayMins); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) validateMinHeadwayMins(formats strfmt.Registry) error {
+
+ if err := validate.Required("MinHeadwayMins", "body", m.MinHeadwayMins); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) validateServiceDay(formats strfmt.Registry) error {
+ if swag.IsZero(m.ServiceDay) { // not required
+ return nil
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) validateSpecialDays(formats strfmt.Registry) error {
+ if swag.IsZero(m.SpecialDays) { // not required
+ return nil
+ }
+
+ for i := 0; i < len(m.SpecialDays); i++ {
+ if swag.IsZero(m.SpecialDays[i]) { // not required
+ continue
+ }
+
+ if m.SpecialDays[i] != nil {
+ if err := m.SpecialDays[i].Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SpecialDays" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) validateStartTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("StartTime", "body", m.StartTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validate this p t x service d t o tourism specification v2 bus frequency based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSpecialDays(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) contextValidateSpecialDays(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SpecialDays); i++ {
+
+ if m.SpecialDays[i] != nil {
+ if err := m.SpecialDays[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SpecialDays" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2BusFrequency) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOTourismSpecificationV2BusFrequency
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_n1_estimate_time.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_n1_estimate_time.go
index 840aa457..762a6e62 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_n1_estimate_time.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_n1_estimate_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -175,7 +177,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) validateDirection
}
func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) validateStopName(formats strfmt.Registry) error {
-
if swag.IsZero(m.StopName) { // not required
return nil
}
@@ -184,7 +185,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) validateStopName(
}
func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) validateSubRouteName(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRouteName) { // not required
return nil
}
@@ -193,7 +193,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) validateSubRouteN
}
func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) validateTaiwanTripName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TaiwanTripName) { // not required
return nil
}
@@ -210,6 +209,43 @@ func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) validateUpdateTim
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 bus n1 estimate time based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) 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.contextValidateSubRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTaiwanTripName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) contextValidateTaiwanTripName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2BusN1EstimateTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_route.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_route.go
index 95e51131..15289969 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_route.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -94,7 +95,7 @@ type PTXServiceDTOTourismSpecificationV2BusRoute struct {
//
// 營運業者
// Required: true
- Operators []*PTXServiceDTOBusSpecificationV2RouteOperator `json:"Operators"`
+ Operators []*PTXServiceDTOTourismSpecificationV2RouteOperator `json:"Operators"`
// String
//
@@ -127,7 +128,7 @@ type PTXServiceDTOTourismSpecificationV2BusRoute struct {
// Array
//
// 附屬路線資料(如果原始資料並無提供附屬路線ID,而本平台基於跨來源資料之一致性,會以SubRouteID=RouteID產製一份相對應的附屬路線資料(若有去返程,則會有兩筆))
- SubRoutes []*PTXServiceDTOBusSpecificationV2BusSubRoute `json:"SubRoutes"`
+ SubRoutes []*PTXServiceDTOTourismSpecificationV2BusSubRoute `json:"SubRoutes"`
// NameType
//
@@ -297,7 +298,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusRoute) validateRouteUID(formats s
}
func (m *PTXServiceDTOTourismSpecificationV2BusRoute) validateSubRoutes(formats strfmt.Registry) error {
-
if swag.IsZero(m.SubRoutes) { // not required
return nil
}
@@ -335,6 +335,69 @@ func (m *PTXServiceDTOTourismSpecificationV2BusRoute) validateUpdateTime(formats
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 bus route based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperators(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSubRoutes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTaiwanTripName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusRoute) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Operators); i++ {
+
+ if m.Operators[i] != nil {
+ if err := m.Operators[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Operators" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusRoute) contextValidateSubRoutes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SubRoutes); i++ {
+
+ if m.SubRoutes[i] != nil {
+ if err := m.SubRoutes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SubRoutes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusRoute) contextValidateTaiwanTripName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2BusRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_schedule.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_schedule.go
index eacb7a02..9e2292e6 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_schedule.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_schedule.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -28,7 +29,7 @@ type PTXServiceDTOTourismSpecificationV2BusSchedule struct {
// Array
//
// 發車班距
- Frequencys []*PTXServiceDTOBusSpecificationV2BusFrequency `json:"Frequencys"`
+ Frequencys []*PTXServiceDTOTourismSpecificationV2BusFrequency `json:"Frequencys"`
// String
//
@@ -73,7 +74,7 @@ type PTXServiceDTOTourismSpecificationV2BusSchedule struct {
// Array
//
// 預定班表
- Timetables []*PTXServiceDTOBusSpecificationV2BusTimetable `json:"Timetables"`
+ Timetables []*PTXServiceDTOTourismSpecificationV2BusTimetable `json:"Timetables"`
// DateTime
//
@@ -142,7 +143,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusSchedule) validateDirection(forma
}
func (m *PTXServiceDTOTourismSpecificationV2BusSchedule) validateFrequencys(formats strfmt.Registry) error {
-
if swag.IsZero(m.Frequencys) { // not required
return nil
}
@@ -213,7 +213,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusSchedule) validateTaiwanTripName(
}
func (m *PTXServiceDTOTourismSpecificationV2BusSchedule) validateTimetables(formats strfmt.Registry) error {
-
if swag.IsZero(m.Timetables) { // not required
return nil
}
@@ -246,6 +245,78 @@ func (m *PTXServiceDTOTourismSpecificationV2BusSchedule) validateUpdateTime(form
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 bus schedule based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusSchedule) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateFrequencys(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSubRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateTaiwanTripName(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 *PTXServiceDTOTourismSpecificationV2BusSchedule) contextValidateFrequencys(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.Frequencys); i++ {
+
+ if m.Frequencys[i] != nil {
+ if err := m.Frequencys[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("Frequencys" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusSchedule) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusSchedule) contextValidateTaiwanTripName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusSchedule) 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 *PTXServiceDTOTourismSpecificationV2BusSchedule) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_stop_of_route.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_stop_of_route.go
index 7f939fd0..c35f9821 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_stop_of_route.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_stop_of_route.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -49,7 +50,7 @@ type PTXServiceDTOTourismSpecificationV2BusStopOfRoute struct {
//
// 所有經過站牌
// Required: true
- Stops []*PTXServiceDTOBusSpecificationV2Stop `json:"Stops"`
+ Stops []*PTXServiceDTOTourismSpecificationV2Stop `json:"Stops"`
// String
//
@@ -234,6 +235,56 @@ func (m *PTXServiceDTOTourismSpecificationV2BusStopOfRoute) validateUpdateTime(f
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 bus stop of route based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusStopOfRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ 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 err := m.contextValidateTaiwanTripName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusStopOfRoute) 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 *PTXServiceDTOTourismSpecificationV2BusStopOfRoute) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusStopOfRoute) contextValidateTaiwanTripName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2BusStopOfRoute) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_stop_time.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_stop_time.go
new file mode 100644
index 00000000..79dfe01c
--- /dev/null
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_stop_time.go
@@ -0,0 +1,182 @@
+// 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"
+)
+
+// PTXServiceDTOTourismSpecificationV2BusStopTime BusStopTime
+//
+// 公車停靠時間資料
+//
+// swagger:model PTX.Service.DTO.Tourism.Specification.V2.BusStopTime
+type PTXServiceDTOTourismSpecificationV2BusStopTime struct {
+
+ // String
+ //
+ // 到站時間,格式為:HH:mm
+ // Required: true
+ ArrivalTime *string `json:"ArrivalTime"`
+
+ // String
+ //
+ // 離站時間,格式為:HH:mm
+ // Required: true
+ DepartureTime *string `json:"DepartureTime"`
+
+ // String
+ //
+ // 地區既用中之站牌代碼(為原資料內碼)
+ // Required: true
+ StopID *string `json:"StopID"`
+
+ // NameType
+ //
+ // 站牌名稱
+ // Required: true
+ StopName struct {
+ PTXServiceDTOSharedSpecificationV2BaseNameType
+ } `json:"StopName"`
+
+ // Int32
+ //
+ // 路線經過站牌之順序(由1開始)
+ // Required: true
+ StopSequence *int32 `json:"StopSequence"`
+
+ // String
+ //
+ // 站牌唯一識別代碼,規則為 {業管機關代碼} + {StopID},其中 {業管機關代碼} 可於Authority API中的AuthorityCode欄位查詢
+ // Required: true
+ StopUID *string `json:"StopUID"`
+}
+
+// Validate validates this p t x service d t o tourism specification v2 bus stop time
+func (m *PTXServiceDTOTourismSpecificationV2BusStopTime) 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 len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusStopTime) validateArrivalTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("ArrivalTime", "body", m.ArrivalTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusStopTime) validateDepartureTime(formats strfmt.Registry) error {
+
+ if err := validate.Required("DepartureTime", "body", m.DepartureTime); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusStopTime) validateStopID(formats strfmt.Registry) error {
+
+ if err := validate.Required("StopID", "body", m.StopID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusStopTime) validateStopName(formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusStopTime) validateStopSequence(formats strfmt.Registry) error {
+
+ if err := validate.Required("StopSequence", "body", m.StopSequence); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusStopTime) validateStopUID(formats strfmt.Registry) error {
+
+ if err := validate.Required("StopUID", "body", m.StopUID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validate this p t x service d t o tourism specification v2 bus stop time based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusStopTime) 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 *PTXServiceDTOTourismSpecificationV2BusStopTime) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2BusStopTime) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2BusStopTime) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOTourismSpecificationV2BusStopTime
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_sub_route.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_sub_route.go
similarity index 50%
rename from tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_sub_route.go
rename to tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_sub_route.go
index a61e86c6..df66b3ec 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_bus_specification_v2_bus_sub_route.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_sub_route.go
@@ -6,64 +6,86 @@ package models
// 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"
)
-// PTXServiceDTOBusSpecificationV2BusSubRoute BusSubRoute
+// PTXServiceDTOTourismSpecificationV2BusSubRoute BusSubRoute
+//
+// 附屬路線資料型別
//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.BusSubRoute
-type PTXServiceDTOBusSpecificationV2BusSubRoute struct {
+// swagger:model PTX.Service.DTO.Tourism.Specification.V2.BusSubRoute
+type PTXServiceDTOTourismSpecificationV2BusSubRoute struct {
// integer
//
- // [0:'去程',1:'返程',2:'迴圈',255:'未知']
+ // 去返程 : [0:'去程',1:'返程',2:'迴圈',255:'未知']
// Required: true
Direction *int32 `json:"Direction"`
// String
+ //
+ // 平日第一班發車時間
FirstBusTime string `json:"FirstBusTime,omitempty"`
// String
+ //
+ // 車頭描述
Headsign string `json:"Headsign,omitempty"`
// String
+ //
+ // 車頭英文描述
HeadsignEn string `json:"HeadsignEn,omitempty"`
// String
+ //
+ // 假日去程第一班發車時間
HolidayFirstBusTime string `json:"HolidayFirstBusTime,omitempty"`
// String
+ //
+ // 假日返程第一班發車時間
HolidayLastBusTime string `json:"HolidayLastBusTime,omitempty"`
// String
+ //
+ // 平日返程第一班發車時間
LastBusTime string `json:"LastBusTime,omitempty"`
// Array
+ //
+ // 營運業者代碼
// Required: true
OperatorIDs []string `json:"OperatorIDs"`
// String
+ //
+ // 地區既用中之附屬路線代碼(為原資料內碼)
// Required: true
SubRouteID *string `json:"SubRouteID"`
// NameType
//
- // 名稱資料型別
+ // 附屬路線名稱
// Required: true
SubRouteName struct {
PTXServiceDTOSharedSpecificationV2BaseNameType
} `json:"SubRouteName"`
// String
+ //
+ // 附屬路線唯一識別代碼,規則為 {業管機關簡碼} + {SubRouteID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢
// Required: true
SubRouteUID *string `json:"SubRouteUID"`
}
-// Validate validates this p t x service d t o bus specification v2 bus sub route
-func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) Validate(formats strfmt.Registry) error {
+// Validate validates this p t x service d t o tourism specification v2 bus sub route
+func (m *PTXServiceDTOTourismSpecificationV2BusSubRoute) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDirection(formats); err != nil {
@@ -92,7 +114,7 @@ func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) Validate(formats strfmt.Reg
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) validateDirection(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2BusSubRoute) validateDirection(formats strfmt.Registry) error {
if err := validate.Required("Direction", "body", m.Direction); err != nil {
return err
@@ -101,7 +123,7 @@ func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) validateDirection(formats s
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) validateOperatorIDs(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2BusSubRoute) validateOperatorIDs(formats strfmt.Registry) error {
if err := validate.Required("OperatorIDs", "body", m.OperatorIDs); err != nil {
return err
@@ -110,7 +132,7 @@ func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) validateOperatorIDs(formats
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) validateSubRouteID(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2BusSubRoute) validateSubRouteID(formats strfmt.Registry) error {
if err := validate.Required("SubRouteID", "body", m.SubRouteID); err != nil {
return err
@@ -119,12 +141,12 @@ func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) validateSubRouteID(formats
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) validateSubRouteName(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2BusSubRoute) validateSubRouteName(formats strfmt.Registry) error {
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) validateSubRouteUID(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2BusSubRoute) validateSubRouteUID(formats strfmt.Registry) error {
if err := validate.Required("SubRouteUID", "body", m.SubRouteUID); err != nil {
return err
@@ -133,8 +155,27 @@ func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) validateSubRouteUID(formats
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 bus sub route based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusSubRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateSubRouteName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusSubRoute) contextValidateSubRouteName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) MarshalBinary() ([]byte, error) {
+func (m *PTXServiceDTOTourismSpecificationV2BusSubRoute) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -142,8 +183,8 @@ func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) MarshalBinary() ([]byte, er
}
// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2BusSubRoute) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2BusSubRoute
+func (m *PTXServiceDTOTourismSpecificationV2BusSubRoute) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOTourismSpecificationV2BusSubRoute
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_news.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_news.go
index a611576c..818adf7b 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_news.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_news.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -145,6 +147,11 @@ func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripNews) validateUpdateTim
return nil
}
+// ContextValidate validates this p t x service d t o tourism specification v2 bus taiwan trip news based on context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripNews) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripNews) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_s2_s_travel_time.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_s2_s_travel_time.go
index 8aa55282..3dc6d0f3 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_s2_s_travel_time.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_s2_s_travel_time.go
@@ -6,6 +6,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
"strconv"
"github.com/go-openapi/errors"
@@ -132,6 +133,38 @@ func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripS2STravelTime) validate
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 bus taiwan trip s2 s travel time based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripS2STravelTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTravelTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripS2STravelTime) contextValidateTravelTimes(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.TravelTimes); i++ {
+
+ if m.TravelTimes[i] != nil {
+ if err := m.TravelTimes[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("TravelTimes" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripS2STravelTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_s2_s_travel_time_travel_time.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_s2_s_travel_time_travel_time.go
index 7cf2fb13..5333d93c 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_s2_s_travel_time_travel_time.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_s2_s_travel_time_travel_time.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -142,6 +144,11 @@ func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripS2STravelTimeTravelTime
return nil
}
+// ContextValidate validates this p t x service d t o tourism specification v2 bus taiwan trip s2 s travel time travel time based on context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripS2STravelTimeTravelTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripS2STravelTimeTravelTime) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_shape.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_shape.go
index a279e021..f398ea04 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_shape.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_taiwan_trip_shape.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -147,7 +149,6 @@ func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripShape) validateSrcUpdat
}
func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripShape) validateTaiwanTripName(formats strfmt.Registry) error {
-
if swag.IsZero(m.TaiwanTripName) { // not required
return nil
}
@@ -164,6 +165,25 @@ func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripShape) validateUpdateTi
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 bus taiwan trip shape based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripShape) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateTaiwanTripName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripShape) contextValidateTaiwanTripName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2BusTaiwanTripShape) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_timetable.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_timetable.go
new file mode 100644
index 00000000..e1853f2a
--- /dev/null
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_bus_timetable.go
@@ -0,0 +1,207 @@
+// 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"
+)
+
+// PTXServiceDTOTourismSpecificationV2BusTimetable BusTimetable
+//
+// 班次資料
+//
+// swagger:model PTX.Service.DTO.Tourism.Specification.V2.BusTimetable
+type PTXServiceDTOTourismSpecificationV2BusTimetable struct {
+
+ // ServiceDay
+ //
+ // 週內營運日
+ ServiceDay struct {
+ PTXServiceDTOTourismSpecificationV2ServiceDay
+ } `json:"ServiceDay,omitempty"`
+
+ // Array
+ //
+ // 特殊營運日
+ SpecialDays []*PTXServiceDTOTourismSpecificationV2SpecialDay `json:"SpecialDays"`
+
+ // Array
+ //
+ // 公車停靠時間資料
+ // Required: true
+ StopTimes []*PTXServiceDTOTourismSpecificationV2BusStopTime `json:"StopTimes"`
+
+ // String
+ //
+ // 班次代碼,為無意義之編碼
+ TripID string `json:"TripID,omitempty"`
+}
+
+// Validate validates this p t x service d t o tourism specification v2 bus timetable
+func (m *PTXServiceDTOTourismSpecificationV2BusTimetable) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateServiceDay(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateSpecialDays(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateStopTimes(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusTimetable) validateServiceDay(formats strfmt.Registry) error {
+ if swag.IsZero(m.ServiceDay) { // not required
+ return nil
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusTimetable) validateSpecialDays(formats strfmt.Registry) error {
+ if swag.IsZero(m.SpecialDays) { // not required
+ return nil
+ }
+
+ for i := 0; i < len(m.SpecialDays); i++ {
+ if swag.IsZero(m.SpecialDays[i]) { // not required
+ continue
+ }
+
+ if m.SpecialDays[i] != nil {
+ if err := m.SpecialDays[i].Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SpecialDays" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusTimetable) 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 tourism specification v2 bus timetable based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2BusTimetable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateServiceDay(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateSpecialDays(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStopTimes(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusTimetable) contextValidateServiceDay(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusTimetable) contextValidateSpecialDays(ctx context.Context, formats strfmt.Registry) error {
+
+ for i := 0; i < len(m.SpecialDays); i++ {
+
+ if m.SpecialDays[i] != nil {
+ if err := m.SpecialDays[i].ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SpecialDays" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2BusTimetable) 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 *PTXServiceDTOTourismSpecificationV2BusTimetable) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2BusTimetable) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOTourismSpecificationV2BusTimetable
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_date_period.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_date_period.go
new file mode 100644
index 00000000..0d6aac90
--- /dev/null
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_date_period.go
@@ -0,0 +1,57 @@
+// 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/strfmt"
+ "github.com/go-openapi/swag"
+)
+
+// PTXServiceDTOTourismSpecificationV2DatePeriod DatePeriod
+//
+// swagger:model PTX.Service.DTO.Tourism.Specification.V2.DatePeriod
+type PTXServiceDTOTourismSpecificationV2DatePeriod struct {
+
+ // String
+ //
+ // 營運結束日(格式: yyyy-MM-dd)
+ EndDate string `json:"EndDate,omitempty"`
+
+ // String
+ //
+ // 營運起始日(格式: yyyy-MM-dd)
+ StartDate string `json:"StartDate,omitempty"`
+}
+
+// Validate validates this p t x service d t o tourism specification v2 date period
+func (m *PTXServiceDTOTourismSpecificationV2DatePeriod) Validate(formats strfmt.Registry) error {
+ return nil
+}
+
+// ContextValidate validates this p t x service d t o tourism specification v2 date period based on context it is used
+func (m *PTXServiceDTOTourismSpecificationV2DatePeriod) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2DatePeriod) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2DatePeriod) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOTourismSpecificationV2DatePeriod
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_hotel_tourism_info.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_hotel_tourism_info.go
index beda5598..0a00a90b 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_hotel_tourism_info.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_hotel_tourism_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -162,7 +164,6 @@ func (m *PTXServiceDTOTourismSpecificationV2HotelTourismInfo) validateID(formats
}
func (m *PTXServiceDTOTourismSpecificationV2HotelTourismInfo) validatePicture(formats strfmt.Registry) error {
-
if swag.IsZero(m.Picture) { // not required
return nil
}
@@ -171,7 +172,6 @@ func (m *PTXServiceDTOTourismSpecificationV2HotelTourismInfo) validatePicture(fo
}
func (m *PTXServiceDTOTourismSpecificationV2HotelTourismInfo) validatePosition(formats strfmt.Registry) error {
-
if swag.IsZero(m.Position) { // not required
return nil
}
@@ -197,6 +197,34 @@ func (m *PTXServiceDTOTourismSpecificationV2HotelTourismInfo) validateUpdateTime
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 hotel tourism info based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2HotelTourismInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidatePicture(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidatePosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2HotelTourismInfo) contextValidatePicture(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2HotelTourismInfo) contextValidatePosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2HotelTourismInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_restaurant_tourism_info.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_restaurant_tourism_info.go
index 9fc7fa41..7a116010 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_restaurant_tourism_info.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_restaurant_tourism_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -147,7 +149,6 @@ func (m *PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo) validateID(fo
}
func (m *PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo) validatePicture(formats strfmt.Registry) error {
-
if swag.IsZero(m.Picture) { // not required
return nil
}
@@ -156,7 +157,6 @@ func (m *PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo) validatePictu
}
func (m *PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo) validatePosition(formats strfmt.Registry) error {
-
if swag.IsZero(m.Position) { // not required
return nil
}
@@ -182,6 +182,34 @@ func (m *PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo) validateUpdat
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 restaurant tourism info based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidatePicture(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidatePosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo) contextValidatePicture(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo) contextValidatePosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2RestaurantTourismInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_route_operator.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_route_operator.go
new file mode 100644
index 00000000..6ef48ede
--- /dev/null
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_route_operator.go
@@ -0,0 +1,144 @@
+// 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"
+)
+
+// PTXServiceDTOTourismSpecificationV2RouteOperator RouteOperator
+//
+// 營運業者資訊
+//
+// swagger:model PTX.Service.DTO.Tourism.Specification.V2.RouteOperator
+type PTXServiceDTOTourismSpecificationV2RouteOperator struct {
+
+ // String
+ //
+ // 營運業者簡碼
+ // Required: true
+ OperatorCode *string `json:"OperatorCode"`
+
+ // String
+ //
+ // 營運業者代碼
+ // Required: true
+ OperatorID *string `json:"OperatorID"`
+
+ // NameType
+ //
+ // 營運業者名稱
+ // Required: true
+ OperatorName struct {
+ PTXServiceDTOSharedSpecificationV2BaseNameType
+ } `json:"OperatorName"`
+
+ // String
+ //
+ // 營運業者編號[交通部票證資料系統定義]
+ // Required: true
+ OperatorNo *string `json:"OperatorNo"`
+}
+
+// Validate validates this p t x service d t o tourism specification v2 route operator
+func (m *PTXServiceDTOTourismSpecificationV2RouteOperator) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ 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.validateOperatorName(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateOperatorNo(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2RouteOperator) validateOperatorCode(formats strfmt.Registry) error {
+
+ if err := validate.Required("OperatorCode", "body", m.OperatorCode); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2RouteOperator) validateOperatorID(formats strfmt.Registry) error {
+
+ if err := validate.Required("OperatorID", "body", m.OperatorID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2RouteOperator) validateOperatorName(formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2RouteOperator) validateOperatorNo(formats strfmt.Registry) error {
+
+ if err := validate.Required("OperatorNo", "body", m.OperatorNo); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validate this p t x service d t o tourism specification v2 route operator based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2RouteOperator) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateOperatorName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2RouteOperator) contextValidateOperatorName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2RouteOperator) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2RouteOperator) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOTourismSpecificationV2RouteOperator
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_scenic_spot_tourism_info.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_scenic_spot_tourism_info.go
index 8eb9cafc..6b631da4 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_scenic_spot_tourism_info.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_scenic_spot_tourism_info.go
@@ -6,6 +6,8 @@ package models
// 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"
@@ -198,7 +200,6 @@ func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) validateID(fo
}
func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) validateParkingPosition(formats strfmt.Registry) error {
-
if swag.IsZero(m.ParkingPosition) { // not required
return nil
}
@@ -207,7 +208,6 @@ func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) validateParki
}
func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) validatePicture(formats strfmt.Registry) error {
-
if swag.IsZero(m.Picture) { // not required
return nil
}
@@ -216,7 +216,6 @@ func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) validatePictu
}
func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) validatePosition(formats strfmt.Registry) error {
-
if swag.IsZero(m.Position) { // not required
return nil
}
@@ -242,6 +241,43 @@ func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) validateUpdat
return nil
}
+// ContextValidate validate this p t x service d t o tourism specification v2 scenic spot tourism info based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateParkingPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidatePicture(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidatePosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) contextValidateParkingPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) contextValidatePicture(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) contextValidatePosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2ScenicSpotTourismInfo) MarshalBinary() ([]byte, error) {
if m == nil {
diff --git a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_service_day.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_service_day.go
similarity index 64%
rename from bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_service_day.go
rename to tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_service_day.go
index 06785263..4c5a4e2c 100644
--- a/bus/v2/models/p_t_x_service_d_t_o_bus_specification_v2_service_day.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_service_day.go
@@ -6,18 +6,20 @@ package models
// 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"
)
-// PTXServiceDTOBusSpecificationV2ServiceDay ServiceDay
+// PTXServiceDTOTourismSpecificationV2ServiceDay ServiceDay
//
// 週內營運日資料
//
-// swagger:model PTX.Service.DTO.Bus.Specification.V2.ServiceDay
-type PTXServiceDTOBusSpecificationV2ServiceDay struct {
+// swagger:model PTX.Service.DTO.Tourism.Specification.V2.ServiceDay
+type PTXServiceDTOTourismSpecificationV2ServiceDay struct {
// integer
//
@@ -67,8 +69,8 @@ type PTXServiceDTOBusSpecificationV2ServiceDay struct {
Wednesday *int32 `json:"Wednesday"`
}
-// Validate validates this p t x service d t o bus specification v2 service day
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) Validate(formats strfmt.Registry) error {
+// Validate validates this p t x service d t o tourism specification v2 service day
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFriday(formats); err != nil {
@@ -105,7 +107,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) Validate(formats strfmt.Regi
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateFriday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) validateFriday(formats strfmt.Registry) error {
if err := validate.Required("Friday", "body", m.Friday); err != nil {
return err
@@ -114,7 +116,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateFriday(formats strfm
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateMonday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) validateMonday(formats strfmt.Registry) error {
if err := validate.Required("Monday", "body", m.Monday); err != nil {
return err
@@ -123,7 +125,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateMonday(formats strfm
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateSaturday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) validateSaturday(formats strfmt.Registry) error {
if err := validate.Required("Saturday", "body", m.Saturday); err != nil {
return err
@@ -132,7 +134,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateSaturday(formats str
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateSunday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) validateSunday(formats strfmt.Registry) error {
if err := validate.Required("Sunday", "body", m.Sunday); err != nil {
return err
@@ -141,7 +143,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateSunday(formats strfm
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateThursday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) validateThursday(formats strfmt.Registry) error {
if err := validate.Required("Thursday", "body", m.Thursday); err != nil {
return err
@@ -150,7 +152,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateThursday(formats str
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateTuesday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) validateTuesday(formats strfmt.Registry) error {
if err := validate.Required("Tuesday", "body", m.Tuesday); err != nil {
return err
@@ -159,7 +161,7 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateTuesday(formats strf
return nil
}
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateWednesday(formats strfmt.Registry) error {
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) validateWednesday(formats strfmt.Registry) error {
if err := validate.Required("Wednesday", "body", m.Wednesday); err != nil {
return err
@@ -168,8 +170,13 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) validateWednesday(formats st
return nil
}
+// ContextValidate validates this p t x service d t o tourism specification v2 service day based on context it is used
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) MarshalBinary() ([]byte, error) {
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -177,8 +184,8 @@ func (m *PTXServiceDTOBusSpecificationV2ServiceDay) MarshalBinary() ([]byte, err
}
// UnmarshalBinary interface implementation
-func (m *PTXServiceDTOBusSpecificationV2ServiceDay) UnmarshalBinary(b []byte) error {
- var res PTXServiceDTOBusSpecificationV2ServiceDay
+func (m *PTXServiceDTOTourismSpecificationV2ServiceDay) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOTourismSpecificationV2ServiceDay
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_special_day.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_special_day.go
new file mode 100644
index 00000000..ad3180f7
--- /dev/null
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_special_day.go
@@ -0,0 +1,103 @@
+// 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"
+)
+
+// PTXServiceDTOTourismSpecificationV2SpecialDay SpecialDay
+//
+// 特殊營運日資料
+//
+// swagger:model PTX.Service.DTO.Tourism.Specification.V2.SpecialDay
+type PTXServiceDTOTourismSpecificationV2SpecialDay struct {
+
+ // DatePeriod
+ //
+ // 連續特殊日期
+ DatePeriod struct {
+ PTXServiceDTOTourismSpecificationV2DatePeriod
+ } `json:"DatePeriod,omitempty"`
+
+ // Array
+ //
+ // 不連續特殊日期
+ Dates []string `json:"Dates"`
+
+ // String
+ //
+ // 特殊營運描述
+ Description string `json:"Description,omitempty"`
+
+ // integer
+ //
+ // 營運服務狀態代碼 : [0:'正常營運',1:'加班營運',2:'取消/停駛營運']
+ ServiceStatus int32 `json:"ServiceStatus,omitempty"`
+}
+
+// Validate validates this p t x service d t o tourism specification v2 special day
+func (m *PTXServiceDTOTourismSpecificationV2SpecialDay) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateDatePeriod(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2SpecialDay) validateDatePeriod(formats strfmt.Registry) error {
+ if swag.IsZero(m.DatePeriod) { // not required
+ return nil
+ }
+
+ return nil
+}
+
+// ContextValidate validate this p t x service d t o tourism specification v2 special day based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2SpecialDay) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateDatePeriod(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2SpecialDay) contextValidateDatePeriod(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2SpecialDay) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2SpecialDay) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOTourismSpecificationV2SpecialDay
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_stop.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_stop.go
new file mode 100644
index 00000000..53050b6b
--- /dev/null
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_stop.go
@@ -0,0 +1,204 @@
+// 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"
+)
+
+// PTXServiceDTOTourismSpecificationV2Stop Stop
+//
+// 站牌代碼資料
+//
+// swagger:model PTX.Service.DTO.Tourism.Specification.V2.Stop
+type PTXServiceDTOTourismSpecificationV2Stop struct {
+
+ // String
+ //
+ // 站牌位置縣市之代碼(國際ISO 3166-2 三碼城市代碼)[若為公路/國道客運路線則為空值]
+ LocationCityCode string `json:"LocationCityCode,omitempty"`
+
+ // String
+ //
+ // 站牌所屬的組站位ID
+ // Required: true
+ StationGroupID *string `json:"StationGroupID"`
+
+ // String
+ //
+ // 站牌所屬的站位ID
+ StationID string `json:"StationID,omitempty"`
+
+ // integer
+ //
+ // 上下車站別 : [-1:'可下車',0:'可上下車',1:'可上車']
+ StopBoarding int32 `json:"StopBoarding,omitempty"`
+
+ // String
+ //
+ // 地區既用中之站牌代碼(為原資料內碼)
+ // Required: true
+ StopID *string `json:"StopID"`
+
+ // NameType
+ //
+ // 站牌名稱
+ // Required: true
+ StopName struct {
+ PTXServiceDTOSharedSpecificationV2BaseNameType
+ } `json:"StopName"`
+
+ // PointType
+ //
+ // 站牌位置
+ // Required: true
+ StopPosition struct {
+ PTXServiceDTOSharedSpecificationV2BasePointType
+ } `json:"StopPosition"`
+
+ // Int32
+ //
+ // 路線經過站牌之順序
+ // Required: true
+ StopSequence *int32 `json:"StopSequence"`
+
+ // String
+ //
+ // 站牌唯一識別代碼,規則為 {業管機關簡碼} + {StopID},其中 {業管機關簡碼} 可於Authority API中的AuthorityCode欄位查詢
+ // Required: true
+ StopUID *string `json:"StopUID"`
+}
+
+// Validate validates this p t x service d t o tourism specification v2 stop
+func (m *PTXServiceDTOTourismSpecificationV2Stop) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateStationGroupID(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.validateStopPosition(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 len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2Stop) validateStationGroupID(formats strfmt.Registry) error {
+
+ if err := validate.Required("StationGroupID", "body", m.StationGroupID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2Stop) validateStopID(formats strfmt.Registry) error {
+
+ if err := validate.Required("StopID", "body", m.StopID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2Stop) validateStopName(formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2Stop) validateStopPosition(formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2Stop) validateStopSequence(formats strfmt.Registry) error {
+
+ if err := validate.Required("StopSequence", "body", m.StopSequence); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2Stop) validateStopUID(formats strfmt.Registry) error {
+
+ if err := validate.Required("StopUID", "body", m.StopUID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validate this p t x service d t o tourism specification v2 stop based on the context it is used
+func (m *PTXServiceDTOTourismSpecificationV2Stop) 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.contextValidateStopPosition(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2Stop) contextValidateStopName(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+func (m *PTXServiceDTOTourismSpecificationV2Stop) contextValidateStopPosition(ctx context.Context, formats strfmt.Registry) error {
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2Stop) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *PTXServiceDTOTourismSpecificationV2Stop) UnmarshalBinary(b []byte) error {
+ var res PTXServiceDTOTourismSpecificationV2Stop
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_tourism_picture.go b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_tourism_picture.go
index 8e516270..a5b0f785 100644
--- a/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_tourism_picture.go
+++ b/tourism/v2/models/p_t_x_service_d_t_o_tourism_specification_v2_tourism_picture.go
@@ -6,6 +6,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
+ "context"
+
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -53,6 +55,11 @@ func (m *PTXServiceDTOTourismSpecificationV2TourismPicture) Validate(formats str
return nil
}
+// ContextValidate validates this p t x service d t o tourism specification v2 tourism picture based on context it is used
+func (m *PTXServiceDTOTourismSpecificationV2TourismPicture) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ return nil
+}
+
// MarshalBinary interface implementation
func (m *PTXServiceDTOTourismSpecificationV2TourismPicture) MarshalBinary() ([]byte, error) {
if m == nil {