mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-12-04 18:46:27 +00:00
496b60ba44
Signed-off-by: Mustafa Gezen <mustafa@ctrliq.com>
191 lines
6.1 KiB
Go
191 lines
6.1 KiB
Go
/*
|
|
* peridot/proto/v1/batch.proto
|
|
*
|
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
*
|
|
* API version: version not set
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package peridotopenapi
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// ApiHttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.
|
|
type ApiHttpBody struct {
|
|
// The HTTP Content-Type header value specifying the content type of the body.
|
|
ContentType *string `json:"contentType,omitempty"`
|
|
// The HTTP request/response body as raw binary.
|
|
Data *string `json:"data,omitempty"`
|
|
// Application specific response metadata. Must be set in the first response for streaming APIs.
|
|
Extensions *[]ProtobufAny `json:"extensions,omitempty"`
|
|
}
|
|
|
|
// NewApiHttpBody instantiates a new ApiHttpBody object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewApiHttpBody() *ApiHttpBody {
|
|
this := ApiHttpBody{}
|
|
return &this
|
|
}
|
|
|
|
// NewApiHttpBodyWithDefaults instantiates a new ApiHttpBody object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewApiHttpBodyWithDefaults() *ApiHttpBody {
|
|
this := ApiHttpBody{}
|
|
return &this
|
|
}
|
|
|
|
// GetContentType returns the ContentType field value if set, zero value otherwise.
|
|
func (o *ApiHttpBody) GetContentType() string {
|
|
if o == nil || o.ContentType == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ContentType
|
|
}
|
|
|
|
// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ApiHttpBody) GetContentTypeOk() (*string, bool) {
|
|
if o == nil || o.ContentType == nil {
|
|
return nil, false
|
|
}
|
|
return o.ContentType, true
|
|
}
|
|
|
|
// HasContentType returns a boolean if a field has been set.
|
|
func (o *ApiHttpBody) HasContentType() bool {
|
|
if o != nil && o.ContentType != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetContentType gets a reference to the given string and assigns it to the ContentType field.
|
|
func (o *ApiHttpBody) SetContentType(v string) {
|
|
o.ContentType = &v
|
|
}
|
|
|
|
// GetData returns the Data field value if set, zero value otherwise.
|
|
func (o *ApiHttpBody) GetData() string {
|
|
if o == nil || o.Data == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Data
|
|
}
|
|
|
|
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ApiHttpBody) GetDataOk() (*string, bool) {
|
|
if o == nil || o.Data == nil {
|
|
return nil, false
|
|
}
|
|
return o.Data, true
|
|
}
|
|
|
|
// HasData returns a boolean if a field has been set.
|
|
func (o *ApiHttpBody) HasData() bool {
|
|
if o != nil && o.Data != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetData gets a reference to the given string and assigns it to the Data field.
|
|
func (o *ApiHttpBody) SetData(v string) {
|
|
o.Data = &v
|
|
}
|
|
|
|
// GetExtensions returns the Extensions field value if set, zero value otherwise.
|
|
func (o *ApiHttpBody) GetExtensions() []ProtobufAny {
|
|
if o == nil || o.Extensions == nil {
|
|
var ret []ProtobufAny
|
|
return ret
|
|
}
|
|
return *o.Extensions
|
|
}
|
|
|
|
// GetExtensionsOk returns a tuple with the Extensions field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ApiHttpBody) GetExtensionsOk() (*[]ProtobufAny, bool) {
|
|
if o == nil || o.Extensions == nil {
|
|
return nil, false
|
|
}
|
|
return o.Extensions, true
|
|
}
|
|
|
|
// HasExtensions returns a boolean if a field has been set.
|
|
func (o *ApiHttpBody) HasExtensions() bool {
|
|
if o != nil && o.Extensions != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExtensions gets a reference to the given []ProtobufAny and assigns it to the Extensions field.
|
|
func (o *ApiHttpBody) SetExtensions(v []ProtobufAny) {
|
|
o.Extensions = &v
|
|
}
|
|
|
|
func (o ApiHttpBody) MarshalJSON() ([]byte, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if o.ContentType != nil {
|
|
toSerialize["contentType"] = o.ContentType
|
|
}
|
|
if o.Data != nil {
|
|
toSerialize["data"] = o.Data
|
|
}
|
|
if o.Extensions != nil {
|
|
toSerialize["extensions"] = o.Extensions
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
type NullableApiHttpBody struct {
|
|
value *ApiHttpBody
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableApiHttpBody) Get() *ApiHttpBody {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableApiHttpBody) Set(val *ApiHttpBody) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableApiHttpBody) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableApiHttpBody) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableApiHttpBody(val *ApiHttpBody) *NullableApiHttpBody {
|
|
return &NullableApiHttpBody{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableApiHttpBody) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableApiHttpBody) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
|