Skip to content

Commit ef4f288

Browse files
committed
chore: bump elixir-protobuf to 0.15
deprecated functions have been removed, so they've been replaced with a struct definition regenerate pb.ex files ``` ❯ protoc --elixir_out=. --elixir_opt=package_prefix=astarte.core lib/astarte_core/proto/*.proto ❯ protoc --elixir_out=. --elixir_opt=package_prefix=astarte.core.triggers lib/astarte_core/triggers/*.proto ❯ protoc --elixir_out=. --elixir_opt=package_prefix=astarte.core.triggers.policy_protobuf lib/astarte_core/triggers/policy_protobuf/*.proto ❯ protoc --elixir_out=. --elixir_opt=package_prefix=astarte.core.triggers.simple_events lib/astarte_core/triggers/simple_events/*.proto ❯ protoc --elixir_out=. --elixir_opt=package_prefix=astarte.core.triggers.simple_triggers_protobuf lib/astarte_core/triggers/simple_triggers_protobuf/*.proto ``` Signed-off-by: Francesco Noacco <francesco.noacco@secomind.com>
1 parent c0a05fb commit ef4f288

29 files changed

+45
-108
lines changed

lib/astarte_core/proto/astarte_reference.pb.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
defmodule Astarte.Core.AstarteReference do
22
@moduledoc false
33

4-
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
5-
6-
def fully_qualified_name, do: "AstarteReference"
4+
use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
75

86
field :object_type, 1, type: :int32, json_name: "objectType"
97
field :object_uuid, 2, proto3_optional: true, type: :bytes, json_name: "objectUuid"

lib/astarte_core/triggers/policy/handler.ex

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ defmodule Astarte.Core.Triggers.Policy.Handler do
115115
strategy: strategy
116116
} = handler
117117

118-
HandlerProto.new(
118+
%HandlerProto{
119119
strategy: Map.get(@strategy_string_to_atom, strategy),
120120
on: error_type_to_tagged_error_tuple(error_type)
121-
)
121+
}
122122
end
123123

124124
def from_handler_proto(%HandlerProto{} = handler_proto) do
@@ -134,12 +134,13 @@ defmodule Astarte.Core.Triggers.Policy.Handler do
134134
end
135135

136136
defp error_type_to_tagged_error_tuple(%Policy.ErrorKeyword{keyword: keyword}) do
137-
{:error_keyword,
138-
ErrorKeywordProto.new(keyword: Map.get(@error_keyword_string_to_atom, keyword))}
137+
error_keyword = %ErrorKeywordProto{keyword: Map.get(@error_keyword_string_to_atom, keyword)}
138+
{:error_keyword, error_keyword}
139139
end
140140

141141
defp error_type_to_tagged_error_tuple(%Policy.ErrorRange{error_codes: codes}) do
142-
{:error_range, ErrorRangeProto.new(error_codes: codes)}
142+
error_range = %ErrorRangeProto{error_codes: codes}
143+
{:error_range, error_range}
143144
end
144145

145146
defp tagged_error_tuple_to_error_type({_, %ErrorKeywordProto{keyword: keyword}}) do

lib/astarte_core/triggers/policy_protobuf/error_keyword.pb.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
defmodule Astarte.Core.Triggers.PolicyProtobuf.ErrorKeyword.KeywordType do
22
@moduledoc false
33

4-
use Protobuf, enum: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
5-
6-
def fully_qualified_name, do: "ErrorKeyword.KeywordType"
4+
use Protobuf, enum: true, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
75

86
field :INVALID, 0
97
field :ANY_ERROR, 1
@@ -14,9 +12,7 @@ end
1412
defmodule Astarte.Core.Triggers.PolicyProtobuf.ErrorKeyword do
1513
@moduledoc false
1614

17-
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
18-
19-
def fully_qualified_name, do: "ErrorKeyword"
15+
use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
2016

2117
field :keyword, 1,
2218
type: Astarte.Core.Triggers.PolicyProtobuf.ErrorKeyword.KeywordType,
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
defmodule Astarte.Core.Triggers.PolicyProtobuf.ErrorRange do
22
@moduledoc false
33

4-
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
5-
6-
def fully_qualified_name, do: "ErrorRange"
4+
use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
75

86
field :error_codes, 1, repeated: true, type: :int32, json_name: "errorCodes"
97
end

lib/astarte_core/triggers/policy_protobuf/handler.pb.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
defmodule Astarte.Core.Triggers.PolicyProtobuf.Handler.StrategyType do
22
@moduledoc false
33

4-
use Protobuf, enum: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
5-
6-
def fully_qualified_name, do: "Handler.StrategyType"
4+
use Protobuf, enum: true, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
75

86
field :INVALID, 0
97
field :DISCARD, 1
@@ -13,9 +11,7 @@ end
1311
defmodule Astarte.Core.Triggers.PolicyProtobuf.Handler do
1412
@moduledoc false
1513

16-
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
17-
18-
def fully_qualified_name, do: "Handler"
14+
use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
1915

2016
oneof :on, 0
2117

lib/astarte_core/triggers/policy_protobuf/policy.pb.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
defmodule Astarte.Core.Triggers.PolicyProtobuf.Policy do
22
@moduledoc false
33

4-
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
5-
6-
def fully_qualified_name, do: "Policy"
4+
use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
75

86
field :name, 1, proto3_optional: true, type: :string
97
field :maximum_capacity, 2, type: :int32, json_name: "maximumCapacity"
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
defmodule Astarte.Core.Triggers.SimpleEvents.DeviceConnectedEvent do
22
@moduledoc false
33

4-
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
5-
6-
def fully_qualified_name, do: "DeviceConnectedEvent"
4+
use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
75

86
field :device_ip_address, 1, proto3_optional: true, type: :string, json_name: "deviceIpAddress"
97
end
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
defmodule Astarte.Core.Triggers.SimpleEvents.DeviceDisconnectedEvent do
22
@moduledoc false
33

4-
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
5-
6-
def fully_qualified_name, do: "DeviceDisconnectedEvent"
4+
use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
75
end

lib/astarte_core/triggers/simple_events/device_error_event.pb.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
defmodule Astarte.Core.Triggers.SimpleEvents.DeviceErrorEvent.MetadataEntry do
22
@moduledoc false
33

4-
use Protobuf, map: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
5-
6-
def fully_qualified_name, do: "DeviceErrorEvent.MetadataEntry"
4+
use Protobuf, map: true, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
75

86
field :key, 1, type: :string
97
field :value, 2, type: :string
@@ -12,9 +10,7 @@ end
1210
defmodule Astarte.Core.Triggers.SimpleEvents.DeviceErrorEvent do
1311
@moduledoc false
1412

15-
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
16-
17-
def fully_qualified_name, do: "DeviceErrorEvent"
13+
use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
1814

1915
field :error_name, 1, proto3_optional: true, type: :string, json_name: "errorName"
2016

lib/astarte_core/triggers/simple_events/incoming_data_event.pb.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
defmodule Astarte.Core.Triggers.SimpleEvents.IncomingDataEvent do
22
@moduledoc false
33

4-
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
5-
6-
def fully_qualified_name, do: "IncomingDataEvent"
4+
use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3
75

86
field :interface, 1, proto3_optional: true, type: :string
97
field :path, 2, proto3_optional: true, type: :string

0 commit comments

Comments
 (0)