diff --git a/metric_ruleset/model_create_metric_ruleset_request.go b/metric_ruleset/model_create_metric_ruleset_request.go index bafaeb1..4ab85ec 100644 --- a/metric_ruleset/model_create_metric_ruleset_request.go +++ b/metric_ruleset/model_create_metric_ruleset_request.go @@ -1,9 +1,9 @@ /* Metric Ruleset API -Metric ruleset API + Metric ruleset API -API version: 3.0.1 +API version: 3.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,6 +18,8 @@ import ( type CreateMetricRulesetRequest struct { // Aggregation rules in the ruleset AggregationRules []AggregationRule `json:"aggregationRules,omitempty"` + // List of exception rules. Exception rules reroute a metric time series (MTS) from an archival route to a real-time route if the MTS contains values that match those of a specified filter. + ExceptionRules []ExceptionRule `json:"exceptionRules,omitempty"` // Name of the metric MetricName string `json:"metricName"` RoutingRule RoutingRule `json:"routingRule"` @@ -58,7 +60,7 @@ func (o *CreateMetricRulesetRequest) GetAggregationRules() []AggregationRule { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetRequest) GetAggregationRulesOk() ([]AggregationRule, bool) { if o == nil || isNil(o.AggregationRules) { - return nil, false + return nil, false } return o.AggregationRules, true } @@ -77,6 +79,38 @@ func (o *CreateMetricRulesetRequest) SetAggregationRules(v []AggregationRule) { o.AggregationRules = v } +// GetExceptionRules returns the ExceptionRules field value if set, zero value otherwise. +func (o *CreateMetricRulesetRequest) GetExceptionRules() []ExceptionRule { + if o == nil || isNil(o.ExceptionRules) { + var ret []ExceptionRule + return ret + } + return o.ExceptionRules +} + +// GetExceptionRulesOk returns a tuple with the ExceptionRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateMetricRulesetRequest) GetExceptionRulesOk() ([]ExceptionRule, bool) { + if o == nil || isNil(o.ExceptionRules) { + return nil, false + } + return o.ExceptionRules, true +} + +// HasExceptionRules returns a boolean if a field has been set. +func (o *CreateMetricRulesetRequest) HasExceptionRules() bool { + if o != nil && !isNil(o.ExceptionRules) { + return true + } + + return false +} + +// SetExceptionRules gets a reference to the given []ExceptionRule and assigns it to the ExceptionRules field. +func (o *CreateMetricRulesetRequest) SetExceptionRules(v []ExceptionRule) { + o.ExceptionRules = v +} + // GetMetricName returns the MetricName field value func (o *CreateMetricRulesetRequest) GetMetricName() string { if o == nil { @@ -91,7 +125,7 @@ func (o *CreateMetricRulesetRequest) GetMetricName() string { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetRequest) GetMetricNameOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.MetricName, true } @@ -115,7 +149,7 @@ func (o *CreateMetricRulesetRequest) GetRoutingRule() RoutingRule { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetRequest) GetRoutingRuleOk() (*RoutingRule, bool) { if o == nil { - return nil, false + return nil, false } return &o.RoutingRule, true } @@ -139,7 +173,7 @@ func (o *CreateMetricRulesetRequest) GetVersion() int64 { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetRequest) GetVersionOk() (*int64, bool) { if o == nil { - return nil, false + return nil, false } return &o.Version, true } @@ -154,15 +188,12 @@ func (o CreateMetricRulesetRequest) MarshalJSON() ([]byte, error) { if !isNil(o.AggregationRules) { toSerialize["aggregationRules"] = o.AggregationRules } - if true { - toSerialize["metricName"] = o.MetricName - } - if true { - toSerialize["routingRule"] = o.RoutingRule - } - if true { - toSerialize["version"] = o.Version + if !isNil(o.ExceptionRules) { + toSerialize["exceptionRules"] = o.ExceptionRules } + toSerialize["metricName"] = o.MetricName + toSerialize["routingRule"] = o.RoutingRule + toSerialize["version"] = o.Version return json.Marshal(toSerialize) } diff --git a/metric_ruleset/model_create_metric_ruleset_response.go b/metric_ruleset/model_create_metric_ruleset_response.go index 18d7fb6..94a75e1 100644 --- a/metric_ruleset/model_create_metric_ruleset_response.go +++ b/metric_ruleset/model_create_metric_ruleset_response.go @@ -1,9 +1,9 @@ /* Metric Ruleset API -Metric ruleset API + Metric ruleset API -API version: 3.0.1 +API version: 3.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,8 +22,10 @@ type CreateMetricRulesetResponse struct { Creator *string `json:"creator,omitempty"` // Name of the user who created this metric ruleset CreatorName *string `json:"creatorName,omitempty"` - // Date and time when this ruleset was created + // Ruleset creation timestamp Created *int64 `json:"created,omitempty"` + // List of exception rules. Exception rules reroute a metric time series (MTS) from an archival route to a real-time route if the MTS contains values that match those of a specified filter. + ExceptionRules []ExceptionRule `json:"exceptionRules,omitempty"` // Ruleset ID Id *string `json:"id,omitempty"` // ID of the user who last updated the ruleset @@ -69,7 +71,7 @@ func (o *CreateMetricRulesetResponse) GetAggregationRules() []AggregationRule { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetAggregationRulesOk() ([]AggregationRule, bool) { if o == nil || isNil(o.AggregationRules) { - return nil, false + return nil, false } return o.AggregationRules, true } @@ -101,7 +103,7 @@ func (o *CreateMetricRulesetResponse) GetCreator() string { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetCreatorOk() (*string, bool) { if o == nil || isNil(o.Creator) { - return nil, false + return nil, false } return o.Creator, true } @@ -133,7 +135,7 @@ func (o *CreateMetricRulesetResponse) GetCreatorName() string { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetCreatorNameOk() (*string, bool) { if o == nil || isNil(o.CreatorName) { - return nil, false + return nil, false } return o.CreatorName, true } @@ -165,7 +167,7 @@ func (o *CreateMetricRulesetResponse) GetCreated() int64 { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetCreatedOk() (*int64, bool) { if o == nil || isNil(o.Created) { - return nil, false + return nil, false } return o.Created, true } @@ -184,6 +186,38 @@ func (o *CreateMetricRulesetResponse) SetCreated(v int64) { o.Created = &v } +// GetExceptionRules returns the ExceptionRules field value if set, zero value otherwise. +func (o *CreateMetricRulesetResponse) GetExceptionRules() []ExceptionRule { + if o == nil || isNil(o.ExceptionRules) { + var ret []ExceptionRule + return ret + } + return o.ExceptionRules +} + +// GetExceptionRulesOk returns a tuple with the ExceptionRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateMetricRulesetResponse) GetExceptionRulesOk() ([]ExceptionRule, bool) { + if o == nil || isNil(o.ExceptionRules) { + return nil, false + } + return o.ExceptionRules, true +} + +// HasExceptionRules returns a boolean if a field has been set. +func (o *CreateMetricRulesetResponse) HasExceptionRules() bool { + if o != nil && !isNil(o.ExceptionRules) { + return true + } + + return false +} + +// SetExceptionRules gets a reference to the given []ExceptionRule and assigns it to the ExceptionRules field. +func (o *CreateMetricRulesetResponse) SetExceptionRules(v []ExceptionRule) { + o.ExceptionRules = v +} + // GetId returns the Id field value if set, zero value otherwise. func (o *CreateMetricRulesetResponse) GetId() string { if o == nil || isNil(o.Id) { @@ -197,7 +231,7 @@ func (o *CreateMetricRulesetResponse) GetId() string { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetIdOk() (*string, bool) { if o == nil || isNil(o.Id) { - return nil, false + return nil, false } return o.Id, true } @@ -229,7 +263,7 @@ func (o *CreateMetricRulesetResponse) GetLastUpdatedBy() string { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetLastUpdatedByOk() (*string, bool) { if o == nil || isNil(o.LastUpdatedBy) { - return nil, false + return nil, false } return o.LastUpdatedBy, true } @@ -261,7 +295,7 @@ func (o *CreateMetricRulesetResponse) GetLastUpdatedByName() string { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetLastUpdatedByNameOk() (*string, bool) { if o == nil || isNil(o.LastUpdatedByName) { - return nil, false + return nil, false } return o.LastUpdatedByName, true } @@ -293,7 +327,7 @@ func (o *CreateMetricRulesetResponse) GetLastUpdated() int64 { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetLastUpdatedOk() (*int64, bool) { if o == nil || isNil(o.LastUpdated) { - return nil, false + return nil, false } return o.LastUpdated, true } @@ -325,7 +359,7 @@ func (o *CreateMetricRulesetResponse) GetMetricName() string { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetMetricNameOk() (*string, bool) { if o == nil || isNil(o.MetricName) { - return nil, false + return nil, false } return o.MetricName, true } @@ -357,7 +391,7 @@ func (o *CreateMetricRulesetResponse) GetRoutingRule() RoutingRule { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetRoutingRuleOk() (*RoutingRule, bool) { if o == nil || isNil(o.RoutingRule) { - return nil, false + return nil, false } return o.RoutingRule, true } @@ -389,7 +423,7 @@ func (o *CreateMetricRulesetResponse) GetVersion() int64 { // and a boolean to check if the value has been set. func (o *CreateMetricRulesetResponse) GetVersionOk() (*int64, bool) { if o == nil || isNil(o.Version) { - return nil, false + return nil, false } return o.Version, true } @@ -422,6 +456,9 @@ func (o CreateMetricRulesetResponse) MarshalJSON() ([]byte, error) { if !isNil(o.Created) { toSerialize["created"] = o.Created } + if !isNil(o.ExceptionRules) { + toSerialize["exceptionRules"] = o.ExceptionRules + } if !isNil(o.Id) { toSerialize["id"] = o.Id } diff --git a/metric_ruleset/model_destination.go b/metric_ruleset/model_destination.go deleted file mode 100644 index 79849c0..0000000 --- a/metric_ruleset/model_destination.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Metric Ingest Ruleset API - -Metric ingest ruleset API - -API version: 3.0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package metric_ruleset - -import ( - "encoding/json" - "fmt" -) - -// Destination The routing destination for your data points -type Destination string - -// List of Destination -const ( - UNKNOWN Destination = "Unknown" - REALTIME_13_MO Destination = "Realtime_13MO" - REALTIME_3_MO Destination = "Realtime_3MO" - HCM Destination = "HCM" - FULL_FIDELITY Destination = "FullFidelity" - DROP Destination = "Drop" -) - -// All allowed values of Destination enum -var AllowedDestinationEnumValues = []Destination{ - "Unknown", - "Realtime_13MO", - "Realtime_3MO", - "HCM", - "FullFidelity", - "Drop", -} - -func (v *Destination) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := Destination(value) - for _, existing := range AllowedDestinationEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid Destination", value) -} diff --git a/metric_ruleset/model_exception_rule.go b/metric_ruleset/model_exception_rule.go new file mode 100644 index 0000000..8286b5b --- /dev/null +++ b/metric_ruleset/model_exception_rule.go @@ -0,0 +1,246 @@ +/* +Metric Ruleset API + + Metric ruleset API + +API version: 3.3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metric_ruleset + +import ( + "encoding/json" +) + +// ExceptionRule Fields for exception rules. +type ExceptionRule struct { + // Name of the exception rule. + Name string `json:"name"` + // Whether to reroute the metric with the specified dimension. If false, the rule remains defined but will not reroute metrics. + Enabled bool `json:"enabled"` + Matcher ExceptionRuleMatcher `json:"matcher"` + // Contains fields for the restoration job. The restoration job reroutes metrics from the archival route to the real-time route. + Restoration []ExceptionRuleRestorationFields `json:"restoration,omitempty"` + // Information about an exception rule. + Description *string `json:"description,omitempty"` +} + +type _ExceptionRule ExceptionRule + +// NewExceptionRule instantiates a new ExceptionRule 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 NewExceptionRule(name string, enabled bool, matcher ExceptionRuleMatcher) *ExceptionRule { + this := ExceptionRule{} + this.Name = name + this.Enabled = enabled + this.Matcher = matcher + return &this +} + +// NewExceptionRuleWithDefaults instantiates a new ExceptionRule 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 NewExceptionRuleWithDefaults() *ExceptionRule { + this := ExceptionRule{} + return &this +} + +// GetName returns the Name field value +func (o *ExceptionRule) 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 *ExceptionRule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ExceptionRule) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value +func (o *ExceptionRule) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *ExceptionRule) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value +func (o *ExceptionRule) SetEnabled(v bool) { + o.Enabled = v +} + +// GetMatcher returns the Matcher field value +func (o *ExceptionRule) GetMatcher() ExceptionRuleMatcher { + if o == nil { + var ret ExceptionRuleMatcher + return ret + } + + return o.Matcher +} + +// GetMatcherOk returns a tuple with the Matcher field value +// and a boolean to check if the value has been set. +func (o *ExceptionRule) GetMatcherOk() (*ExceptionRuleMatcher, bool) { + if o == nil { + return nil, false + } + return &o.Matcher, true +} + +// SetMatcher sets field value +func (o *ExceptionRule) SetMatcher(v ExceptionRuleMatcher) { + o.Matcher = v +} + +// GetRestoration returns the Restoration field value if set, zero value otherwise. +func (o *ExceptionRule) GetRestoration() []ExceptionRuleRestorationFields { + if o == nil || isNil(o.Restoration) { + var ret []ExceptionRuleRestorationFields + return ret + } + return o.Restoration +} + +// GetRestorationOk returns a tuple with the Restoration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExceptionRule) GetRestorationOk() ([]ExceptionRuleRestorationFields, bool) { + if o == nil || isNil(o.Restoration) { + return nil, false + } + return o.Restoration, true +} + +// HasRestoration returns a boolean if a field has been set. +func (o *ExceptionRule) HasRestoration() bool { + if o != nil && !isNil(o.Restoration) { + return true + } + + return false +} + +// SetRestoration gets a reference to the given []ExceptionRuleRestorationFields and assigns it to the Restoration field. +func (o *ExceptionRule) SetRestoration(v []ExceptionRuleRestorationFields) { + o.Restoration = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ExceptionRule) GetDescription() string { + if o == nil || isNil(o.Description) { + 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 *ExceptionRule) GetDescriptionOk() (*string, bool) { + if o == nil || isNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ExceptionRule) HasDescription() bool { + if o != nil && !isNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ExceptionRule) SetDescription(v string) { + o.Description = &v +} + +func (o ExceptionRule) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExceptionRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["enabled"] = o.Enabled + toSerialize["matcher"] = o.Matcher + if !isNil(o.Restoration) { + toSerialize["restoration"] = o.Restoration + } + if !isNil(o.Description) { + toSerialize["description"] = o.Description + } + return toSerialize, nil +} + +type NullableExceptionRule struct { + value *ExceptionRule + isSet bool +} + +func (v NullableExceptionRule) Get() *ExceptionRule { + return v.value +} + +func (v *NullableExceptionRule) Set(val *ExceptionRule) { + v.value = val + v.isSet = true +} + +func (v NullableExceptionRule) IsSet() bool { + return v.isSet +} + +func (v *NullableExceptionRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExceptionRule(val *ExceptionRule) *NullableExceptionRule { + return &NullableExceptionRule{value: val, isSet: true} +} + +func (v NullableExceptionRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExceptionRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/metric_ruleset/model_exception_rule_matcher.go b/metric_ruleset/model_exception_rule_matcher.go new file mode 100644 index 0000000..26fd6b8 --- /dev/null +++ b/metric_ruleset/model_exception_rule_matcher.go @@ -0,0 +1,143 @@ +/* +Metric Ruleset API + + Metric ruleset API + +API version: 3.3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metric_ruleset + +import ( + "encoding/json" +) + +// ExceptionRuleMatcher Finds the metric to reroute. +type ExceptionRuleMatcher struct { + // Metric component to apply filters for. The only supported metric component is \"dimension\". + Type string `json:"type"` + // List of filters to apply to your metric. + Filters []PropertyFilter `json:"filters"` +} + +// NewExceptionRuleMatcher instantiates a new ExceptionRuleMatcher 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 NewExceptionRuleMatcher(type_ string, filters []PropertyFilter) *ExceptionRuleMatcher { + this := ExceptionRuleMatcher{} + this.Type = type_ + this.Filters = filters + return &this +} + +// NewExceptionRuleMatcherWithDefaults instantiates a new ExceptionRuleMatcher 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 NewExceptionRuleMatcherWithDefaults() *ExceptionRuleMatcher { + this := ExceptionRuleMatcher{} + return &this +} + +// GetType returns the Type field value +func (o *ExceptionRuleMatcher) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ExceptionRuleMatcher) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ExceptionRuleMatcher) SetType(v string) { + o.Type = v +} + +// GetFilters returns the Filters field value +func (o *ExceptionRuleMatcher) GetFilters() []PropertyFilter { + if o == nil { + var ret []PropertyFilter + return ret + } + + return o.Filters +} + +// GetFiltersOk returns a tuple with the Filters field value +// and a boolean to check if the value has been set. +func (o *ExceptionRuleMatcher) GetFiltersOk() ([]PropertyFilter, bool) { + if o == nil { + return nil, false + } + return o.Filters, true +} + +// SetFilters sets field value +func (o *ExceptionRuleMatcher) SetFilters(v []PropertyFilter) { + o.Filters = v +} + +func (o ExceptionRuleMatcher) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExceptionRuleMatcher) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["filters"] = o.Filters + return toSerialize, nil +} + +type NullableExceptionRuleMatcher struct { + value *ExceptionRuleMatcher + isSet bool +} + +func (v NullableExceptionRuleMatcher) Get() *ExceptionRuleMatcher { + return v.value +} + +func (v *NullableExceptionRuleMatcher) Set(val *ExceptionRuleMatcher) { + v.value = val + v.isSet = true +} + +func (v NullableExceptionRuleMatcher) IsSet() bool { + return v.isSet +} + +func (v *NullableExceptionRuleMatcher) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExceptionRuleMatcher(val *ExceptionRuleMatcher) *NullableExceptionRuleMatcher { + return &NullableExceptionRuleMatcher{value: val, isSet: true} +} + +func (v NullableExceptionRuleMatcher) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExceptionRuleMatcher) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/metric_ruleset/model_exception_rule_restoration_fields.go b/metric_ruleset/model_exception_rule_restoration_fields.go new file mode 100644 index 0000000..7f5eff5 --- /dev/null +++ b/metric_ruleset/model_exception_rule_restoration_fields.go @@ -0,0 +1,161 @@ +/* +Metric Ruleset API + + Metric ruleset API + +API version: 3.3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metric_ruleset + +import ( + "encoding/json" +) + +// ExceptionRuleRestorationFields Fields of the exceptionRules restoration element. +type ExceptionRuleRestorationFields struct { + // ID of the restoration job. + RestorationId *string `json:"restorationId,omitempty"` + // Time at which the API begins the restoration job. + StartTime *int32 `json:"startTime,omitempty"` +} + +// NewExceptionRuleRestorationFields instantiates a new ExceptionRuleRestorationFields 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 NewExceptionRuleRestorationFields() *ExceptionRuleRestorationFields { + this := ExceptionRuleRestorationFields{} + return &this +} + +// NewExceptionRuleRestorationFieldsWithDefaults instantiates a new ExceptionRuleRestorationFields 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 NewExceptionRuleRestorationFieldsWithDefaults() *ExceptionRuleRestorationFields { + this := ExceptionRuleRestorationFields{} + return &this +} + +// GetRestorationId returns the RestorationId field value if set, zero value otherwise. +func (o *ExceptionRuleRestorationFields) GetRestorationId() string { + if o == nil || isNil(o.RestorationId) { + var ret string + return ret + } + return *o.RestorationId +} + +// GetRestorationIdOk returns a tuple with the RestorationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExceptionRuleRestorationFields) GetRestorationIdOk() (*string, bool) { + if o == nil || isNil(o.RestorationId) { + return nil, false + } + return o.RestorationId, true +} + +// HasRestorationId returns a boolean if a field has been set. +func (o *ExceptionRuleRestorationFields) HasRestorationId() bool { + if o != nil && !isNil(o.RestorationId) { + return true + } + + return false +} + +// SetRestorationId gets a reference to the given string and assigns it to the RestorationId field. +func (o *ExceptionRuleRestorationFields) SetRestorationId(v string) { + o.RestorationId = &v +} + +// GetStartTime returns the StartTime field value if set, zero value otherwise. +func (o *ExceptionRuleRestorationFields) GetStartTime() int32 { + if o == nil || isNil(o.StartTime) { + var ret int32 + return ret + } + return *o.StartTime +} + +// GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExceptionRuleRestorationFields) GetStartTimeOk() (*int32, bool) { + if o == nil || isNil(o.StartTime) { + return nil, false + } + return o.StartTime, true +} + +// HasStartTime returns a boolean if a field has been set. +func (o *ExceptionRuleRestorationFields) HasStartTime() bool { + if o != nil && !isNil(o.StartTime) { + return true + } + + return false +} + +// SetStartTime gets a reference to the given int32 and assigns it to the StartTime field. +func (o *ExceptionRuleRestorationFields) SetStartTime(v int32) { + o.StartTime = &v +} + +func (o ExceptionRuleRestorationFields) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExceptionRuleRestorationFields) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.RestorationId) { + toSerialize["restorationId"] = o.RestorationId + } + if !isNil(o.StartTime) { + toSerialize["startTime"] = o.StartTime + } + return toSerialize, nil +} + +type NullableExceptionRuleRestorationFields struct { + value *ExceptionRuleRestorationFields + isSet bool +} + +func (v NullableExceptionRuleRestorationFields) Get() *ExceptionRuleRestorationFields { + return v.value +} + +func (v *NullableExceptionRuleRestorationFields) Set(val *ExceptionRuleRestorationFields) { + v.value = val + v.isSet = true +} + +func (v NullableExceptionRuleRestorationFields) IsSet() bool { + return v.isSet +} + +func (v *NullableExceptionRuleRestorationFields) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExceptionRuleRestorationFields(val *ExceptionRuleRestorationFields) *NullableExceptionRuleRestorationFields { + return &NullableExceptionRuleRestorationFields{value: val, isSet: true} +} + +func (v NullableExceptionRuleRestorationFields) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExceptionRuleRestorationFields) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/metric_ruleset/model_get_metric_ruleset_response.go b/metric_ruleset/model_get_metric_ruleset_response.go index aebf6a9..a994637 100644 --- a/metric_ruleset/model_get_metric_ruleset_response.go +++ b/metric_ruleset/model_get_metric_ruleset_response.go @@ -1,9 +1,9 @@ /* Metric Ruleset API -Metric ruleset API + Metric ruleset API -API version: 3.0.1 +API version: 3.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,8 +22,10 @@ type GetMetricRulesetResponse struct { Creator *string `json:"creator,omitempty"` // Name of the user who created this metric ruleset CreatorName *string `json:"creatorName,omitempty"` - // Date and time when this ruleset was created + // Ruleset creation timestamp Created *int64 `json:"created,omitempty"` + // List of exception rules. Exception rules reroute a metric time series (MTS) from an archival route to a real-time route if the MTS contains values that match those of a specified filter. + ExceptionRules []ExceptionRule `json:"exceptionRules,omitempty"` // Ruleset ID Id *string `json:"id,omitempty"` // ID of the user who last updated the ruleset @@ -69,7 +71,7 @@ func (o *GetMetricRulesetResponse) GetAggregationRules() []AggregationRule { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetAggregationRulesOk() ([]AggregationRule, bool) { if o == nil || isNil(o.AggregationRules) { - return nil, false + return nil, false } return o.AggregationRules, true } @@ -101,7 +103,7 @@ func (o *GetMetricRulesetResponse) GetCreator() string { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetCreatorOk() (*string, bool) { if o == nil || isNil(o.Creator) { - return nil, false + return nil, false } return o.Creator, true } @@ -133,7 +135,7 @@ func (o *GetMetricRulesetResponse) GetCreatorName() string { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetCreatorNameOk() (*string, bool) { if o == nil || isNil(o.CreatorName) { - return nil, false + return nil, false } return o.CreatorName, true } @@ -165,7 +167,7 @@ func (o *GetMetricRulesetResponse) GetCreated() int64 { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetCreatedOk() (*int64, bool) { if o == nil || isNil(o.Created) { - return nil, false + return nil, false } return o.Created, true } @@ -184,6 +186,38 @@ func (o *GetMetricRulesetResponse) SetCreated(v int64) { o.Created = &v } +// GetExceptionRules returns the ExceptionRules field value if set, zero value otherwise. +func (o *GetMetricRulesetResponse) GetExceptionRules() []ExceptionRule { + if o == nil || isNil(o.ExceptionRules) { + var ret []ExceptionRule + return ret + } + return o.ExceptionRules +} + +// GetExceptionRulesOk returns a tuple with the ExceptionRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricRulesetResponse) GetExceptionRulesOk() ([]ExceptionRule, bool) { + if o == nil || isNil(o.ExceptionRules) { + return nil, false + } + return o.ExceptionRules, true +} + +// HasExceptionRules returns a boolean if a field has been set. +func (o *GetMetricRulesetResponse) HasExceptionRules() bool { + if o != nil && !isNil(o.ExceptionRules) { + return true + } + + return false +} + +// SetExceptionRules gets a reference to the given []ExceptionRule and assigns it to the ExceptionRules field. +func (o *GetMetricRulesetResponse) SetExceptionRules(v []ExceptionRule) { + o.ExceptionRules = v +} + // GetId returns the Id field value if set, zero value otherwise. func (o *GetMetricRulesetResponse) GetId() string { if o == nil || isNil(o.Id) { @@ -197,7 +231,7 @@ func (o *GetMetricRulesetResponse) GetId() string { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetIdOk() (*string, bool) { if o == nil || isNil(o.Id) { - return nil, false + return nil, false } return o.Id, true } @@ -229,7 +263,7 @@ func (o *GetMetricRulesetResponse) GetLastUpdatedBy() string { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetLastUpdatedByOk() (*string, bool) { if o == nil || isNil(o.LastUpdatedBy) { - return nil, false + return nil, false } return o.LastUpdatedBy, true } @@ -261,7 +295,7 @@ func (o *GetMetricRulesetResponse) GetLastUpdatedByName() string { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetLastUpdatedByNameOk() (*string, bool) { if o == nil || isNil(o.LastUpdatedByName) { - return nil, false + return nil, false } return o.LastUpdatedByName, true } @@ -293,7 +327,7 @@ func (o *GetMetricRulesetResponse) GetLastUpdated() int64 { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetLastUpdatedOk() (*int64, bool) { if o == nil || isNil(o.LastUpdated) { - return nil, false + return nil, false } return o.LastUpdated, true } @@ -325,7 +359,7 @@ func (o *GetMetricRulesetResponse) GetMetricName() string { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetMetricNameOk() (*string, bool) { if o == nil || isNil(o.MetricName) { - return nil, false + return nil, false } return o.MetricName, true } @@ -357,7 +391,7 @@ func (o *GetMetricRulesetResponse) GetRoutingRule() RoutingRule { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetRoutingRuleOk() (*RoutingRule, bool) { if o == nil || isNil(o.RoutingRule) { - return nil, false + return nil, false } return o.RoutingRule, true } @@ -389,7 +423,7 @@ func (o *GetMetricRulesetResponse) GetVersion() int64 { // and a boolean to check if the value has been set. func (o *GetMetricRulesetResponse) GetVersionOk() (*int64, bool) { if o == nil || isNil(o.Version) { - return nil, false + return nil, false } return o.Version, true } @@ -422,6 +456,9 @@ func (o GetMetricRulesetResponse) MarshalJSON() ([]byte, error) { if !isNil(o.Created) { toSerialize["created"] = o.Created } + if !isNil(o.ExceptionRules) { + toSerialize["exceptionRules"] = o.ExceptionRules + } if !isNil(o.Id) { toSerialize["id"] = o.Id } diff --git a/metric_ruleset/model_get_metric_rulesets_response.go b/metric_ruleset/model_get_metric_rulesets_response.go index 259eef0..ca3e65a 100644 --- a/metric_ruleset/model_get_metric_rulesets_response.go +++ b/metric_ruleset/model_get_metric_rulesets_response.go @@ -1,9 +1,9 @@ /* Metric Ruleset API -Metric ruleset API + Metric ruleset API -API version: 3.0.1 +API version: 3.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -52,7 +52,7 @@ func (o *GetMetricRulesetsResponse) GetCount() int32 { // and a boolean to check if the value has been set. func (o *GetMetricRulesetsResponse) GetCountOk() (*int32, bool) { if o == nil || isNil(o.Count) { - return nil, false + return nil, false } return o.Count, true } @@ -84,7 +84,7 @@ func (o *GetMetricRulesetsResponse) GetResults() []MetricRuleset { // and a boolean to check if the value has been set. func (o *GetMetricRulesetsResponse) GetResultsOk() ([]MetricRuleset, bool) { if o == nil || isNil(o.Results) { - return nil, false + return nil, false } return o.Results, true } diff --git a/metric_ruleset/model_metric_ruleset.go b/metric_ruleset/model_metric_ruleset.go index 3fc57bb..50def0d 100644 --- a/metric_ruleset/model_metric_ruleset.go +++ b/metric_ruleset/model_metric_ruleset.go @@ -1,9 +1,9 @@ /* Metric Ruleset API -Metric ruleset API + Metric ruleset API -API version: 3.0.1 +API version: 3.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,8 +22,10 @@ type MetricRuleset struct { Creator *string `json:"creator,omitempty"` // Name of the user who created this metric ruleset CreatorName *string `json:"creatorName,omitempty"` - // Date and time when this ruleset was created + // Ruleset creation timestamp Created *int64 `json:"created,omitempty"` + // List of exception rules. Exception rules reroute a metric time series (MTS) from an archival route to a real-time route if the MTS contains values that match those of a specified filter. + ExceptionRules []ExceptionRule `json:"exceptionRules,omitempty"` // Ruleset ID Id *string `json:"id,omitempty"` // ID of the user who last updated the ruleset @@ -37,6 +39,8 @@ type MetricRuleset struct { RoutingRule *RoutingRule `json:"routingRule,omitempty"` // Version of the ruleset Version *int64 `json:"version,omitempty"` + // Information about the metric ruleset. + Description *string `json:"description,omitempty"` } // NewMetricRuleset instantiates a new MetricRuleset object @@ -69,7 +73,7 @@ func (o *MetricRuleset) GetAggregationRules() []AggregationRule { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetAggregationRulesOk() ([]AggregationRule, bool) { if o == nil || isNil(o.AggregationRules) { - return nil, false + return nil, false } return o.AggregationRules, true } @@ -101,7 +105,7 @@ func (o *MetricRuleset) GetCreator() string { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetCreatorOk() (*string, bool) { if o == nil || isNil(o.Creator) { - return nil, false + return nil, false } return o.Creator, true } @@ -133,7 +137,7 @@ func (o *MetricRuleset) GetCreatorName() string { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetCreatorNameOk() (*string, bool) { if o == nil || isNil(o.CreatorName) { - return nil, false + return nil, false } return o.CreatorName, true } @@ -165,7 +169,7 @@ func (o *MetricRuleset) GetCreated() int64 { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetCreatedOk() (*int64, bool) { if o == nil || isNil(o.Created) { - return nil, false + return nil, false } return o.Created, true } @@ -184,6 +188,38 @@ func (o *MetricRuleset) SetCreated(v int64) { o.Created = &v } +// GetExceptionRules returns the ExceptionRules field value if set, zero value otherwise. +func (o *MetricRuleset) GetExceptionRules() []ExceptionRule { + if o == nil || isNil(o.ExceptionRules) { + var ret []ExceptionRule + return ret + } + return o.ExceptionRules +} + +// GetExceptionRulesOk returns a tuple with the ExceptionRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetricRuleset) GetExceptionRulesOk() ([]ExceptionRule, bool) { + if o == nil || isNil(o.ExceptionRules) { + return nil, false + } + return o.ExceptionRules, true +} + +// HasExceptionRules returns a boolean if a field has been set. +func (o *MetricRuleset) HasExceptionRules() bool { + if o != nil && !isNil(o.ExceptionRules) { + return true + } + + return false +} + +// SetExceptionRules gets a reference to the given []ExceptionRule and assigns it to the ExceptionRules field. +func (o *MetricRuleset) SetExceptionRules(v []ExceptionRule) { + o.ExceptionRules = v +} + // GetId returns the Id field value if set, zero value otherwise. func (o *MetricRuleset) GetId() string { if o == nil || isNil(o.Id) { @@ -197,7 +233,7 @@ func (o *MetricRuleset) GetId() string { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetIdOk() (*string, bool) { if o == nil || isNil(o.Id) { - return nil, false + return nil, false } return o.Id, true } @@ -229,7 +265,7 @@ func (o *MetricRuleset) GetLastUpdatedBy() string { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetLastUpdatedByOk() (*string, bool) { if o == nil || isNil(o.LastUpdatedBy) { - return nil, false + return nil, false } return o.LastUpdatedBy, true } @@ -261,7 +297,7 @@ func (o *MetricRuleset) GetLastUpdatedByName() string { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetLastUpdatedByNameOk() (*string, bool) { if o == nil || isNil(o.LastUpdatedByName) { - return nil, false + return nil, false } return o.LastUpdatedByName, true } @@ -293,7 +329,7 @@ func (o *MetricRuleset) GetLastUpdated() int64 { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetLastUpdatedOk() (*int64, bool) { if o == nil || isNil(o.LastUpdated) { - return nil, false + return nil, false } return o.LastUpdated, true } @@ -325,7 +361,7 @@ func (o *MetricRuleset) GetMetricName() string { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetMetricNameOk() (*string, bool) { if o == nil || isNil(o.MetricName) { - return nil, false + return nil, false } return o.MetricName, true } @@ -357,7 +393,7 @@ func (o *MetricRuleset) GetRoutingRule() RoutingRule { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetRoutingRuleOk() (*RoutingRule, bool) { if o == nil || isNil(o.RoutingRule) { - return nil, false + return nil, false } return o.RoutingRule, true } @@ -389,7 +425,7 @@ func (o *MetricRuleset) GetVersion() int64 { // and a boolean to check if the value has been set. func (o *MetricRuleset) GetVersionOk() (*int64, bool) { if o == nil || isNil(o.Version) { - return nil, false + return nil, false } return o.Version, true } @@ -408,6 +444,38 @@ func (o *MetricRuleset) SetVersion(v int64) { o.Version = &v } +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MetricRuleset) GetDescription() string { + if o == nil || isNil(o.Description) { + 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 *MetricRuleset) GetDescriptionOk() (*string, bool) { + if o == nil || isNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *MetricRuleset) HasDescription() bool { + if o != nil && !isNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *MetricRuleset) SetDescription(v string) { + o.Description = &v +} + func (o MetricRuleset) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if !isNil(o.AggregationRules) { @@ -422,6 +490,9 @@ func (o MetricRuleset) MarshalJSON() ([]byte, error) { if !isNil(o.Created) { toSerialize["created"] = o.Created } + if !isNil(o.ExceptionRules) { + toSerialize["exceptionRules"] = o.ExceptionRules + } if !isNil(o.Id) { toSerialize["id"] = o.Id } @@ -443,6 +514,9 @@ func (o MetricRuleset) MarshalJSON() ([]byte, error) { if !isNil(o.Version) { toSerialize["version"] = o.Version } + if !isNil(o.Description) { + toSerialize["description"] = o.Description + } return json.Marshal(toSerialize) } diff --git a/metric_ruleset/model_restoration_job_response.go b/metric_ruleset/model_restoration_job_response.go new file mode 100644 index 0000000..1607852 --- /dev/null +++ b/metric_ruleset/model_restoration_job_response.go @@ -0,0 +1,383 @@ +/* +Metric Ruleset API + + Metric ruleset API + +API version: 3.3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metric_ruleset + +import ( + "encoding/json" +) + +// RestorationJobResponse Response body returned when `GET /v2/metricruleset/restoration/{id}` successfully retrieves a restoration job. +type RestorationJobResponse struct { + // Ruleset creation timestamp + Created *int64 `json:"created,omitempty"` + // User ID of the user who created this metric ruleset + Creator *string `json:"creator,omitempty"` + // Name of the user who created this metric ruleset + CreatorName *string `json:"creatorName,omitempty"` + // Ruleset ID + Id *string `json:"id,omitempty"` + // Time at which this ruleset was last updated + LastUpdated *int64 `json:"lastUpdated,omitempty"` + // ID of the user who last updated the ruleset + LastUpdatedBy *string `json:"lastUpdatedBy,omitempty"` + // Name of the user who last updated the ruleset + LastUpdatedByName *string `json:"lastUpdatedByName,omitempty"` + // Status of the restoration job. + Status *string `json:"status,omitempty"` +} + +// NewRestorationJobResponse instantiates a new RestorationJobResponse 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 NewRestorationJobResponse() *RestorationJobResponse { + this := RestorationJobResponse{} + return &this +} + +// NewRestorationJobResponseWithDefaults instantiates a new RestorationJobResponse 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 NewRestorationJobResponseWithDefaults() *RestorationJobResponse { + this := RestorationJobResponse{} + return &this +} + +// GetCreated returns the Created field value if set, zero value otherwise. +func (o *RestorationJobResponse) GetCreated() int64 { + if o == nil || isNil(o.Created) { + var ret int64 + return ret + } + return *o.Created +} + +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestorationJobResponse) GetCreatedOk() (*int64, bool) { + if o == nil || isNil(o.Created) { + return nil, false + } + return o.Created, true +} + +// HasCreated returns a boolean if a field has been set. +func (o *RestorationJobResponse) HasCreated() bool { + if o != nil && !isNil(o.Created) { + return true + } + + return false +} + +// SetCreated gets a reference to the given int64 and assigns it to the Created field. +func (o *RestorationJobResponse) SetCreated(v int64) { + o.Created = &v +} + +// GetCreator returns the Creator field value if set, zero value otherwise. +func (o *RestorationJobResponse) GetCreator() string { + if o == nil || isNil(o.Creator) { + var ret string + return ret + } + return *o.Creator +} + +// GetCreatorOk returns a tuple with the Creator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestorationJobResponse) GetCreatorOk() (*string, bool) { + if o == nil || isNil(o.Creator) { + return nil, false + } + return o.Creator, true +} + +// HasCreator returns a boolean if a field has been set. +func (o *RestorationJobResponse) HasCreator() bool { + if o != nil && !isNil(o.Creator) { + return true + } + + return false +} + +// SetCreator gets a reference to the given string and assigns it to the Creator field. +func (o *RestorationJobResponse) SetCreator(v string) { + o.Creator = &v +} + +// GetCreatorName returns the CreatorName field value if set, zero value otherwise. +func (o *RestorationJobResponse) GetCreatorName() string { + if o == nil || isNil(o.CreatorName) { + var ret string + return ret + } + return *o.CreatorName +} + +// GetCreatorNameOk returns a tuple with the CreatorName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestorationJobResponse) GetCreatorNameOk() (*string, bool) { + if o == nil || isNil(o.CreatorName) { + return nil, false + } + return o.CreatorName, true +} + +// HasCreatorName returns a boolean if a field has been set. +func (o *RestorationJobResponse) HasCreatorName() bool { + if o != nil && !isNil(o.CreatorName) { + return true + } + + return false +} + +// SetCreatorName gets a reference to the given string and assigns it to the CreatorName field. +func (o *RestorationJobResponse) SetCreatorName(v string) { + o.CreatorName = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RestorationJobResponse) GetId() string { + if o == nil || isNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestorationJobResponse) GetIdOk() (*string, bool) { + if o == nil || isNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *RestorationJobResponse) HasId() bool { + if o != nil && !isNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *RestorationJobResponse) SetId(v string) { + o.Id = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *RestorationJobResponse) GetLastUpdated() int64 { + if o == nil || isNil(o.LastUpdated) { + var ret int64 + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestorationJobResponse) GetLastUpdatedOk() (*int64, bool) { + if o == nil || isNil(o.LastUpdated) { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *RestorationJobResponse) HasLastUpdated() bool { + if o != nil && !isNil(o.LastUpdated) { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given int64 and assigns it to the LastUpdated field. +func (o *RestorationJobResponse) SetLastUpdated(v int64) { + o.LastUpdated = &v +} + +// GetLastUpdatedBy returns the LastUpdatedBy field value if set, zero value otherwise. +func (o *RestorationJobResponse) GetLastUpdatedBy() string { + if o == nil || isNil(o.LastUpdatedBy) { + var ret string + return ret + } + return *o.LastUpdatedBy +} + +// GetLastUpdatedByOk returns a tuple with the LastUpdatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestorationJobResponse) GetLastUpdatedByOk() (*string, bool) { + if o == nil || isNil(o.LastUpdatedBy) { + return nil, false + } + return o.LastUpdatedBy, true +} + +// HasLastUpdatedBy returns a boolean if a field has been set. +func (o *RestorationJobResponse) HasLastUpdatedBy() bool { + if o != nil && !isNil(o.LastUpdatedBy) { + return true + } + + return false +} + +// SetLastUpdatedBy gets a reference to the given string and assigns it to the LastUpdatedBy field. +func (o *RestorationJobResponse) SetLastUpdatedBy(v string) { + o.LastUpdatedBy = &v +} + +// GetLastUpdatedByName returns the LastUpdatedByName field value if set, zero value otherwise. +func (o *RestorationJobResponse) GetLastUpdatedByName() string { + if o == nil || isNil(o.LastUpdatedByName) { + var ret string + return ret + } + return *o.LastUpdatedByName +} + +// GetLastUpdatedByNameOk returns a tuple with the LastUpdatedByName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestorationJobResponse) GetLastUpdatedByNameOk() (*string, bool) { + if o == nil || isNil(o.LastUpdatedByName) { + return nil, false + } + return o.LastUpdatedByName, true +} + +// HasLastUpdatedByName returns a boolean if a field has been set. +func (o *RestorationJobResponse) HasLastUpdatedByName() bool { + if o != nil && !isNil(o.LastUpdatedByName) { + return true + } + + return false +} + +// SetLastUpdatedByName gets a reference to the given string and assigns it to the LastUpdatedByName field. +func (o *RestorationJobResponse) SetLastUpdatedByName(v string) { + o.LastUpdatedByName = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *RestorationJobResponse) GetStatus() string { + if o == nil || isNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestorationJobResponse) GetStatusOk() (*string, bool) { + if o == nil || isNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *RestorationJobResponse) HasStatus() bool { + if o != nil && !isNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *RestorationJobResponse) SetStatus(v string) { + o.Status = &v +} + +func (o RestorationJobResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestorationJobResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Created) { + toSerialize["created"] = o.Created + } + if !isNil(o.Creator) { + toSerialize["creator"] = o.Creator + } + if !isNil(o.CreatorName) { + toSerialize["creatorName"] = o.CreatorName + } + if !isNil(o.Id) { + toSerialize["id"] = o.Id + } + if !isNil(o.LastUpdated) { + toSerialize["lastUpdated"] = o.LastUpdated + } + if !isNil(o.LastUpdatedBy) { + toSerialize["lastUpdatedBy"] = o.LastUpdatedBy + } + if !isNil(o.LastUpdatedByName) { + toSerialize["lastUpdatedByName"] = o.LastUpdatedByName + } + if !isNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableRestorationJobResponse struct { + value *RestorationJobResponse + isSet bool +} + +func (v NullableRestorationJobResponse) Get() *RestorationJobResponse { + return v.value +} + +func (v *NullableRestorationJobResponse) Set(val *RestorationJobResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRestorationJobResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRestorationJobResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestorationJobResponse(val *RestorationJobResponse) *NullableRestorationJobResponse { + return &NullableRestorationJobResponse{value: val, isSet: true} +} + +func (v NullableRestorationJobResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestorationJobResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/metric_ruleset/model_update_metric_ruleset_response.go b/metric_ruleset/model_update_metric_ruleset_response.go index bf26ba8..19ec57e 100644 --- a/metric_ruleset/model_update_metric_ruleset_response.go +++ b/metric_ruleset/model_update_metric_ruleset_response.go @@ -1,9 +1,9 @@ /* Metric Ruleset API -Metric ruleset API + Metric ruleset API -API version: 3.0.1 +API version: 3.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,8 +22,10 @@ type UpdateMetricRulesetResponse struct { Creator *string `json:"creator,omitempty"` // Name of the user who created this metric ruleset CreatorName *string `json:"creatorName,omitempty"` - // Date and time when this ruleset was created + // Ruleset creation timestamp Created *int64 `json:"created,omitempty"` + // List of exception rules. Exception rules reroute a metric time series (MTS) from an archival route to a real-time route if the MTS contains values that match those of a specified filter. + ExceptionRules []ExceptionRule `json:"exceptionRules,omitempty"` // Ruleset ID Id *string `json:"id,omitempty"` // ID of the user who last updated the ruleset @@ -69,7 +71,7 @@ func (o *UpdateMetricRulesetResponse) GetAggregationRules() []AggregationRule { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetAggregationRulesOk() ([]AggregationRule, bool) { if o == nil || isNil(o.AggregationRules) { - return nil, false + return nil, false } return o.AggregationRules, true } @@ -101,7 +103,7 @@ func (o *UpdateMetricRulesetResponse) GetCreator() string { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetCreatorOk() (*string, bool) { if o == nil || isNil(o.Creator) { - return nil, false + return nil, false } return o.Creator, true } @@ -133,7 +135,7 @@ func (o *UpdateMetricRulesetResponse) GetCreatorName() string { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetCreatorNameOk() (*string, bool) { if o == nil || isNil(o.CreatorName) { - return nil, false + return nil, false } return o.CreatorName, true } @@ -165,7 +167,7 @@ func (o *UpdateMetricRulesetResponse) GetCreated() int64 { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetCreatedOk() (*int64, bool) { if o == nil || isNil(o.Created) { - return nil, false + return nil, false } return o.Created, true } @@ -184,6 +186,38 @@ func (o *UpdateMetricRulesetResponse) SetCreated(v int64) { o.Created = &v } +// GetExceptionRules returns the ExceptionRules field value if set, zero value otherwise. +func (o *UpdateMetricRulesetResponse) GetExceptionRules() []ExceptionRule { + if o == nil || isNil(o.ExceptionRules) { + var ret []ExceptionRule + return ret + } + return o.ExceptionRules +} + +// GetExceptionRulesOk returns a tuple with the ExceptionRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateMetricRulesetResponse) GetExceptionRulesOk() ([]ExceptionRule, bool) { + if o == nil || isNil(o.ExceptionRules) { + return nil, false + } + return o.ExceptionRules, true +} + +// HasExceptionRules returns a boolean if a field has been set. +func (o *UpdateMetricRulesetResponse) HasExceptionRules() bool { + if o != nil && !isNil(o.ExceptionRules) { + return true + } + + return false +} + +// SetExceptionRules gets a reference to the given []ExceptionRule and assigns it to the ExceptionRules field. +func (o *UpdateMetricRulesetResponse) SetExceptionRules(v []ExceptionRule) { + o.ExceptionRules = v +} + // GetId returns the Id field value if set, zero value otherwise. func (o *UpdateMetricRulesetResponse) GetId() string { if o == nil || isNil(o.Id) { @@ -197,7 +231,7 @@ func (o *UpdateMetricRulesetResponse) GetId() string { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetIdOk() (*string, bool) { if o == nil || isNil(o.Id) { - return nil, false + return nil, false } return o.Id, true } @@ -229,7 +263,7 @@ func (o *UpdateMetricRulesetResponse) GetLastUpdatedBy() string { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetLastUpdatedByOk() (*string, bool) { if o == nil || isNil(o.LastUpdatedBy) { - return nil, false + return nil, false } return o.LastUpdatedBy, true } @@ -261,7 +295,7 @@ func (o *UpdateMetricRulesetResponse) GetLastUpdatedByName() string { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetLastUpdatedByNameOk() (*string, bool) { if o == nil || isNil(o.LastUpdatedByName) { - return nil, false + return nil, false } return o.LastUpdatedByName, true } @@ -293,7 +327,7 @@ func (o *UpdateMetricRulesetResponse) GetLastUpdated() int64 { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetLastUpdatedOk() (*int64, bool) { if o == nil || isNil(o.LastUpdated) { - return nil, false + return nil, false } return o.LastUpdated, true } @@ -325,7 +359,7 @@ func (o *UpdateMetricRulesetResponse) GetMetricName() string { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetMetricNameOk() (*string, bool) { if o == nil || isNil(o.MetricName) { - return nil, false + return nil, false } return o.MetricName, true } @@ -357,7 +391,7 @@ func (o *UpdateMetricRulesetResponse) GetRoutingRule() RoutingRule { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetRoutingRuleOk() (*RoutingRule, bool) { if o == nil || isNil(o.RoutingRule) { - return nil, false + return nil, false } return o.RoutingRule, true } @@ -389,7 +423,7 @@ func (o *UpdateMetricRulesetResponse) GetVersion() int64 { // and a boolean to check if the value has been set. func (o *UpdateMetricRulesetResponse) GetVersionOk() (*int64, bool) { if o == nil || isNil(o.Version) { - return nil, false + return nil, false } return o.Version, true } @@ -422,6 +456,9 @@ func (o UpdateMetricRulesetResponse) MarshalJSON() ([]byte, error) { if !isNil(o.Created) { toSerialize["created"] = o.Created } + if !isNil(o.ExceptionRules) { + toSerialize["exceptionRules"] = o.ExceptionRules + } if !isNil(o.Id) { toSerialize["id"] = o.Id } diff --git a/metric_ruleset_test.go b/metric_ruleset_test.go index abaf17c..a1f7bc7 100644 --- a/metric_ruleset_test.go +++ b/metric_ruleset_test.go @@ -9,13 +9,55 @@ import ( "github.com/stretchr/testify/assert" ) +func TestCreateArchivedMetricRuleset(t *testing.T) { + teardown := setup() + defer teardown() + + mux.HandleFunc(MetricRulesetApiURL, verifyRequest(t, http.MethodPost, true, http.StatusOK, nil, "metric_ruleset/create_archived_ruleset_success.json")) + + dest := "Archived" + ruleName := "TestRule" + filterNot := false + filterPropertyValue := "container_id" + result, err := client.CreateMetricRuleset(context.Background(), &metric_ruleset.CreateMetricRulesetRequest{ + MetricName: "container_cpu_utilization", + Version: 1, + ExceptionRules: []metric_ruleset.ExceptionRule{ + { + Name: ruleName, + Enabled: true, + Matcher: metric_ruleset.ExceptionRuleMatcher{ + Type: "dimension", + Filters: []metric_ruleset.PropertyFilter{ + { + NOT: &filterNot, + Property: &filterPropertyValue, + PropertyValue: []string{"cont_a", "cont_b"}, + }, + }, + }, + }, + }, + RoutingRule: metric_ruleset.RoutingRule{ + Destination: (*string)(&dest), + }, + }) + + assert.NoError(t, err, "Unexpected error creating metric ruleset") + assert.Equal(t, "container_cpu_utilization", *result.MetricName, "MetricName does not match") + assert.Equal(t, 1, len(result.ExceptionRules), "Unexpected length of exception rules array") + assert.Equal(t, 1, len(result.ExceptionRules[0].Matcher.Filters), "Unexpected length of exception rule filter array") + assert.Equal(t, 2, len(result.ExceptionRules[0].Matcher.Filters[0].PropertyValue), "Unexpected length of exception rule filter property values array") + assert.Equal(t, dest, *result.RoutingRule.Destination, "RoutingRule destination does not match expected") +} + func TestCreateMetricRuleset(t *testing.T) { teardown := setup() defer teardown() mux.HandleFunc(MetricRulesetApiURL, verifyRequest(t, http.MethodPost, true, http.StatusOK, nil, "metric_ruleset/create_ruleset_success.json")) - dest := metric_ruleset.FULL_FIDELITY + dest := "RealTime" dropDimensions := false ruleName := "TestRule" result, err := client.CreateMetricRuleset(context.Background(), &metric_ruleset.CreateMetricRulesetRequest{ @@ -27,6 +69,7 @@ func TestCreateMetricRuleset(t *testing.T) { Enabled: true, Matcher: metric_ruleset.MetricMatcher{ DimensionMatcher: &metric_ruleset.DimensionMatcher{ + Type: "dimension", Filters: []metric_ruleset.PropertyFilter{}, }, }, @@ -49,6 +92,7 @@ func TestCreateMetricRuleset(t *testing.T) { assert.Equal(t, "container_cpu_utilization", *result.MetricName, "MetricName does not match") assert.Equal(t, 1, len(result.AggregationRules), "Unexpected length of aggregation rules array") assert.Equal(t, "rollup", result.AggregationRules[0].Aggregator.RollupAggregator.Type, "Aggregation Rule type does not match expected") + assert.Equal(t, dest, *result.RoutingRule.Destination, "RoutingRule destination does not match expected") } func TestGetMetricRuleset(t *testing.T) { @@ -69,7 +113,7 @@ func TestUpdateMetricRuleset(t *testing.T) { mux.HandleFunc(MetricRulesetApiURL+"/TestId", verifyRequest(t, http.MethodPut, true, http.StatusOK, nil, "metric_ruleset/update_ruleset_success.json")) metricName := "container_cpu_utilization" - dest := metric_ruleset.DROP + dest := "Drop" version := int64(2) dropDimensions := false ruleName := "UpdatedName" diff --git a/testdata/fixtures/metric_ruleset/create_archived_ruleset_success.json b/testdata/fixtures/metric_ruleset/create_archived_ruleset_success.json new file mode 100644 index 0000000..ea32c56 --- /dev/null +++ b/testdata/fixtures/metric_ruleset/create_archived_ruleset_success.json @@ -0,0 +1,28 @@ +{ + "exceptionRules": [ + { + "enabled": true, + "matcher": { + "filters" : [ { + "NOT" : false, + "property" : "container_id", + "propertyValue" : [ "cont_a", "cont_b" ] + } ], + "type": "dimension" + }, + "name": "TestRule" + } + ], + "created": 1674598662022, + "creator": "TestCreatorId", + "creatorName": "TestName", + "id": "TestId", + "lastUpdated": 1674598662022, + "lastUpdatedBy": "TestUpdatedId", + "lastUpdatedByName": "TestName", + "metricName": "container_cpu_utilization", + "routingRule": { + "destination": "Archived" + }, + "version": 1 +} \ No newline at end of file