...

Source file src/github.com/prometheus/alertmanager/api/v2/restapi/operations/general/get_status_parameters.go

Documentation: github.com/prometheus/alertmanager/api/v2/restapi/operations/general

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright Prometheus Team
     4  // Licensed under the Apache License, Version 2.0 (the "License");
     5  // you may not use this file except in compliance with the License.
     6  // You may obtain a copy of the License at
     7  //
     8  // http://www.apache.org/licenses/LICENSE-2.0
     9  //
    10  // Unless required by applicable law or agreed to in writing, software
    11  // distributed under the License is distributed on an "AS IS" BASIS,
    12  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  // See the License for the specific language governing permissions and
    14  // limitations under the License.
    15  //
    16  
    17  package general
    18  
    19  // This file was generated by the swagger tool.
    20  // Editing this file might prove futile when you re-run the swagger generate command
    21  
    22  import (
    23  	"net/http"
    24  
    25  	"github.com/go-openapi/errors"
    26  	"github.com/go-openapi/runtime/middleware"
    27  )
    28  
    29  // NewGetStatusParams creates a new GetStatusParams object
    30  //
    31  // There are no default values defined in the spec.
    32  func NewGetStatusParams() GetStatusParams {
    33  
    34  	return GetStatusParams{}
    35  }
    36  
    37  // GetStatusParams contains all the bound params for the get status operation
    38  // typically these are obtained from a http.Request
    39  //
    40  // swagger:parameters getStatus
    41  type GetStatusParams struct {
    42  
    43  	// HTTP Request Object
    44  	HTTPRequest *http.Request `json:"-"`
    45  }
    46  
    47  // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
    48  // for simple values it will use straight method calls.
    49  //
    50  // To ensure default values, the struct must have been initialized with NewGetStatusParams() beforehand.
    51  func (o *GetStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
    52  	var res []error
    53  
    54  	o.HTTPRequest = r
    55  
    56  	if len(res) > 0 {
    57  		return errors.CompositeValidationError(res...)
    58  	}
    59  	return nil
    60  }
    61  

View as plain text