mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.3 KiB
Go
345 lines
9.3 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the ExperimentAnalysis type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ExperimentAnalysis{}
|
|
|
|
// ExperimentAnalysis struct for ExperimentAnalysis
|
|
type ExperimentAnalysis struct {
|
|
// the two-tailed threshold significance was judged at
|
|
Alpha *float64 `json:"alpha,omitempty"`
|
|
// the experiment that was analysed
|
|
Experiment *string `json:"experiment,omitempty"`
|
|
// subjects enrolled across every arm
|
|
ExposedTotal *int64 `json:"exposedTotal,omitempty"`
|
|
// the event a conversion is counted from
|
|
Metric *string `json:"metric,omitempty"`
|
|
// one row per declared arm, control first
|
|
Results []ExperimentOutcome `json:"results,omitempty"`
|
|
// ADVISORY: the significant, control-beating arm with the highest rate, else empty
|
|
Winner *string `json:"winner,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ExperimentAnalysis ExperimentAnalysis
|
|
|
|
// NewExperimentAnalysis instantiates a new ExperimentAnalysis 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 NewExperimentAnalysis() *ExperimentAnalysis {
|
|
this := ExperimentAnalysis{}
|
|
return &this
|
|
}
|
|
|
|
// NewExperimentAnalysisWithDefaults instantiates a new ExperimentAnalysis 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 NewExperimentAnalysisWithDefaults() *ExperimentAnalysis {
|
|
this := ExperimentAnalysis{}
|
|
return &this
|
|
}
|
|
|
|
// GetAlpha returns the Alpha field value if set, zero value otherwise.
|
|
func (o *ExperimentAnalysis) GetAlpha() float64 {
|
|
if o == nil || IsNil(o.Alpha) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.Alpha
|
|
}
|
|
|
|
// GetAlphaOk returns a tuple with the Alpha field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ExperimentAnalysis) GetAlphaOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.Alpha) {
|
|
return nil, false
|
|
}
|
|
return o.Alpha, true
|
|
}
|
|
|
|
// HasAlpha returns a boolean if a field has been set.
|
|
func (o *ExperimentAnalysis) HasAlpha() bool {
|
|
if o != nil && !IsNil(o.Alpha) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAlpha gets a reference to the given float64 and assigns it to the Alpha field.
|
|
func (o *ExperimentAnalysis) SetAlpha(v float64) {
|
|
o.Alpha = &v
|
|
}
|
|
|
|
// GetExperiment returns the Experiment field value if set, zero value otherwise.
|
|
func (o *ExperimentAnalysis) GetExperiment() string {
|
|
if o == nil || IsNil(o.Experiment) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Experiment
|
|
}
|
|
|
|
// GetExperimentOk returns a tuple with the Experiment field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ExperimentAnalysis) GetExperimentOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Experiment) {
|
|
return nil, false
|
|
}
|
|
return o.Experiment, true
|
|
}
|
|
|
|
// HasExperiment returns a boolean if a field has been set.
|
|
func (o *ExperimentAnalysis) HasExperiment() bool {
|
|
if o != nil && !IsNil(o.Experiment) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExperiment gets a reference to the given string and assigns it to the Experiment field.
|
|
func (o *ExperimentAnalysis) SetExperiment(v string) {
|
|
o.Experiment = &v
|
|
}
|
|
|
|
// GetExposedTotal returns the ExposedTotal field value if set, zero value otherwise.
|
|
func (o *ExperimentAnalysis) GetExposedTotal() int64 {
|
|
if o == nil || IsNil(o.ExposedTotal) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.ExposedTotal
|
|
}
|
|
|
|
// GetExposedTotalOk returns a tuple with the ExposedTotal field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ExperimentAnalysis) GetExposedTotalOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.ExposedTotal) {
|
|
return nil, false
|
|
}
|
|
return o.ExposedTotal, true
|
|
}
|
|
|
|
// HasExposedTotal returns a boolean if a field has been set.
|
|
func (o *ExperimentAnalysis) HasExposedTotal() bool {
|
|
if o != nil && !IsNil(o.ExposedTotal) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExposedTotal gets a reference to the given int64 and assigns it to the ExposedTotal field.
|
|
func (o *ExperimentAnalysis) SetExposedTotal(v int64) {
|
|
o.ExposedTotal = &v
|
|
}
|
|
|
|
// GetMetric returns the Metric field value if set, zero value otherwise.
|
|
func (o *ExperimentAnalysis) GetMetric() string {
|
|
if o == nil || IsNil(o.Metric) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Metric
|
|
}
|
|
|
|
// GetMetricOk returns a tuple with the Metric field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ExperimentAnalysis) GetMetricOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Metric) {
|
|
return nil, false
|
|
}
|
|
return o.Metric, true
|
|
}
|
|
|
|
// HasMetric returns a boolean if a field has been set.
|
|
func (o *ExperimentAnalysis) HasMetric() bool {
|
|
if o != nil && !IsNil(o.Metric) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMetric gets a reference to the given string and assigns it to the Metric field.
|
|
func (o *ExperimentAnalysis) SetMetric(v string) {
|
|
o.Metric = &v
|
|
}
|
|
|
|
// GetResults returns the Results field value if set, zero value otherwise.
|
|
func (o *ExperimentAnalysis) GetResults() []ExperimentOutcome {
|
|
if o == nil || IsNil(o.Results) {
|
|
var ret []ExperimentOutcome
|
|
return ret
|
|
}
|
|
return o.Results
|
|
}
|
|
|
|
// GetResultsOk returns a tuple with the Results field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ExperimentAnalysis) GetResultsOk() ([]ExperimentOutcome, bool) {
|
|
if o == nil || IsNil(o.Results) {
|
|
return nil, false
|
|
}
|
|
return o.Results, true
|
|
}
|
|
|
|
// HasResults returns a boolean if a field has been set.
|
|
func (o *ExperimentAnalysis) HasResults() bool {
|
|
if o != nil && !IsNil(o.Results) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResults gets a reference to the given []ExperimentOutcome and assigns it to the Results field.
|
|
func (o *ExperimentAnalysis) SetResults(v []ExperimentOutcome) {
|
|
o.Results = v
|
|
}
|
|
|
|
// GetWinner returns the Winner field value if set, zero value otherwise.
|
|
func (o *ExperimentAnalysis) GetWinner() string {
|
|
if o == nil || IsNil(o.Winner) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Winner
|
|
}
|
|
|
|
// GetWinnerOk returns a tuple with the Winner field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ExperimentAnalysis) GetWinnerOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Winner) {
|
|
return nil, false
|
|
}
|
|
return o.Winner, true
|
|
}
|
|
|
|
// HasWinner returns a boolean if a field has been set.
|
|
func (o *ExperimentAnalysis) HasWinner() bool {
|
|
if o != nil && !IsNil(o.Winner) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWinner gets a reference to the given string and assigns it to the Winner field.
|
|
func (o *ExperimentAnalysis) SetWinner(v string) {
|
|
o.Winner = &v
|
|
}
|
|
|
|
func (o ExperimentAnalysis) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ExperimentAnalysis) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Alpha) {
|
|
toSerialize["alpha"] = o.Alpha
|
|
}
|
|
if !IsNil(o.Experiment) {
|
|
toSerialize["experiment"] = o.Experiment
|
|
}
|
|
if !IsNil(o.ExposedTotal) {
|
|
toSerialize["exposedTotal"] = o.ExposedTotal
|
|
}
|
|
if !IsNil(o.Metric) {
|
|
toSerialize["metric"] = o.Metric
|
|
}
|
|
if !IsNil(o.Results) {
|
|
toSerialize["results"] = o.Results
|
|
}
|
|
if !IsNil(o.Winner) {
|
|
toSerialize["winner"] = o.Winner
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ExperimentAnalysis) UnmarshalJSON(data []byte) (err error) {
|
|
varExperimentAnalysis := _ExperimentAnalysis{}
|
|
|
|
err = json.Unmarshal(data, &varExperimentAnalysis)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ExperimentAnalysis(varExperimentAnalysis)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "alpha")
|
|
delete(additionalProperties, "experiment")
|
|
delete(additionalProperties, "exposedTotal")
|
|
delete(additionalProperties, "metric")
|
|
delete(additionalProperties, "results")
|
|
delete(additionalProperties, "winner")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableExperimentAnalysis struct {
|
|
value *ExperimentAnalysis
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableExperimentAnalysis) Get() *ExperimentAnalysis {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableExperimentAnalysis) Set(val *ExperimentAnalysis) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableExperimentAnalysis) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableExperimentAnalysis) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableExperimentAnalysis(val *ExperimentAnalysis) *NullableExperimentAnalysis {
|
|
return &NullableExperimentAnalysis{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableExperimentAnalysis) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableExperimentAnalysis) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|