...

Source file src/github.com/prometheus/alertmanager/api/v2/restapi/operations/alertgroup/get_alert_groups_responses.go

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

     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 alertgroup
    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/runtime"
    26  
    27  	"github.com/prometheus/alertmanager/api/v2/models"
    28  )
    29  
    30  // GetAlertGroupsOKCode is the HTTP code returned for type GetAlertGroupsOK
    31  const GetAlertGroupsOKCode int = 200
    32  
    33  /*
    34  GetAlertGroupsOK Get alert groups response
    35  
    36  swagger:response getAlertGroupsOK
    37  */
    38  type GetAlertGroupsOK struct {
    39  
    40  	/*
    41  	  In: Body
    42  	*/
    43  	Payload models.AlertGroups `json:"body,omitempty"`
    44  }
    45  
    46  // NewGetAlertGroupsOK creates GetAlertGroupsOK with default headers values
    47  func NewGetAlertGroupsOK() *GetAlertGroupsOK {
    48  
    49  	return &GetAlertGroupsOK{}
    50  }
    51  
    52  // WithPayload adds the payload to the get alert groups o k response
    53  func (o *GetAlertGroupsOK) WithPayload(payload models.AlertGroups) *GetAlertGroupsOK {
    54  	o.Payload = payload
    55  	return o
    56  }
    57  
    58  // SetPayload sets the payload to the get alert groups o k response
    59  func (o *GetAlertGroupsOK) SetPayload(payload models.AlertGroups) {
    60  	o.Payload = payload
    61  }
    62  
    63  // WriteResponse to the client
    64  func (o *GetAlertGroupsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    65  
    66  	rw.WriteHeader(200)
    67  	payload := o.Payload
    68  	if payload == nil {
    69  		// return empty array
    70  		payload = models.AlertGroups{}
    71  	}
    72  
    73  	if err := producer.Produce(rw, payload); err != nil {
    74  		panic(err) // let the recovery middleware deal with this
    75  	}
    76  }
    77  
    78  // GetAlertGroupsBadRequestCode is the HTTP code returned for type GetAlertGroupsBadRequest
    79  const GetAlertGroupsBadRequestCode int = 400
    80  
    81  /*
    82  GetAlertGroupsBadRequest Bad request
    83  
    84  swagger:response getAlertGroupsBadRequest
    85  */
    86  type GetAlertGroupsBadRequest struct {
    87  
    88  	/*
    89  	  In: Body
    90  	*/
    91  	Payload string `json:"body,omitempty"`
    92  }
    93  
    94  // NewGetAlertGroupsBadRequest creates GetAlertGroupsBadRequest with default headers values
    95  func NewGetAlertGroupsBadRequest() *GetAlertGroupsBadRequest {
    96  
    97  	return &GetAlertGroupsBadRequest{}
    98  }
    99  
   100  // WithPayload adds the payload to the get alert groups bad request response
   101  func (o *GetAlertGroupsBadRequest) WithPayload(payload string) *GetAlertGroupsBadRequest {
   102  	o.Payload = payload
   103  	return o
   104  }
   105  
   106  // SetPayload sets the payload to the get alert groups bad request response
   107  func (o *GetAlertGroupsBadRequest) SetPayload(payload string) {
   108  	o.Payload = payload
   109  }
   110  
   111  // WriteResponse to the client
   112  func (o *GetAlertGroupsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   113  
   114  	rw.WriteHeader(400)
   115  	payload := o.Payload
   116  	if err := producer.Produce(rw, payload); err != nil {
   117  		panic(err) // let the recovery middleware deal with this
   118  	}
   119  }
   120  
   121  // GetAlertGroupsInternalServerErrorCode is the HTTP code returned for type GetAlertGroupsInternalServerError
   122  const GetAlertGroupsInternalServerErrorCode int = 500
   123  
   124  /*
   125  GetAlertGroupsInternalServerError Internal server error
   126  
   127  swagger:response getAlertGroupsInternalServerError
   128  */
   129  type GetAlertGroupsInternalServerError struct {
   130  
   131  	/*
   132  	  In: Body
   133  	*/
   134  	Payload string `json:"body,omitempty"`
   135  }
   136  
   137  // NewGetAlertGroupsInternalServerError creates GetAlertGroupsInternalServerError with default headers values
   138  func NewGetAlertGroupsInternalServerError() *GetAlertGroupsInternalServerError {
   139  
   140  	return &GetAlertGroupsInternalServerError{}
   141  }
   142  
   143  // WithPayload adds the payload to the get alert groups internal server error response
   144  func (o *GetAlertGroupsInternalServerError) WithPayload(payload string) *GetAlertGroupsInternalServerError {
   145  	o.Payload = payload
   146  	return o
   147  }
   148  
   149  // SetPayload sets the payload to the get alert groups internal server error response
   150  func (o *GetAlertGroupsInternalServerError) SetPayload(payload string) {
   151  	o.Payload = payload
   152  }
   153  
   154  // WriteResponse to the client
   155  func (o *GetAlertGroupsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   156  
   157  	rw.WriteHeader(500)
   158  	payload := o.Payload
   159  	if err := producer.Produce(rw, payload); err != nil {
   160  		panic(err) // let the recovery middleware deal with this
   161  	}
   162  }
   163  

View as plain text