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:
Sam Arnold
2021-05-25 10:05:01 -04:00
committed by GitHub
parent d54aa9ec2d
commit 9747d05ae1
191 changed files with 377 additions and 372 deletions

152
api/model_log_event.gen.go Normal file
View File

@ -0,0 +1,152 @@
/*
* 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"
"time"
)
// LogEvent struct for LogEvent
type LogEvent struct {
// Time event occurred, RFC3339Nano.
Time *time.Time `json:"time,omitempty"`
// A description of the event that occurred.
Message *string `json:"message,omitempty"`
}
// NewLogEvent instantiates a new LogEvent 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 NewLogEvent() *LogEvent {
this := LogEvent{}
return &this
}
// NewLogEventWithDefaults instantiates a new LogEvent 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 NewLogEventWithDefaults() *LogEvent {
this := LogEvent{}
return &this
}
// GetTime returns the Time field value if set, zero value otherwise.
func (o *LogEvent) GetTime() time.Time {
if o == nil || o.Time == nil {
var ret time.Time
return ret
}
return *o.Time
}
// GetTimeOk returns a tuple with the Time field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LogEvent) GetTimeOk() (*time.Time, bool) {
if o == nil || o.Time == nil {
return nil, false
}
return o.Time, true
}
// HasTime returns a boolean if a field has been set.
func (o *LogEvent) HasTime() bool {
if o != nil && o.Time != nil {
return true
}
return false
}
// SetTime gets a reference to the given time.Time and assigns it to the Time field.
func (o *LogEvent) SetTime(v time.Time) {
o.Time = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *LogEvent) GetMessage() string {
if o == nil || o.Message == nil {
var ret string
return ret
}
return *o.Message
}
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LogEvent) GetMessageOk() (*string, bool) {
if o == nil || o.Message == nil {
return nil, false
}
return o.Message, true
}
// HasMessage returns a boolean if a field has been set.
func (o *LogEvent) HasMessage() bool {
if o != nil && o.Message != nil {
return true
}
return false
}
// SetMessage gets a reference to the given string and assigns it to the Message field.
func (o *LogEvent) SetMessage(v string) {
o.Message = &v
}
func (o LogEvent) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Time != nil {
toSerialize["time"] = o.Time
}
if o.Message != nil {
toSerialize["message"] = o.Message
}
return json.Marshal(toSerialize)
}
type NullableLogEvent struct {
value *LogEvent
isSet bool
}
func (v NullableLogEvent) Get() *LogEvent {
return v.value
}
func (v *NullableLogEvent) Set(val *LogEvent) {
v.value = val
v.isSet = true
}
func (v NullableLogEvent) IsSet() bool {
return v.isSet
}
func (v *NullableLogEvent) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLogEvent(val *LogEvent) *NullableLogEvent {
return &NullableLogEvent{value: val, isSet: true}
}
func (v NullableLogEvent) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLogEvent) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}