refactor: expose generated code and client business logic to share with Kapacitor (#103)
* refactor: take clients out of internal * refactor: move stdio to pkg * Move internal/api to api * refactor: final changes for Kapacitor to access shared functionality * chore: regenerate mocks * fix: bad automated refactor * chore: extra formatting not caught by make fmt
This commit is contained in:
273
api/model_post_bucket_request.gen.go
Normal file
273
api/model_post_bucket_request.gen.go
Normal file
@ -0,0 +1,273 @@
|
||||
/*
|
||||
* Subset of Influx API covered by Influx CLI
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 2.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// PostBucketRequest struct for PostBucketRequest
|
||||
type PostBucketRequest struct {
|
||||
OrgID string `json:"orgID"`
|
||||
Name string `json:"name"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Rp *string `json:"rp,omitempty"`
|
||||
// Rules to expire or retain data. No rules means data never expires.
|
||||
RetentionRules []RetentionRule `json:"retentionRules"`
|
||||
SchemaType *SchemaType `json:"schemaType,omitempty"`
|
||||
}
|
||||
|
||||
// NewPostBucketRequest instantiates a new PostBucketRequest 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 NewPostBucketRequest(orgID string, name string, retentionRules []RetentionRule) *PostBucketRequest {
|
||||
this := PostBucketRequest{}
|
||||
this.OrgID = orgID
|
||||
this.Name = name
|
||||
this.RetentionRules = retentionRules
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewPostBucketRequestWithDefaults instantiates a new PostBucketRequest 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 NewPostBucketRequestWithDefaults() *PostBucketRequest {
|
||||
this := PostBucketRequest{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetOrgID returns the OrgID field value
|
||||
func (o *PostBucketRequest) GetOrgID() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.OrgID
|
||||
}
|
||||
|
||||
// GetOrgIDOk returns a tuple with the OrgID field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *PostBucketRequest) GetOrgIDOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.OrgID, true
|
||||
}
|
||||
|
||||
// SetOrgID sets field value
|
||||
func (o *PostBucketRequest) SetOrgID(v string) {
|
||||
o.OrgID = v
|
||||
}
|
||||
|
||||
// GetName returns the Name field value
|
||||
func (o *PostBucketRequest) GetName() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Name
|
||||
}
|
||||
|
||||
// GetNameOk returns a tuple with the Name field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *PostBucketRequest) GetNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Name, true
|
||||
}
|
||||
|
||||
// SetName sets field value
|
||||
func (o *PostBucketRequest) SetName(v string) {
|
||||
o.Name = v
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *PostBucketRequest) GetDescription() string {
|
||||
if o == nil || o.Description == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Description
|
||||
}
|
||||
|
||||
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *PostBucketRequest) GetDescriptionOk() (*string, bool) {
|
||||
if o == nil || o.Description == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Description, true
|
||||
}
|
||||
|
||||
// HasDescription returns a boolean if a field has been set.
|
||||
func (o *PostBucketRequest) HasDescription() bool {
|
||||
if o != nil && o.Description != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDescription gets a reference to the given string and assigns it to the Description field.
|
||||
func (o *PostBucketRequest) SetDescription(v string) {
|
||||
o.Description = &v
|
||||
}
|
||||
|
||||
// GetRp returns the Rp field value if set, zero value otherwise.
|
||||
func (o *PostBucketRequest) GetRp() string {
|
||||
if o == nil || o.Rp == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Rp
|
||||
}
|
||||
|
||||
// GetRpOk returns a tuple with the Rp field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *PostBucketRequest) GetRpOk() (*string, bool) {
|
||||
if o == nil || o.Rp == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Rp, true
|
||||
}
|
||||
|
||||
// HasRp returns a boolean if a field has been set.
|
||||
func (o *PostBucketRequest) HasRp() bool {
|
||||
if o != nil && o.Rp != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRp gets a reference to the given string and assigns it to the Rp field.
|
||||
func (o *PostBucketRequest) SetRp(v string) {
|
||||
o.Rp = &v
|
||||
}
|
||||
|
||||
// GetRetentionRules returns the RetentionRules field value
|
||||
func (o *PostBucketRequest) GetRetentionRules() []RetentionRule {
|
||||
if o == nil {
|
||||
var ret []RetentionRule
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.RetentionRules
|
||||
}
|
||||
|
||||
// GetRetentionRulesOk returns a tuple with the RetentionRules field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *PostBucketRequest) GetRetentionRulesOk() (*[]RetentionRule, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.RetentionRules, true
|
||||
}
|
||||
|
||||
// SetRetentionRules sets field value
|
||||
func (o *PostBucketRequest) SetRetentionRules(v []RetentionRule) {
|
||||
o.RetentionRules = v
|
||||
}
|
||||
|
||||
// GetSchemaType returns the SchemaType field value if set, zero value otherwise.
|
||||
func (o *PostBucketRequest) GetSchemaType() SchemaType {
|
||||
if o == nil || o.SchemaType == nil {
|
||||
var ret SchemaType
|
||||
return ret
|
||||
}
|
||||
return *o.SchemaType
|
||||
}
|
||||
|
||||
// GetSchemaTypeOk returns a tuple with the SchemaType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *PostBucketRequest) GetSchemaTypeOk() (*SchemaType, bool) {
|
||||
if o == nil || o.SchemaType == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.SchemaType, true
|
||||
}
|
||||
|
||||
// HasSchemaType returns a boolean if a field has been set.
|
||||
func (o *PostBucketRequest) HasSchemaType() bool {
|
||||
if o != nil && o.SchemaType != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSchemaType gets a reference to the given SchemaType and assigns it to the SchemaType field.
|
||||
func (o *PostBucketRequest) SetSchemaType(v SchemaType) {
|
||||
o.SchemaType = &v
|
||||
}
|
||||
|
||||
func (o PostBucketRequest) MarshalJSON() ([]byte, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if true {
|
||||
toSerialize["orgID"] = o.OrgID
|
||||
}
|
||||
if true {
|
||||
toSerialize["name"] = o.Name
|
||||
}
|
||||
if o.Description != nil {
|
||||
toSerialize["description"] = o.Description
|
||||
}
|
||||
if o.Rp != nil {
|
||||
toSerialize["rp"] = o.Rp
|
||||
}
|
||||
if true {
|
||||
toSerialize["retentionRules"] = o.RetentionRules
|
||||
}
|
||||
if o.SchemaType != nil {
|
||||
toSerialize["schemaType"] = o.SchemaType
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
type NullablePostBucketRequest struct {
|
||||
value *PostBucketRequest
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullablePostBucketRequest) Get() *PostBucketRequest {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullablePostBucketRequest) Set(val *PostBucketRequest) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullablePostBucketRequest) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullablePostBucketRequest) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullablePostBucketRequest(val *PostBucketRequest) *NullablePostBucketRequest {
|
||||
return &NullablePostBucketRequest{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullablePostBucketRequest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullablePostBucketRequest) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
Reference in New Issue
Block a user