feat: add stacks APIs to codegen (#163)

This commit is contained in:
Daniel Moran
2021-06-30 14:47:35 -04:00
committed by GitHub
parent a3f36a9821
commit aaf99da0a9
22 changed files with 2820 additions and 0 deletions

868
api/api_stacks.gen.go Normal file
View File

@ -0,0 +1,868 @@
/*
* 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 (
_context "context"
_fmt "fmt"
_ioutil "io/ioutil"
_nethttp "net/http"
_neturl "net/url"
"reflect"
"strings"
)
// Linger please
var (
_ _context.Context
)
type StacksApi interface {
/*
* CreateStack Create a new stack
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiCreateStackRequest
*/
CreateStack(ctx _context.Context) ApiCreateStackRequest
/*
* CreateStackExecute executes the request
* @return Stack
*/
CreateStackExecute(r ApiCreateStackRequest) (Stack, error)
/*
* DeleteStack Delete a stack and associated resources
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param stackId Theidentifier of the stack.
* @return ApiDeleteStackRequest
*/
DeleteStack(ctx _context.Context, stackId string) ApiDeleteStackRequest
/*
* DeleteStackExecute executes the request
*/
DeleteStackExecute(r ApiDeleteStackRequest) error
/*
* ListStacks List all installed InfluxDB templates
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiListStacksRequest
*/
ListStacks(ctx _context.Context) ApiListStacksRequest
/*
* ListStacksExecute executes the request
* @return Stacks
*/
ListStacksExecute(r ApiListStacksRequest) (Stacks, error)
/*
* ReadStack Retrieve a stack
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param stackId Theidentifier of the stack.
* @return ApiReadStackRequest
*/
ReadStack(ctx _context.Context, stackId string) ApiReadStackRequest
/*
* ReadStackExecute executes the request
* @return Stack
*/
ReadStackExecute(r ApiReadStackRequest) (Stack, error)
/*
* UpdateStack Update an InfluxDB Stack
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param stackId Theidentifier of the stack.
* @return ApiUpdateStackRequest
*/
UpdateStack(ctx _context.Context, stackId string) ApiUpdateStackRequest
/*
* UpdateStackExecute executes the request
* @return Stack
*/
UpdateStackExecute(r ApiUpdateStackRequest) (Stack, error)
// Sets additional descriptive text in the error message if any request in
// this API fails, indicating that it is intended to be used only on OSS
// servers.
OnlyOSS() StacksApi
// Sets additional descriptive text in the error message if any request in
// this API fails, indicating that it is intended to be used only on cloud
// servers.
OnlyCloud() StacksApi
}
// StacksApiService StacksApi service
type StacksApiService service
func (a *StacksApiService) OnlyOSS() StacksApi {
a.isOnlyOSS = true
return a
}
func (a *StacksApiService) OnlyCloud() StacksApi {
a.isOnlyCloud = true
return a
}
type ApiCreateStackRequest struct {
ctx _context.Context
ApiService StacksApi
stackPostRequest *StackPostRequest
}
func (r ApiCreateStackRequest) StackPostRequest(stackPostRequest StackPostRequest) ApiCreateStackRequest {
r.stackPostRequest = &stackPostRequest
return r
}
func (r ApiCreateStackRequest) GetStackPostRequest() *StackPostRequest {
return r.stackPostRequest
}
func (r ApiCreateStackRequest) Execute() (Stack, error) {
return r.ApiService.CreateStackExecute(r)
}
/*
* CreateStack Create a new stack
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiCreateStackRequest
*/
func (a *StacksApiService) CreateStack(ctx _context.Context) ApiCreateStackRequest {
return ApiCreateStackRequest{
ApiService: a,
ctx: ctx,
}
}
/*
* Execute executes the request
* @return Stack
*/
func (a *StacksApiService) CreateStackExecute(r ApiCreateStackRequest) (Stack, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Stack
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StacksApiService.CreateStack")
if err != nil {
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/stacks"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
if r.stackPostRequest == nil {
return localVarReturnValue, reportError("stackPostRequest is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.stackPostRequest
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, err
}
var errorPrefix string
if a.isOnlyOSS {
errorPrefix = "InfluxDB OSS-only command failed: "
} else if a.isOnlyCloud {
errorPrefix = "InfluxDB Cloud-only command failed: "
}
if localVarHTTPResponse.StatusCode >= 300 {
body, err := GunzipIfNeeded(localVarHTTPResponse)
if err != nil {
body.Close()
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
localVarBody, err := _ioutil.ReadAll(body)
body.Close()
if err != nil {
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
newErr := GenericOpenAPIError{
body: localVarBody,
error: _fmt.Sprintf("%s%s", errorPrefix, localVarHTTPResponse.Status),
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
return localVarReturnValue, newErr
}
newErr.model = &v
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
return localVarReturnValue, newErr
}
body, err := GunzipIfNeeded(localVarHTTPResponse)
if err != nil {
body.Close()
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
localVarBody, err := _ioutil.ReadAll(body)
body.Close()
if err != nil {
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: _fmt.Sprintf("%s%s", errorPrefix, err.Error()),
}
return localVarReturnValue, newErr
}
return localVarReturnValue, nil
}
type ApiDeleteStackRequest struct {
ctx _context.Context
ApiService StacksApi
stackId string
orgID *string
}
func (r ApiDeleteStackRequest) StackId(stackId string) ApiDeleteStackRequest {
r.stackId = stackId
return r
}
func (r ApiDeleteStackRequest) GetStackId() string {
return r.stackId
}
func (r ApiDeleteStackRequest) OrgID(orgID string) ApiDeleteStackRequest {
r.orgID = &orgID
return r
}
func (r ApiDeleteStackRequest) GetOrgID() *string {
return r.orgID
}
func (r ApiDeleteStackRequest) Execute() error {
return r.ApiService.DeleteStackExecute(r)
}
/*
* DeleteStack Delete a stack and associated resources
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param stackId Theidentifier of the stack.
* @return ApiDeleteStackRequest
*/
func (a *StacksApiService) DeleteStack(ctx _context.Context, stackId string) ApiDeleteStackRequest {
return ApiDeleteStackRequest{
ApiService: a,
ctx: ctx,
stackId: stackId,
}
}
/*
* Execute executes the request
*/
func (a *StacksApiService) DeleteStackExecute(r ApiDeleteStackRequest) error {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StacksApiService.DeleteStack")
if err != nil {
return GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/stacks/{stack_id}"
localVarPath = strings.Replace(localVarPath, "{"+"stack_id"+"}", _neturl.PathEscape(parameterToString(r.stackId, "")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
if r.orgID == nil {
return reportError("orgID is required and must be specified")
}
localVarQueryParams.Add("orgID", parameterToString(*r.orgID, ""))
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return err
}
var errorPrefix string
if a.isOnlyOSS {
errorPrefix = "InfluxDB OSS-only command failed: "
} else if a.isOnlyCloud {
errorPrefix = "InfluxDB Cloud-only command failed: "
}
if localVarHTTPResponse.StatusCode >= 300 {
body, err := GunzipIfNeeded(localVarHTTPResponse)
if err != nil {
body.Close()
return _fmt.Errorf("%s%w", errorPrefix, err)
}
localVarBody, err := _ioutil.ReadAll(body)
body.Close()
if err != nil {
return _fmt.Errorf("%s%w", errorPrefix, err)
}
newErr := GenericOpenAPIError{
body: localVarBody,
error: _fmt.Sprintf("%s%s", errorPrefix, localVarHTTPResponse.Status),
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
return newErr
}
newErr.model = &v
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
return newErr
}
return nil
}
type ApiListStacksRequest struct {
ctx _context.Context
ApiService StacksApi
orgID *string
name *[]string
stackID *[]string
}
func (r ApiListStacksRequest) OrgID(orgID string) ApiListStacksRequest {
r.orgID = &orgID
return r
}
func (r ApiListStacksRequest) GetOrgID() *string {
return r.orgID
}
func (r ApiListStacksRequest) Name(name []string) ApiListStacksRequest {
r.name = &name
return r
}
func (r ApiListStacksRequest) GetName() *[]string {
return r.name
}
func (r ApiListStacksRequest) StackID(stackID []string) ApiListStacksRequest {
r.stackID = &stackID
return r
}
func (r ApiListStacksRequest) GetStackID() *[]string {
return r.stackID
}
func (r ApiListStacksRequest) Execute() (Stacks, error) {
return r.ApiService.ListStacksExecute(r)
}
/*
* ListStacks List all installed InfluxDB templates
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiListStacksRequest
*/
func (a *StacksApiService) ListStacks(ctx _context.Context) ApiListStacksRequest {
return ApiListStacksRequest{
ApiService: a,
ctx: ctx,
}
}
/*
* Execute executes the request
* @return Stacks
*/
func (a *StacksApiService) ListStacksExecute(r ApiListStacksRequest) (Stacks, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Stacks
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StacksApiService.ListStacks")
if err != nil {
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/stacks"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
if r.orgID == nil {
return localVarReturnValue, reportError("orgID is required and must be specified")
}
localVarQueryParams.Add("orgID", parameterToString(*r.orgID, ""))
if r.name != nil {
t := *r.name
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
for i := 0; i < s.Len(); i++ {
localVarQueryParams.Add("name", parameterToString(s.Index(i), "multi"))
}
} else {
localVarQueryParams.Add("name", parameterToString(t, "multi"))
}
}
if r.stackID != nil {
t := *r.stackID
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
for i := 0; i < s.Len(); i++ {
localVarQueryParams.Add("stackID", parameterToString(s.Index(i), "multi"))
}
} else {
localVarQueryParams.Add("stackID", parameterToString(t, "multi"))
}
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, err
}
var errorPrefix string
if a.isOnlyOSS {
errorPrefix = "InfluxDB OSS-only command failed: "
} else if a.isOnlyCloud {
errorPrefix = "InfluxDB Cloud-only command failed: "
}
if localVarHTTPResponse.StatusCode >= 300 {
body, err := GunzipIfNeeded(localVarHTTPResponse)
if err != nil {
body.Close()
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
localVarBody, err := _ioutil.ReadAll(body)
body.Close()
if err != nil {
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
newErr := GenericOpenAPIError{
body: localVarBody,
error: _fmt.Sprintf("%s%s", errorPrefix, localVarHTTPResponse.Status),
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
return localVarReturnValue, newErr
}
newErr.model = &v
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
return localVarReturnValue, newErr
}
body, err := GunzipIfNeeded(localVarHTTPResponse)
if err != nil {
body.Close()
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
localVarBody, err := _ioutil.ReadAll(body)
body.Close()
if err != nil {
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: _fmt.Sprintf("%s%s", errorPrefix, err.Error()),
}
return localVarReturnValue, newErr
}
return localVarReturnValue, nil
}
type ApiReadStackRequest struct {
ctx _context.Context
ApiService StacksApi
stackId string
}
func (r ApiReadStackRequest) StackId(stackId string) ApiReadStackRequest {
r.stackId = stackId
return r
}
func (r ApiReadStackRequest) GetStackId() string {
return r.stackId
}
func (r ApiReadStackRequest) Execute() (Stack, error) {
return r.ApiService.ReadStackExecute(r)
}
/*
* ReadStack Retrieve a stack
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param stackId Theidentifier of the stack.
* @return ApiReadStackRequest
*/
func (a *StacksApiService) ReadStack(ctx _context.Context, stackId string) ApiReadStackRequest {
return ApiReadStackRequest{
ApiService: a,
ctx: ctx,
stackId: stackId,
}
}
/*
* Execute executes the request
* @return Stack
*/
func (a *StacksApiService) ReadStackExecute(r ApiReadStackRequest) (Stack, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Stack
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StacksApiService.ReadStack")
if err != nil {
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/stacks/{stack_id}"
localVarPath = strings.Replace(localVarPath, "{"+"stack_id"+"}", _neturl.PathEscape(parameterToString(r.stackId, "")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, err
}
var errorPrefix string
if a.isOnlyOSS {
errorPrefix = "InfluxDB OSS-only command failed: "
} else if a.isOnlyCloud {
errorPrefix = "InfluxDB Cloud-only command failed: "
}
if localVarHTTPResponse.StatusCode >= 300 {
body, err := GunzipIfNeeded(localVarHTTPResponse)
if err != nil {
body.Close()
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
localVarBody, err := _ioutil.ReadAll(body)
body.Close()
if err != nil {
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
newErr := GenericOpenAPIError{
body: localVarBody,
error: _fmt.Sprintf("%s%s", errorPrefix, localVarHTTPResponse.Status),
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
return localVarReturnValue, newErr
}
newErr.model = &v
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
return localVarReturnValue, newErr
}
body, err := GunzipIfNeeded(localVarHTTPResponse)
if err != nil {
body.Close()
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
localVarBody, err := _ioutil.ReadAll(body)
body.Close()
if err != nil {
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: _fmt.Sprintf("%s%s", errorPrefix, err.Error()),
}
return localVarReturnValue, newErr
}
return localVarReturnValue, nil
}
type ApiUpdateStackRequest struct {
ctx _context.Context
ApiService StacksApi
stackId string
stackPatchRequest *StackPatchRequest
}
func (r ApiUpdateStackRequest) StackId(stackId string) ApiUpdateStackRequest {
r.stackId = stackId
return r
}
func (r ApiUpdateStackRequest) GetStackId() string {
return r.stackId
}
func (r ApiUpdateStackRequest) StackPatchRequest(stackPatchRequest StackPatchRequest) ApiUpdateStackRequest {
r.stackPatchRequest = &stackPatchRequest
return r
}
func (r ApiUpdateStackRequest) GetStackPatchRequest() *StackPatchRequest {
return r.stackPatchRequest
}
func (r ApiUpdateStackRequest) Execute() (Stack, error) {
return r.ApiService.UpdateStackExecute(r)
}
/*
* UpdateStack Update an InfluxDB Stack
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param stackId Theidentifier of the stack.
* @return ApiUpdateStackRequest
*/
func (a *StacksApiService) UpdateStack(ctx _context.Context, stackId string) ApiUpdateStackRequest {
return ApiUpdateStackRequest{
ApiService: a,
ctx: ctx,
stackId: stackId,
}
}
/*
* Execute executes the request
* @return Stack
*/
func (a *StacksApiService) UpdateStackExecute(r ApiUpdateStackRequest) (Stack, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Stack
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StacksApiService.UpdateStack")
if err != nil {
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/stacks/{stack_id}"
localVarPath = strings.Replace(localVarPath, "{"+"stack_id"+"}", _neturl.PathEscape(parameterToString(r.stackId, "")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
if r.stackPatchRequest == nil {
return localVarReturnValue, reportError("stackPatchRequest is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.stackPatchRequest
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, err
}
var errorPrefix string
if a.isOnlyOSS {
errorPrefix = "InfluxDB OSS-only command failed: "
} else if a.isOnlyCloud {
errorPrefix = "InfluxDB Cloud-only command failed: "
}
if localVarHTTPResponse.StatusCode >= 300 {
body, err := GunzipIfNeeded(localVarHTTPResponse)
if err != nil {
body.Close()
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
localVarBody, err := _ioutil.ReadAll(body)
body.Close()
if err != nil {
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
newErr := GenericOpenAPIError{
body: localVarBody,
error: _fmt.Sprintf("%s%s", errorPrefix, localVarHTTPResponse.Status),
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
return localVarReturnValue, newErr
}
newErr.model = &v
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
return localVarReturnValue, newErr
}
body, err := GunzipIfNeeded(localVarHTTPResponse)
if err != nil {
body.Close()
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
localVarBody, err := _ioutil.ReadAll(body)
body.Close()
if err != nil {
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: _fmt.Sprintf("%s%s", errorPrefix, err.Error()),
}
return localVarReturnValue, newErr
}
return localVarReturnValue, nil
}

View File

@ -75,6 +75,8 @@ type APIClient struct {
SetupApi SetupApi SetupApi SetupApi
StacksApi StacksApi
TasksApi TasksApi TasksApi TasksApi
TelegrafsApi TelegrafsApi TelegrafsApi TelegrafsApi
@ -118,6 +120,7 @@ func NewAPIClient(cfg *Configuration) *APIClient {
c.RestoreApi = (*RestoreApiService)(&c.common) c.RestoreApi = (*RestoreApiService)(&c.common)
c.SecretsApi = (*SecretsApiService)(&c.common) c.SecretsApi = (*SecretsApiService)(&c.common)
c.SetupApi = (*SetupApiService)(&c.common) c.SetupApi = (*SetupApiService)(&c.common)
c.StacksApi = (*StacksApiService)(&c.common)
c.TasksApi = (*TasksApiService)(&c.common) c.TasksApi = (*TasksApiService)(&c.common)
c.TelegrafsApi = (*TelegrafsApiService)(&c.common) c.TelegrafsApi = (*TelegrafsApiService)(&c.common)
c.TemplatesApi = (*TemplatesApiService)(&c.common) c.TemplatesApi = (*TemplatesApiService)(&c.common)

View File

@ -79,6 +79,10 @@ paths:
$ref: "./overrides/paths/templates_export.yml" $ref: "./overrides/paths/templates_export.yml"
/templates/apply: /templates/apply:
$ref: "./overrides/paths/templates_apply.yml" $ref: "./overrides/paths/templates_apply.yml"
/stacks:
$ref: "./overrides/paths/stacks.yml"
/stacks/{stack_id}:
$ref: "./overrides/paths/stacks_stack_id.yml"
/dbrps: /dbrps:
$ref: "./openapi/src/common/paths/dbrps.yml" $ref: "./openapi/src/common/paths/dbrps.yml"
"/dbrps/{dbrpID}": "/dbrps/{dbrpID}":
@ -371,6 +375,22 @@ components:
$ref: "./overrides/schemas/TemplateSummaryDiffVariable.yml" $ref: "./overrides/schemas/TemplateSummaryDiffVariable.yml"
TemplateSummaryDiffVariableFields: TemplateSummaryDiffVariableFields:
$ref: "./overrides/schemas/TemplateSummaryDiffVariableFields.yml" $ref: "./overrides/schemas/TemplateSummaryDiffVariableFields.yml"
Stacks:
$ref: "./overrides/schemas/Stacks.yml"
Stack:
$ref: "./overrides/schemas/Stack.yml"
StackEvent:
$ref: "./overrides/schemas/StackEvent.yml"
StackEventResource:
$ref: "./overrides/schemas/StackEventResource.yml"
StackEventResourceAssociation:
$ref: "./overrides/schemas/StackEventResourceAssociation.yml"
StackPostRequest:
$ref: "./overrides/schemas/StackPostRequest.yml"
StackPatchRequest:
$ref: "./overrides/schemas/StackPatchRequest.yml"
StackPatchRequestResource:
$ref: "./overrides/schemas/StackPatchRequestResource.yml"
SecretKeysResponse: SecretKeysResponse:
$ref: "./openapi/src/common/schemas/SecretKeysResponse.yml" $ref: "./openapi/src/common/schemas/SecretKeysResponse.yml"
SecretKeys: SecretKeys:

View File

@ -0,0 +1,64 @@
get:
operationId: ListStacks
tags:
- Stacks
summary: List all installed InfluxDB templates
parameters:
- in: query
name: orgID
required: true
schema:
type: string
description: The organization id of the stacks
- in: query
name: name
schema:
type: array
items:
type: string
description: A collection of names to filter the list by.
- in: query
name: stackID
schema:
type: array
items:
type: string
description: A collection of stackIDs to filter the list by.
responses:
"200":
description: Influx stacks found
content:
application/json:
schema:
$ref: "../schemas/Stacks.yml"
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "../../openapi/src/common/schemas/Error.yml"
post:
operationId: CreateStack
tags:
- Stacks
summary: Create a new stack
requestBody:
description: Stack to create.
required: true
content:
application/json:
schema:
$ref: "../schemas/StackPostRequest.yml"
responses:
"201":
description: InfluxDB Stack created
content:
application/json:
schema:
$ref: "../schemas/Stack.yml"
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "../../openapi/src/common/schemas/Error.yml"

View File

@ -0,0 +1,84 @@
get:
operationId: ReadStack
tags:
- Stacks
summary: Retrieve a stack
parameters:
- in: path
name: stack_id
required: true
schema:
type: string
description: Theidentifier of the stack.
responses:
"200":
description: The InfluxDB stack
content:
application/json:
schema:
$ref: "../schemas/Stack.yml"
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "../../openapi/src/common/schemas/Error.yml"
patch:
operationId: UpdateStack
tags:
- Stacks
summary: Update an InfluxDB Stack
parameters:
- in: path
name: stack_id
required: true
schema:
type: string
description: Theidentifier of the stack.
requestBody:
description: Influx stack to update.
required: true
content:
application/json:
schema:
$ref: "../schemas/StackPatchRequest.yml"
responses:
"200":
description: Influx stack updated
content:
application/json:
schema:
$ref: "../schemas/Stack.yml"
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "../../openapi/src/common/schemas/Error.yml"
delete:
operationId: DeleteStack
tags:
- Stacks
summary: Delete a stack and associated resources
parameters:
- in: path
name: stack_id
required: true
schema:
type: string
description: Theidentifier of the stack.
- in: query
name: orgID
required: true
schema:
type: string
description: The identifier of the organization.
responses:
"204":
description: The stack and its associated resources are deleted
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "../../openapi/src/common/schemas/Error.yml"

View File

@ -0,0 +1,14 @@
type: object
properties:
id:
type: string
orgID:
type: string
createdAt:
type: string
format: date-time
events:
type: array
items:
$ref: "./StackEvent.yml"
required: [id, orgID, createdAt, events]

View File

@ -0,0 +1,24 @@
type: object
properties:
eventType:
type: string
name:
type: string
description:
type: string
sources:
type: array
items:
type: string
resources:
type: array
items:
$ref: "./StackEventResource.yml"
urls:
type: array
items:
type: string
updatedAt:
type: string
format: date-time
required: [eventType, name, sources, resources, urls, updatedAt]

View File

@ -0,0 +1,20 @@
type: object
properties:
apiVersion:
type: string
resourceID:
type: string
kind:
type: string
templateMetaName:
type: string
associations:
type: array
items:
$ref: "./StackEventResourceAssociation.yml"
links:
type: object
properties:
self:
type: string
required: [apiVersion, resourceID, kind, templateMetaName, associations]

View File

@ -0,0 +1,7 @@
type: object
properties:
kind:
type: string
metaName:
type: string
required: [kind, metaName]

View File

@ -0,0 +1,15 @@
type: object
properties:
name:
type: string
description:
type: string
templateURLs:
type: array
items:
type: string
additionalResources:
type: array
items:
$ref: "./StackPatchRequestResource.yml"
required: [templateURLs, additionalResources]

View File

@ -0,0 +1,9 @@
type: object
properties:
resourceID:
type: string
kind:
type: string
templateMetaName:
type: string
required: [kind, resourceID]

View File

@ -0,0 +1,13 @@
type: object
properties:
orgID:
type: string
name:
type: string
description:
type: string
urls:
type: array
items:
type: string
required: [orgID, name, urls]

View File

@ -0,0 +1,7 @@
type: object
properties:
stacks:
type: array
items:
$ref: "./Stack.yml"
required: [stacks]

194
api/model_stack.gen.go Normal file
View File

@ -0,0 +1,194 @@
/*
* 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"
)
// Stack struct for Stack
type Stack struct {
Id string `json:"id" yaml:"id"`
OrgID string `json:"orgID" yaml:"orgID"`
CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
Events []StackEvent `json:"events" yaml:"events"`
}
// NewStack instantiates a new Stack 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 NewStack(id string, orgID string, createdAt time.Time, events []StackEvent) *Stack {
this := Stack{}
this.Id = id
this.OrgID = orgID
this.CreatedAt = createdAt
this.Events = events
return &this
}
// NewStackWithDefaults instantiates a new Stack 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 NewStackWithDefaults() *Stack {
this := Stack{}
return &this
}
// GetId returns the Id field value
func (o *Stack) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *Stack) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *Stack) SetId(v string) {
o.Id = v
}
// GetOrgID returns the OrgID field value
func (o *Stack) 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 *Stack) GetOrgIDOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OrgID, true
}
// SetOrgID sets field value
func (o *Stack) SetOrgID(v string) {
o.OrgID = v
}
// GetCreatedAt returns the CreatedAt field value
func (o *Stack) GetCreatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *Stack) GetCreatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.CreatedAt, true
}
// SetCreatedAt sets field value
func (o *Stack) SetCreatedAt(v time.Time) {
o.CreatedAt = v
}
// GetEvents returns the Events field value
func (o *Stack) GetEvents() []StackEvent {
if o == nil {
var ret []StackEvent
return ret
}
return o.Events
}
// GetEventsOk returns a tuple with the Events field value
// and a boolean to check if the value has been set.
func (o *Stack) GetEventsOk() (*[]StackEvent, bool) {
if o == nil {
return nil, false
}
return &o.Events, true
}
// SetEvents sets field value
func (o *Stack) SetEvents(v []StackEvent) {
o.Events = v
}
func (o Stack) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
}
if true {
toSerialize["orgID"] = o.OrgID
}
if true {
toSerialize["createdAt"] = o.CreatedAt
}
if true {
toSerialize["events"] = o.Events
}
return json.Marshal(toSerialize)
}
type NullableStack struct {
value *Stack
isSet bool
}
func (v NullableStack) Get() *Stack {
return v.value
}
func (v *NullableStack) Set(val *Stack) {
v.value = val
v.isSet = true
}
func (v NullableStack) IsSet() bool {
return v.isSet
}
func (v *NullableStack) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStack(val *Stack) *NullableStack {
return &NullableStack{value: val, isSet: true}
}
func (v NullableStack) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStack) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,288 @@
/*
* 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"
)
// StackEvent struct for StackEvent
type StackEvent struct {
EventType string `json:"eventType" yaml:"eventType"`
Name string `json:"name" yaml:"name"`
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
Sources []string `json:"sources" yaml:"sources"`
Resources []StackEventResource `json:"resources" yaml:"resources"`
Urls []string `json:"urls" yaml:"urls"`
UpdatedAt time.Time `json:"updatedAt" yaml:"updatedAt"`
}
// NewStackEvent instantiates a new StackEvent 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 NewStackEvent(eventType string, name string, sources []string, resources []StackEventResource, urls []string, updatedAt time.Time) *StackEvent {
this := StackEvent{}
this.EventType = eventType
this.Name = name
this.Sources = sources
this.Resources = resources
this.Urls = urls
this.UpdatedAt = updatedAt
return &this
}
// NewStackEventWithDefaults instantiates a new StackEvent 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 NewStackEventWithDefaults() *StackEvent {
this := StackEvent{}
return &this
}
// GetEventType returns the EventType field value
func (o *StackEvent) GetEventType() string {
if o == nil {
var ret string
return ret
}
return o.EventType
}
// GetEventTypeOk returns a tuple with the EventType field value
// and a boolean to check if the value has been set.
func (o *StackEvent) GetEventTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.EventType, true
}
// SetEventType sets field value
func (o *StackEvent) SetEventType(v string) {
o.EventType = v
}
// GetName returns the Name field value
func (o *StackEvent) 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 *StackEvent) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *StackEvent) SetName(v string) {
o.Name = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *StackEvent) 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 *StackEvent) 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 *StackEvent) 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 *StackEvent) SetDescription(v string) {
o.Description = &v
}
// GetSources returns the Sources field value
func (o *StackEvent) GetSources() []string {
if o == nil {
var ret []string
return ret
}
return o.Sources
}
// GetSourcesOk returns a tuple with the Sources field value
// and a boolean to check if the value has been set.
func (o *StackEvent) GetSourcesOk() (*[]string, bool) {
if o == nil {
return nil, false
}
return &o.Sources, true
}
// SetSources sets field value
func (o *StackEvent) SetSources(v []string) {
o.Sources = v
}
// GetResources returns the Resources field value
func (o *StackEvent) GetResources() []StackEventResource {
if o == nil {
var ret []StackEventResource
return ret
}
return o.Resources
}
// GetResourcesOk returns a tuple with the Resources field value
// and a boolean to check if the value has been set.
func (o *StackEvent) GetResourcesOk() (*[]StackEventResource, bool) {
if o == nil {
return nil, false
}
return &o.Resources, true
}
// SetResources sets field value
func (o *StackEvent) SetResources(v []StackEventResource) {
o.Resources = v
}
// GetUrls returns the Urls field value
func (o *StackEvent) GetUrls() []string {
if o == nil {
var ret []string
return ret
}
return o.Urls
}
// GetUrlsOk returns a tuple with the Urls field value
// and a boolean to check if the value has been set.
func (o *StackEvent) GetUrlsOk() (*[]string, bool) {
if o == nil {
return nil, false
}
return &o.Urls, true
}
// SetUrls sets field value
func (o *StackEvent) SetUrls(v []string) {
o.Urls = v
}
// GetUpdatedAt returns the UpdatedAt field value
func (o *StackEvent) GetUpdatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value
// and a boolean to check if the value has been set.
func (o *StackEvent) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.UpdatedAt, true
}
// SetUpdatedAt sets field value
func (o *StackEvent) SetUpdatedAt(v time.Time) {
o.UpdatedAt = v
}
func (o StackEvent) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["eventType"] = o.EventType
}
if true {
toSerialize["name"] = o.Name
}
if o.Description != nil {
toSerialize["description"] = o.Description
}
if true {
toSerialize["sources"] = o.Sources
}
if true {
toSerialize["resources"] = o.Resources
}
if true {
toSerialize["urls"] = o.Urls
}
if true {
toSerialize["updatedAt"] = o.UpdatedAt
}
return json.Marshal(toSerialize)
}
type NullableStackEvent struct {
value *StackEvent
isSet bool
}
func (v NullableStackEvent) Get() *StackEvent {
return v.value
}
func (v *NullableStackEvent) Set(val *StackEvent) {
v.value = val
v.isSet = true
}
func (v NullableStackEvent) IsSet() bool {
return v.isSet
}
func (v *NullableStackEvent) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStackEvent(val *StackEvent) *NullableStackEvent {
return &NullableStackEvent{value: val, isSet: true}
}
func (v NullableStackEvent) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStackEvent) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,258 @@
/*
* 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"
)
// StackEventResource struct for StackEventResource
type StackEventResource struct {
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
ResourceID string `json:"resourceID" yaml:"resourceID"`
Kind string `json:"kind" yaml:"kind"`
TemplateMetaName string `json:"templateMetaName" yaml:"templateMetaName"`
Associations []StackEventResourceAssociation `json:"associations" yaml:"associations"`
Links *StackEventResourceLinks `json:"links,omitempty" yaml:"links,omitempty"`
}
// NewStackEventResource instantiates a new StackEventResource 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 NewStackEventResource(apiVersion string, resourceID string, kind string, templateMetaName string, associations []StackEventResourceAssociation) *StackEventResource {
this := StackEventResource{}
this.ApiVersion = apiVersion
this.ResourceID = resourceID
this.Kind = kind
this.TemplateMetaName = templateMetaName
this.Associations = associations
return &this
}
// NewStackEventResourceWithDefaults instantiates a new StackEventResource 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 NewStackEventResourceWithDefaults() *StackEventResource {
this := StackEventResource{}
return &this
}
// GetApiVersion returns the ApiVersion field value
func (o *StackEventResource) GetApiVersion() string {
if o == nil {
var ret string
return ret
}
return o.ApiVersion
}
// GetApiVersionOk returns a tuple with the ApiVersion field value
// and a boolean to check if the value has been set.
func (o *StackEventResource) GetApiVersionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ApiVersion, true
}
// SetApiVersion sets field value
func (o *StackEventResource) SetApiVersion(v string) {
o.ApiVersion = v
}
// GetResourceID returns the ResourceID field value
func (o *StackEventResource) GetResourceID() string {
if o == nil {
var ret string
return ret
}
return o.ResourceID
}
// GetResourceIDOk returns a tuple with the ResourceID field value
// and a boolean to check if the value has been set.
func (o *StackEventResource) GetResourceIDOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ResourceID, true
}
// SetResourceID sets field value
func (o *StackEventResource) SetResourceID(v string) {
o.ResourceID = v
}
// GetKind returns the Kind field value
func (o *StackEventResource) GetKind() string {
if o == nil {
var ret string
return ret
}
return o.Kind
}
// GetKindOk returns a tuple with the Kind field value
// and a boolean to check if the value has been set.
func (o *StackEventResource) GetKindOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Kind, true
}
// SetKind sets field value
func (o *StackEventResource) SetKind(v string) {
o.Kind = v
}
// GetTemplateMetaName returns the TemplateMetaName field value
func (o *StackEventResource) GetTemplateMetaName() string {
if o == nil {
var ret string
return ret
}
return o.TemplateMetaName
}
// GetTemplateMetaNameOk returns a tuple with the TemplateMetaName field value
// and a boolean to check if the value has been set.
func (o *StackEventResource) GetTemplateMetaNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TemplateMetaName, true
}
// SetTemplateMetaName sets field value
func (o *StackEventResource) SetTemplateMetaName(v string) {
o.TemplateMetaName = v
}
// GetAssociations returns the Associations field value
func (o *StackEventResource) GetAssociations() []StackEventResourceAssociation {
if o == nil {
var ret []StackEventResourceAssociation
return ret
}
return o.Associations
}
// GetAssociationsOk returns a tuple with the Associations field value
// and a boolean to check if the value has been set.
func (o *StackEventResource) GetAssociationsOk() (*[]StackEventResourceAssociation, bool) {
if o == nil {
return nil, false
}
return &o.Associations, true
}
// SetAssociations sets field value
func (o *StackEventResource) SetAssociations(v []StackEventResourceAssociation) {
o.Associations = v
}
// GetLinks returns the Links field value if set, zero value otherwise.
func (o *StackEventResource) GetLinks() StackEventResourceLinks {
if o == nil || o.Links == nil {
var ret StackEventResourceLinks
return ret
}
return *o.Links
}
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *StackEventResource) GetLinksOk() (*StackEventResourceLinks, bool) {
if o == nil || o.Links == nil {
return nil, false
}
return o.Links, true
}
// HasLinks returns a boolean if a field has been set.
func (o *StackEventResource) HasLinks() bool {
if o != nil && o.Links != nil {
return true
}
return false
}
// SetLinks gets a reference to the given StackEventResourceLinks and assigns it to the Links field.
func (o *StackEventResource) SetLinks(v StackEventResourceLinks) {
o.Links = &v
}
func (o StackEventResource) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["apiVersion"] = o.ApiVersion
}
if true {
toSerialize["resourceID"] = o.ResourceID
}
if true {
toSerialize["kind"] = o.Kind
}
if true {
toSerialize["templateMetaName"] = o.TemplateMetaName
}
if true {
toSerialize["associations"] = o.Associations
}
if o.Links != nil {
toSerialize["links"] = o.Links
}
return json.Marshal(toSerialize)
}
type NullableStackEventResource struct {
value *StackEventResource
isSet bool
}
func (v NullableStackEventResource) Get() *StackEventResource {
return v.value
}
func (v *NullableStackEventResource) Set(val *StackEventResource) {
v.value = val
v.isSet = true
}
func (v NullableStackEventResource) IsSet() bool {
return v.isSet
}
func (v *NullableStackEventResource) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStackEventResource(val *StackEventResource) *NullableStackEventResource {
return &NullableStackEventResource{value: val, isSet: true}
}
func (v NullableStackEventResource) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStackEventResource) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,135 @@
/*
* 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"
)
// StackEventResourceAssociation struct for StackEventResourceAssociation
type StackEventResourceAssociation struct {
Kind string `json:"kind" yaml:"kind"`
MetaName string `json:"metaName" yaml:"metaName"`
}
// NewStackEventResourceAssociation instantiates a new StackEventResourceAssociation 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 NewStackEventResourceAssociation(kind string, metaName string) *StackEventResourceAssociation {
this := StackEventResourceAssociation{}
this.Kind = kind
this.MetaName = metaName
return &this
}
// NewStackEventResourceAssociationWithDefaults instantiates a new StackEventResourceAssociation 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 NewStackEventResourceAssociationWithDefaults() *StackEventResourceAssociation {
this := StackEventResourceAssociation{}
return &this
}
// GetKind returns the Kind field value
func (o *StackEventResourceAssociation) GetKind() string {
if o == nil {
var ret string
return ret
}
return o.Kind
}
// GetKindOk returns a tuple with the Kind field value
// and a boolean to check if the value has been set.
func (o *StackEventResourceAssociation) GetKindOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Kind, true
}
// SetKind sets field value
func (o *StackEventResourceAssociation) SetKind(v string) {
o.Kind = v
}
// GetMetaName returns the MetaName field value
func (o *StackEventResourceAssociation) GetMetaName() string {
if o == nil {
var ret string
return ret
}
return o.MetaName
}
// GetMetaNameOk returns a tuple with the MetaName field value
// and a boolean to check if the value has been set.
func (o *StackEventResourceAssociation) GetMetaNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MetaName, true
}
// SetMetaName sets field value
func (o *StackEventResourceAssociation) SetMetaName(v string) {
o.MetaName = v
}
func (o StackEventResourceAssociation) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["kind"] = o.Kind
}
if true {
toSerialize["metaName"] = o.MetaName
}
return json.Marshal(toSerialize)
}
type NullableStackEventResourceAssociation struct {
value *StackEventResourceAssociation
isSet bool
}
func (v NullableStackEventResourceAssociation) Get() *StackEventResourceAssociation {
return v.value
}
func (v *NullableStackEventResourceAssociation) Set(val *StackEventResourceAssociation) {
v.value = val
v.isSet = true
}
func (v NullableStackEventResourceAssociation) IsSet() bool {
return v.isSet
}
func (v *NullableStackEventResourceAssociation) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStackEventResourceAssociation(val *StackEventResourceAssociation) *NullableStackEventResourceAssociation {
return &NullableStackEventResourceAssociation{value: val, isSet: true}
}
func (v NullableStackEventResourceAssociation) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStackEventResourceAssociation) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,113 @@
/*
* 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"
)
// StackEventResourceLinks struct for StackEventResourceLinks
type StackEventResourceLinks struct {
Self *string `json:"self,omitempty" yaml:"self,omitempty"`
}
// NewStackEventResourceLinks instantiates a new StackEventResourceLinks 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 NewStackEventResourceLinks() *StackEventResourceLinks {
this := StackEventResourceLinks{}
return &this
}
// NewStackEventResourceLinksWithDefaults instantiates a new StackEventResourceLinks 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 NewStackEventResourceLinksWithDefaults() *StackEventResourceLinks {
this := StackEventResourceLinks{}
return &this
}
// GetSelf returns the Self field value if set, zero value otherwise.
func (o *StackEventResourceLinks) GetSelf() string {
if o == nil || o.Self == nil {
var ret string
return ret
}
return *o.Self
}
// GetSelfOk returns a tuple with the Self field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *StackEventResourceLinks) GetSelfOk() (*string, bool) {
if o == nil || o.Self == nil {
return nil, false
}
return o.Self, true
}
// HasSelf returns a boolean if a field has been set.
func (o *StackEventResourceLinks) HasSelf() bool {
if o != nil && o.Self != nil {
return true
}
return false
}
// SetSelf gets a reference to the given string and assigns it to the Self field.
func (o *StackEventResourceLinks) SetSelf(v string) {
o.Self = &v
}
func (o StackEventResourceLinks) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Self != nil {
toSerialize["self"] = o.Self
}
return json.Marshal(toSerialize)
}
type NullableStackEventResourceLinks struct {
value *StackEventResourceLinks
isSet bool
}
func (v NullableStackEventResourceLinks) Get() *StackEventResourceLinks {
return v.value
}
func (v *NullableStackEventResourceLinks) Set(val *StackEventResourceLinks) {
v.value = val
v.isSet = true
}
func (v NullableStackEventResourceLinks) IsSet() bool {
return v.isSet
}
func (v *NullableStackEventResourceLinks) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStackEventResourceLinks(val *StackEventResourceLinks) *NullableStackEventResourceLinks {
return &NullableStackEventResourceLinks{value: val, isSet: true}
}
func (v NullableStackEventResourceLinks) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStackEventResourceLinks) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,207 @@
/*
* 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"
)
// StackPatchRequest struct for StackPatchRequest
type StackPatchRequest struct {
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
TemplateURLs []string `json:"templateURLs" yaml:"templateURLs"`
AdditionalResources []StackPatchRequestResource `json:"additionalResources" yaml:"additionalResources"`
}
// NewStackPatchRequest instantiates a new StackPatchRequest 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 NewStackPatchRequest(templateURLs []string, additionalResources []StackPatchRequestResource) *StackPatchRequest {
this := StackPatchRequest{}
this.TemplateURLs = templateURLs
this.AdditionalResources = additionalResources
return &this
}
// NewStackPatchRequestWithDefaults instantiates a new StackPatchRequest 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 NewStackPatchRequestWithDefaults() *StackPatchRequest {
this := StackPatchRequest{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *StackPatchRequest) 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 *StackPatchRequest) 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 *StackPatchRequest) 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 *StackPatchRequest) SetName(v string) {
o.Name = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *StackPatchRequest) 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 *StackPatchRequest) 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 *StackPatchRequest) 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 *StackPatchRequest) SetDescription(v string) {
o.Description = &v
}
// GetTemplateURLs returns the TemplateURLs field value
func (o *StackPatchRequest) GetTemplateURLs() []string {
if o == nil {
var ret []string
return ret
}
return o.TemplateURLs
}
// GetTemplateURLsOk returns a tuple with the TemplateURLs field value
// and a boolean to check if the value has been set.
func (o *StackPatchRequest) GetTemplateURLsOk() (*[]string, bool) {
if o == nil {
return nil, false
}
return &o.TemplateURLs, true
}
// SetTemplateURLs sets field value
func (o *StackPatchRequest) SetTemplateURLs(v []string) {
o.TemplateURLs = v
}
// GetAdditionalResources returns the AdditionalResources field value
func (o *StackPatchRequest) GetAdditionalResources() []StackPatchRequestResource {
if o == nil {
var ret []StackPatchRequestResource
return ret
}
return o.AdditionalResources
}
// GetAdditionalResourcesOk returns a tuple with the AdditionalResources field value
// and a boolean to check if the value has been set.
func (o *StackPatchRequest) GetAdditionalResourcesOk() (*[]StackPatchRequestResource, bool) {
if o == nil {
return nil, false
}
return &o.AdditionalResources, true
}
// SetAdditionalResources sets field value
func (o *StackPatchRequest) SetAdditionalResources(v []StackPatchRequestResource) {
o.AdditionalResources = v
}
func (o StackPatchRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.Description != nil {
toSerialize["description"] = o.Description
}
if true {
toSerialize["templateURLs"] = o.TemplateURLs
}
if true {
toSerialize["additionalResources"] = o.AdditionalResources
}
return json.Marshal(toSerialize)
}
type NullableStackPatchRequest struct {
value *StackPatchRequest
isSet bool
}
func (v NullableStackPatchRequest) Get() *StackPatchRequest {
return v.value
}
func (v *NullableStackPatchRequest) Set(val *StackPatchRequest) {
v.value = val
v.isSet = true
}
func (v NullableStackPatchRequest) IsSet() bool {
return v.isSet
}
func (v *NullableStackPatchRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStackPatchRequest(val *StackPatchRequest) *NullableStackPatchRequest {
return &NullableStackPatchRequest{value: val, isSet: true}
}
func (v NullableStackPatchRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStackPatchRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,171 @@
/*
* 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"
)
// StackPatchRequestResource struct for StackPatchRequestResource
type StackPatchRequestResource struct {
ResourceID string `json:"resourceID" yaml:"resourceID"`
Kind string `json:"kind" yaml:"kind"`
TemplateMetaName *string `json:"templateMetaName,omitempty" yaml:"templateMetaName,omitempty"`
}
// NewStackPatchRequestResource instantiates a new StackPatchRequestResource 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 NewStackPatchRequestResource(resourceID string, kind string) *StackPatchRequestResource {
this := StackPatchRequestResource{}
this.ResourceID = resourceID
this.Kind = kind
return &this
}
// NewStackPatchRequestResourceWithDefaults instantiates a new StackPatchRequestResource 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 NewStackPatchRequestResourceWithDefaults() *StackPatchRequestResource {
this := StackPatchRequestResource{}
return &this
}
// GetResourceID returns the ResourceID field value
func (o *StackPatchRequestResource) GetResourceID() string {
if o == nil {
var ret string
return ret
}
return o.ResourceID
}
// GetResourceIDOk returns a tuple with the ResourceID field value
// and a boolean to check if the value has been set.
func (o *StackPatchRequestResource) GetResourceIDOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ResourceID, true
}
// SetResourceID sets field value
func (o *StackPatchRequestResource) SetResourceID(v string) {
o.ResourceID = v
}
// GetKind returns the Kind field value
func (o *StackPatchRequestResource) GetKind() string {
if o == nil {
var ret string
return ret
}
return o.Kind
}
// GetKindOk returns a tuple with the Kind field value
// and a boolean to check if the value has been set.
func (o *StackPatchRequestResource) GetKindOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Kind, true
}
// SetKind sets field value
func (o *StackPatchRequestResource) SetKind(v string) {
o.Kind = v
}
// GetTemplateMetaName returns the TemplateMetaName field value if set, zero value otherwise.
func (o *StackPatchRequestResource) GetTemplateMetaName() string {
if o == nil || o.TemplateMetaName == nil {
var ret string
return ret
}
return *o.TemplateMetaName
}
// GetTemplateMetaNameOk returns a tuple with the TemplateMetaName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *StackPatchRequestResource) GetTemplateMetaNameOk() (*string, bool) {
if o == nil || o.TemplateMetaName == nil {
return nil, false
}
return o.TemplateMetaName, true
}
// HasTemplateMetaName returns a boolean if a field has been set.
func (o *StackPatchRequestResource) HasTemplateMetaName() bool {
if o != nil && o.TemplateMetaName != nil {
return true
}
return false
}
// SetTemplateMetaName gets a reference to the given string and assigns it to the TemplateMetaName field.
func (o *StackPatchRequestResource) SetTemplateMetaName(v string) {
o.TemplateMetaName = &v
}
func (o StackPatchRequestResource) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["resourceID"] = o.ResourceID
}
if true {
toSerialize["kind"] = o.Kind
}
if o.TemplateMetaName != nil {
toSerialize["templateMetaName"] = o.TemplateMetaName
}
return json.Marshal(toSerialize)
}
type NullableStackPatchRequestResource struct {
value *StackPatchRequestResource
isSet bool
}
func (v NullableStackPatchRequestResource) Get() *StackPatchRequestResource {
return v.value
}
func (v *NullableStackPatchRequestResource) Set(val *StackPatchRequestResource) {
v.value = val
v.isSet = true
}
func (v NullableStackPatchRequestResource) IsSet() bool {
return v.isSet
}
func (v *NullableStackPatchRequestResource) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStackPatchRequestResource(val *StackPatchRequestResource) *NullableStackPatchRequestResource {
return &NullableStackPatchRequestResource{value: val, isSet: true}
}
func (v NullableStackPatchRequestResource) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStackPatchRequestResource) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -0,0 +1,200 @@
/*
* 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"
)
// StackPostRequest struct for StackPostRequest
type StackPostRequest struct {
OrgID string `json:"orgID" yaml:"orgID"`
Name string `json:"name" yaml:"name"`
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
Urls []string `json:"urls" yaml:"urls"`
}
// NewStackPostRequest instantiates a new StackPostRequest 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 NewStackPostRequest(orgID string, name string, urls []string) *StackPostRequest {
this := StackPostRequest{}
this.OrgID = orgID
this.Name = name
this.Urls = urls
return &this
}
// NewStackPostRequestWithDefaults instantiates a new StackPostRequest 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 NewStackPostRequestWithDefaults() *StackPostRequest {
this := StackPostRequest{}
return &this
}
// GetOrgID returns the OrgID field value
func (o *StackPostRequest) 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 *StackPostRequest) GetOrgIDOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OrgID, true
}
// SetOrgID sets field value
func (o *StackPostRequest) SetOrgID(v string) {
o.OrgID = v
}
// GetName returns the Name field value
func (o *StackPostRequest) 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 *StackPostRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *StackPostRequest) SetName(v string) {
o.Name = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *StackPostRequest) 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 *StackPostRequest) 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 *StackPostRequest) 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 *StackPostRequest) SetDescription(v string) {
o.Description = &v
}
// GetUrls returns the Urls field value
func (o *StackPostRequest) GetUrls() []string {
if o == nil {
var ret []string
return ret
}
return o.Urls
}
// GetUrlsOk returns a tuple with the Urls field value
// and a boolean to check if the value has been set.
func (o *StackPostRequest) GetUrlsOk() (*[]string, bool) {
if o == nil {
return nil, false
}
return &o.Urls, true
}
// SetUrls sets field value
func (o *StackPostRequest) SetUrls(v []string) {
o.Urls = v
}
func (o StackPostRequest) 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 true {
toSerialize["urls"] = o.Urls
}
return json.Marshal(toSerialize)
}
type NullableStackPostRequest struct {
value *StackPostRequest
isSet bool
}
func (v NullableStackPostRequest) Get() *StackPostRequest {
return v.value
}
func (v *NullableStackPostRequest) Set(val *StackPostRequest) {
v.value = val
v.isSet = true
}
func (v NullableStackPostRequest) IsSet() bool {
return v.isSet
}
func (v *NullableStackPostRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStackPostRequest(val *StackPostRequest) *NullableStackPostRequest {
return &NullableStackPostRequest{value: val, isSet: true}
}
func (v NullableStackPostRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStackPostRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

106
api/model_stacks.gen.go Normal file
View File

@ -0,0 +1,106 @@
/*
* 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"
)
// Stacks struct for Stacks
type Stacks struct {
Stacks []Stack `json:"stacks" yaml:"stacks"`
}
// NewStacks instantiates a new Stacks 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 NewStacks(stacks []Stack) *Stacks {
this := Stacks{}
this.Stacks = stacks
return &this
}
// NewStacksWithDefaults instantiates a new Stacks 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 NewStacksWithDefaults() *Stacks {
this := Stacks{}
return &this
}
// GetStacks returns the Stacks field value
func (o *Stacks) GetStacks() []Stack {
if o == nil {
var ret []Stack
return ret
}
return o.Stacks
}
// GetStacksOk returns a tuple with the Stacks field value
// and a boolean to check if the value has been set.
func (o *Stacks) GetStacksOk() (*[]Stack, bool) {
if o == nil {
return nil, false
}
return &o.Stacks, true
}
// SetStacks sets field value
func (o *Stacks) SetStacks(v []Stack) {
o.Stacks = v
}
func (o Stacks) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["stacks"] = o.Stacks
}
return json.Marshal(toSerialize)
}
type NullableStacks struct {
value *Stacks
isSet bool
}
func (v NullableStacks) Get() *Stacks {
return v.value
}
func (v *NullableStacks) Set(val *Stacks) {
v.value = val
v.isSet = true
}
func (v NullableStacks) IsSet() bool {
return v.isSet
}
func (v *NullableStacks) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStacks(val *Stacks) *NullableStacks {
return &NullableStacks{value: val, isSet: true}
}
func (v NullableStacks) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStacks) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}