Skip to content

Commit

Permalink
trim unnecessary code from google wellknown types
Browse files Browse the repository at this point in the history
related: 00e48e8 (part of #108)
  • Loading branch information
tanmaykm committed Jul 9, 2018
1 parent 677e707 commit 6e5858d
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 174 deletions.
4 changes: 0 additions & 4 deletions src/google/any_pb.jl
Expand Up @@ -2,15 +2,11 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==

mutable struct _Any <: ProtoType
type_url::AbstractString
value::Array{UInt8,1}
_Any(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type _Any
hash(v::_Any) = ProtoBuf.protohash(v)
isequal(v1::_Any, v2::_Any) = ProtoBuf.protoisequal(v1, v2)
==(v1::_Any, v2::_Any) = ProtoBuf.protoeq(v1, v2)

export _Any
10 changes: 0 additions & 10 deletions src/google/api_pb.jl
Expand Up @@ -2,7 +2,6 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==

mutable struct Method <: ProtoType
name::AbstractString
Expand All @@ -14,18 +13,12 @@ mutable struct Method <: ProtoType
syntax::Int32
Method(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Method
hash(v::Method) = ProtoBuf.protohash(v)
isequal(v1::Method, v2::Method) = ProtoBuf.protoisequal(v1, v2)
==(v1::Method, v2::Method) = ProtoBuf.protoeq(v1, v2)

mutable struct Mixin <: ProtoType
name::AbstractString
root::AbstractString
Mixin(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Mixin
hash(v::Mixin) = ProtoBuf.protohash(v)
isequal(v1::Mixin, v2::Mixin) = ProtoBuf.protoisequal(v1, v2)
==(v1::Mixin, v2::Mixin) = ProtoBuf.protoeq(v1, v2)

mutable struct Api <: ProtoType
name::AbstractString
Expand All @@ -37,8 +30,5 @@ mutable struct Api <: ProtoType
syntax::Int32
Api(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Api
hash(v::Api) = ProtoBuf.protohash(v)
isequal(v1::Api, v2::Api) = ProtoBuf.protoisequal(v1, v2)
==(v1::Api, v2::Api) = ProtoBuf.protoeq(v1, v2)

export Api, Method, Mixin
76 changes: 0 additions & 76 deletions src/google/descriptor_pb.jl

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions src/google/duration_pb.jl
Expand Up @@ -2,15 +2,11 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==

mutable struct Duration <: ProtoType
seconds::Int64
nanos::Int32
Duration(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Duration
hash(v::Duration) = ProtoBuf.protohash(v)
isequal(v1::Duration, v2::Duration) = ProtoBuf.protoisequal(v1, v2)
==(v1::Duration, v2::Duration) = ProtoBuf.protoeq(v1, v2)

export Duration
4 changes: 0 additions & 4 deletions src/google/empty_pb.jl
Expand Up @@ -2,13 +2,9 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==

mutable struct Empty <: ProtoType
Empty(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Empty
hash(v::Empty) = ProtoBuf.protohash(v)
isequal(v1::Empty, v2::Empty) = ProtoBuf.protoisequal(v1, v2)
==(v1::Empty, v2::Empty) = ProtoBuf.protoeq(v1, v2)

export Empty
4 changes: 0 additions & 4 deletions src/google/field_mask_pb.jl
Expand Up @@ -2,14 +2,10 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==

mutable struct FieldMask <: ProtoType
paths::Array{AbstractString,1}
FieldMask(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type FieldMask
hash(v::FieldMask) = ProtoBuf.protohash(v)
isequal(v1::FieldMask, v2::FieldMask) = ProtoBuf.protoisequal(v1, v2)
==(v1::FieldMask, v2::FieldMask) = ProtoBuf.protoeq(v1, v2)

export FieldMask
10 changes: 0 additions & 10 deletions src/google/plugin_pb.jl
Expand Up @@ -2,7 +2,6 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==
using ProtoBuf.GoogleProtoBuf

mutable struct CodeGeneratorRequest <: ProtoType
Expand All @@ -13,9 +12,6 @@ mutable struct CodeGeneratorRequest <: ProtoType
end #type CodeGeneratorRequest
const __fnum_CodeGeneratorRequest = Int[1,2,15]
meta(t::Type{CodeGeneratorRequest}) = meta(t, ProtoBuf.DEF_REQ, __fnum_CodeGeneratorRequest, ProtoBuf.DEF_VAL, true, ProtoBuf.DEF_PACK, ProtoBuf.DEF_WTYPES, ProtoBuf.DEF_ONEOFS, ProtoBuf.DEF_ONEOF_NAMES)
hash(v::CodeGeneratorRequest) = ProtoBuf.protohash(v)
isequal(v1::CodeGeneratorRequest, v2::CodeGeneratorRequest) = ProtoBuf.protoisequal(v1, v2)
==(v1::CodeGeneratorRequest, v2::CodeGeneratorRequest) = ProtoBuf.protoeq(v1, v2)

mutable struct CodeGeneratorResponse_File <: ProtoType
name::AbstractString
Expand All @@ -25,9 +21,6 @@ mutable struct CodeGeneratorResponse_File <: ProtoType
end #type CodeGeneratorResponse_File
const __fnum_CodeGeneratorResponse_File = Int[1,2,15]
meta(t::Type{CodeGeneratorResponse_File}) = meta(t, ProtoBuf.DEF_REQ, __fnum_CodeGeneratorResponse_File, ProtoBuf.DEF_VAL, true, ProtoBuf.DEF_PACK, ProtoBuf.DEF_WTYPES, ProtoBuf.DEF_ONEOFS, ProtoBuf.DEF_ONEOF_NAMES)
hash(v::CodeGeneratorResponse_File) = ProtoBuf.protohash(v)
isequal(v1::CodeGeneratorResponse_File, v2::CodeGeneratorResponse_File) = ProtoBuf.protoisequal(v1, v2)
==(v1::CodeGeneratorResponse_File, v2::CodeGeneratorResponse_File) = ProtoBuf.protoeq(v1, v2)

mutable struct CodeGeneratorResponse <: ProtoType
error::AbstractString
Expand All @@ -36,8 +29,5 @@ mutable struct CodeGeneratorResponse <: ProtoType
end #type CodeGeneratorResponse
const __fnum_CodeGeneratorResponse = Int[1,15]
meta(t::Type{CodeGeneratorResponse}) = meta(t, ProtoBuf.DEF_REQ, __fnum_CodeGeneratorResponse, ProtoBuf.DEF_VAL, true, ProtoBuf.DEF_PACK, ProtoBuf.DEF_WTYPES, ProtoBuf.DEF_ONEOFS, ProtoBuf.DEF_ONEOF_NAMES)
hash(v::CodeGeneratorResponse) = ProtoBuf.protohash(v)
isequal(v1::CodeGeneratorResponse, v2::CodeGeneratorResponse) = ProtoBuf.protoisequal(v1, v2)
==(v1::CodeGeneratorResponse, v2::CodeGeneratorResponse) = ProtoBuf.protoeq(v1, v2)

export CodeGeneratorRequest, CodeGeneratorResponse_File, CodeGeneratorResponse
4 changes: 0 additions & 4 deletions src/google/source_context_pb.jl
Expand Up @@ -2,14 +2,10 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==

mutable struct SourceContext <: ProtoType
file_name::AbstractString
SourceContext(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type SourceContext
hash(v::SourceContext) = ProtoBuf.protohash(v)
isequal(v1::SourceContext, v2::SourceContext) = ProtoBuf.protoisequal(v1, v2)
==(v1::SourceContext, v2::SourceContext) = ProtoBuf.protoeq(v1, v2)

export SourceContext
10 changes: 0 additions & 10 deletions src/google/struct_pb.jl
Expand Up @@ -2,7 +2,6 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==

struct __enum_NullValue <: ProtoEnum
NULL_VALUE::Int32
Expand All @@ -14,17 +13,11 @@ mutable struct Struct <: ProtoType
fields::Dict{AbstractString,Any} # map entry
Struct(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Struct
hash(v::Struct) = ProtoBuf.protohash(v)
isequal(v1::Struct, v2::Struct) = ProtoBuf.protoisequal(v1, v2)
==(v1::Struct, v2::Struct) = ProtoBuf.protoeq(v1, v2)

mutable struct ListValue <: ProtoType
values::Array{Any,1}
ListValue(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type ListValue
hash(v::ListValue) = ProtoBuf.protohash(v)
isequal(v1::ListValue, v2::ListValue) = ProtoBuf.protoisequal(v1, v2)
==(v1::ListValue, v2::ListValue) = ProtoBuf.protoeq(v1, v2)

mutable struct Value <: ProtoType
null_value::Int32
Expand All @@ -38,9 +31,6 @@ end #type Value
const __oneofs_Value = Int[1,1,1,1,1,1]
const __oneof_names_Value = [Symbol("kind")]
meta(t::Type{Value}) = meta(t, ProtoBuf.DEF_REQ, ProtoBuf.DEF_FNUM, ProtoBuf.DEF_VAL, true, ProtoBuf.DEF_PACK, ProtoBuf.DEF_WTYPES, __oneofs_Value, __oneof_names_Value)
hash(v::Value) = ProtoBuf.protohash(v)
isequal(v1::Value, v2::Value) = ProtoBuf.protoisequal(v1, v2)
==(v1::Value, v2::Value) = ProtoBuf.protoeq(v1, v2)

function meta(t::Type{ListValue})
haskey(ProtoBuf._metacache, t) && (return ProtoBuf._metacache[t])
Expand Down
4 changes: 0 additions & 4 deletions src/google/timestamp_pb.jl
Expand Up @@ -2,15 +2,11 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==

mutable struct Timestamp <: ProtoType
seconds::Int64
nanos::Int32
Timestamp(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Timestamp
hash(v::Timestamp) = ProtoBuf.protohash(v)
isequal(v1::Timestamp, v2::Timestamp) = ProtoBuf.protoisequal(v1, v2)
==(v1::Timestamp, v2::Timestamp) = ProtoBuf.protoeq(v1, v2)

export Timestamp
16 changes: 0 additions & 16 deletions src/google/type_pb.jl
Expand Up @@ -2,7 +2,6 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==

struct __enum_Syntax <: ProtoEnum
SYNTAX_PROTO2::Int32
Expand All @@ -16,19 +15,13 @@ mutable struct Option <: ProtoType
value::_Any
Option(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Option
hash(v::Option) = ProtoBuf.protohash(v)
isequal(v1::Option, v2::Option) = ProtoBuf.protoisequal(v1, v2)
==(v1::Option, v2::Option) = ProtoBuf.protoeq(v1, v2)

mutable struct EnumValue <: ProtoType
name::AbstractString
number::Int32
options::Array{Option,1}
EnumValue(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type EnumValue
hash(v::EnumValue) = ProtoBuf.protohash(v)
isequal(v1::EnumValue, v2::EnumValue) = ProtoBuf.protoisequal(v1, v2)
==(v1::EnumValue, v2::EnumValue) = ProtoBuf.protoeq(v1, v2)

struct __enum_Field_Kind <: ProtoEnum
TYPE_UNKNOWN::Int32
Expand Down Expand Up @@ -78,9 +71,6 @@ mutable struct Field <: ProtoType
end #type Field
const __fnum_Field = Int[1,2,3,4,6,7,8,9,10,11]
meta(t::Type{Field}) = meta(t, ProtoBuf.DEF_REQ, __fnum_Field, ProtoBuf.DEF_VAL, true, ProtoBuf.DEF_PACK, ProtoBuf.DEF_WTYPES, ProtoBuf.DEF_ONEOFS, ProtoBuf.DEF_ONEOF_NAMES)
hash(v::Field) = ProtoBuf.protohash(v)
isequal(v1::Field, v2::Field) = ProtoBuf.protoisequal(v1, v2)
==(v1::Field, v2::Field) = ProtoBuf.protoeq(v1, v2)

mutable struct _Enum <: ProtoType
name::AbstractString
Expand All @@ -90,9 +80,6 @@ mutable struct _Enum <: ProtoType
syntax::Int32
_Enum(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type _Enum
hash(v::_Enum) = ProtoBuf.protohash(v)
isequal(v1::_Enum, v2::_Enum) = ProtoBuf.protoisequal(v1, v2)
==(v1::_Enum, v2::_Enum) = ProtoBuf.protoeq(v1, v2)

mutable struct _Type <: ProtoType
name::AbstractString
Expand All @@ -103,8 +90,5 @@ mutable struct _Type <: ProtoType
syntax::Int32
_Type(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type _Type
hash(v::_Type) = ProtoBuf.protohash(v)
isequal(v1::_Type, v2::_Type) = ProtoBuf.protoisequal(v1, v2)
==(v1::_Type, v2::_Type) = ProtoBuf.protoeq(v1, v2)

export Syntax, _Type, Field_Kind, Field_Cardinality, Field, _Enum, EnumValue, Option
28 changes: 0 additions & 28 deletions src/google/wrappers_pb.jl
Expand Up @@ -2,78 +2,50 @@
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==

mutable struct DoubleValue <: ProtoType
value::Float64
DoubleValue(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type DoubleValue
hash(v::DoubleValue) = ProtoBuf.protohash(v)
isequal(v1::DoubleValue, v2::DoubleValue) = ProtoBuf.protoisequal(v1, v2)
==(v1::DoubleValue, v2::DoubleValue) = ProtoBuf.protoeq(v1, v2)

mutable struct FloatValue <: ProtoType
value::Float32
FloatValue(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type FloatValue
hash(v::FloatValue) = ProtoBuf.protohash(v)
isequal(v1::FloatValue, v2::FloatValue) = ProtoBuf.protoisequal(v1, v2)
==(v1::FloatValue, v2::FloatValue) = ProtoBuf.protoeq(v1, v2)

mutable struct Int64Value <: ProtoType
value::Int64
Int64Value(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Int64Value
hash(v::Int64Value) = ProtoBuf.protohash(v)
isequal(v1::Int64Value, v2::Int64Value) = ProtoBuf.protoisequal(v1, v2)
==(v1::Int64Value, v2::Int64Value) = ProtoBuf.protoeq(v1, v2)

mutable struct UInt64Value <: ProtoType
value::UInt64
UInt64Value(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type UInt64Value
hash(v::UInt64Value) = ProtoBuf.protohash(v)
isequal(v1::UInt64Value, v2::UInt64Value) = ProtoBuf.protoisequal(v1, v2)
==(v1::UInt64Value, v2::UInt64Value) = ProtoBuf.protoeq(v1, v2)

mutable struct Int32Value <: ProtoType
value::Int32
Int32Value(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Int32Value
hash(v::Int32Value) = ProtoBuf.protohash(v)
isequal(v1::Int32Value, v2::Int32Value) = ProtoBuf.protoisequal(v1, v2)
==(v1::Int32Value, v2::Int32Value) = ProtoBuf.protoeq(v1, v2)

mutable struct UInt32Value <: ProtoType
value::UInt32
UInt32Value(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type UInt32Value
hash(v::UInt32Value) = ProtoBuf.protohash(v)
isequal(v1::UInt32Value, v2::UInt32Value) = ProtoBuf.protoisequal(v1, v2)
==(v1::UInt32Value, v2::UInt32Value) = ProtoBuf.protoeq(v1, v2)

mutable struct BoolValue <: ProtoType
value::Bool
BoolValue(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type BoolValue
hash(v::BoolValue) = ProtoBuf.protohash(v)
isequal(v1::BoolValue, v2::BoolValue) = ProtoBuf.protoisequal(v1, v2)
==(v1::BoolValue, v2::BoolValue) = ProtoBuf.protoeq(v1, v2)

mutable struct StringValue <: ProtoType
value::AbstractString
StringValue(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type StringValue
hash(v::StringValue) = ProtoBuf.protohash(v)
isequal(v1::StringValue, v2::StringValue) = ProtoBuf.protoisequal(v1, v2)
==(v1::StringValue, v2::StringValue) = ProtoBuf.protoeq(v1, v2)

mutable struct BytesValue <: ProtoType
value::Array{UInt8,1}
BytesValue(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type BytesValue
hash(v::BytesValue) = ProtoBuf.protohash(v)
isequal(v1::BytesValue, v2::BytesValue) = ProtoBuf.protoisequal(v1, v2)
==(v1::BytesValue, v2::BytesValue) = ProtoBuf.protoeq(v1, v2)

export DoubleValue, FloatValue, Int64Value, UInt64Value, Int32Value, UInt32Value, BoolValue, StringValue, BytesValue

0 comments on commit 6e5858d

Please sign in to comment.