github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/schema/tenants_create_responses.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  // Code generated by go-swagger; DO NOT EDIT.
    13  
    14  package schema
    15  
    16  // This file was generated by the swagger tool.
    17  // Editing this file might prove futile when you re-run the swagger generate command
    18  
    19  import (
    20  	"net/http"
    21  
    22  	"github.com/go-openapi/runtime"
    23  
    24  	"github.com/weaviate/weaviate/entities/models"
    25  )
    26  
    27  // TenantsCreateOKCode is the HTTP code returned for type TenantsCreateOK
    28  const TenantsCreateOKCode int = 200
    29  
    30  /*
    31  TenantsCreateOK Added new tenants to the specified class
    32  
    33  swagger:response tenantsCreateOK
    34  */
    35  type TenantsCreateOK struct {
    36  
    37  	/*
    38  	  In: Body
    39  	*/
    40  	Payload []*models.Tenant `json:"body,omitempty"`
    41  }
    42  
    43  // NewTenantsCreateOK creates TenantsCreateOK with default headers values
    44  func NewTenantsCreateOK() *TenantsCreateOK {
    45  
    46  	return &TenantsCreateOK{}
    47  }
    48  
    49  // WithPayload adds the payload to the tenants create o k response
    50  func (o *TenantsCreateOK) WithPayload(payload []*models.Tenant) *TenantsCreateOK {
    51  	o.Payload = payload
    52  	return o
    53  }
    54  
    55  // SetPayload sets the payload to the tenants create o k response
    56  func (o *TenantsCreateOK) SetPayload(payload []*models.Tenant) {
    57  	o.Payload = payload
    58  }
    59  
    60  // WriteResponse to the client
    61  func (o *TenantsCreateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    62  
    63  	rw.WriteHeader(200)
    64  	payload := o.Payload
    65  	if payload == nil {
    66  		// return empty array
    67  		payload = make([]*models.Tenant, 0, 50)
    68  	}
    69  
    70  	if err := producer.Produce(rw, payload); err != nil {
    71  		panic(err) // let the recovery middleware deal with this
    72  	}
    73  }
    74  
    75  // TenantsCreateUnauthorizedCode is the HTTP code returned for type TenantsCreateUnauthorized
    76  const TenantsCreateUnauthorizedCode int = 401
    77  
    78  /*
    79  TenantsCreateUnauthorized Unauthorized or invalid credentials.
    80  
    81  swagger:response tenantsCreateUnauthorized
    82  */
    83  type TenantsCreateUnauthorized struct {
    84  }
    85  
    86  // NewTenantsCreateUnauthorized creates TenantsCreateUnauthorized with default headers values
    87  func NewTenantsCreateUnauthorized() *TenantsCreateUnauthorized {
    88  
    89  	return &TenantsCreateUnauthorized{}
    90  }
    91  
    92  // WriteResponse to the client
    93  func (o *TenantsCreateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    94  
    95  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    96  
    97  	rw.WriteHeader(401)
    98  }
    99  
   100  // TenantsCreateForbiddenCode is the HTTP code returned for type TenantsCreateForbidden
   101  const TenantsCreateForbiddenCode int = 403
   102  
   103  /*
   104  TenantsCreateForbidden Forbidden
   105  
   106  swagger:response tenantsCreateForbidden
   107  */
   108  type TenantsCreateForbidden struct {
   109  
   110  	/*
   111  	  In: Body
   112  	*/
   113  	Payload *models.ErrorResponse `json:"body,omitempty"`
   114  }
   115  
   116  // NewTenantsCreateForbidden creates TenantsCreateForbidden with default headers values
   117  func NewTenantsCreateForbidden() *TenantsCreateForbidden {
   118  
   119  	return &TenantsCreateForbidden{}
   120  }
   121  
   122  // WithPayload adds the payload to the tenants create forbidden response
   123  func (o *TenantsCreateForbidden) WithPayload(payload *models.ErrorResponse) *TenantsCreateForbidden {
   124  	o.Payload = payload
   125  	return o
   126  }
   127  
   128  // SetPayload sets the payload to the tenants create forbidden response
   129  func (o *TenantsCreateForbidden) SetPayload(payload *models.ErrorResponse) {
   130  	o.Payload = payload
   131  }
   132  
   133  // WriteResponse to the client
   134  func (o *TenantsCreateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   135  
   136  	rw.WriteHeader(403)
   137  	if o.Payload != nil {
   138  		payload := o.Payload
   139  		if err := producer.Produce(rw, payload); err != nil {
   140  			panic(err) // let the recovery middleware deal with this
   141  		}
   142  	}
   143  }
   144  
   145  // TenantsCreateUnprocessableEntityCode is the HTTP code returned for type TenantsCreateUnprocessableEntity
   146  const TenantsCreateUnprocessableEntityCode int = 422
   147  
   148  /*
   149  TenantsCreateUnprocessableEntity Invalid Tenant class
   150  
   151  swagger:response tenantsCreateUnprocessableEntity
   152  */
   153  type TenantsCreateUnprocessableEntity struct {
   154  
   155  	/*
   156  	  In: Body
   157  	*/
   158  	Payload *models.ErrorResponse `json:"body,omitempty"`
   159  }
   160  
   161  // NewTenantsCreateUnprocessableEntity creates TenantsCreateUnprocessableEntity with default headers values
   162  func NewTenantsCreateUnprocessableEntity() *TenantsCreateUnprocessableEntity {
   163  
   164  	return &TenantsCreateUnprocessableEntity{}
   165  }
   166  
   167  // WithPayload adds the payload to the tenants create unprocessable entity response
   168  func (o *TenantsCreateUnprocessableEntity) WithPayload(payload *models.ErrorResponse) *TenantsCreateUnprocessableEntity {
   169  	o.Payload = payload
   170  	return o
   171  }
   172  
   173  // SetPayload sets the payload to the tenants create unprocessable entity response
   174  func (o *TenantsCreateUnprocessableEntity) SetPayload(payload *models.ErrorResponse) {
   175  	o.Payload = payload
   176  }
   177  
   178  // WriteResponse to the client
   179  func (o *TenantsCreateUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   180  
   181  	rw.WriteHeader(422)
   182  	if o.Payload != nil {
   183  		payload := o.Payload
   184  		if err := producer.Produce(rw, payload); err != nil {
   185  			panic(err) // let the recovery middleware deal with this
   186  		}
   187  	}
   188  }
   189  
   190  // TenantsCreateInternalServerErrorCode is the HTTP code returned for type TenantsCreateInternalServerError
   191  const TenantsCreateInternalServerErrorCode int = 500
   192  
   193  /*
   194  TenantsCreateInternalServerError An error has occurred while trying to fulfill the request. Most likely the ErrorResponse will contain more information about the error.
   195  
   196  swagger:response tenantsCreateInternalServerError
   197  */
   198  type TenantsCreateInternalServerError struct {
   199  
   200  	/*
   201  	  In: Body
   202  	*/
   203  	Payload *models.ErrorResponse `json:"body,omitempty"`
   204  }
   205  
   206  // NewTenantsCreateInternalServerError creates TenantsCreateInternalServerError with default headers values
   207  func NewTenantsCreateInternalServerError() *TenantsCreateInternalServerError {
   208  
   209  	return &TenantsCreateInternalServerError{}
   210  }
   211  
   212  // WithPayload adds the payload to the tenants create internal server error response
   213  func (o *TenantsCreateInternalServerError) WithPayload(payload *models.ErrorResponse) *TenantsCreateInternalServerError {
   214  	o.Payload = payload
   215  	return o
   216  }
   217  
   218  // SetPayload sets the payload to the tenants create internal server error response
   219  func (o *TenantsCreateInternalServerError) SetPayload(payload *models.ErrorResponse) {
   220  	o.Payload = payload
   221  }
   222  
   223  // WriteResponse to the client
   224  func (o *TenantsCreateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   225  
   226  	rw.WriteHeader(500)
   227  	if o.Payload != nil {
   228  		payload := o.Payload
   229  		if err := producer.Produce(rw, payload); err != nil {
   230  			panic(err) // let the recovery middleware deal with this
   231  		}
   232  	}
   233  }