diff --git a/api/api_telegrafs.gen.go b/api/api_telegrafs.gen.go index 084e976..2c80be6 100644 --- a/api/api_telegrafs.gen.go +++ b/api/api_telegrafs.gen.go @@ -648,18 +648,18 @@ func (a *TelegrafsApiService) GetTelegrafsIDExecuteWithHttpInfo(r ApiGetTelegraf } type ApiPostTelegrafsRequest struct { - ctx _context.Context - ApiService TelegrafsApi - telegrafRequest *TelegrafRequest - zapTraceSpan *string + ctx _context.Context + ApiService TelegrafsApi + telegrafPluginRequest *TelegrafPluginRequest + zapTraceSpan *string } -func (r ApiPostTelegrafsRequest) TelegrafRequest(telegrafRequest TelegrafRequest) ApiPostTelegrafsRequest { - r.telegrafRequest = &telegrafRequest +func (r ApiPostTelegrafsRequest) TelegrafPluginRequest(telegrafPluginRequest TelegrafPluginRequest) ApiPostTelegrafsRequest { + r.telegrafPluginRequest = &telegrafPluginRequest return r } -func (r ApiPostTelegrafsRequest) GetTelegrafRequest() *TelegrafRequest { - return r.telegrafRequest +func (r ApiPostTelegrafsRequest) GetTelegrafPluginRequest() *TelegrafPluginRequest { + return r.telegrafPluginRequest } func (r ApiPostTelegrafsRequest) ZapTraceSpan(zapTraceSpan string) ApiPostTelegrafsRequest { @@ -725,8 +725,8 @@ func (a *TelegrafsApiService) PostTelegrafsExecuteWithHttpInfo(r ApiPostTelegraf localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.telegrafRequest == nil { - return localVarReturnValue, nil, reportError("telegrafRequest is required and must be specified") + if r.telegrafPluginRequest == nil { + return localVarReturnValue, nil, reportError("telegrafPluginRequest is required and must be specified") } // to determine the Content-Type header @@ -750,7 +750,7 @@ func (a *TelegrafsApiService) PostTelegrafsExecuteWithHttpInfo(r ApiPostTelegraf localVarHeaderParams["Zap-Trace-Span"] = parameterToString(*r.zapTraceSpan, "") } // body params - localVarPostBody = r.telegrafRequest + localVarPostBody = r.telegrafPluginRequest req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err diff --git a/api/api_write.gen.go b/api/api_write.gen.go index 2f2af6f..a70a8d1 100644 --- a/api/api_write.gen.go +++ b/api/api_write.gen.go @@ -30,7 +30,8 @@ type WriteApi interface { * Writes data to a bucket. To write data into InfluxDB, you need the following: - - **organization** – _See [View organizations]({{% INFLUXDB_DOCS_URL %}}/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ + + - **organization name or ID** – _See [View organizations]({{% INFLUXDB_DOCS_URL %}}/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **bucket** – _See [View buckets]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/view-buckets/) for instructions on viewing your bucket ID._ - **API token** – _See [View tokens]({{% INFLUXDB_DOCS_URL %}}/security/tokens/view-tokens/) @@ -38,6 +39,8 @@ type WriteApi interface { - **InfluxDB URL** – _See [InfluxDB URLs]({{% INFLUXDB_DOCS_URL %}}/reference/urls/)_. - data in [line protocol]({{% INFLUXDB_DOCS_URL %}}/reference/syntax/line-protocol) format. + InfluxDB Cloud enforces rate and size limits different from InfluxDB OSS. For details, see Responses. + For more information and examples, see the following: - [Write data with the InfluxDB API]({{% INFLUXDB_DOCS_URL %}}/write-data/developer-tools/api). - [Optimize writes to InfluxDB]({{% INFLUXDB_DOCS_URL %}}/write-data/best-practices/optimize-writes/). @@ -191,7 +194,8 @@ func (r ApiPostWriteRequest) ExecuteWithHttpInfo() (*_nethttp.Response, error) { * Writes data to a bucket. To write data into InfluxDB, you need the following: -- **organization** – _See [View organizations]({{% INFLUXDB_DOCS_URL %}}/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ + +- **organization name or ID** – _See [View organizations]({{% INFLUXDB_DOCS_URL %}}/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **bucket** – _See [View buckets]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/view-buckets/) for instructions on viewing your bucket ID._ - **API token** – _See [View tokens]({{% INFLUXDB_DOCS_URL %}}/security/tokens/view-tokens/) @@ -199,6 +203,8 @@ To write data into InfluxDB, you need the following: - **InfluxDB URL** – _See [InfluxDB URLs]({{% INFLUXDB_DOCS_URL %}}/reference/urls/)_. - data in [line protocol]({{% INFLUXDB_DOCS_URL %}}/reference/syntax/line-protocol) format. +InfluxDB Cloud enforces rate and size limits different from InfluxDB OSS. For details, see Responses. + For more information and examples, see the following: - [Write data with the InfluxDB API]({{% INFLUXDB_DOCS_URL %}}/write-data/developer-tools/api). - [Optimize writes to InfluxDB]({{% INFLUXDB_DOCS_URL %}}/write-data/best-practices/optimize-writes/). @@ -273,7 +279,7 @@ func (a *WriteApiService) PostWriteExecuteWithHttpInfo(r ApiPostWriteRequest) (* } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json", "text/html"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) diff --git a/api/contract/cli.yml b/api/contract/cli.yml index 20a31d7..bf0b3e9 100644 --- a/api/contract/cli.yml +++ b/api/contract/cli.yml @@ -12,7 +12,7 @@ paths: /setup: $ref: "./openapi/src/common/paths/setup.yml" /write: - $ref: "./openapi/src/oss/paths/write.yml" + $ref: "./openapi/src/common/paths/write.yml" /buckets: $ref: "./openapi/src/common/paths/buckets.yml" /buckets/{bucketID}: @@ -291,6 +291,8 @@ components: $ref: "./openapi/src/common/schemas/Telegrafs.yml" TelegrafRequest: $ref: "./openapi/src/common/schemas/TelegrafRequest.yml" + TelegrafPluginRequest: + $ref: "./openapi/src/common/schemas/TelegrafPluginRequest.yml" Telegraf: $ref: "./openapi/src/common/schemas/Telegraf.yml" Dashboards: diff --git a/api/contract/openapi b/api/contract/openapi index 1243aa6..2199c99 160000 --- a/api/contract/openapi +++ b/api/contract/openapi @@ -1 +1 @@ -Subproject commit 1243aa6c501b26aabb1c32121de1e235152398a6 +Subproject commit 2199c9997e9fb159acc0cc524a1e5fa30d6229c2 diff --git a/api/model_line_protocol_length_error.gen.go b/api/model_line_protocol_length_error.gen.go index 38efe06..17a96e2 100644 --- a/api/model_line_protocol_length_error.gen.go +++ b/api/model_line_protocol_length_error.gen.go @@ -19,19 +19,16 @@ type LineProtocolLengthError struct { Code LineProtocolLengthErrorCode `json:"code" yaml:"code"` // Message is a human-readable message. Message string `json:"message" yaml:"message"` - // Max length in bytes for a body of line-protocol. - MaxLength int32 `json:"maxLength" yaml:"maxLength"` } // NewLineProtocolLengthError instantiates a new LineProtocolLengthError 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 NewLineProtocolLengthError(code LineProtocolLengthErrorCode, message string, maxLength int32) *LineProtocolLengthError { +func NewLineProtocolLengthError(code LineProtocolLengthErrorCode, message string) *LineProtocolLengthError { this := LineProtocolLengthError{} this.Code = code this.Message = message - this.MaxLength = maxLength return &this } @@ -91,30 +88,6 @@ func (o *LineProtocolLengthError) SetMessage(v string) { o.Message = v } -// GetMaxLength returns the MaxLength field value -func (o *LineProtocolLengthError) GetMaxLength() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MaxLength -} - -// GetMaxLengthOk returns a tuple with the MaxLength field value -// and a boolean to check if the value has been set. -func (o *LineProtocolLengthError) GetMaxLengthOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MaxLength, true -} - -// SetMaxLength sets field value -func (o *LineProtocolLengthError) SetMaxLength(v int32) { - o.MaxLength = v -} - func (o LineProtocolLengthError) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if true { @@ -123,9 +96,6 @@ func (o LineProtocolLengthError) MarshalJSON() ([]byte, error) { if true { toSerialize["message"] = o.Message } - if true { - toSerialize["maxLength"] = o.MaxLength - } return json.Marshal(toSerialize) } diff --git a/api/model_telegraf_plugin_request.gen.go b/api/model_telegraf_plugin_request.gen.go new file mode 100644 index 0000000..eddad81 --- /dev/null +++ b/api/model_telegraf_plugin_request.gen.go @@ -0,0 +1,293 @@ +/* + * 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" +) + +// TelegrafPluginRequest struct for TelegrafPluginRequest +type TelegrafPluginRequest struct { + Name *string `json:"name,omitempty" yaml:"name,omitempty"` + Description *string `json:"description,omitempty" yaml:"description,omitempty"` + Plugins *[]TelegrafPluginRequestPlugins `json:"plugins,omitempty" yaml:"plugins,omitempty"` + Metadata *TelegrafRequestMetadata `json:"metadata,omitempty" yaml:"metadata,omitempty"` + Config *string `json:"config,omitempty" yaml:"config,omitempty"` + OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"` +} + +// NewTelegrafPluginRequest instantiates a new TelegrafPluginRequest 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 NewTelegrafPluginRequest() *TelegrafPluginRequest { + this := TelegrafPluginRequest{} + return &this +} + +// NewTelegrafPluginRequestWithDefaults instantiates a new TelegrafPluginRequest 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 NewTelegrafPluginRequestWithDefaults() *TelegrafPluginRequest { + this := TelegrafPluginRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *TelegrafPluginRequest) 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 *TelegrafPluginRequest) 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 *TelegrafPluginRequest) 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 *TelegrafPluginRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TelegrafPluginRequest) 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 *TelegrafPluginRequest) 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 *TelegrafPluginRequest) 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 *TelegrafPluginRequest) SetDescription(v string) { + o.Description = &v +} + +// GetPlugins returns the Plugins field value if set, zero value otherwise. +func (o *TelegrafPluginRequest) GetPlugins() []TelegrafPluginRequestPlugins { + if o == nil || o.Plugins == nil { + var ret []TelegrafPluginRequestPlugins + return ret + } + return *o.Plugins +} + +// GetPluginsOk returns a tuple with the Plugins field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegrafPluginRequest) GetPluginsOk() (*[]TelegrafPluginRequestPlugins, bool) { + if o == nil || o.Plugins == nil { + return nil, false + } + return o.Plugins, true +} + +// HasPlugins returns a boolean if a field has been set. +func (o *TelegrafPluginRequest) HasPlugins() bool { + if o != nil && o.Plugins != nil { + return true + } + + return false +} + +// SetPlugins gets a reference to the given []TelegrafPluginRequestPlugins and assigns it to the Plugins field. +func (o *TelegrafPluginRequest) SetPlugins(v []TelegrafPluginRequestPlugins) { + o.Plugins = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *TelegrafPluginRequest) GetMetadata() TelegrafRequestMetadata { + if o == nil || o.Metadata == nil { + var ret TelegrafRequestMetadata + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegrafPluginRequest) GetMetadataOk() (*TelegrafRequestMetadata, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *TelegrafPluginRequest) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// SetMetadata gets a reference to the given TelegrafRequestMetadata and assigns it to the Metadata field. +func (o *TelegrafPluginRequest) SetMetadata(v TelegrafRequestMetadata) { + o.Metadata = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *TelegrafPluginRequest) GetConfig() string { + if o == nil || o.Config == nil { + var ret string + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegrafPluginRequest) GetConfigOk() (*string, bool) { + if o == nil || o.Config == nil { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *TelegrafPluginRequest) HasConfig() bool { + if o != nil && o.Config != nil { + return true + } + + return false +} + +// SetConfig gets a reference to the given string and assigns it to the Config field. +func (o *TelegrafPluginRequest) SetConfig(v string) { + o.Config = &v +} + +// GetOrgID returns the OrgID field value if set, zero value otherwise. +func (o *TelegrafPluginRequest) GetOrgID() string { + if o == nil || o.OrgID == nil { + var ret string + return ret + } + return *o.OrgID +} + +// GetOrgIDOk returns a tuple with the OrgID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegrafPluginRequest) GetOrgIDOk() (*string, bool) { + if o == nil || o.OrgID == nil { + return nil, false + } + return o.OrgID, true +} + +// HasOrgID returns a boolean if a field has been set. +func (o *TelegrafPluginRequest) HasOrgID() bool { + if o != nil && o.OrgID != nil { + return true + } + + return false +} + +// SetOrgID gets a reference to the given string and assigns it to the OrgID field. +func (o *TelegrafPluginRequest) SetOrgID(v string) { + o.OrgID = &v +} + +func (o TelegrafPluginRequest) 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.Plugins != nil { + toSerialize["plugins"] = o.Plugins + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Config != nil { + toSerialize["config"] = o.Config + } + if o.OrgID != nil { + toSerialize["orgID"] = o.OrgID + } + return json.Marshal(toSerialize) +} + +type NullableTelegrafPluginRequest struct { + value *TelegrafPluginRequest + isSet bool +} + +func (v NullableTelegrafPluginRequest) Get() *TelegrafPluginRequest { + return v.value +} + +func (v *NullableTelegrafPluginRequest) Set(val *TelegrafPluginRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTelegrafPluginRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTelegrafPluginRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelegrafPluginRequest(val *TelegrafPluginRequest) *NullableTelegrafPluginRequest { + return &NullableTelegrafPluginRequest{value: val, isSet: true} +} + +func (v NullableTelegrafPluginRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelegrafPluginRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/model_telegraf_plugin_request_plugins.gen.go b/api/model_telegraf_plugin_request_plugins.gen.go new file mode 100644 index 0000000..f4a7e2d --- /dev/null +++ b/api/model_telegraf_plugin_request_plugins.gen.go @@ -0,0 +1,257 @@ +/* + * 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" +) + +// TelegrafPluginRequestPlugins struct for TelegrafPluginRequestPlugins +type TelegrafPluginRequestPlugins struct { + Type *string `json:"type,omitempty" yaml:"type,omitempty"` + Name *string `json:"name,omitempty" yaml:"name,omitempty"` + Alias *string `json:"alias,omitempty" yaml:"alias,omitempty"` + Description *string `json:"description,omitempty" yaml:"description,omitempty"` + Config *string `json:"config,omitempty" yaml:"config,omitempty"` +} + +// NewTelegrafPluginRequestPlugins instantiates a new TelegrafPluginRequestPlugins 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 NewTelegrafPluginRequestPlugins() *TelegrafPluginRequestPlugins { + this := TelegrafPluginRequestPlugins{} + return &this +} + +// NewTelegrafPluginRequestPluginsWithDefaults instantiates a new TelegrafPluginRequestPlugins 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 NewTelegrafPluginRequestPluginsWithDefaults() *TelegrafPluginRequestPlugins { + this := TelegrafPluginRequestPlugins{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TelegrafPluginRequestPlugins) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegrafPluginRequestPlugins) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *TelegrafPluginRequestPlugins) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *TelegrafPluginRequestPlugins) SetType(v string) { + o.Type = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *TelegrafPluginRequestPlugins) 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 *TelegrafPluginRequestPlugins) 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 *TelegrafPluginRequestPlugins) 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 *TelegrafPluginRequestPlugins) SetName(v string) { + o.Name = &v +} + +// GetAlias returns the Alias field value if set, zero value otherwise. +func (o *TelegrafPluginRequestPlugins) GetAlias() string { + if o == nil || o.Alias == nil { + var ret string + return ret + } + return *o.Alias +} + +// GetAliasOk returns a tuple with the Alias field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegrafPluginRequestPlugins) GetAliasOk() (*string, bool) { + if o == nil || o.Alias == nil { + return nil, false + } + return o.Alias, true +} + +// HasAlias returns a boolean if a field has been set. +func (o *TelegrafPluginRequestPlugins) HasAlias() bool { + if o != nil && o.Alias != nil { + return true + } + + return false +} + +// SetAlias gets a reference to the given string and assigns it to the Alias field. +func (o *TelegrafPluginRequestPlugins) SetAlias(v string) { + o.Alias = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TelegrafPluginRequestPlugins) 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 *TelegrafPluginRequestPlugins) 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 *TelegrafPluginRequestPlugins) 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 *TelegrafPluginRequestPlugins) SetDescription(v string) { + o.Description = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *TelegrafPluginRequestPlugins) GetConfig() string { + if o == nil || o.Config == nil { + var ret string + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegrafPluginRequestPlugins) GetConfigOk() (*string, bool) { + if o == nil || o.Config == nil { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *TelegrafPluginRequestPlugins) HasConfig() bool { + if o != nil && o.Config != nil { + return true + } + + return false +} + +// SetConfig gets a reference to the given string and assigns it to the Config field. +func (o *TelegrafPluginRequestPlugins) SetConfig(v string) { + o.Config = &v +} + +func (o TelegrafPluginRequestPlugins) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Alias != nil { + toSerialize["alias"] = o.Alias + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Config != nil { + toSerialize["config"] = o.Config + } + return json.Marshal(toSerialize) +} + +type NullableTelegrafPluginRequestPlugins struct { + value *TelegrafPluginRequestPlugins + isSet bool +} + +func (v NullableTelegrafPluginRequestPlugins) Get() *TelegrafPluginRequestPlugins { + return v.value +} + +func (v *NullableTelegrafPluginRequestPlugins) Set(val *TelegrafPluginRequestPlugins) { + v.value = val + v.isSet = true +} + +func (v NullableTelegrafPluginRequestPlugins) IsSet() bool { + return v.isSet +} + +func (v *NullableTelegrafPluginRequestPlugins) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelegrafPluginRequestPlugins(val *TelegrafPluginRequestPlugins) *NullableTelegrafPluginRequestPlugins { + return &NullableTelegrafPluginRequestPlugins{value: val, isSet: true} +} + +func (v NullableTelegrafPluginRequestPlugins) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelegrafPluginRequestPlugins) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/clients/telegrafs/telegrafs.go b/clients/telegrafs/telegrafs.go index d63afed..e2ab0d2 100644 --- a/clients/telegrafs/telegrafs.go +++ b/clients/telegrafs/telegrafs.go @@ -65,14 +65,14 @@ func (c Client) Create(ctx context.Context, params *CreateParams) error { return err } - newTelegraf := api.TelegrafRequest{ + newTelegraf := api.TelegrafPluginRequest{ Name: ¶ms.Name, Description: ¶ms.Desc, Config: ¶ms.Config, OrgID: &orgID, } - graf, err := c.PostTelegrafs(ctx).TelegrafRequest(newTelegraf).Execute() + graf, err := c.PostTelegrafs(ctx).TelegrafPluginRequest(newTelegraf).Execute() if err != nil { return fmt.Errorf("failed to create telegraf config %q: %w", params.Name, err) }