feat: added functionality for remote create
subcommand (#268)
* feat: implement remote create subcommand * chore: generate mocks for testing remote command * refactor: separated out test code, made small changes to remote create code * chore: ran make fmt * chore: removed excess print statements * refactor: made changes suggested in code review * refactor: added name and remote id to printed table
This commit is contained in:
289
api/model_remote_connection_creation_request.gen.go
Normal file
289
api/model_remote_connection_creation_request.gen.go
Normal file
@ -0,0 +1,289 @@
|
||||
/*
|
||||
* 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"
|
||||
)
|
||||
|
||||
// RemoteConnectionCreationRequest struct for RemoteConnectionCreationRequest
|
||||
type RemoteConnectionCreationRequest struct {
|
||||
Name string `json:"name" yaml:"name"`
|
||||
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
|
||||
OrgID string `json:"orgID" yaml:"orgID"`
|
||||
RemoteURL string `json:"remoteURL" yaml:"remoteURL"`
|
||||
RemoteAPIToken string `json:"remoteAPIToken" yaml:"remoteAPIToken"`
|
||||
RemoteOrgID string `json:"remoteOrgID" yaml:"remoteOrgID"`
|
||||
AllowInsecureTLS bool `json:"allowInsecureTLS" yaml:"allowInsecureTLS"`
|
||||
}
|
||||
|
||||
// NewRemoteConnectionCreationRequest instantiates a new RemoteConnectionCreationRequest 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 NewRemoteConnectionCreationRequest(name string, orgID string, remoteURL string, remoteAPIToken string, remoteOrgID string, allowInsecureTLS bool) *RemoteConnectionCreationRequest {
|
||||
this := RemoteConnectionCreationRequest{}
|
||||
this.Name = name
|
||||
this.OrgID = orgID
|
||||
this.RemoteURL = remoteURL
|
||||
this.RemoteAPIToken = remoteAPIToken
|
||||
this.RemoteOrgID = remoteOrgID
|
||||
this.AllowInsecureTLS = allowInsecureTLS
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewRemoteConnectionCreationRequestWithDefaults instantiates a new RemoteConnectionCreationRequest 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 NewRemoteConnectionCreationRequestWithDefaults() *RemoteConnectionCreationRequest {
|
||||
this := RemoteConnectionCreationRequest{}
|
||||
var allowInsecureTLS bool = false
|
||||
this.AllowInsecureTLS = allowInsecureTLS
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetName returns the Name field value
|
||||
func (o *RemoteConnectionCreationRequest) 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 *RemoteConnectionCreationRequest) GetNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Name, true
|
||||
}
|
||||
|
||||
// SetName sets field value
|
||||
func (o *RemoteConnectionCreationRequest) SetName(v string) {
|
||||
o.Name = v
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *RemoteConnectionCreationRequest) 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 *RemoteConnectionCreationRequest) 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 *RemoteConnectionCreationRequest) 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 *RemoteConnectionCreationRequest) SetDescription(v string) {
|
||||
o.Description = &v
|
||||
}
|
||||
|
||||
// GetOrgID returns the OrgID field value
|
||||
func (o *RemoteConnectionCreationRequest) 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 *RemoteConnectionCreationRequest) GetOrgIDOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.OrgID, true
|
||||
}
|
||||
|
||||
// SetOrgID sets field value
|
||||
func (o *RemoteConnectionCreationRequest) SetOrgID(v string) {
|
||||
o.OrgID = v
|
||||
}
|
||||
|
||||
// GetRemoteURL returns the RemoteURL field value
|
||||
func (o *RemoteConnectionCreationRequest) GetRemoteURL() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.RemoteURL
|
||||
}
|
||||
|
||||
// GetRemoteURLOk returns a tuple with the RemoteURL field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteConnectionCreationRequest) GetRemoteURLOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.RemoteURL, true
|
||||
}
|
||||
|
||||
// SetRemoteURL sets field value
|
||||
func (o *RemoteConnectionCreationRequest) SetRemoteURL(v string) {
|
||||
o.RemoteURL = v
|
||||
}
|
||||
|
||||
// GetRemoteAPIToken returns the RemoteAPIToken field value
|
||||
func (o *RemoteConnectionCreationRequest) GetRemoteAPIToken() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.RemoteAPIToken
|
||||
}
|
||||
|
||||
// GetRemoteAPITokenOk returns a tuple with the RemoteAPIToken field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteConnectionCreationRequest) GetRemoteAPITokenOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.RemoteAPIToken, true
|
||||
}
|
||||
|
||||
// SetRemoteAPIToken sets field value
|
||||
func (o *RemoteConnectionCreationRequest) SetRemoteAPIToken(v string) {
|
||||
o.RemoteAPIToken = v
|
||||
}
|
||||
|
||||
// GetRemoteOrgID returns the RemoteOrgID field value
|
||||
func (o *RemoteConnectionCreationRequest) GetRemoteOrgID() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.RemoteOrgID
|
||||
}
|
||||
|
||||
// GetRemoteOrgIDOk returns a tuple with the RemoteOrgID field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteConnectionCreationRequest) GetRemoteOrgIDOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.RemoteOrgID, true
|
||||
}
|
||||
|
||||
// SetRemoteOrgID sets field value
|
||||
func (o *RemoteConnectionCreationRequest) SetRemoteOrgID(v string) {
|
||||
o.RemoteOrgID = v
|
||||
}
|
||||
|
||||
// GetAllowInsecureTLS returns the AllowInsecureTLS field value
|
||||
func (o *RemoteConnectionCreationRequest) GetAllowInsecureTLS() bool {
|
||||
if o == nil {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.AllowInsecureTLS
|
||||
}
|
||||
|
||||
// GetAllowInsecureTLSOk returns a tuple with the AllowInsecureTLS field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteConnectionCreationRequest) GetAllowInsecureTLSOk() (*bool, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.AllowInsecureTLS, true
|
||||
}
|
||||
|
||||
// SetAllowInsecureTLS sets field value
|
||||
func (o *RemoteConnectionCreationRequest) SetAllowInsecureTLS(v bool) {
|
||||
o.AllowInsecureTLS = v
|
||||
}
|
||||
|
||||
func (o RemoteConnectionCreationRequest) MarshalJSON() ([]byte, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if true {
|
||||
toSerialize["name"] = o.Name
|
||||
}
|
||||
if o.Description != nil {
|
||||
toSerialize["description"] = o.Description
|
||||
}
|
||||
if true {
|
||||
toSerialize["orgID"] = o.OrgID
|
||||
}
|
||||
if true {
|
||||
toSerialize["remoteURL"] = o.RemoteURL
|
||||
}
|
||||
if true {
|
||||
toSerialize["remoteAPIToken"] = o.RemoteAPIToken
|
||||
}
|
||||
if true {
|
||||
toSerialize["remoteOrgID"] = o.RemoteOrgID
|
||||
}
|
||||
if true {
|
||||
toSerialize["allowInsecureTLS"] = o.AllowInsecureTLS
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
type NullableRemoteConnectionCreationRequest struct {
|
||||
value *RemoteConnectionCreationRequest
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableRemoteConnectionCreationRequest) Get() *RemoteConnectionCreationRequest {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableRemoteConnectionCreationRequest) Set(val *RemoteConnectionCreationRequest) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableRemoteConnectionCreationRequest) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableRemoteConnectionCreationRequest) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableRemoteConnectionCreationRequest(val *RemoteConnectionCreationRequest) *NullableRemoteConnectionCreationRequest {
|
||||
return &NullableRemoteConnectionCreationRequest{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableRemoteConnectionCreationRequest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableRemoteConnectionCreationRequest) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
Reference in New Issue
Block a user