From f46cdff34a37973fa193a2e02b4b8144359d67fe Mon Sep 17 00:00:00 2001 From: Shamim Mohamed Date: Tue, 5 May 2020 10:29:57 -0700 Subject: [PATCH] Error for exceeding the rate limit (#40) * Add error for rate-based throttling * Generated files * all endpoints should be able return 429 --- .gen/dosa/dosa_canupsertschema.go | 61 ++++++++- .gen/dosa/dosa_checkschema.go | 55 +++++++- .gen/dosa/dosa_checkschemastatus.go | 55 +++++++- .gen/dosa/dosa_createifnotexists.go | 55 +++++++- .gen/dosa/dosa_createscope.go | 55 +++++++- .gen/dosa/dosa_dropscope.go | 55 +++++++- .gen/dosa/dosa_multiread.go | 55 +++++++- .gen/dosa/dosa_multiremove.go | 55 +++++++- .gen/dosa/dosa_multiupsert.go | 55 +++++++- .gen/dosa/dosa_range.go | 55 +++++++- .gen/dosa/dosa_read.go | 55 +++++++- .gen/dosa/dosa_remove.go | 55 +++++++- .gen/dosa/dosa_removerange.go | 55 +++++++- .gen/dosa/dosa_scan.go | 55 +++++++- .gen/dosa/dosa_scopeexists.go | 55 +++++++- .gen/dosa/dosa_search.go | 55 +++++++- .gen/dosa/dosa_truncatescope.go | 55 +++++++- .gen/dosa/dosa_upsert.go | 55 +++++++- .gen/dosa/dosa_upsertschema.go | 55 +++++++- .gen/dosa/idl.go | 4 +- .gen/dosa/types.go | 204 ++++++++++++++++++++++++++++ idl/dosa/dosa.thrift | 25 ++++ 22 files changed, 1244 insertions(+), 40 deletions(-) diff --git a/.gen/dosa/dosa_canupsertschema.go b/.gen/dosa/dosa_canupsertschema.go index 2a2ac66..f848461 100644 --- a/.gen/dosa/dosa_canupsertschema.go +++ b/.gen/dosa/dosa_canupsertschema.go @@ -226,6 +226,8 @@ func init() { return true case *BadSchemaError: return true + case *RateLimitError: + return true default: return false } @@ -252,6 +254,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_CanUpsertSchema_Result.SchemaError") } return &Dosa_CanUpsertSchema_Result{SchemaError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_CanUpsertSchema_Result.LimitError") + } + return &Dosa_CanUpsertSchema_Result{LimitError: e}, nil } return nil, err @@ -269,6 +276,10 @@ func init() { err = result.SchemaError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -292,6 +303,7 @@ type Dosa_CanUpsertSchema_Result struct { ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` SchemaError *BadSchemaError `json:"schemaError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_CanUpsertSchema_Result struct into a Thrift-level intermediate @@ -311,7 +323,7 @@ type Dosa_CanUpsertSchema_Result struct { // } func (v *Dosa_CanUpsertSchema_Result) ToWire() (wire.Value, error) { var ( - fields [4]wire.Field + fields [5]wire.Field i int = 0 w wire.Value err error @@ -349,6 +361,14 @@ func (v *Dosa_CanUpsertSchema_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 3, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 4, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_CanUpsertSchema_Result should have exactly one field: got %v fields", i) @@ -381,6 +401,12 @@ func _BadSchemaError_Read(w wire.Value) (*BadSchemaError, error) { return &v, err } +func _RateLimitError_Read(w wire.Value) (*RateLimitError, error) { + var v RateLimitError + err := v.FromWire(w) + return &v, err +} + // FromWire deserializes a Dosa_CanUpsertSchema_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. @@ -434,6 +460,14 @@ func (v *Dosa_CanUpsertSchema_Result) FromWire(w wire.Value) error { return err } + } + case 4: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -451,6 +485,9 @@ func (v *Dosa_CanUpsertSchema_Result) FromWire(w wire.Value) error { if v.SchemaError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_CanUpsertSchema_Result should have exactly one field: got %v fields", count) } @@ -465,7 +502,7 @@ func (v *Dosa_CanUpsertSchema_Result) String() string { return "" } - var fields [4]string + var fields [5]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -483,6 +520,10 @@ func (v *Dosa_CanUpsertSchema_Result) String() string { fields[i] = fmt.Sprintf("SchemaError: %v", v.SchemaError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_CanUpsertSchema_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -509,6 +550,9 @@ func (v *Dosa_CanUpsertSchema_Result) Equals(rhs *Dosa_CanUpsertSchema_Result) b if !((v.SchemaError == nil && rhs.SchemaError == nil) || (v.SchemaError != nil && rhs.SchemaError != nil && v.SchemaError.Equals(rhs.SchemaError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -528,6 +572,9 @@ func (v *Dosa_CanUpsertSchema_Result) MarshalLogObject(enc zapcore.ObjectEncoder if v.SchemaError != nil { err = multierr.Append(err, enc.AddObject("schemaError", v.SchemaError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -571,6 +618,16 @@ func (v *Dosa_CanUpsertSchema_Result) GetSchemaError() (o *BadSchemaError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_CanUpsertSchema_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_checkschema.go b/.gen/dosa/dosa_checkschema.go index 09d3f35..fb33409 100644 --- a/.gen/dosa/dosa_checkschema.go +++ b/.gen/dosa/dosa_checkschema.go @@ -226,6 +226,8 @@ func init() { return true case *BadSchemaError: return true + case *RateLimitError: + return true default: return false } @@ -252,6 +254,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_CheckSchema_Result.SchemaError") } return &Dosa_CheckSchema_Result{SchemaError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_CheckSchema_Result.LimitError") + } + return &Dosa_CheckSchema_Result{LimitError: e}, nil } return nil, err @@ -269,6 +276,10 @@ func init() { err = result.SchemaError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -292,6 +303,7 @@ type Dosa_CheckSchema_Result struct { ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` SchemaError *BadSchemaError `json:"schemaError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_CheckSchema_Result struct into a Thrift-level intermediate @@ -311,7 +323,7 @@ type Dosa_CheckSchema_Result struct { // } func (v *Dosa_CheckSchema_Result) ToWire() (wire.Value, error) { var ( - fields [4]wire.Field + fields [5]wire.Field i int = 0 w wire.Value err error @@ -349,6 +361,14 @@ func (v *Dosa_CheckSchema_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 3, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 4, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_CheckSchema_Result should have exactly one field: got %v fields", i) @@ -416,6 +436,14 @@ func (v *Dosa_CheckSchema_Result) FromWire(w wire.Value) error { return err } + } + case 4: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -433,6 +461,9 @@ func (v *Dosa_CheckSchema_Result) FromWire(w wire.Value) error { if v.SchemaError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_CheckSchema_Result should have exactly one field: got %v fields", count) } @@ -447,7 +478,7 @@ func (v *Dosa_CheckSchema_Result) String() string { return "" } - var fields [4]string + var fields [5]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -465,6 +496,10 @@ func (v *Dosa_CheckSchema_Result) String() string { fields[i] = fmt.Sprintf("SchemaError: %v", v.SchemaError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_CheckSchema_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -491,6 +526,9 @@ func (v *Dosa_CheckSchema_Result) Equals(rhs *Dosa_CheckSchema_Result) bool { if !((v.SchemaError == nil && rhs.SchemaError == nil) || (v.SchemaError != nil && rhs.SchemaError != nil && v.SchemaError.Equals(rhs.SchemaError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -510,6 +548,9 @@ func (v *Dosa_CheckSchema_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (e if v.SchemaError != nil { err = multierr.Append(err, enc.AddObject("schemaError", v.SchemaError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -553,6 +594,16 @@ func (v *Dosa_CheckSchema_Result) GetSchemaError() (o *BadSchemaError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_CheckSchema_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_checkschemastatus.go b/.gen/dosa/dosa_checkschemastatus.go index 5deda3a..8029427 100644 --- a/.gen/dosa/dosa_checkschemastatus.go +++ b/.gen/dosa/dosa_checkschemastatus.go @@ -224,6 +224,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -245,6 +247,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_CheckSchemaStatus_Result.ServerError") } return &Dosa_CheckSchemaStatus_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_CheckSchemaStatus_Result.LimitError") + } + return &Dosa_CheckSchemaStatus_Result{LimitError: e}, nil } return nil, err @@ -258,6 +265,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -280,6 +291,7 @@ type Dosa_CheckSchemaStatus_Result struct { Success *CheckSchemaStatusResponse `json:"success,omitempty"` ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_CheckSchemaStatus_Result struct into a Thrift-level intermediate @@ -299,7 +311,7 @@ type Dosa_CheckSchemaStatus_Result struct { // } func (v *Dosa_CheckSchemaStatus_Result) ToWire() (wire.Value, error) { var ( - fields [3]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error @@ -329,6 +341,14 @@ func (v *Dosa_CheckSchemaStatus_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_CheckSchemaStatus_Result should have exactly one field: got %v fields", i) @@ -388,6 +408,14 @@ func (v *Dosa_CheckSchemaStatus_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -402,6 +430,9 @@ func (v *Dosa_CheckSchemaStatus_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_CheckSchemaStatus_Result should have exactly one field: got %v fields", count) } @@ -416,7 +447,7 @@ func (v *Dosa_CheckSchemaStatus_Result) String() string { return "" } - var fields [3]string + var fields [4]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -430,6 +461,10 @@ func (v *Dosa_CheckSchemaStatus_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_CheckSchemaStatus_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -453,6 +488,9 @@ func (v *Dosa_CheckSchemaStatus_Result) Equals(rhs *Dosa_CheckSchemaStatus_Resul if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -469,6 +507,9 @@ func (v *Dosa_CheckSchemaStatus_Result) MarshalLogObject(enc zapcore.ObjectEncod if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -502,6 +543,16 @@ func (v *Dosa_CheckSchemaStatus_Result) GetServerError() (o *InternalServerError return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_CheckSchemaStatus_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_createifnotexists.go b/.gen/dosa/dosa_createifnotexists.go index 3f26518..eb849e2 100644 --- a/.gen/dosa/dosa_createifnotexists.go +++ b/.gen/dosa/dosa_createifnotexists.go @@ -225,6 +225,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -246,6 +248,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_CreateIfNotExists_Result.ServerError") } return &Dosa_CreateIfNotExists_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_CreateIfNotExists_Result.LimitError") + } + return &Dosa_CreateIfNotExists_Result{LimitError: e}, nil } return nil, err @@ -259,6 +266,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } return } @@ -270,6 +281,7 @@ func init() { type Dosa_CreateIfNotExists_Result struct { ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_CreateIfNotExists_Result struct into a Thrift-level intermediate @@ -289,7 +301,7 @@ type Dosa_CreateIfNotExists_Result struct { // } func (v *Dosa_CreateIfNotExists_Result) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [3]wire.Field i int = 0 w wire.Value err error @@ -311,6 +323,14 @@ func (v *Dosa_CreateIfNotExists_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i > 1 { return wire.Value{}, fmt.Errorf("Dosa_CreateIfNotExists_Result should have at most one field: got %v fields", i) @@ -356,6 +376,14 @@ func (v *Dosa_CreateIfNotExists_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -367,6 +395,9 @@ func (v *Dosa_CreateIfNotExists_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count > 1 { return fmt.Errorf("Dosa_CreateIfNotExists_Result should have at most one field: got %v fields", count) } @@ -381,7 +412,7 @@ func (v *Dosa_CreateIfNotExists_Result) String() string { return "" } - var fields [2]string + var fields [3]string i := 0 if v.ClientError != nil { fields[i] = fmt.Sprintf("ClientError: %v", v.ClientError) @@ -391,6 +422,10 @@ func (v *Dosa_CreateIfNotExists_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_CreateIfNotExists_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -411,6 +446,9 @@ func (v *Dosa_CreateIfNotExists_Result) Equals(rhs *Dosa_CreateIfNotExists_Resul if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -424,6 +462,9 @@ func (v *Dosa_CreateIfNotExists_Result) MarshalLogObject(enc zapcore.ObjectEncod if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -447,6 +488,16 @@ func (v *Dosa_CreateIfNotExists_Result) GetServerError() (o *InternalServerError return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_CreateIfNotExists_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_createscope.go b/.gen/dosa/dosa_createscope.go index 2a6ecc7..83a5cc1 100644 --- a/.gen/dosa/dosa_createscope.go +++ b/.gen/dosa/dosa_createscope.go @@ -225,6 +225,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -246,6 +248,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_CreateScope_Result.ServerError") } return &Dosa_CreateScope_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_CreateScope_Result.LimitError") + } + return &Dosa_CreateScope_Result{LimitError: e}, nil } return nil, err @@ -259,6 +266,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } return } @@ -270,6 +281,7 @@ func init() { type Dosa_CreateScope_Result struct { ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_CreateScope_Result struct into a Thrift-level intermediate @@ -289,7 +301,7 @@ type Dosa_CreateScope_Result struct { // } func (v *Dosa_CreateScope_Result) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [3]wire.Field i int = 0 w wire.Value err error @@ -311,6 +323,14 @@ func (v *Dosa_CreateScope_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i > 1 { return wire.Value{}, fmt.Errorf("Dosa_CreateScope_Result should have at most one field: got %v fields", i) @@ -356,6 +376,14 @@ func (v *Dosa_CreateScope_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -367,6 +395,9 @@ func (v *Dosa_CreateScope_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count > 1 { return fmt.Errorf("Dosa_CreateScope_Result should have at most one field: got %v fields", count) } @@ -381,7 +412,7 @@ func (v *Dosa_CreateScope_Result) String() string { return "" } - var fields [2]string + var fields [3]string i := 0 if v.ClientError != nil { fields[i] = fmt.Sprintf("ClientError: %v", v.ClientError) @@ -391,6 +422,10 @@ func (v *Dosa_CreateScope_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_CreateScope_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -411,6 +446,9 @@ func (v *Dosa_CreateScope_Result) Equals(rhs *Dosa_CreateScope_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -424,6 +462,9 @@ func (v *Dosa_CreateScope_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (e if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -447,6 +488,16 @@ func (v *Dosa_CreateScope_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_CreateScope_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_dropscope.go b/.gen/dosa/dosa_dropscope.go index 8129cb4..122815c 100644 --- a/.gen/dosa/dosa_dropscope.go +++ b/.gen/dosa/dosa_dropscope.go @@ -225,6 +225,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -246,6 +248,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_DropScope_Result.ServerError") } return &Dosa_DropScope_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_DropScope_Result.LimitError") + } + return &Dosa_DropScope_Result{LimitError: e}, nil } return nil, err @@ -259,6 +266,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } return } @@ -270,6 +281,7 @@ func init() { type Dosa_DropScope_Result struct { ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_DropScope_Result struct into a Thrift-level intermediate @@ -289,7 +301,7 @@ type Dosa_DropScope_Result struct { // } func (v *Dosa_DropScope_Result) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [3]wire.Field i int = 0 w wire.Value err error @@ -311,6 +323,14 @@ func (v *Dosa_DropScope_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i > 1 { return wire.Value{}, fmt.Errorf("Dosa_DropScope_Result should have at most one field: got %v fields", i) @@ -356,6 +376,14 @@ func (v *Dosa_DropScope_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -367,6 +395,9 @@ func (v *Dosa_DropScope_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count > 1 { return fmt.Errorf("Dosa_DropScope_Result should have at most one field: got %v fields", count) } @@ -381,7 +412,7 @@ func (v *Dosa_DropScope_Result) String() string { return "" } - var fields [2]string + var fields [3]string i := 0 if v.ClientError != nil { fields[i] = fmt.Sprintf("ClientError: %v", v.ClientError) @@ -391,6 +422,10 @@ func (v *Dosa_DropScope_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_DropScope_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -411,6 +446,9 @@ func (v *Dosa_DropScope_Result) Equals(rhs *Dosa_DropScope_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -424,6 +462,9 @@ func (v *Dosa_DropScope_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -447,6 +488,16 @@ func (v *Dosa_DropScope_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_DropScope_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_multiread.go b/.gen/dosa/dosa_multiread.go index b06b2c8..a18a7fb 100644 --- a/.gen/dosa/dosa_multiread.go +++ b/.gen/dosa/dosa_multiread.go @@ -224,6 +224,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -245,6 +247,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_MultiRead_Result.ServerError") } return &Dosa_MultiRead_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_MultiRead_Result.LimitError") + } + return &Dosa_MultiRead_Result{LimitError: e}, nil } return nil, err @@ -258,6 +265,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -280,6 +291,7 @@ type Dosa_MultiRead_Result struct { Success *MultiReadResponse `json:"success,omitempty"` ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_MultiRead_Result struct into a Thrift-level intermediate @@ -299,7 +311,7 @@ type Dosa_MultiRead_Result struct { // } func (v *Dosa_MultiRead_Result) ToWire() (wire.Value, error) { var ( - fields [3]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error @@ -329,6 +341,14 @@ func (v *Dosa_MultiRead_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_MultiRead_Result should have exactly one field: got %v fields", i) @@ -388,6 +408,14 @@ func (v *Dosa_MultiRead_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -402,6 +430,9 @@ func (v *Dosa_MultiRead_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_MultiRead_Result should have exactly one field: got %v fields", count) } @@ -416,7 +447,7 @@ func (v *Dosa_MultiRead_Result) String() string { return "" } - var fields [3]string + var fields [4]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -430,6 +461,10 @@ func (v *Dosa_MultiRead_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_MultiRead_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -453,6 +488,9 @@ func (v *Dosa_MultiRead_Result) Equals(rhs *Dosa_MultiRead_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -469,6 +507,9 @@ func (v *Dosa_MultiRead_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -502,6 +543,16 @@ func (v *Dosa_MultiRead_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_MultiRead_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_multiremove.go b/.gen/dosa/dosa_multiremove.go index 246d064..5246101 100644 --- a/.gen/dosa/dosa_multiremove.go +++ b/.gen/dosa/dosa_multiremove.go @@ -224,6 +224,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -245,6 +247,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_MultiRemove_Result.ServerError") } return &Dosa_MultiRemove_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_MultiRemove_Result.LimitError") + } + return &Dosa_MultiRemove_Result{LimitError: e}, nil } return nil, err @@ -258,6 +265,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -280,6 +291,7 @@ type Dosa_MultiRemove_Result struct { Success *MultiRemoveResponse `json:"success,omitempty"` ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_MultiRemove_Result struct into a Thrift-level intermediate @@ -299,7 +311,7 @@ type Dosa_MultiRemove_Result struct { // } func (v *Dosa_MultiRemove_Result) ToWire() (wire.Value, error) { var ( - fields [3]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error @@ -329,6 +341,14 @@ func (v *Dosa_MultiRemove_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_MultiRemove_Result should have exactly one field: got %v fields", i) @@ -388,6 +408,14 @@ func (v *Dosa_MultiRemove_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -402,6 +430,9 @@ func (v *Dosa_MultiRemove_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_MultiRemove_Result should have exactly one field: got %v fields", count) } @@ -416,7 +447,7 @@ func (v *Dosa_MultiRemove_Result) String() string { return "" } - var fields [3]string + var fields [4]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -430,6 +461,10 @@ func (v *Dosa_MultiRemove_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_MultiRemove_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -453,6 +488,9 @@ func (v *Dosa_MultiRemove_Result) Equals(rhs *Dosa_MultiRemove_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -469,6 +507,9 @@ func (v *Dosa_MultiRemove_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (e if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -502,6 +543,16 @@ func (v *Dosa_MultiRemove_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_MultiRemove_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_multiupsert.go b/.gen/dosa/dosa_multiupsert.go index b7c0cee..ce5c954 100644 --- a/.gen/dosa/dosa_multiupsert.go +++ b/.gen/dosa/dosa_multiupsert.go @@ -224,6 +224,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -245,6 +247,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_MultiUpsert_Result.ServerError") } return &Dosa_MultiUpsert_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_MultiUpsert_Result.LimitError") + } + return &Dosa_MultiUpsert_Result{LimitError: e}, nil } return nil, err @@ -258,6 +265,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -280,6 +291,7 @@ type Dosa_MultiUpsert_Result struct { Success *MultiUpsertResponse `json:"success,omitempty"` ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_MultiUpsert_Result struct into a Thrift-level intermediate @@ -299,7 +311,7 @@ type Dosa_MultiUpsert_Result struct { // } func (v *Dosa_MultiUpsert_Result) ToWire() (wire.Value, error) { var ( - fields [3]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error @@ -329,6 +341,14 @@ func (v *Dosa_MultiUpsert_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_MultiUpsert_Result should have exactly one field: got %v fields", i) @@ -388,6 +408,14 @@ func (v *Dosa_MultiUpsert_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -402,6 +430,9 @@ func (v *Dosa_MultiUpsert_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_MultiUpsert_Result should have exactly one field: got %v fields", count) } @@ -416,7 +447,7 @@ func (v *Dosa_MultiUpsert_Result) String() string { return "" } - var fields [3]string + var fields [4]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -430,6 +461,10 @@ func (v *Dosa_MultiUpsert_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_MultiUpsert_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -453,6 +488,9 @@ func (v *Dosa_MultiUpsert_Result) Equals(rhs *Dosa_MultiUpsert_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -469,6 +507,9 @@ func (v *Dosa_MultiUpsert_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (e if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -502,6 +543,16 @@ func (v *Dosa_MultiUpsert_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_MultiUpsert_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_range.go b/.gen/dosa/dosa_range.go index 9e9ec01..f48dc22 100644 --- a/.gen/dosa/dosa_range.go +++ b/.gen/dosa/dosa_range.go @@ -224,6 +224,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -245,6 +247,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Range_Result.ServerError") } return &Dosa_Range_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Range_Result.LimitError") + } + return &Dosa_Range_Result{LimitError: e}, nil } return nil, err @@ -258,6 +265,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -280,6 +291,7 @@ type Dosa_Range_Result struct { Success *RangeResponse `json:"success,omitempty"` ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_Range_Result struct into a Thrift-level intermediate @@ -299,7 +311,7 @@ type Dosa_Range_Result struct { // } func (v *Dosa_Range_Result) ToWire() (wire.Value, error) { var ( - fields [3]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error @@ -329,6 +341,14 @@ func (v *Dosa_Range_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_Range_Result should have exactly one field: got %v fields", i) @@ -388,6 +408,14 @@ func (v *Dosa_Range_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -402,6 +430,9 @@ func (v *Dosa_Range_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_Range_Result should have exactly one field: got %v fields", count) } @@ -416,7 +447,7 @@ func (v *Dosa_Range_Result) String() string { return "" } - var fields [3]string + var fields [4]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -430,6 +461,10 @@ func (v *Dosa_Range_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_Range_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -453,6 +488,9 @@ func (v *Dosa_Range_Result) Equals(rhs *Dosa_Range_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -469,6 +507,9 @@ func (v *Dosa_Range_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err err if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -502,6 +543,16 @@ func (v *Dosa_Range_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_Range_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_read.go b/.gen/dosa/dosa_read.go index a55cc43..7d37b82 100644 --- a/.gen/dosa/dosa_read.go +++ b/.gen/dosa/dosa_read.go @@ -224,6 +224,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -245,6 +247,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Read_Result.ServerError") } return &Dosa_Read_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Read_Result.LimitError") + } + return &Dosa_Read_Result{LimitError: e}, nil } return nil, err @@ -258,6 +265,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -280,6 +291,7 @@ type Dosa_Read_Result struct { Success *ReadResponse `json:"success,omitempty"` ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_Read_Result struct into a Thrift-level intermediate @@ -299,7 +311,7 @@ type Dosa_Read_Result struct { // } func (v *Dosa_Read_Result) ToWire() (wire.Value, error) { var ( - fields [3]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error @@ -329,6 +341,14 @@ func (v *Dosa_Read_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_Read_Result should have exactly one field: got %v fields", i) @@ -388,6 +408,14 @@ func (v *Dosa_Read_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -402,6 +430,9 @@ func (v *Dosa_Read_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_Read_Result should have exactly one field: got %v fields", count) } @@ -416,7 +447,7 @@ func (v *Dosa_Read_Result) String() string { return "" } - var fields [3]string + var fields [4]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -430,6 +461,10 @@ func (v *Dosa_Read_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_Read_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -453,6 +488,9 @@ func (v *Dosa_Read_Result) Equals(rhs *Dosa_Read_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -469,6 +507,9 @@ func (v *Dosa_Read_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err erro if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -502,6 +543,16 @@ func (v *Dosa_Read_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_Read_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_remove.go b/.gen/dosa/dosa_remove.go index 3fb5727..ba439aa 100644 --- a/.gen/dosa/dosa_remove.go +++ b/.gen/dosa/dosa_remove.go @@ -225,6 +225,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -246,6 +248,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Remove_Result.ServerError") } return &Dosa_Remove_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Remove_Result.LimitError") + } + return &Dosa_Remove_Result{LimitError: e}, nil } return nil, err @@ -259,6 +266,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } return } @@ -270,6 +281,7 @@ func init() { type Dosa_Remove_Result struct { ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_Remove_Result struct into a Thrift-level intermediate @@ -289,7 +301,7 @@ type Dosa_Remove_Result struct { // } func (v *Dosa_Remove_Result) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [3]wire.Field i int = 0 w wire.Value err error @@ -311,6 +323,14 @@ func (v *Dosa_Remove_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i > 1 { return wire.Value{}, fmt.Errorf("Dosa_Remove_Result should have at most one field: got %v fields", i) @@ -356,6 +376,14 @@ func (v *Dosa_Remove_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -367,6 +395,9 @@ func (v *Dosa_Remove_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count > 1 { return fmt.Errorf("Dosa_Remove_Result should have at most one field: got %v fields", count) } @@ -381,7 +412,7 @@ func (v *Dosa_Remove_Result) String() string { return "" } - var fields [2]string + var fields [3]string i := 0 if v.ClientError != nil { fields[i] = fmt.Sprintf("ClientError: %v", v.ClientError) @@ -391,6 +422,10 @@ func (v *Dosa_Remove_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_Remove_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -411,6 +446,9 @@ func (v *Dosa_Remove_Result) Equals(rhs *Dosa_Remove_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -424,6 +462,9 @@ func (v *Dosa_Remove_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err er if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -447,6 +488,16 @@ func (v *Dosa_Remove_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_Remove_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_removerange.go b/.gen/dosa/dosa_removerange.go index 2e8a383..daa5d2d 100644 --- a/.gen/dosa/dosa_removerange.go +++ b/.gen/dosa/dosa_removerange.go @@ -225,6 +225,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -246,6 +248,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_RemoveRange_Result.ServerError") } return &Dosa_RemoveRange_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_RemoveRange_Result.LimitError") + } + return &Dosa_RemoveRange_Result{LimitError: e}, nil } return nil, err @@ -259,6 +266,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } return } @@ -270,6 +281,7 @@ func init() { type Dosa_RemoveRange_Result struct { ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_RemoveRange_Result struct into a Thrift-level intermediate @@ -289,7 +301,7 @@ type Dosa_RemoveRange_Result struct { // } func (v *Dosa_RemoveRange_Result) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [3]wire.Field i int = 0 w wire.Value err error @@ -311,6 +323,14 @@ func (v *Dosa_RemoveRange_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i > 1 { return wire.Value{}, fmt.Errorf("Dosa_RemoveRange_Result should have at most one field: got %v fields", i) @@ -356,6 +376,14 @@ func (v *Dosa_RemoveRange_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -367,6 +395,9 @@ func (v *Dosa_RemoveRange_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count > 1 { return fmt.Errorf("Dosa_RemoveRange_Result should have at most one field: got %v fields", count) } @@ -381,7 +412,7 @@ func (v *Dosa_RemoveRange_Result) String() string { return "" } - var fields [2]string + var fields [3]string i := 0 if v.ClientError != nil { fields[i] = fmt.Sprintf("ClientError: %v", v.ClientError) @@ -391,6 +422,10 @@ func (v *Dosa_RemoveRange_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_RemoveRange_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -411,6 +446,9 @@ func (v *Dosa_RemoveRange_Result) Equals(rhs *Dosa_RemoveRange_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -424,6 +462,9 @@ func (v *Dosa_RemoveRange_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (e if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -447,6 +488,16 @@ func (v *Dosa_RemoveRange_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_RemoveRange_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_scan.go b/.gen/dosa/dosa_scan.go index 232db3b..55d4ca0 100644 --- a/.gen/dosa/dosa_scan.go +++ b/.gen/dosa/dosa_scan.go @@ -224,6 +224,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -245,6 +247,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Scan_Result.ServerError") } return &Dosa_Scan_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Scan_Result.LimitError") + } + return &Dosa_Scan_Result{LimitError: e}, nil } return nil, err @@ -258,6 +265,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -280,6 +291,7 @@ type Dosa_Scan_Result struct { Success *ScanResponse `json:"success,omitempty"` ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_Scan_Result struct into a Thrift-level intermediate @@ -299,7 +311,7 @@ type Dosa_Scan_Result struct { // } func (v *Dosa_Scan_Result) ToWire() (wire.Value, error) { var ( - fields [3]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error @@ -329,6 +341,14 @@ func (v *Dosa_Scan_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_Scan_Result should have exactly one field: got %v fields", i) @@ -388,6 +408,14 @@ func (v *Dosa_Scan_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -402,6 +430,9 @@ func (v *Dosa_Scan_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_Scan_Result should have exactly one field: got %v fields", count) } @@ -416,7 +447,7 @@ func (v *Dosa_Scan_Result) String() string { return "" } - var fields [3]string + var fields [4]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -430,6 +461,10 @@ func (v *Dosa_Scan_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_Scan_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -453,6 +488,9 @@ func (v *Dosa_Scan_Result) Equals(rhs *Dosa_Scan_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -469,6 +507,9 @@ func (v *Dosa_Scan_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err erro if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -502,6 +543,16 @@ func (v *Dosa_Scan_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_Scan_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_scopeexists.go b/.gen/dosa/dosa_scopeexists.go index 4f08f6b..be9fdd3 100644 --- a/.gen/dosa/dosa_scopeexists.go +++ b/.gen/dosa/dosa_scopeexists.go @@ -224,6 +224,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -245,6 +247,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_ScopeExists_Result.ServerError") } return &Dosa_ScopeExists_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_ScopeExists_Result.LimitError") + } + return &Dosa_ScopeExists_Result{LimitError: e}, nil } return nil, err @@ -258,6 +265,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -280,6 +291,7 @@ type Dosa_ScopeExists_Result struct { Success *ScopeExistsResponse `json:"success,omitempty"` ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_ScopeExists_Result struct into a Thrift-level intermediate @@ -299,7 +311,7 @@ type Dosa_ScopeExists_Result struct { // } func (v *Dosa_ScopeExists_Result) ToWire() (wire.Value, error) { var ( - fields [3]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error @@ -329,6 +341,14 @@ func (v *Dosa_ScopeExists_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_ScopeExists_Result should have exactly one field: got %v fields", i) @@ -388,6 +408,14 @@ func (v *Dosa_ScopeExists_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -402,6 +430,9 @@ func (v *Dosa_ScopeExists_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_ScopeExists_Result should have exactly one field: got %v fields", count) } @@ -416,7 +447,7 @@ func (v *Dosa_ScopeExists_Result) String() string { return "" } - var fields [3]string + var fields [4]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -430,6 +461,10 @@ func (v *Dosa_ScopeExists_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_ScopeExists_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -453,6 +488,9 @@ func (v *Dosa_ScopeExists_Result) Equals(rhs *Dosa_ScopeExists_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -469,6 +507,9 @@ func (v *Dosa_ScopeExists_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (e if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -502,6 +543,16 @@ func (v *Dosa_ScopeExists_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_ScopeExists_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_search.go b/.gen/dosa/dosa_search.go index 21cc086..38af251 100644 --- a/.gen/dosa/dosa_search.go +++ b/.gen/dosa/dosa_search.go @@ -224,6 +224,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -245,6 +247,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Search_Result.ServerError") } return &Dosa_Search_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Search_Result.LimitError") + } + return &Dosa_Search_Result{LimitError: e}, nil } return nil, err @@ -258,6 +265,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -280,6 +291,7 @@ type Dosa_Search_Result struct { Success *SearchResponse `json:"success,omitempty"` ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_Search_Result struct into a Thrift-level intermediate @@ -299,7 +311,7 @@ type Dosa_Search_Result struct { // } func (v *Dosa_Search_Result) ToWire() (wire.Value, error) { var ( - fields [3]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error @@ -329,6 +341,14 @@ func (v *Dosa_Search_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_Search_Result should have exactly one field: got %v fields", i) @@ -388,6 +408,14 @@ func (v *Dosa_Search_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -402,6 +430,9 @@ func (v *Dosa_Search_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_Search_Result should have exactly one field: got %v fields", count) } @@ -416,7 +447,7 @@ func (v *Dosa_Search_Result) String() string { return "" } - var fields [3]string + var fields [4]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -430,6 +461,10 @@ func (v *Dosa_Search_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_Search_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -453,6 +488,9 @@ func (v *Dosa_Search_Result) Equals(rhs *Dosa_Search_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -469,6 +507,9 @@ func (v *Dosa_Search_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err er if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -502,6 +543,16 @@ func (v *Dosa_Search_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_Search_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_truncatescope.go b/.gen/dosa/dosa_truncatescope.go index 8c673b3..5288374 100644 --- a/.gen/dosa/dosa_truncatescope.go +++ b/.gen/dosa/dosa_truncatescope.go @@ -225,6 +225,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -246,6 +248,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_TruncateScope_Result.ServerError") } return &Dosa_TruncateScope_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_TruncateScope_Result.LimitError") + } + return &Dosa_TruncateScope_Result{LimitError: e}, nil } return nil, err @@ -259,6 +266,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } return } @@ -270,6 +281,7 @@ func init() { type Dosa_TruncateScope_Result struct { ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_TruncateScope_Result struct into a Thrift-level intermediate @@ -289,7 +301,7 @@ type Dosa_TruncateScope_Result struct { // } func (v *Dosa_TruncateScope_Result) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [3]wire.Field i int = 0 w wire.Value err error @@ -311,6 +323,14 @@ func (v *Dosa_TruncateScope_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i > 1 { return wire.Value{}, fmt.Errorf("Dosa_TruncateScope_Result should have at most one field: got %v fields", i) @@ -356,6 +376,14 @@ func (v *Dosa_TruncateScope_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -367,6 +395,9 @@ func (v *Dosa_TruncateScope_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count > 1 { return fmt.Errorf("Dosa_TruncateScope_Result should have at most one field: got %v fields", count) } @@ -381,7 +412,7 @@ func (v *Dosa_TruncateScope_Result) String() string { return "" } - var fields [2]string + var fields [3]string i := 0 if v.ClientError != nil { fields[i] = fmt.Sprintf("ClientError: %v", v.ClientError) @@ -391,6 +422,10 @@ func (v *Dosa_TruncateScope_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_TruncateScope_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -411,6 +446,9 @@ func (v *Dosa_TruncateScope_Result) Equals(rhs *Dosa_TruncateScope_Result) bool if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -424,6 +462,9 @@ func (v *Dosa_TruncateScope_Result) MarshalLogObject(enc zapcore.ObjectEncoder) if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -447,6 +488,16 @@ func (v *Dosa_TruncateScope_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_TruncateScope_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_upsert.go b/.gen/dosa/dosa_upsert.go index fcc5c44..8825ed3 100644 --- a/.gen/dosa/dosa_upsert.go +++ b/.gen/dosa/dosa_upsert.go @@ -225,6 +225,8 @@ func init() { return true case *InternalServerError: return true + case *RateLimitError: + return true default: return false } @@ -246,6 +248,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Upsert_Result.ServerError") } return &Dosa_Upsert_Result{ServerError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_Upsert_Result.LimitError") + } + return &Dosa_Upsert_Result{LimitError: e}, nil } return nil, err @@ -259,6 +266,10 @@ func init() { err = result.ServerError return } + if result.LimitError != nil { + err = result.LimitError + return + } return } @@ -270,6 +281,7 @@ func init() { type Dosa_Upsert_Result struct { ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_Upsert_Result struct into a Thrift-level intermediate @@ -289,7 +301,7 @@ type Dosa_Upsert_Result struct { // } func (v *Dosa_Upsert_Result) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [3]wire.Field i int = 0 w wire.Value err error @@ -311,6 +323,14 @@ func (v *Dosa_Upsert_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } if i > 1 { return wire.Value{}, fmt.Errorf("Dosa_Upsert_Result should have at most one field: got %v fields", i) @@ -356,6 +376,14 @@ func (v *Dosa_Upsert_Result) FromWire(w wire.Value) error { return err } + } + case 3: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -367,6 +395,9 @@ func (v *Dosa_Upsert_Result) FromWire(w wire.Value) error { if v.ServerError != nil { count++ } + if v.LimitError != nil { + count++ + } if count > 1 { return fmt.Errorf("Dosa_Upsert_Result should have at most one field: got %v fields", count) } @@ -381,7 +412,7 @@ func (v *Dosa_Upsert_Result) String() string { return "" } - var fields [2]string + var fields [3]string i := 0 if v.ClientError != nil { fields[i] = fmt.Sprintf("ClientError: %v", v.ClientError) @@ -391,6 +422,10 @@ func (v *Dosa_Upsert_Result) String() string { fields[i] = fmt.Sprintf("ServerError: %v", v.ServerError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_Upsert_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -411,6 +446,9 @@ func (v *Dosa_Upsert_Result) Equals(rhs *Dosa_Upsert_Result) bool { if !((v.ServerError == nil && rhs.ServerError == nil) || (v.ServerError != nil && rhs.ServerError != nil && v.ServerError.Equals(rhs.ServerError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -424,6 +462,9 @@ func (v *Dosa_Upsert_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err er if v.ServerError != nil { err = multierr.Append(err, enc.AddObject("serverError", v.ServerError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -447,6 +488,16 @@ func (v *Dosa_Upsert_Result) GetServerError() (o *InternalServerError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_Upsert_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/dosa_upsertschema.go b/.gen/dosa/dosa_upsertschema.go index cdd10cf..6be8c2f 100644 --- a/.gen/dosa/dosa_upsertschema.go +++ b/.gen/dosa/dosa_upsertschema.go @@ -226,6 +226,8 @@ func init() { return true case *BadSchemaError: return true + case *RateLimitError: + return true default: return false } @@ -252,6 +254,11 @@ func init() { return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_UpsertSchema_Result.SchemaError") } return &Dosa_UpsertSchema_Result{SchemaError: e}, nil + case *RateLimitError: + if e == nil { + return nil, errors.New("WrapResponse received non-nil error type with nil value for Dosa_UpsertSchema_Result.LimitError") + } + return &Dosa_UpsertSchema_Result{LimitError: e}, nil } return nil, err @@ -269,6 +276,10 @@ func init() { err = result.SchemaError return } + if result.LimitError != nil { + err = result.LimitError + return + } if result.Success != nil { success = result.Success @@ -292,6 +303,7 @@ type Dosa_UpsertSchema_Result struct { ClientError *BadRequestError `json:"clientError,omitempty"` ServerError *InternalServerError `json:"serverError,omitempty"` SchemaError *BadSchemaError `json:"schemaError,omitempty"` + LimitError *RateLimitError `json:"limitError,omitempty"` } // ToWire translates a Dosa_UpsertSchema_Result struct into a Thrift-level intermediate @@ -311,7 +323,7 @@ type Dosa_UpsertSchema_Result struct { // } func (v *Dosa_UpsertSchema_Result) ToWire() (wire.Value, error) { var ( - fields [4]wire.Field + fields [5]wire.Field i int = 0 w wire.Value err error @@ -349,6 +361,14 @@ func (v *Dosa_UpsertSchema_Result) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 3, Value: w} i++ } + if v.LimitError != nil { + w, err = v.LimitError.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 4, Value: w} + i++ + } if i != 1 { return wire.Value{}, fmt.Errorf("Dosa_UpsertSchema_Result should have exactly one field: got %v fields", i) @@ -416,6 +436,14 @@ func (v *Dosa_UpsertSchema_Result) FromWire(w wire.Value) error { return err } + } + case 4: + if field.Value.Type() == wire.TStruct { + v.LimitError, err = _RateLimitError_Read(field.Value) + if err != nil { + return err + } + } } } @@ -433,6 +461,9 @@ func (v *Dosa_UpsertSchema_Result) FromWire(w wire.Value) error { if v.SchemaError != nil { count++ } + if v.LimitError != nil { + count++ + } if count != 1 { return fmt.Errorf("Dosa_UpsertSchema_Result should have exactly one field: got %v fields", count) } @@ -447,7 +478,7 @@ func (v *Dosa_UpsertSchema_Result) String() string { return "" } - var fields [4]string + var fields [5]string i := 0 if v.Success != nil { fields[i] = fmt.Sprintf("Success: %v", v.Success) @@ -465,6 +496,10 @@ func (v *Dosa_UpsertSchema_Result) String() string { fields[i] = fmt.Sprintf("SchemaError: %v", v.SchemaError) i++ } + if v.LimitError != nil { + fields[i] = fmt.Sprintf("LimitError: %v", v.LimitError) + i++ + } return fmt.Sprintf("Dosa_UpsertSchema_Result{%v}", strings.Join(fields[:i], ", ")) } @@ -491,6 +526,9 @@ func (v *Dosa_UpsertSchema_Result) Equals(rhs *Dosa_UpsertSchema_Result) bool { if !((v.SchemaError == nil && rhs.SchemaError == nil) || (v.SchemaError != nil && rhs.SchemaError != nil && v.SchemaError.Equals(rhs.SchemaError))) { return false } + if !((v.LimitError == nil && rhs.LimitError == nil) || (v.LimitError != nil && rhs.LimitError != nil && v.LimitError.Equals(rhs.LimitError))) { + return false + } return true } @@ -510,6 +548,9 @@ func (v *Dosa_UpsertSchema_Result) MarshalLogObject(enc zapcore.ObjectEncoder) ( if v.SchemaError != nil { err = multierr.Append(err, enc.AddObject("schemaError", v.SchemaError)) } + if v.LimitError != nil { + err = multierr.Append(err, enc.AddObject("limitError", v.LimitError)) + } return err } @@ -553,6 +594,16 @@ func (v *Dosa_UpsertSchema_Result) GetSchemaError() (o *BadSchemaError) { return } +// GetLimitError returns the value of LimitError if it is set or its +// zero value if it is unset. +func (v *Dosa_UpsertSchema_Result) GetLimitError() (o *RateLimitError) { + if v.LimitError != nil { + return v.LimitError + } + + return +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // diff --git a/.gen/dosa/idl.go b/.gen/dosa/idl.go index bf8a01b..d4e943f 100644 --- a/.gen/dosa/idl.go +++ b/.gen/dosa/idl.go @@ -10,8 +10,8 @@ var ThriftModule = &thriftreflect.ThriftModule{ Name: "dosa", Package: "github.com/uber/dosa-idl/.gen/dosa", FilePath: "dosa.thrift", - SHA1: "dc7d33e5b0c595ab43602080b8179887ff27bfbd", + SHA1: "03d9ec431fa9b8949303908f7211be063b82bacc", Raw: rawIDL, } -const rawIDL = "// Copyright (c) 2019 Uber Technologies, Inc.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace java com.uber.dosa\n\ntypedef map FieldValueMap\n\nenum ElemType {\n BOOL,\n BLOB,\n STRING,\n INT32,\n INT64,\n DOUBLE,\n TIMESTAMP, // Timestamps are 64-bit integers, the number of ns from the Unix epoch.\n UUID,\n\n // Reserve a few enum types in case we want to support few more\n RESERVED0,\n RESERVED1,\n RESERVED2,\n RESERVED3,\n}\n\nunion RawValue {\n 1: optional binary binaryValue // BLOB, UUID\n 2: optional bool boolValue // BOOL\n 3: optional double doubleValue // DOUBLE\n 4: optional i32 int32Value // INT32\n 5: optional i64 (js.type = \"Long\") int64Value // INT64, TIMESTAMP\n 6: optional string stringValue // STRING\n}\n\n// make it union in case we want to support collections like set\nunion Value {\n 1: optional RawValue elemValue\n}\n\nstruct SchemaRef {\n 1: optional string scope\n 2: optional string namePrefix\n 3: optional string entityName\n 4: optional i32 version\n}\n\nstruct FieldTag {\n 1: optional string name\n 2: optional string value\n}\n\nstruct FieldDesc {\n 1: optional ElemType type\n 2: optional set tags\n}\n\nstruct ClusteringKey {\n 1: optional string name\n 2: optional bool asc\n}\n\nstruct PrimaryKey {\n 1: optional list partitionKeys\n 2: optional list clusteringKeys\n}\n\nstruct IndexDefinition {\n 1: optional PrimaryKey key\n 2: optional list columns\n 3: optional bool defunct\n}\n\nenum ETLState {\n OFF = 1,\n ON,\n\n // Reserve a few enum types in case we want to support more\n RESERVED0,\n RESERVED1\n}\n\nstruct EntityDefinition {\n 1: optional string name\n 2: optional map fieldDescs\n 3: optional PrimaryKey primaryKey\n 4: optional map Indexes\n 5: optional ETLState etl\n 6: optional list columnOrder\n}\n\nstruct Error {\n 1: optional i32 errCode\n 2: optional string msg\n 3: optional bool shouldRetry\n}\n\nstruct CreateRequest {\n 1: optional SchemaRef ref\n 2: optional FieldValueMap entityValues\n 3: optional i64 ttl\n 4: optional i64 timestamp\n}\n\nstruct ReadRequest {\n 1: optional SchemaRef ref\n 2: optional FieldValueMap keyValues\n 3: optional set fieldsToRead\n}\n\nstruct ReadResponse {\n 1: optional FieldValueMap entityValues\n}\n\nstruct MultiReadRequest {\n 1: optional SchemaRef ref\n 2: optional list keyValues\n 3: optional set fieldsToRead\n}\n\nunion EntityOrError{\n 1: optional FieldValueMap entityValues\n 2: optional Error error\n}\n\nstruct MultiReadResponse {\n 1: optional list results\n}\n\nstruct MultiUpsertResponse {\n 1: optional list errors\n}\n\nstruct UpsertRequest {\n 1: optional SchemaRef ref\n 2: optional FieldValueMap entityValues\n 3: optional i64 ttl\n 4: optional i64 timestamp\n}\n\nstruct MultiUpsertRequest {\n 1: optional SchemaRef ref\n 2: optional list entities\n 3: optional i64 timestamp\n}\n\nstruct RemoveRequest {\n 1: optional SchemaRef ref\n 2: optional FieldValueMap keyValues\n 3: optional i64 timestamp\n}\n\nstruct MultiRemoveRequest {\n 1: optional SchemaRef ref\n 2: optional list keyValues\n 3: optional i64 timestamp\n}\n\nstruct MultiRemoveResponse {\n 1: optional list errors\n}\n\nenum Operator {\n EQ,\n LT,\n GT,\n LT_OR_EQ,\n GT_OR_EQ,\n}\n\nstruct Field {\n 1: optional string name\n 2: optional Value value\n}\n\nstruct Condition {\n 1: optional Operator op\n 2: optional Field field\n}\n\nstruct RangeRequest {\n 1: optional SchemaRef ref\n 2: optional string token\n 3: optional i32 limit\n 4: optional list conditions\n 5: optional set fieldsToRead\n}\n\nstruct RangeResponse {\n 1: optional list entities\n 2: optional string nextToken\n}\n\nstruct RemoveRangeRequest {\n 1: optional SchemaRef ref\n 2: optional list conditions\n 3: optional i64 timestamp\n}\n\nstruct SearchRequest {\n 1: optional SchemaRef ref\n 2: optional string token\n 3: optional i32 limit\n 4: optional Field searchBy\n 5: optional set fieldsToRead\n}\n\nstruct SearchResponse {\n 1: optional list entities\n 2: optional string nextToken\n}\n\nstruct ScanRequest {\n 1: optional SchemaRef ref\n 2: optional string token\n 3: optional i32 limit\n 4: optional set fieldsToRead\n}\n\nstruct ScanResponse {\n 1: optional list entities\n 2: optional string nextToken\n}\n\nstruct CanUpsertSchemaRequest {\n 1: optional string scope\n 2: optional string namePrefix\n 3: optional list entityDefs\n}\n\nstruct CanUpsertSchemaResponse {\n // latest upserted version\n 1: optional i32 version\n}\n\nstruct CheckSchemaRequest {\n 1: optional string scope\n 2: optional string namePrefix\n 3: optional list entityDefs\n}\n\nstruct CheckSchemaResponse {\n 1: optional i32 version\n}\n\nstruct UpsertSchemaRequest {\n 1: optional string scope\n 2: optional string namePrefix\n 3: optional list entityDefs\n 4: optional bool dryRun\n}\n\nstruct UpsertSchemaResponse {\n 1: optional i32 version\n 2: optional string status\n}\n\nstruct CheckSchemaStatusRequest {\n 1: optional string scope\n 2: optional string namePrefix\n 3: optional i32 version\n}\n\nstruct CheckSchemaStatusResponse {\n 1: optional i32 version\n 2: optional string status\n}\n\nstruct CreateScopeRequest {\n 1: optional string name\n 2: optional string requester\n 3: optional string metadata\n}\n\nstruct ScopeExistsRequest {\n 1: optional string name\n}\n\nstruct ScopeExistsResponse {\n 1: optional bool exists\n}\n\nstruct TruncateScopeRequest {\n 1: optional string name\n 2: optional string requester\n}\nstruct DropScopeRequest {\n 1: optional string name\n 2: optional string requester\n}\n\nexception BadRequestError {\n 1: required string err\n 2: optional string message\n 3: optional i32 errorCode\n}\n\nexception InternalServerError {\n 1: required string err\n 2: optional string message\n 3: optional i32 errorCode\n}\n\nexception BadSchemaError {\n // EntityName -> Error msg\n 1: required map reasons\n}\n\nservice Dosa {\n void createIfNotExists(\n 1: CreateRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n ReadResponse read (\n 1: ReadRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n MultiReadResponse multiRead (\n 1: MultiReadRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n void upsert (\n 1: UpsertRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n MultiUpsertResponse multiUpsert (\n 1: MultiUpsertRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n void remove (\n 1: RemoveRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n MultiRemoveResponse multiRemove (\n 1: MultiRemoveRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n RangeResponse range (\n 1: RangeRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n void removeRange (\n 1: RemoveRangeRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n SearchResponse search (\n 1: SearchRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n ScanResponse scan (\n 1: ScanRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n CanUpsertSchemaResponse canUpsertSchema(\n 1: CanUpsertSchemaRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: BadSchemaError schemaError\n )\n\n CheckSchemaResponse checkSchema(\n 1: CheckSchemaRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: BadSchemaError schemaError\n )\n\n UpsertSchemaResponse upsertSchema(\n 1: UpsertSchemaRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: BadSchemaError schemaError\n )\n\n CheckSchemaStatusResponse checkSchemaStatus(\n 1: CheckSchemaStatusRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n void createScope(\n 1: CreateScopeRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n ScopeExistsResponse scopeExists(\n 1: ScopeExistsRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n void truncateScope(\n 1: TruncateScopeRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n\n void dropScope(\n 1: DropScopeRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n )\n}\n" +const rawIDL = "// Copyright (c) 2019 Uber Technologies, Inc.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace java com.uber.dosa\n\ntypedef map FieldValueMap\n\nenum ElemType {\n BOOL,\n BLOB,\n STRING,\n INT32,\n INT64,\n DOUBLE,\n TIMESTAMP, // Timestamps are 64-bit integers, the number of ns from the Unix epoch.\n UUID,\n\n // Reserve a few enum types in case we want to support few more\n RESERVED0,\n RESERVED1,\n RESERVED2,\n RESERVED3,\n}\n\nunion RawValue {\n 1: optional binary binaryValue // BLOB, UUID\n 2: optional bool boolValue // BOOL\n 3: optional double doubleValue // DOUBLE\n 4: optional i32 int32Value // INT32\n 5: optional i64 (js.type = \"Long\") int64Value // INT64, TIMESTAMP\n 6: optional string stringValue // STRING\n}\n\n// make it union in case we want to support collections like set\nunion Value {\n 1: optional RawValue elemValue\n}\n\nstruct SchemaRef {\n 1: optional string scope\n 2: optional string namePrefix\n 3: optional string entityName\n 4: optional i32 version\n}\n\nstruct FieldTag {\n 1: optional string name\n 2: optional string value\n}\n\nstruct FieldDesc {\n 1: optional ElemType type\n 2: optional set tags\n}\n\nstruct ClusteringKey {\n 1: optional string name\n 2: optional bool asc\n}\n\nstruct PrimaryKey {\n 1: optional list partitionKeys\n 2: optional list clusteringKeys\n}\n\nstruct IndexDefinition {\n 1: optional PrimaryKey key\n 2: optional list columns\n 3: optional bool defunct\n}\n\nenum ETLState {\n OFF = 1,\n ON,\n\n // Reserve a few enum types in case we want to support more\n RESERVED0,\n RESERVED1\n}\n\nstruct EntityDefinition {\n 1: optional string name\n 2: optional map fieldDescs\n 3: optional PrimaryKey primaryKey\n 4: optional map Indexes\n 5: optional ETLState etl\n 6: optional list columnOrder\n}\n\nstruct Error {\n 1: optional i32 errCode\n 2: optional string msg\n 3: optional bool shouldRetry\n}\n\nstruct CreateRequest {\n 1: optional SchemaRef ref\n 2: optional FieldValueMap entityValues\n 3: optional i64 ttl\n 4: optional i64 timestamp\n}\n\nstruct ReadRequest {\n 1: optional SchemaRef ref\n 2: optional FieldValueMap keyValues\n 3: optional set fieldsToRead\n}\n\nstruct ReadResponse {\n 1: optional FieldValueMap entityValues\n}\n\nstruct MultiReadRequest {\n 1: optional SchemaRef ref\n 2: optional list keyValues\n 3: optional set fieldsToRead\n}\n\nunion EntityOrError{\n 1: optional FieldValueMap entityValues\n 2: optional Error error\n}\n\nstruct MultiReadResponse {\n 1: optional list results\n}\n\nstruct MultiUpsertResponse {\n 1: optional list errors\n}\n\nstruct UpsertRequest {\n 1: optional SchemaRef ref\n 2: optional FieldValueMap entityValues\n 3: optional i64 ttl\n 4: optional i64 timestamp\n}\n\nstruct MultiUpsertRequest {\n 1: optional SchemaRef ref\n 2: optional list entities\n 3: optional i64 timestamp\n}\n\nstruct RemoveRequest {\n 1: optional SchemaRef ref\n 2: optional FieldValueMap keyValues\n 3: optional i64 timestamp\n}\n\nstruct MultiRemoveRequest {\n 1: optional SchemaRef ref\n 2: optional list keyValues\n 3: optional i64 timestamp\n}\n\nstruct MultiRemoveResponse {\n 1: optional list errors\n}\n\nenum Operator {\n EQ,\n LT,\n GT,\n LT_OR_EQ,\n GT_OR_EQ,\n}\n\nstruct Field {\n 1: optional string name\n 2: optional Value value\n}\n\nstruct Condition {\n 1: optional Operator op\n 2: optional Field field\n}\n\nstruct RangeRequest {\n 1: optional SchemaRef ref\n 2: optional string token\n 3: optional i32 limit\n 4: optional list conditions\n 5: optional set fieldsToRead\n}\n\nstruct RangeResponse {\n 1: optional list entities\n 2: optional string nextToken\n}\n\nstruct RemoveRangeRequest {\n 1: optional SchemaRef ref\n 2: optional list conditions\n 3: optional i64 timestamp\n}\n\nstruct SearchRequest {\n 1: optional SchemaRef ref\n 2: optional string token\n 3: optional i32 limit\n 4: optional Field searchBy\n 5: optional set fieldsToRead\n}\n\nstruct SearchResponse {\n 1: optional list entities\n 2: optional string nextToken\n}\n\nstruct ScanRequest {\n 1: optional SchemaRef ref\n 2: optional string token\n 3: optional i32 limit\n 4: optional set fieldsToRead\n}\n\nstruct ScanResponse {\n 1: optional list entities\n 2: optional string nextToken\n}\n\nstruct CanUpsertSchemaRequest {\n 1: optional string scope\n 2: optional string namePrefix\n 3: optional list entityDefs\n}\n\nstruct CanUpsertSchemaResponse {\n // latest upserted version\n 1: optional i32 version\n}\n\nstruct CheckSchemaRequest {\n 1: optional string scope\n 2: optional string namePrefix\n 3: optional list entityDefs\n}\n\nstruct CheckSchemaResponse {\n 1: optional i32 version\n}\n\nstruct UpsertSchemaRequest {\n 1: optional string scope\n 2: optional string namePrefix\n 3: optional list entityDefs\n 4: optional bool dryRun\n}\n\nstruct UpsertSchemaResponse {\n 1: optional i32 version\n 2: optional string status\n}\n\nstruct CheckSchemaStatusRequest {\n 1: optional string scope\n 2: optional string namePrefix\n 3: optional i32 version\n}\n\nstruct CheckSchemaStatusResponse {\n 1: optional i32 version\n 2: optional string status\n}\n\nstruct CreateScopeRequest {\n 1: optional string name\n 2: optional string requester\n 3: optional string metadata\n}\n\nstruct ScopeExistsRequest {\n 1: optional string name\n}\n\nstruct ScopeExistsResponse {\n 1: optional bool exists\n}\n\nstruct TruncateScopeRequest {\n 1: optional string name\n 2: optional string requester\n}\nstruct DropScopeRequest {\n 1: optional string name\n 2: optional string requester\n}\n\nexception BadRequestError {\n 1: required string err\n 2: optional string message\n 3: optional i32 errorCode\n}\n\nexception InternalServerError {\n 1: required string err\n 2: optional string message\n 3: optional i32 errorCode\n}\n\nexception BadSchemaError {\n // EntityName -> Error msg\n 1: required map reasons\n}\n\nexception RateLimitError {\n 1: required string err\n 2: optional string message\n 3: optional i32 errorCode\n}\n\nservice Dosa {\n void createIfNotExists(\n 1: CreateRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n ReadResponse read (\n 1: ReadRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n MultiReadResponse multiRead (\n 1: MultiReadRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n void upsert (\n 1: UpsertRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n MultiUpsertResponse multiUpsert (\n 1: MultiUpsertRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n void remove (\n 1: RemoveRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n MultiRemoveResponse multiRemove (\n 1: MultiRemoveRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n RangeResponse range (\n 1: RangeRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n void removeRange (\n 1: RemoveRangeRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n SearchResponse search (\n 1: SearchRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n ScanResponse scan (\n 1: ScanRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n CanUpsertSchemaResponse canUpsertSchema(\n 1: CanUpsertSchemaRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: BadSchemaError schemaError\n 4: RateLimitError limitError\n )\n\n CheckSchemaResponse checkSchema(\n 1: CheckSchemaRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: BadSchemaError schemaError\n 4: RateLimitError limitError\n )\n\n UpsertSchemaResponse upsertSchema(\n 1: UpsertSchemaRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: BadSchemaError schemaError\n 4: RateLimitError limitError\n )\n\n CheckSchemaStatusResponse checkSchemaStatus(\n 1: CheckSchemaStatusRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n void createScope(\n 1: CreateScopeRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n ScopeExistsResponse scopeExists(\n 1: ScopeExistsRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n void truncateScope(\n 1: TruncateScopeRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n\n void dropScope(\n 1: DropScopeRequest request\n ) throws (\n 1: BadRequestError clientError\n 2: InternalServerError serverError\n 3: RateLimitError limitError\n )\n}\n" diff --git a/.gen/dosa/types.go b/.gen/dosa/types.go index a4a6e3c..c06d48f 100644 --- a/.gen/dosa/types.go +++ b/.gen/dosa/types.go @@ -7517,6 +7517,210 @@ func (v *RangeResponse) GetNextToken() (o string) { return } +type RateLimitError struct { + Err string `json:"err,required"` + Message *string `json:"message,omitempty"` + ErrorCode *int32 `json:"errorCode,omitempty"` +} + +// ToWire translates a RateLimitError struct into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// An error is returned if the struct or any of its fields failed to +// validate. +// +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } +func (v *RateLimitError) ToWire() (wire.Value, error) { + var ( + fields [3]wire.Field + i int = 0 + w wire.Value + err error + ) + + w, err = wire.NewValueString(v.Err), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 1, Value: w} + i++ + if v.Message != nil { + w, err = wire.NewValueString(*(v.Message)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 2, Value: w} + i++ + } + if v.ErrorCode != nil { + w, err = wire.NewValueI32(*(v.ErrorCode)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } + + return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil +} + +// FromWire deserializes a RateLimitError struct from its Thrift-level +// representation. The Thrift-level representation may be obtained +// from a ThriftRW protocol implementation. +// +// An error is returned if we were unable to build a RateLimitError struct +// from the provided intermediate representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } +// +// var v RateLimitError +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil +func (v *RateLimitError) FromWire(w wire.Value) error { + var err error + + errIsSet := false + + for _, field := range w.GetStruct().Fields { + switch field.ID { + case 1: + if field.Value.Type() == wire.TBinary { + v.Err, err = field.Value.GetString(), error(nil) + if err != nil { + return err + } + errIsSet = true + } + case 2: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Message = &x + if err != nil { + return err + } + + } + case 3: + if field.Value.Type() == wire.TI32 { + var x int32 + x, err = field.Value.GetI32(), error(nil) + v.ErrorCode = &x + if err != nil { + return err + } + + } + } + } + + if !errIsSet { + return errors.New("field Err of RateLimitError is required") + } + + return nil +} + +// String returns a readable string representation of a RateLimitError +// struct. +func (v *RateLimitError) String() string { + if v == nil { + return "" + } + + var fields [3]string + i := 0 + fields[i] = fmt.Sprintf("Err: %v", v.Err) + i++ + if v.Message != nil { + fields[i] = fmt.Sprintf("Message: %v", *(v.Message)) + i++ + } + if v.ErrorCode != nil { + fields[i] = fmt.Sprintf("ErrorCode: %v", *(v.ErrorCode)) + i++ + } + + return fmt.Sprintf("RateLimitError{%v}", strings.Join(fields[:i], ", ")) +} + +// Equals returns true if all the fields of this RateLimitError match the +// provided RateLimitError. +// +// This function performs a deep comparison. +func (v *RateLimitError) Equals(rhs *RateLimitError) bool { + if v == nil { + return rhs == nil + } else if rhs == nil { + return false + } + if !(v.Err == rhs.Err) { + return false + } + if !_String_EqualsPtr(v.Message, rhs.Message) { + return false + } + if !_I32_EqualsPtr(v.ErrorCode, rhs.ErrorCode) { + return false + } + + return true +} + +// MarshalLogObject implements zapcore.ObjectMarshaler, enabling +// fast logging of RateLimitError. +func (v *RateLimitError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { + enc.AddString("err", v.Err) + if v.Message != nil { + enc.AddString("message", *v.Message) + } + if v.ErrorCode != nil { + enc.AddInt32("errorCode", *v.ErrorCode) + } + return err +} + +// GetErr returns the value of Err if it is set or its +// zero value if it is unset. +func (v *RateLimitError) GetErr() (o string) { return v.Err } + +// GetMessage returns the value of Message if it is set or its +// zero value if it is unset. +func (v *RateLimitError) GetMessage() (o string) { + if v.Message != nil { + return *v.Message + } + + return +} + +// GetErrorCode returns the value of ErrorCode if it is set or its +// zero value if it is unset. +func (v *RateLimitError) GetErrorCode() (o int32) { + if v.ErrorCode != nil { + return *v.ErrorCode + } + + return +} + +func (v *RateLimitError) Error() string { + return v.String() +} + type RawValue struct { BinaryValue []byte `json:"binaryValue,omitempty"` BoolValue *bool `json:"boolValue,omitempty"` diff --git a/idl/dosa/dosa.thrift b/idl/dosa/dosa.thrift index 28d13b3..01b8fa2 100644 --- a/idl/dosa/dosa.thrift +++ b/idl/dosa/dosa.thrift @@ -321,12 +321,19 @@ exception BadSchemaError { 1: required map reasons } +exception RateLimitError { + 1: required string err + 2: optional string message + 3: optional i32 errorCode +} + service Dosa { void createIfNotExists( 1: CreateRequest request ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) ReadResponse read ( @@ -334,6 +341,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) MultiReadResponse multiRead ( @@ -341,6 +349,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) void upsert ( @@ -348,6 +357,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) MultiUpsertResponse multiUpsert ( @@ -355,6 +365,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) void remove ( @@ -362,6 +373,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) MultiRemoveResponse multiRemove ( @@ -369,6 +381,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) RangeResponse range ( @@ -376,6 +389,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) void removeRange ( @@ -383,6 +397,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) SearchResponse search ( @@ -390,6 +405,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) ScanResponse scan ( @@ -397,6 +413,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) CanUpsertSchemaResponse canUpsertSchema( @@ -405,6 +422,7 @@ service Dosa { 1: BadRequestError clientError 2: InternalServerError serverError 3: BadSchemaError schemaError + 4: RateLimitError limitError ) CheckSchemaResponse checkSchema( @@ -413,6 +431,7 @@ service Dosa { 1: BadRequestError clientError 2: InternalServerError serverError 3: BadSchemaError schemaError + 4: RateLimitError limitError ) UpsertSchemaResponse upsertSchema( @@ -421,6 +440,7 @@ service Dosa { 1: BadRequestError clientError 2: InternalServerError serverError 3: BadSchemaError schemaError + 4: RateLimitError limitError ) CheckSchemaStatusResponse checkSchemaStatus( @@ -428,6 +448,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) void createScope( @@ -435,6 +456,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) ScopeExistsResponse scopeExists( @@ -442,6 +464,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) void truncateScope( @@ -449,6 +472,7 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) void dropScope( @@ -456,5 +480,6 @@ service Dosa { ) throws ( 1: BadRequestError clientError 2: InternalServerError serverError + 3: RateLimitError limitError ) }