feat: replication bucket name (#440)

* chore: gofmt

* chore: update openapi gen files

* feat: add replication-bucket-name flag

* fix: fix tests

* chore: rename to replication-bucket

* feat: show remote bucket name or id

* chore: fmt fixup

* chore: update openapi to master

* chore: fix openapi generation
This commit is contained in:
Jeffrey Smith II
2022-08-18 14:21:50 -04:00
committed by GitHub
parent 051a6aafc4
commit 5c7c34f16d
22 changed files with 420 additions and 218 deletions

View File

@ -47,10 +47,40 @@ type BucketsApi interface {
DeleteBucketsIDExecuteWithHttpInfo(r ApiDeleteBucketsIDRequest) (*_nethttp.Response, error)
/*
* GetBuckets List all buckets
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetBucketsRequest
*/
* GetBuckets List buckets
* Retrieves a list of [buckets]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket).
To limit which buckets are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all buckets up to the
default `limit`.
#### Limitations
- Paging with an `offset` greater than the number of records will result in
an empty list of buckets--for example:
The following request is paging to the 50th record, but the user only has
10 buckets.
```sh
$ curl --request GET "INFLUX_URL/api/v2/scripts?limit=1&offset=50"
$ {
"links": {
"prev": "/api/v2/buckets?descending=false\u0026limit=1\u0026offset=49\u0026orgID=ORG_ID",
"self": "/api/v2/buckets?descending=false\u0026limit=1\u0026offset=50\u0026orgID=ORG_ID"
},
"buckets": []
}
```
#### Related Guides
- [Manage buckets]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetBucketsRequest
*/
GetBuckets(ctx _context.Context) ApiGetBucketsRequest
/*
@ -112,10 +142,34 @@ type BucketsApi interface {
PatchBucketsIDExecuteWithHttpInfo(r ApiPatchBucketsIDRequest) (Bucket, *_nethttp.Response, error)
/*
* PostBuckets Create a bucket
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostBucketsRequest
*/
* PostBuckets Create a bucket
* Creates a [bucket]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket)
and returns the created bucket along with metadata. The default data
[retention period]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#retention-period)
is 30 days.
#### InfluxDB OSS
- A single InfluxDB OSS instance supports active writes or queries for
approximately 20 buckets across all organizations at a given time. Reading
or writing to more than 20 buckets at a time can adversely affect
performance.
#### Limitations
- InfluxDB Cloud Free Plan allows users to create up to two buckets.
Exceeding the bucket quota will result in an HTTP `403` status code.
For additional information regarding InfluxDB Cloud offerings, see
[InfluxDB Cloud Pricing](https://www.influxdata.com/influxdb-cloud-pricing/).
#### Related Guides
- [Create bucket]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/create-bucket/)
- [Create bucket CLI reference]({{% INFLUXDB_DOCS_URL %}}/reference/cli/influx/bucket/create)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostBucketsRequest
*/
PostBuckets(ctx _context.Context) ApiPostBucketsRequest
/*
@ -375,10 +429,40 @@ func (r ApiGetBucketsRequest) ExecuteWithHttpInfo() (Buckets, *_nethttp.Response
}
/*
* GetBuckets List all buckets
* GetBuckets List buckets
* Retrieves a list of [buckets]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket).
To limit which buckets are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all buckets up to the
default `limit`.
#### Limitations
- Paging with an `offset` greater than the number of records will result in
an empty list of buckets--for example:
The following request is paging to the 50th record, but the user only has
10 buckets.
```sh
$ curl --request GET "INFLUX_URL/api/v2/scripts?limit=1&offset=50"
$ {
"links": {
"prev": "/api/v2/buckets?descending=false\u0026limit=1\u0026offset=49\u0026orgID=ORG_ID",
"self": "/api/v2/buckets?descending=false\u0026limit=1\u0026offset=50\u0026orgID=ORG_ID"
},
"buckets": []
}
```
#### Related Guides
- [Manage buckets]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetBucketsRequest
*/
*/
func (a *BucketsApiService) GetBuckets(ctx _context.Context) ApiGetBucketsRequest {
return ApiGetBucketsRequest{
ApiService: a,
@ -900,9 +984,33 @@ func (r ApiPostBucketsRequest) ExecuteWithHttpInfo() (Bucket, *_nethttp.Response
/*
* PostBuckets Create a bucket
* Creates a [bucket]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket)
and returns the created bucket along with metadata. The default data
[retention period]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#retention-period)
is 30 days.
#### InfluxDB OSS
- A single InfluxDB OSS instance supports active writes or queries for
approximately 20 buckets across all organizations at a given time. Reading
or writing to more than 20 buckets at a time can adversely affect
performance.
#### Limitations
- InfluxDB Cloud Free Plan allows users to create up to two buckets.
Exceeding the bucket quota will result in an HTTP `403` status code.
For additional information regarding InfluxDB Cloud offerings, see
[InfluxDB Cloud Pricing](https://www.influxdata.com/influxdb-cloud-pricing/).
#### Related Guides
- [Create bucket]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/create-bucket/)
- [Create bucket CLI reference]({{% INFLUXDB_DOCS_URL %}}/reference/cli/influx/bucket/create)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostBucketsRequest
*/
*/
func (a *BucketsApiService) PostBuckets(ctx _context.Context) ApiPostBucketsRequest {
return ApiPostBucketsRequest{
ApiService: a,
@ -1000,6 +1108,28 @@ func (a *BucketsApiService) PostBucketsExecuteWithHttpInfo(r ApiPostBucketsReque
}
newErr.body = localVarBody
newErr.error = localVarHTTPResponse.Status
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarReturnValue, localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarReturnValue, localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 422 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))

View File

@ -16,7 +16,9 @@ import (
// AddResourceMemberRequestBody struct for AddResourceMemberRequestBody
type AddResourceMemberRequestBody struct {
Id string `json:"id" yaml:"id"`
// The ID of the user to add to the resource.
Id string `json:"id" yaml:"id"`
// The name of the user to add to the resource.
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
}

View File

@ -14,7 +14,7 @@ import (
"encoding/json"
)
// Links struct for Links
// Links URI pointers for additional paged results.
type Links struct {
// URI of resource.
Next *string `json:"next,omitempty" yaml:"next,omitempty"`

View File

@ -16,24 +16,29 @@ import (
// PostBucketRequest struct for PostBucketRequest
type PostBucketRequest struct {
OrgID string `json:"orgID" yaml:"orgID"`
Name string `json:"name" yaml:"name"`
// Organization ID. The ID of the organization.
OrgID string `json:"orgID" yaml:"orgID"`
// The name of the bucket.
Name string `json:"name" yaml:"name"`
// A description of the bucket.
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
Rp *string `json:"rp,omitempty" yaml:"rp,omitempty"`
// Retention policy is an InfluxDB 1.x concept that represents the duration of time that each data point in the retention policy persists. Use `rp` for compatibility with InfluxDB 1.x. The InfluxDB 2.x and Cloud equivalent is [retention period]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#retention-period).
Rp *string `json:"rp,omitempty" yaml:"rp,omitempty"`
// Rules to expire or retain data. No rules means data never expires.
RetentionRules []RetentionRule `json:"retentionRules" yaml:"retentionRules"`
SchemaType *SchemaType `json:"schemaType,omitempty" yaml:"schemaType,omitempty"`
RetentionRules *[]RetentionRule `json:"retentionRules,omitempty" yaml:"retentionRules,omitempty"`
SchemaType *SchemaType `json:"schemaType,omitempty" yaml:"schemaType,omitempty"`
}
// NewPostBucketRequest instantiates a new PostBucketRequest 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 NewPostBucketRequest(orgID string, name string, retentionRules []RetentionRule) *PostBucketRequest {
func NewPostBucketRequest(orgID string, name string) *PostBucketRequest {
this := PostBucketRequest{}
this.OrgID = orgID
this.Name = name
this.RetentionRules = retentionRules
var rp string = "0"
this.Rp = &rp
return &this
}
@ -42,6 +47,8 @@ func NewPostBucketRequest(orgID string, name string, retentionRules []RetentionR
// but it doesn't guarantee that properties required by API are set
func NewPostBucketRequestWithDefaults() *PostBucketRequest {
this := PostBucketRequest{}
var rp string = "0"
this.Rp = &rp
return &this
}
@ -157,28 +164,36 @@ func (o *PostBucketRequest) SetRp(v string) {
o.Rp = &v
}
// GetRetentionRules returns the RetentionRules field value
// GetRetentionRules returns the RetentionRules field value if set, zero value otherwise.
func (o *PostBucketRequest) GetRetentionRules() []RetentionRule {
if o == nil {
if o == nil || o.RetentionRules == nil {
var ret []RetentionRule
return ret
}
return o.RetentionRules
return *o.RetentionRules
}
// GetRetentionRulesOk returns a tuple with the RetentionRules field value
// GetRetentionRulesOk returns a tuple with the RetentionRules field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PostBucketRequest) GetRetentionRulesOk() (*[]RetentionRule, bool) {
if o == nil {
if o == nil || o.RetentionRules == nil {
return nil, false
}
return &o.RetentionRules, true
return o.RetentionRules, true
}
// SetRetentionRules sets field value
// HasRetentionRules returns a boolean if a field has been set.
func (o *PostBucketRequest) HasRetentionRules() bool {
if o != nil && o.RetentionRules != nil {
return true
}
return false
}
// SetRetentionRules gets a reference to the given []RetentionRule and assigns it to the RetentionRules field.
func (o *PostBucketRequest) SetRetentionRules(v []RetentionRule) {
o.RetentionRules = v
o.RetentionRules = &v
}
// GetSchemaType returns the SchemaType field value if set, zero value otherwise.
@ -227,7 +242,7 @@ func (o PostBucketRequest) MarshalJSON() ([]byte, error) {
if o.Rp != nil {
toSerialize["rp"] = o.Rp
}
if true {
if o.RetentionRules != nil {
toSerialize["retentionRules"] = o.RetentionRules
}
if o.SchemaType != nil {

View File

@ -22,7 +22,8 @@ type Replication struct {
OrgID string `json:"orgID" yaml:"orgID"`
RemoteID string `json:"remoteID" yaml:"remoteID"`
LocalBucketID string `json:"localBucketID" yaml:"localBucketID"`
RemoteBucketID string `json:"remoteBucketID" yaml:"remoteBucketID"`
RemoteBucketID *string `json:"remoteBucketID,omitempty" yaml:"remoteBucketID,omitempty"`
RemoteBucketName *string `json:"remoteBucketName,omitempty" yaml:"remoteBucketName,omitempty"`
MaxQueueSizeBytes int64 `json:"maxQueueSizeBytes" yaml:"maxQueueSizeBytes"`
CurrentQueueSizeBytes int64 `json:"currentQueueSizeBytes" yaml:"currentQueueSizeBytes"`
LatestResponseCode *int32 `json:"latestResponseCode,omitempty" yaml:"latestResponseCode,omitempty"`
@ -34,14 +35,13 @@ type Replication struct {
// 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 NewReplication(id string, name string, orgID string, remoteID string, localBucketID string, remoteBucketID string, maxQueueSizeBytes int64, currentQueueSizeBytes int64) *Replication {
func NewReplication(id string, name string, orgID string, remoteID string, localBucketID string, maxQueueSizeBytes int64, currentQueueSizeBytes int64) *Replication {
this := Replication{}
this.Id = id
this.Name = name
this.OrgID = orgID
this.RemoteID = remoteID
this.LocalBucketID = localBucketID
this.RemoteBucketID = remoteBucketID
this.MaxQueueSizeBytes = maxQueueSizeBytes
this.CurrentQueueSizeBytes = currentQueueSizeBytes
return &this
@ -207,28 +207,68 @@ func (o *Replication) SetLocalBucketID(v string) {
o.LocalBucketID = v
}
// GetRemoteBucketID returns the RemoteBucketID field value
// GetRemoteBucketID returns the RemoteBucketID field value if set, zero value otherwise.
func (o *Replication) GetRemoteBucketID() string {
if o == nil {
if o == nil || o.RemoteBucketID == nil {
var ret string
return ret
}
return o.RemoteBucketID
return *o.RemoteBucketID
}
// GetRemoteBucketIDOk returns a tuple with the RemoteBucketID field value
// GetRemoteBucketIDOk returns a tuple with the RemoteBucketID field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Replication) GetRemoteBucketIDOk() (*string, bool) {
if o == nil {
if o == nil || o.RemoteBucketID == nil {
return nil, false
}
return &o.RemoteBucketID, true
return o.RemoteBucketID, true
}
// SetRemoteBucketID sets field value
// HasRemoteBucketID returns a boolean if a field has been set.
func (o *Replication) HasRemoteBucketID() bool {
if o != nil && o.RemoteBucketID != nil {
return true
}
return false
}
// SetRemoteBucketID gets a reference to the given string and assigns it to the RemoteBucketID field.
func (o *Replication) SetRemoteBucketID(v string) {
o.RemoteBucketID = v
o.RemoteBucketID = &v
}
// GetRemoteBucketName returns the RemoteBucketName field value if set, zero value otherwise.
func (o *Replication) GetRemoteBucketName() string {
if o == nil || o.RemoteBucketName == nil {
var ret string
return ret
}
return *o.RemoteBucketName
}
// GetRemoteBucketNameOk returns a tuple with the RemoteBucketName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Replication) GetRemoteBucketNameOk() (*string, bool) {
if o == nil || o.RemoteBucketName == nil {
return nil, false
}
return o.RemoteBucketName, true
}
// HasRemoteBucketName returns a boolean if a field has been set.
func (o *Replication) HasRemoteBucketName() bool {
if o != nil && o.RemoteBucketName != nil {
return true
}
return false
}
// SetRemoteBucketName gets a reference to the given string and assigns it to the RemoteBucketName field.
func (o *Replication) SetRemoteBucketName(v string) {
o.RemoteBucketName = &v
}
// GetMaxQueueSizeBytes returns the MaxQueueSizeBytes field value
@ -395,9 +435,12 @@ func (o Replication) MarshalJSON() ([]byte, error) {
if true {
toSerialize["localBucketID"] = o.LocalBucketID
}
if true {
if o.RemoteBucketID != nil {
toSerialize["remoteBucketID"] = o.RemoteBucketID
}
if o.RemoteBucketName != nil {
toSerialize["remoteBucketName"] = o.RemoteBucketName
}
if true {
toSerialize["maxQueueSizeBytes"] = o.MaxQueueSizeBytes
}

View File

@ -21,7 +21,8 @@ type ReplicationCreationRequest struct {
OrgID string `json:"orgID" yaml:"orgID"`
RemoteID string `json:"remoteID" yaml:"remoteID"`
LocalBucketID string `json:"localBucketID" yaml:"localBucketID"`
RemoteBucketID string `json:"remoteBucketID" yaml:"remoteBucketID"`
RemoteBucketID *string `json:"remoteBucketID,omitempty" yaml:"remoteBucketID,omitempty"`
RemoteBucketName *string `json:"remoteBucketName,omitempty" yaml:"remoteBucketName,omitempty"`
MaxQueueSizeBytes int64 `json:"maxQueueSizeBytes" yaml:"maxQueueSizeBytes"`
DropNonRetryableData *bool `json:"dropNonRetryableData,omitempty" yaml:"dropNonRetryableData,omitempty"`
MaxAgeSeconds int64 `json:"maxAgeSeconds" yaml:"maxAgeSeconds"`
@ -31,13 +32,12 @@ type ReplicationCreationRequest struct {
// 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 NewReplicationCreationRequest(name string, orgID string, remoteID string, localBucketID string, remoteBucketID string, maxQueueSizeBytes int64, maxAgeSeconds int64) *ReplicationCreationRequest {
func NewReplicationCreationRequest(name string, orgID string, remoteID string, localBucketID string, maxQueueSizeBytes int64, maxAgeSeconds int64) *ReplicationCreationRequest {
this := ReplicationCreationRequest{}
this.Name = name
this.OrgID = orgID
this.RemoteID = remoteID
this.LocalBucketID = localBucketID
this.RemoteBucketID = remoteBucketID
this.MaxQueueSizeBytes = maxQueueSizeBytes
var dropNonRetryableData bool = false
this.DropNonRetryableData = &dropNonRetryableData
@ -187,28 +187,68 @@ func (o *ReplicationCreationRequest) SetLocalBucketID(v string) {
o.LocalBucketID = v
}
// GetRemoteBucketID returns the RemoteBucketID field value
// GetRemoteBucketID returns the RemoteBucketID field value if set, zero value otherwise.
func (o *ReplicationCreationRequest) GetRemoteBucketID() string {
if o == nil {
if o == nil || o.RemoteBucketID == nil {
var ret string
return ret
}
return o.RemoteBucketID
return *o.RemoteBucketID
}
// GetRemoteBucketIDOk returns a tuple with the RemoteBucketID field value
// GetRemoteBucketIDOk returns a tuple with the RemoteBucketID field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReplicationCreationRequest) GetRemoteBucketIDOk() (*string, bool) {
if o == nil {
if o == nil || o.RemoteBucketID == nil {
return nil, false
}
return &o.RemoteBucketID, true
return o.RemoteBucketID, true
}
// SetRemoteBucketID sets field value
// HasRemoteBucketID returns a boolean if a field has been set.
func (o *ReplicationCreationRequest) HasRemoteBucketID() bool {
if o != nil && o.RemoteBucketID != nil {
return true
}
return false
}
// SetRemoteBucketID gets a reference to the given string and assigns it to the RemoteBucketID field.
func (o *ReplicationCreationRequest) SetRemoteBucketID(v string) {
o.RemoteBucketID = v
o.RemoteBucketID = &v
}
// GetRemoteBucketName returns the RemoteBucketName field value if set, zero value otherwise.
func (o *ReplicationCreationRequest) GetRemoteBucketName() string {
if o == nil || o.RemoteBucketName == nil {
var ret string
return ret
}
return *o.RemoteBucketName
}
// GetRemoteBucketNameOk returns a tuple with the RemoteBucketName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReplicationCreationRequest) GetRemoteBucketNameOk() (*string, bool) {
if o == nil || o.RemoteBucketName == nil {
return nil, false
}
return o.RemoteBucketName, true
}
// HasRemoteBucketName returns a boolean if a field has been set.
func (o *ReplicationCreationRequest) HasRemoteBucketName() bool {
if o != nil && o.RemoteBucketName != nil {
return true
}
return false
}
// SetRemoteBucketName gets a reference to the given string and assigns it to the RemoteBucketName field.
func (o *ReplicationCreationRequest) SetRemoteBucketName(v string) {
o.RemoteBucketName = &v
}
// GetMaxQueueSizeBytes returns the MaxQueueSizeBytes field value
@ -308,9 +348,12 @@ func (o ReplicationCreationRequest) MarshalJSON() ([]byte, error) {
if true {
toSerialize["localBucketID"] = o.LocalBucketID
}
if true {
if o.RemoteBucketID != nil {
toSerialize["remoteBucketID"] = o.RemoteBucketID
}
if o.RemoteBucketName != nil {
toSerialize["remoteBucketName"] = o.RemoteBucketName
}
if true {
toSerialize["maxQueueSizeBytes"] = o.MaxQueueSizeBytes
}

View File

@ -20,6 +20,7 @@ type ReplicationUpdateRequest struct {
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
RemoteID *string `json:"remoteID,omitempty" yaml:"remoteID,omitempty"`
RemoteBucketID *string `json:"remoteBucketID,omitempty" yaml:"remoteBucketID,omitempty"`
RemoteBucketName *string `json:"remoteBucketName,omitempty" yaml:"remoteBucketName,omitempty"`
MaxQueueSizeBytes *int64 `json:"maxQueueSizeBytes,omitempty" yaml:"maxQueueSizeBytes,omitempty"`
DropNonRetryableData *bool `json:"dropNonRetryableData,omitempty" yaml:"dropNonRetryableData,omitempty"`
MaxAgeSeconds *int64 `json:"maxAgeSeconds,omitempty" yaml:"maxAgeSeconds,omitempty"`
@ -170,6 +171,38 @@ func (o *ReplicationUpdateRequest) SetRemoteBucketID(v string) {
o.RemoteBucketID = &v
}
// GetRemoteBucketName returns the RemoteBucketName field value if set, zero value otherwise.
func (o *ReplicationUpdateRequest) GetRemoteBucketName() string {
if o == nil || o.RemoteBucketName == nil {
var ret string
return ret
}
return *o.RemoteBucketName
}
// GetRemoteBucketNameOk returns a tuple with the RemoteBucketName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReplicationUpdateRequest) GetRemoteBucketNameOk() (*string, bool) {
if o == nil || o.RemoteBucketName == nil {
return nil, false
}
return o.RemoteBucketName, true
}
// HasRemoteBucketName returns a boolean if a field has been set.
func (o *ReplicationUpdateRequest) HasRemoteBucketName() bool {
if o != nil && o.RemoteBucketName != nil {
return true
}
return false
}
// SetRemoteBucketName gets a reference to the given string and assigns it to the RemoteBucketName field.
func (o *ReplicationUpdateRequest) SetRemoteBucketName(v string) {
o.RemoteBucketName = &v
}
// GetMaxQueueSizeBytes returns the MaxQueueSizeBytes field value if set, zero value otherwise.
func (o *ReplicationUpdateRequest) GetMaxQueueSizeBytes() int64 {
if o == nil || o.MaxQueueSizeBytes == nil {
@ -280,6 +313,9 @@ func (o ReplicationUpdateRequest) MarshalJSON() ([]byte, error) {
if o.RemoteBucketID != nil {
toSerialize["remoteBucketID"] = o.RemoteBucketID
}
if o.RemoteBucketName != nil {
toSerialize["remoteBucketName"] = o.RemoteBucketName
}
if o.MaxQueueSizeBytes != nil {
toSerialize["maxQueueSizeBytes"] = o.MaxQueueSizeBytes
}

View File

@ -16,10 +16,11 @@ import (
// ResourceMember struct for ResourceMember
type ResourceMember struct {
Id *string `json:"id,omitempty" yaml:"id,omitempty"`
OauthID *string `json:"oauthID,omitempty" yaml:"oauthID,omitempty"`
Name string `json:"name" yaml:"name"`
// If inactive the user is inactive.
// The ID of the user.
Id *string `json:"id,omitempty" yaml:"id,omitempty"`
// The name of the user.
Name string `json:"name" yaml:"name"`
// The status of a user. An inactive user won't have access to resources.
Status *string `json:"status,omitempty" yaml:"status,omitempty"`
Links *UserResponseLinks `json:"links,omitempty" yaml:"links,omitempty"`
Role *string `json:"role,omitempty" yaml:"role,omitempty"`
@ -83,38 +84,6 @@ func (o *ResourceMember) SetId(v string) {
o.Id = &v
}
// GetOauthID returns the OauthID field value if set, zero value otherwise.
func (o *ResourceMember) GetOauthID() string {
if o == nil || o.OauthID == nil {
var ret string
return ret
}
return *o.OauthID
}
// GetOauthIDOk returns a tuple with the OauthID field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ResourceMember) GetOauthIDOk() (*string, bool) {
if o == nil || o.OauthID == nil {
return nil, false
}
return o.OauthID, true
}
// HasOauthID returns a boolean if a field has been set.
func (o *ResourceMember) HasOauthID() bool {
if o != nil && o.OauthID != nil {
return true
}
return false
}
// SetOauthID gets a reference to the given string and assigns it to the OauthID field.
func (o *ResourceMember) SetOauthID(v string) {
o.OauthID = &v
}
// GetName returns the Name field value
func (o *ResourceMember) GetName() string {
if o == nil {
@ -240,9 +209,6 @@ func (o ResourceMember) MarshalJSON() ([]byte, error) {
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.OauthID != nil {
toSerialize["oauthID"] = o.OauthID
}
if true {
toSerialize["name"] = o.Name
}

View File

@ -16,10 +16,11 @@ import (
// ResourceOwner struct for ResourceOwner
type ResourceOwner struct {
Id *string `json:"id,omitempty" yaml:"id,omitempty"`
OauthID *string `json:"oauthID,omitempty" yaml:"oauthID,omitempty"`
Name string `json:"name" yaml:"name"`
// If inactive the user is inactive.
// The ID of the user.
Id *string `json:"id,omitempty" yaml:"id,omitempty"`
// The name of the user.
Name string `json:"name" yaml:"name"`
// The status of a user. An inactive user won't have access to resources.
Status *string `json:"status,omitempty" yaml:"status,omitempty"`
Links *UserResponseLinks `json:"links,omitempty" yaml:"links,omitempty"`
Role *string `json:"role,omitempty" yaml:"role,omitempty"`
@ -83,38 +84,6 @@ func (o *ResourceOwner) SetId(v string) {
o.Id = &v
}
// GetOauthID returns the OauthID field value if set, zero value otherwise.
func (o *ResourceOwner) GetOauthID() string {
if o == nil || o.OauthID == nil {
var ret string
return ret
}
return *o.OauthID
}
// GetOauthIDOk returns a tuple with the OauthID field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ResourceOwner) GetOauthIDOk() (*string, bool) {
if o == nil || o.OauthID == nil {
return nil, false
}
return o.OauthID, true
}
// HasOauthID returns a boolean if a field has been set.
func (o *ResourceOwner) HasOauthID() bool {
if o != nil && o.OauthID != nil {
return true
}
return false
}
// SetOauthID gets a reference to the given string and assigns it to the OauthID field.
func (o *ResourceOwner) SetOauthID(v string) {
o.OauthID = &v
}
// GetName returns the Name field value
func (o *ResourceOwner) GetName() string {
if o == nil {
@ -240,9 +209,6 @@ func (o ResourceOwner) MarshalJSON() ([]byte, error) {
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.OauthID != nil {
toSerialize["oauthID"] = o.OauthID
}
if true {
toSerialize["name"] = o.Name
}

View File

@ -16,10 +16,10 @@ import (
// RetentionRule struct for RetentionRule
type RetentionRule struct {
Type string `json:"type" yaml:"type"`
// Duration in seconds for how long data will be kept in the database. 0 means infinite.
Type *string `json:"type,omitempty" yaml:"type,omitempty"`
// The duration in seconds for how long data will be kept in the database. The default duration is 2592000 (30 days). 0 represents infinite retention.
EverySeconds int64 `json:"everySeconds" yaml:"everySeconds"`
// Shard duration measured in seconds.
// The shard group duration. The duration or interval (in seconds) that each shard group covers. #### InfluxDB Cloud - Does not use `shardGroupDurationsSeconds`. #### InfluxDB OSS - Default value depends on the [bucket retention period]({{% INFLUXDB_DOCS_URL %}}/v2.3/reference/internals/shards/#shard-group-duration).
ShardGroupDurationSeconds *int64 `json:"shardGroupDurationSeconds,omitempty" yaml:"shardGroupDurationSeconds,omitempty"`
}
@ -27,9 +27,10 @@ type RetentionRule struct {
// 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 NewRetentionRule(type_ string, everySeconds int64) *RetentionRule {
func NewRetentionRule(everySeconds int64) *RetentionRule {
this := RetentionRule{}
this.Type = type_
var type_ string = "expire"
this.Type = &type_
this.EverySeconds = everySeconds
return &this
}
@ -40,32 +41,42 @@ func NewRetentionRule(type_ string, everySeconds int64) *RetentionRule {
func NewRetentionRuleWithDefaults() *RetentionRule {
this := RetentionRule{}
var type_ string = "expire"
this.Type = type_
this.Type = &type_
var everySeconds int64 = 2592000
this.EverySeconds = everySeconds
return &this
}
// GetType returns the Type field value
// GetType returns the Type field value if set, zero value otherwise.
func (o *RetentionRule) GetType() string {
if o == nil {
if o == nil || o.Type == nil {
var ret string
return ret
}
return o.Type
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value
// 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 *RetentionRule) GetTypeOk() (*string, bool) {
if o == nil {
if o == nil || o.Type == nil {
return nil, false
}
return &o.Type, true
return o.Type, true
}
// SetType sets field value
// HasType returns a boolean if a field has been set.
func (o *RetentionRule) 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 *RetentionRule) SetType(v string) {
o.Type = v
o.Type = &v
}
// GetEverySeconds returns the EverySeconds field value
@ -126,7 +137,7 @@ func (o *RetentionRule) SetShardGroupDurationSeconds(v int64) {
func (o RetentionRule) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
if o.Type != nil {
toSerialize["type"] = o.Type
}
if true {

View File

@ -16,10 +16,11 @@ import (
// UserResponse struct for UserResponse
type UserResponse struct {
Id *string `json:"id,omitempty" yaml:"id,omitempty"`
OauthID *string `json:"oauthID,omitempty" yaml:"oauthID,omitempty"`
Name string `json:"name" yaml:"name"`
// If inactive the user is inactive.
// The ID of the user.
Id *string `json:"id,omitempty" yaml:"id,omitempty"`
// The name of the user.
Name string `json:"name" yaml:"name"`
// The status of a user. An inactive user won't have access to resources.
Status *string `json:"status,omitempty" yaml:"status,omitempty"`
Links *UserResponseLinks `json:"links,omitempty" yaml:"links,omitempty"`
}
@ -78,38 +79,6 @@ func (o *UserResponse) SetId(v string) {
o.Id = &v
}
// GetOauthID returns the OauthID field value if set, zero value otherwise.
func (o *UserResponse) GetOauthID() string {
if o == nil || o.OauthID == nil {
var ret string
return ret
}
return *o.OauthID
}
// GetOauthIDOk returns a tuple with the OauthID field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserResponse) GetOauthIDOk() (*string, bool) {
if o == nil || o.OauthID == nil {
return nil, false
}
return o.OauthID, true
}
// HasOauthID returns a boolean if a field has been set.
func (o *UserResponse) HasOauthID() bool {
if o != nil && o.OauthID != nil {
return true
}
return false
}
// SetOauthID gets a reference to the given string and assigns it to the OauthID field.
func (o *UserResponse) SetOauthID(v string) {
o.OauthID = &v
}
// GetName returns the Name field value
func (o *UserResponse) GetName() string {
if o == nil {
@ -203,9 +172,6 @@ func (o UserResponse) MarshalJSON() ([]byte, error) {
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.OauthID != nil {
toSerialize["oauthID"] = o.OauthID
}
if true {
toSerialize["name"] = o.Name
}