feat: invokable scripts (#387)
* basic list, create, and invoke working * all commands working * added support for create script body from file and invoke params from file * linter cleanup * update defaults to existing parameters if not provided * updated generated mock files, added mock files for scripts, added basic script create test * added mock script list * cleanup pass, fixed not using params in list call * added update mock test * fixed mock tests requiring go 1.18 * updated openapi, integrated overrides upstream, added new override to fix codegen bug * added nil check * fixed routes
This commit is contained in:
186
api/model_script_update_request.gen.go
Normal file
186
api/model_script_update_request.gen.go
Normal file
@ -0,0 +1,186 @@
|
||||
/*
|
||||
* 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"
|
||||
)
|
||||
|
||||
// ScriptUpdateRequest struct for ScriptUpdateRequest
|
||||
type ScriptUpdateRequest struct {
|
||||
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
|
||||
// script is script to be executed
|
||||
Script *string `json:"script,omitempty" yaml:"script,omitempty"`
|
||||
}
|
||||
|
||||
// NewScriptUpdateRequest instantiates a new ScriptUpdateRequest 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 NewScriptUpdateRequest() *ScriptUpdateRequest {
|
||||
this := ScriptUpdateRequest{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewScriptUpdateRequestWithDefaults instantiates a new ScriptUpdateRequest 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 NewScriptUpdateRequestWithDefaults() *ScriptUpdateRequest {
|
||||
this := ScriptUpdateRequest{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *ScriptUpdateRequest) GetName() string {
|
||||
if o == nil || o.Name == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Name
|
||||
}
|
||||
|
||||
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ScriptUpdateRequest) GetNameOk() (*string, bool) {
|
||||
if o == nil || o.Name == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Name, true
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *ScriptUpdateRequest) HasName() bool {
|
||||
if o != nil && o.Name != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *ScriptUpdateRequest) SetName(v string) {
|
||||
o.Name = &v
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *ScriptUpdateRequest) 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 *ScriptUpdateRequest) 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 *ScriptUpdateRequest) 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 *ScriptUpdateRequest) SetDescription(v string) {
|
||||
o.Description = &v
|
||||
}
|
||||
|
||||
// GetScript returns the Script field value if set, zero value otherwise.
|
||||
func (o *ScriptUpdateRequest) GetScript() string {
|
||||
if o == nil || o.Script == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Script
|
||||
}
|
||||
|
||||
// GetScriptOk returns a tuple with the Script field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ScriptUpdateRequest) GetScriptOk() (*string, bool) {
|
||||
if o == nil || o.Script == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Script, true
|
||||
}
|
||||
|
||||
// HasScript returns a boolean if a field has been set.
|
||||
func (o *ScriptUpdateRequest) HasScript() bool {
|
||||
if o != nil && o.Script != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetScript gets a reference to the given string and assigns it to the Script field.
|
||||
func (o *ScriptUpdateRequest) SetScript(v string) {
|
||||
o.Script = &v
|
||||
}
|
||||
|
||||
func (o ScriptUpdateRequest) MarshalJSON() ([]byte, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if o.Name != nil {
|
||||
toSerialize["name"] = o.Name
|
||||
}
|
||||
if o.Description != nil {
|
||||
toSerialize["description"] = o.Description
|
||||
}
|
||||
if o.Script != nil {
|
||||
toSerialize["script"] = o.Script
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
type NullableScriptUpdateRequest struct {
|
||||
value *ScriptUpdateRequest
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableScriptUpdateRequest) Get() *ScriptUpdateRequest {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableScriptUpdateRequest) Set(val *ScriptUpdateRequest) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableScriptUpdateRequest) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableScriptUpdateRequest) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableScriptUpdateRequest(val *ScriptUpdateRequest) *NullableScriptUpdateRequest {
|
||||
return &NullableScriptUpdateRequest{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableScriptUpdateRequest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableScriptUpdateRequest) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
Reference in New Issue
Block a user