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
17package 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
22import (
23	"fmt"
24
25	"github.com/go-openapi/runtime"
26
27	strfmt "github.com/go-openapi/strfmt"
28)
29
30// New creates a new general API client.
31func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
32	return &Client{transport: transport, formats: formats}
33}
34
35/*
36Client for general API
37*/
38type Client struct {
39	transport runtime.ClientTransport
40	formats   strfmt.Registry
41}
42
43/*
44GetStatus Get current status of an Alertmanager instance and its cluster
45*/
46func (a *Client) GetStatus(params *GetStatusParams) (*GetStatusOK, error) {
47	// TODO: Validate the params before sending
48	if params == nil {
49		params = NewGetStatusParams()
50	}
51
52	result, err := a.transport.Submit(&runtime.ClientOperation{
53		ID:                 "getStatus",
54		Method:             "GET",
55		PathPattern:        "/status",
56		ProducesMediaTypes: []string{"application/json"},
57		ConsumesMediaTypes: []string{"application/json"},
58		Schemes:            []string{"http"},
59		Params:             params,
60		Reader:             &GetStatusReader{formats: a.formats},
61		Context:            params.Context,
62		Client:             params.HTTPClient,
63	})
64	if err != nil {
65		return nil, err
66	}
67	success, ok := result.(*GetStatusOK)
68	if ok {
69		return success, nil
70	}
71	// unexpected success response
72	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
73	msg := fmt.Sprintf("unexpected success response for getStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result)
74	panic(msg)
75}
76
77// SetTransport changes the transport on the client
78func (a *Client) SetTransport(transport runtime.ClientTransport) {
79	a.transport = transport
80}
81