update prometheus dependencies (#5520)
Signed-off-by: junot <junotxiang@kubesphere.io>
This commit is contained in:
@@ -27,51 +27,51 @@ import (
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetReceiversParams creates a new GetReceiversParams object
|
||||
// with the default values initialized.
|
||||
// NewGetReceiversParams creates a new GetReceiversParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetReceiversParams() *GetReceiversParams {
|
||||
|
||||
return &GetReceiversParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetReceiversParamsWithTimeout creates a new GetReceiversParams 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 NewGetReceiversParamsWithTimeout(timeout time.Duration) *GetReceiversParams {
|
||||
|
||||
return &GetReceiversParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetReceiversParamsWithContext creates a new GetReceiversParams 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 NewGetReceiversParamsWithContext(ctx context.Context) *GetReceiversParams {
|
||||
|
||||
return &GetReceiversParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetReceiversParamsWithHTTPClient creates a new GetReceiversParams 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 NewGetReceiversParamsWithHTTPClient(client *http.Client) *GetReceiversParams {
|
||||
|
||||
return &GetReceiversParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetReceiversParams contains all the parameters to send to the API endpoint
|
||||
for the get receivers operation typically these are written to a http.Request
|
||||
/*
|
||||
GetReceiversParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get receivers operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetReceiversParams struct {
|
||||
timeout time.Duration
|
||||
@@ -79,6 +79,21 @@ type GetReceiversParams struct {
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get receivers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetReceiversParams) WithDefaults() *GetReceiversParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get receivers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetReceiversParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get receivers params
|
||||
func (o *GetReceiversParams) WithTimeout(timeout time.Duration) *GetReceiversParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
||||
@@ -24,10 +24,9 @@ import (
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
models "github.com/prometheus/alertmanager/api/v2/models"
|
||||
"github.com/prometheus/alertmanager/api/v2/models"
|
||||
)
|
||||
|
||||
// GetReceiversReader is a Reader for the GetReceivers structure.
|
||||
@@ -44,9 +43,8 @@ func (o *GetReceiversReader) ReadResponse(response runtime.ClientResponse, consu
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +53,8 @@ func NewGetReceiversOK() *GetReceiversOK {
|
||||
return &GetReceiversOK{}
|
||||
}
|
||||
|
||||
/*GetReceiversOK handles this case with default header values.
|
||||
/*
|
||||
GetReceiversOK describes a response with status code 200, with default header values.
|
||||
|
||||
Get receivers response
|
||||
*/
|
||||
@@ -63,10 +62,39 @@ type GetReceiversOK struct {
|
||||
Payload []*models.Receiver
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get receivers o k response has a 2xx status code
|
||||
func (o *GetReceiversOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get receivers o k response has a 3xx status code
|
||||
func (o *GetReceiversOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get receivers o k response has a 4xx status code
|
||||
func (o *GetReceiversOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get receivers o k response has a 5xx status code
|
||||
func (o *GetReceiversOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get receivers o k response a status code equal to that given
|
||||
func (o *GetReceiversOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetReceiversOK) Error() string {
|
||||
return fmt.Sprintf("[GET /receivers][%d] getReceiversOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetReceiversOK) String() string {
|
||||
return fmt.Sprintf("[GET /receivers][%d] getReceiversOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetReceiversOK) GetPayload() []*models.Receiver {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
27
vendor/github.com/prometheus/alertmanager/api/v2/client/receiver/receiver_client.go
generated
vendored
27
vendor/github.com/prometheus/alertmanager/api/v2/client/receiver/receiver_client.go
generated
vendored
@@ -23,12 +23,11 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new receiver API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
@@ -40,16 +39,25 @@ type Client struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetReceivers(params *GetReceiversParams, opts ...ClientOption) (*GetReceiversOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetReceivers Get list of all receivers (name of notification integrations)
|
||||
*/
|
||||
func (a *Client) GetReceivers(params *GetReceiversParams) (*GetReceiversOK, error) {
|
||||
func (a *Client) GetReceivers(params *GetReceiversParams, opts ...ClientOption) (*GetReceiversOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetReceiversParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getReceivers",
|
||||
Method: "GET",
|
||||
PathPattern: "/receivers",
|
||||
@@ -60,7 +68,12 @@ func (a *Client) GetReceivers(params *GetReceiversParams) (*GetReceiversOK, erro
|
||||
Reader: &GetReceiversReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user