diff --git a/.gen/dosa/idl.go b/.gen/dosa/idl.go index 50e9ba6..bf8a01b 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: "2096b2d86a7a83c27450a31475945bee99cbbe79", + SHA1: "dc7d33e5b0c595ab43602080b8179887ff27bfbd", 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,\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}\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\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" diff --git a/.gen/dosa/types.go b/.gen/dosa/types.go index d119dea..a4a6e3c 100644 --- a/.gen/dosa/types.go +++ b/.gen/dosa/types.go @@ -3109,11 +3109,12 @@ func (v *ElemType) UnmarshalJSON(text []byte) error { } type EntityDefinition struct { - Name *string `json:"name,omitempty"` - FieldDescs map[string]*FieldDesc `json:"fieldDescs,omitempty"` - PrimaryKey *PrimaryKey `json:"primaryKey,omitempty"` - Indexes map[string]*IndexDefinition `json:"Indexes,omitempty"` - Etl *ETLState `json:"etl,omitempty"` + Name *string `json:"name,omitempty"` + FieldDescs map[string]*FieldDesc `json:"fieldDescs,omitempty"` + PrimaryKey *PrimaryKey `json:"primaryKey,omitempty"` + Indexes map[string]*IndexDefinition `json:"Indexes,omitempty"` + Etl *ETLState `json:"etl,omitempty"` + ColumnOrder []string `json:"columnOrder,omitempty"` } type _Map_String_FieldDesc_MapItemList map[string]*FieldDesc @@ -3192,6 +3193,32 @@ func (_Map_String_IndexDefinition_MapItemList) ValueType() wire.Type { func (_Map_String_IndexDefinition_MapItemList) Close() {} +type _List_String_ValueList []string + +func (v _List_String_ValueList) ForEach(f func(wire.Value) error) error { + for _, x := range v { + w, err := wire.NewValueString(x), error(nil) + if err != nil { + return err + } + err = f(w) + if err != nil { + return err + } + } + return nil +} + +func (v _List_String_ValueList) Size() int { + return len(v) +} + +func (_List_String_ValueList) ValueType() wire.Type { + return wire.TBinary +} + +func (_List_String_ValueList) Close() {} + // ToWire translates a EntityDefinition struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. @@ -3209,7 +3236,7 @@ func (_Map_String_IndexDefinition_MapItemList) Close() {} // } func (v *EntityDefinition) ToWire() (wire.Value, error) { var ( - fields [5]wire.Field + fields [6]wire.Field i int = 0 w wire.Value err error @@ -3255,6 +3282,14 @@ func (v *EntityDefinition) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 5, Value: w} i++ } + if v.ColumnOrder != nil { + w, err = wire.NewValueList(_List_String_ValueList(v.ColumnOrder)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 6, Value: w} + i++ + } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } @@ -3339,6 +3374,24 @@ func _ETLState_Read(w wire.Value) (ETLState, error) { return v, err } +func _List_String_Read(l wire.ValueList) ([]string, error) { + if l.ValueType() != wire.TBinary { + return nil, nil + } + + o := make([]string, 0, l.Size()) + err := l.ForEach(func(x wire.Value) error { + i, err := x.GetString(), error(nil) + if err != nil { + return err + } + o = append(o, i) + return nil + }) + l.Close() + return o, err +} + // FromWire deserializes a EntityDefinition struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. @@ -3404,6 +3457,14 @@ func (v *EntityDefinition) FromWire(w wire.Value) error { return err } + } + case 6: + if field.Value.Type() == wire.TList { + v.ColumnOrder, err = _List_String_Read(field.Value.GetList()) + if err != nil { + return err + } + } } } @@ -3418,7 +3479,7 @@ func (v *EntityDefinition) String() string { return "" } - var fields [5]string + var fields [6]string i := 0 if v.Name != nil { fields[i] = fmt.Sprintf("Name: %v", *(v.Name)) @@ -3440,6 +3501,10 @@ func (v *EntityDefinition) String() string { fields[i] = fmt.Sprintf("Etl: %v", *(v.Etl)) i++ } + if v.ColumnOrder != nil { + fields[i] = fmt.Sprintf("ColumnOrder: %v", v.ColumnOrder) + i++ + } return fmt.Sprintf("EntityDefinition{%v}", strings.Join(fields[:i], ", ")) } @@ -3488,6 +3553,21 @@ func _ETLState_EqualsPtr(lhs, rhs *ETLState) bool { return lhs == nil && rhs == nil } +func _List_String_Equals(lhs, rhs []string) bool { + if len(lhs) != len(rhs) { + return false + } + + for i, lv := range lhs { + rv := rhs[i] + if !(lv == rv) { + return false + } + } + + return true +} + // Equals returns true if all the fields of this EntityDefinition match the // provided EntityDefinition. // @@ -3513,6 +3593,9 @@ func (v *EntityDefinition) Equals(rhs *EntityDefinition) bool { if !_ETLState_EqualsPtr(v.Etl, rhs.Etl) { return false } + if !((v.ColumnOrder == nil && rhs.ColumnOrder == nil) || (v.ColumnOrder != nil && rhs.ColumnOrder != nil && _List_String_Equals(v.ColumnOrder, rhs.ColumnOrder))) { + return false + } return true } @@ -3539,6 +3622,17 @@ func (m _Map_String_IndexDefinition_Zapper) MarshalLogObject(enc zapcore.ObjectE return err } +type _List_String_Zapper []string + +// MarshalLogArray implements zapcore.ArrayMarshaler, enabling +// fast logging of _List_String_Zapper. +func (l _List_String_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) { + for _, v := range l { + enc.AppendString(v) + } + return err +} + // MarshalLogObject implements zapcore.ObjectMarshaler, enabling // fast logging of EntityDefinition. func (v *EntityDefinition) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { @@ -3557,6 +3651,9 @@ func (v *EntityDefinition) MarshalLogObject(enc zapcore.ObjectEncoder) (err erro if v.Etl != nil { err = multierr.Append(err, enc.AddObject("etl", *v.Etl)) } + if v.ColumnOrder != nil { + err = multierr.Append(err, enc.AddArray("columnOrder", (_List_String_Zapper)(v.ColumnOrder))) + } return err } @@ -3610,6 +3707,16 @@ func (v *EntityDefinition) GetEtl() (o ETLState) { return } +// GetColumnOrder returns the value of ColumnOrder if it is set or its +// zero value if it is unset. +func (v *EntityDefinition) GetColumnOrder() (o []string) { + if v.ColumnOrder != nil { + return v.ColumnOrder + } + + return +} + type EntityOrError struct { EntityValues FieldValueMap `json:"entityValues,omitempty"` Error *Error `json:"error,omitempty"` @@ -4739,32 +4846,6 @@ type IndexDefinition struct { Defunct *bool `json:"defunct,omitempty"` } -type _List_String_ValueList []string - -func (v _List_String_ValueList) ForEach(f func(wire.Value) error) error { - for _, x := range v { - w, err := wire.NewValueString(x), error(nil) - if err != nil { - return err - } - err = f(w) - if err != nil { - return err - } - } - return nil -} - -func (v _List_String_ValueList) Size() int { - return len(v) -} - -func (_List_String_ValueList) ValueType() wire.Type { - return wire.TBinary -} - -func (_List_String_ValueList) Close() {} - // ToWire translates a IndexDefinition struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. @@ -4816,24 +4897,6 @@ func (v *IndexDefinition) ToWire() (wire.Value, error) { return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _List_String_Read(l wire.ValueList) ([]string, error) { - if l.ValueType() != wire.TBinary { - return nil, nil - } - - o := make([]string, 0, l.Size()) - err := l.ForEach(func(x wire.Value) error { - i, err := x.GetString(), error(nil) - if err != nil { - return err - } - o = append(o, i) - return nil - }) - l.Close() - return o, err -} - // FromWire deserializes a IndexDefinition struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. @@ -4913,21 +4976,6 @@ func (v *IndexDefinition) String() string { return fmt.Sprintf("IndexDefinition{%v}", strings.Join(fields[:i], ", ")) } -func _List_String_Equals(lhs, rhs []string) bool { - if len(lhs) != len(rhs) { - return false - } - - for i, lv := range lhs { - rv := rhs[i] - if !(lv == rv) { - return false - } - } - - return true -} - // Equals returns true if all the fields of this IndexDefinition match the // provided IndexDefinition. // @@ -4951,17 +4999,6 @@ func (v *IndexDefinition) Equals(rhs *IndexDefinition) bool { return true } -type _List_String_Zapper []string - -// MarshalLogArray implements zapcore.ArrayMarshaler, enabling -// fast logging of _List_String_Zapper. -func (l _List_String_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) { - for _, v := range l { - enc.AppendString(v) - } - return err -} - // MarshalLogObject implements zapcore.ObjectMarshaler, enabling // fast logging of IndexDefinition. func (v *IndexDefinition) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {