chore(backend): regenerate openapi code

This commit is contained in:
Łukasz Mierzwa
2024-05-14 14:09:22 +00:00
committed by github-actions[bot]
parent 890ed5f1f7
commit b9363edb59
17 changed files with 225 additions and 50 deletions
@@ -9,6 +9,7 @@ import (
"fmt"
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
@@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi
return &Client{transport: transport, formats: formats}
}
// New creates a new alert API client with basic auth credentials.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - user: user for basic authentication header.
// - password: password for basic authentication header.
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
return &Client{transport: transport, formats: strfmt.Default}
}
// New creates a new alert API client with a bearer token for authentication.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - bearerToken: bearer token for Bearer authentication header.
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
return &Client{transport: transport, formats: strfmt.Default}
}
/*
Client for alert API
*/
@@ -25,7 +51,7 @@ type Client struct {
formats strfmt.Registry
}
// ClientOption is the option for Client methods
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
@@ -6,6 +6,7 @@ package alert
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
@@ -91,11 +92,13 @@ func (o *GetAlertsOK) Code() int {
}
func (o *GetAlertsOK) Error() string {
return fmt.Sprintf("[GET /alerts][%d] getAlertsOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts][%d] getAlertsOK %s", 200, payload)
}
func (o *GetAlertsOK) String() string {
return fmt.Sprintf("[GET /alerts][%d] getAlertsOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts][%d] getAlertsOK %s", 200, payload)
}
func (o *GetAlertsOK) GetPayload() models.GettableAlerts {
@@ -157,11 +160,13 @@ func (o *GetAlertsBadRequest) Code() int {
}
func (o *GetAlertsBadRequest) Error() string {
return fmt.Sprintf("[GET /alerts][%d] getAlertsBadRequest %+v", 400, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts][%d] getAlertsBadRequest %s", 400, payload)
}
func (o *GetAlertsBadRequest) String() string {
return fmt.Sprintf("[GET /alerts][%d] getAlertsBadRequest %+v", 400, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts][%d] getAlertsBadRequest %s", 400, payload)
}
func (o *GetAlertsBadRequest) GetPayload() string {
@@ -223,11 +228,13 @@ func (o *GetAlertsInternalServerError) Code() int {
}
func (o *GetAlertsInternalServerError) Error() string {
return fmt.Sprintf("[GET /alerts][%d] getAlertsInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts][%d] getAlertsInternalServerError %s", 500, payload)
}
func (o *GetAlertsInternalServerError) String() string {
return fmt.Sprintf("[GET /alerts][%d] getAlertsInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts][%d] getAlertsInternalServerError %s", 500, payload)
}
func (o *GetAlertsInternalServerError) GetPayload() string {
@@ -6,6 +6,7 @@ package alert
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
@@ -88,11 +89,11 @@ func (o *PostAlertsOK) Code() int {
}
func (o *PostAlertsOK) Error() string {
return fmt.Sprintf("[POST /alerts][%d] postAlertsOK ", 200)
return fmt.Sprintf("[POST /alerts][%d] postAlertsOK", 200)
}
func (o *PostAlertsOK) String() string {
return fmt.Sprintf("[POST /alerts][%d] postAlertsOK ", 200)
return fmt.Sprintf("[POST /alerts][%d] postAlertsOK", 200)
}
func (o *PostAlertsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
@@ -145,11 +146,13 @@ func (o *PostAlertsBadRequest) Code() int {
}
func (o *PostAlertsBadRequest) Error() string {
return fmt.Sprintf("[POST /alerts][%d] postAlertsBadRequest %+v", 400, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /alerts][%d] postAlertsBadRequest %s", 400, payload)
}
func (o *PostAlertsBadRequest) String() string {
return fmt.Sprintf("[POST /alerts][%d] postAlertsBadRequest %+v", 400, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /alerts][%d] postAlertsBadRequest %s", 400, payload)
}
func (o *PostAlertsBadRequest) GetPayload() string {
@@ -211,11 +214,13 @@ func (o *PostAlertsInternalServerError) Code() int {
}
func (o *PostAlertsInternalServerError) Error() string {
return fmt.Sprintf("[POST /alerts][%d] postAlertsInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /alerts][%d] postAlertsInternalServerError %s", 500, payload)
}
func (o *PostAlertsInternalServerError) String() string {
return fmt.Sprintf("[POST /alerts][%d] postAlertsInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /alerts][%d] postAlertsInternalServerError %s", 500, payload)
}
func (o *PostAlertsInternalServerError) GetPayload() string {
@@ -9,6 +9,7 @@ import (
"fmt"
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
@@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi
return &Client{transport: transport, formats: formats}
}
// New creates a new alertgroup API client with basic auth credentials.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - user: user for basic authentication header.
// - password: password for basic authentication header.
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
return &Client{transport: transport, formats: strfmt.Default}
}
// New creates a new alertgroup API client with a bearer token for authentication.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - bearerToken: bearer token for Bearer authentication header.
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
return &Client{transport: transport, formats: strfmt.Default}
}
/*
Client for alertgroup API
*/
@@ -25,7 +51,7 @@ type Client struct {
formats strfmt.Registry
}
// ClientOption is the option for Client methods
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
@@ -6,6 +6,7 @@ package alertgroup
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
@@ -91,11 +92,13 @@ func (o *GetAlertGroupsOK) Code() int {
}
func (o *GetAlertGroupsOK) Error() string {
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsOK %s", 200, payload)
}
func (o *GetAlertGroupsOK) String() string {
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsOK %s", 200, payload)
}
func (o *GetAlertGroupsOK) GetPayload() models.AlertGroups {
@@ -157,11 +160,13 @@ func (o *GetAlertGroupsBadRequest) Code() int {
}
func (o *GetAlertGroupsBadRequest) Error() string {
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsBadRequest %+v", 400, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsBadRequest %s", 400, payload)
}
func (o *GetAlertGroupsBadRequest) String() string {
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsBadRequest %+v", 400, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsBadRequest %s", 400, payload)
}
func (o *GetAlertGroupsBadRequest) GetPayload() string {
@@ -223,11 +228,13 @@ func (o *GetAlertGroupsInternalServerError) Code() int {
}
func (o *GetAlertGroupsInternalServerError) Error() string {
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsInternalServerError %s", 500, payload)
}
func (o *GetAlertGroupsInternalServerError) String() string {
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsInternalServerError %s", 500, payload)
}
func (o *GetAlertGroupsInternalServerError) GetPayload() string {
@@ -9,6 +9,7 @@ import (
"fmt"
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
@@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi
return &Client{transport: transport, formats: formats}
}
// New creates a new general API client with basic auth credentials.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - user: user for basic authentication header.
// - password: password for basic authentication header.
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
return &Client{transport: transport, formats: strfmt.Default}
}
// New creates a new general API client with a bearer token for authentication.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - bearerToken: bearer token for Bearer authentication header.
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
return &Client{transport: transport, formats: strfmt.Default}
}
/*
Client for general API
*/
@@ -25,7 +51,7 @@ type Client struct {
formats strfmt.Registry
}
// ClientOption is the option for Client methods
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
@@ -6,6 +6,7 @@ package general
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
@@ -79,11 +80,13 @@ func (o *GetStatusOK) Code() int {
}
func (o *GetStatusOK) Error() string {
return fmt.Sprintf("[GET /status][%d] getStatusOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /status][%d] getStatusOK %s", 200, payload)
}
func (o *GetStatusOK) String() string {
return fmt.Sprintf("[GET /status][%d] getStatusOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /status][%d] getStatusOK %s", 200, payload)
}
func (o *GetStatusOK) GetPayload() *models.AlertmanagerStatus {
@@ -6,6 +6,7 @@ package receiver
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
@@ -79,11 +80,13 @@ func (o *GetReceiversOK) Code() int {
}
func (o *GetReceiversOK) Error() string {
return fmt.Sprintf("[GET /receivers][%d] getReceiversOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /receivers][%d] getReceiversOK %s", 200, payload)
}
func (o *GetReceiversOK) String() string {
return fmt.Sprintf("[GET /receivers][%d] getReceiversOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /receivers][%d] getReceiversOK %s", 200, payload)
}
func (o *GetReceiversOK) GetPayload() []*models.Receiver {
@@ -9,6 +9,7 @@ import (
"fmt"
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
@@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi
return &Client{transport: transport, formats: formats}
}
// New creates a new receiver API client with basic auth credentials.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - user: user for basic authentication header.
// - password: password for basic authentication header.
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
return &Client{transport: transport, formats: strfmt.Default}
}
// New creates a new receiver API client with a bearer token for authentication.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - bearerToken: bearer token for Bearer authentication header.
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
return &Client{transport: transport, formats: strfmt.Default}
}
/*
Client for receiver API
*/
@@ -25,7 +51,7 @@ type Client struct {
formats strfmt.Registry
}
// ClientOption is the option for Client methods
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
@@ -6,6 +6,7 @@ package silence
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
@@ -82,11 +83,11 @@ func (o *DeleteSilenceOK) Code() int {
}
func (o *DeleteSilenceOK) Error() string {
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceOK ", 200)
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceOK", 200)
}
func (o *DeleteSilenceOK) String() string {
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceOK ", 200)
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceOK", 200)
}
func (o *DeleteSilenceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
@@ -139,11 +140,13 @@ func (o *DeleteSilenceInternalServerError) Code() int {
}
func (o *DeleteSilenceInternalServerError) Error() string {
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceInternalServerError %s", 500, payload)
}
func (o *DeleteSilenceInternalServerError) String() string {
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceInternalServerError %s", 500, payload)
}
func (o *DeleteSilenceInternalServerError) GetPayload() string {
@@ -6,6 +6,7 @@ package silence
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
@@ -91,11 +92,13 @@ func (o *GetSilenceOK) Code() int {
}
func (o *GetSilenceOK) Error() string {
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceOK %s", 200, payload)
}
func (o *GetSilenceOK) String() string {
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceOK %s", 200, payload)
}
func (o *GetSilenceOK) GetPayload() *models.GettableSilence {
@@ -158,11 +161,11 @@ func (o *GetSilenceNotFound) Code() int {
}
func (o *GetSilenceNotFound) Error() string {
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceNotFound ", 404)
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceNotFound", 404)
}
func (o *GetSilenceNotFound) String() string {
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceNotFound ", 404)
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceNotFound", 404)
}
func (o *GetSilenceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
@@ -215,11 +218,13 @@ func (o *GetSilenceInternalServerError) Code() int {
}
func (o *GetSilenceInternalServerError) Error() string {
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceInternalServerError %s", 500, payload)
}
func (o *GetSilenceInternalServerError) String() string {
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceInternalServerError %s", 500, payload)
}
func (o *GetSilenceInternalServerError) GetPayload() string {
@@ -6,6 +6,7 @@ package silence
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
@@ -85,11 +86,13 @@ func (o *GetSilencesOK) Code() int {
}
func (o *GetSilencesOK) Error() string {
return fmt.Sprintf("[GET /silences][%d] getSilencesOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /silences][%d] getSilencesOK %s", 200, payload)
}
func (o *GetSilencesOK) String() string {
return fmt.Sprintf("[GET /silences][%d] getSilencesOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /silences][%d] getSilencesOK %s", 200, payload)
}
func (o *GetSilencesOK) GetPayload() models.GettableSilences {
@@ -151,11 +154,13 @@ func (o *GetSilencesInternalServerError) Code() int {
}
func (o *GetSilencesInternalServerError) Error() string {
return fmt.Sprintf("[GET /silences][%d] getSilencesInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /silences][%d] getSilencesInternalServerError %s", 500, payload)
}
func (o *GetSilencesInternalServerError) String() string {
return fmt.Sprintf("[GET /silences][%d] getSilencesInternalServerError %+v", 500, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /silences][%d] getSilencesInternalServerError %s", 500, payload)
}
func (o *GetSilencesInternalServerError) GetPayload() string {
@@ -7,6 +7,7 @@ package silence
import (
"context"
"encoding/json"
"fmt"
"io"
@@ -91,11 +92,13 @@ func (o *PostSilencesOK) Code() int {
}
func (o *PostSilencesOK) Error() string {
return fmt.Sprintf("[POST /silences][%d] postSilencesOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /silences][%d] postSilencesOK %s", 200, payload)
}
func (o *PostSilencesOK) String() string {
return fmt.Sprintf("[POST /silences][%d] postSilencesOK %+v", 200, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /silences][%d] postSilencesOK %s", 200, payload)
}
func (o *PostSilencesOK) GetPayload() *PostSilencesOKBody {
@@ -159,11 +162,13 @@ func (o *PostSilencesBadRequest) Code() int {
}
func (o *PostSilencesBadRequest) Error() string {
return fmt.Sprintf("[POST /silences][%d] postSilencesBadRequest %+v", 400, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /silences][%d] postSilencesBadRequest %s", 400, payload)
}
func (o *PostSilencesBadRequest) String() string {
return fmt.Sprintf("[POST /silences][%d] postSilencesBadRequest %+v", 400, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /silences][%d] postSilencesBadRequest %s", 400, payload)
}
func (o *PostSilencesBadRequest) GetPayload() string {
@@ -225,11 +230,13 @@ func (o *PostSilencesNotFound) Code() int {
}
func (o *PostSilencesNotFound) Error() string {
return fmt.Sprintf("[POST /silences][%d] postSilencesNotFound %+v", 404, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /silences][%d] postSilencesNotFound %s", 404, payload)
}
func (o *PostSilencesNotFound) String() string {
return fmt.Sprintf("[POST /silences][%d] postSilencesNotFound %+v", 404, o.Payload)
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /silences][%d] postSilencesNotFound %s", 404, payload)
}
func (o *PostSilencesNotFound) GetPayload() string {
@@ -9,6 +9,7 @@ import (
"fmt"
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
@@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi
return &Client{transport: transport, formats: formats}
}
// New creates a new silence API client with basic auth credentials.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - user: user for basic authentication header.
// - password: password for basic authentication header.
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
return &Client{transport: transport, formats: strfmt.Default}
}
// New creates a new silence API client with a bearer token for authentication.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - bearerToken: bearer token for Bearer authentication header.
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
return &Client{transport: transport, formats: strfmt.Default}
}
/*
Client for silence API
*/
@@ -25,7 +51,7 @@ type Client struct {
formats strfmt.Registry
}
// ClientOption is the option for Client methods
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
+1 -1
View File
@@ -30,7 +30,7 @@ type AlertStatus struct {
// state
// Required: true
// Enum: [unprocessed active suppressed]
// Enum: ["unprocessed","active","suppressed"]
State *string `json:"state"`
}
@@ -29,7 +29,7 @@ type ClusterStatus struct {
// status
// Required: true
// Enum: [ready settling disabled]
// Enum: ["ready","settling","disabled"]
Status *string `json:"status"`
}
@@ -22,7 +22,7 @@ type SilenceStatus struct {
// state
// Required: true
// Enum: [expired active pending]
// Enum: ["expired","active","pending"]
State *string `json:"state"`
}