primary_connect_proto 0.7.0 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84b6c17757a04a0c85141e80f5198e418d22750fb67ea20e7dcc396717d57837
4
- data.tar.gz: d7ea410edebecd2613f2db10f31178e25122ee0d5cbb189914d51fdb4bbad614
3
+ metadata.gz: 2fa78c8e4e9515e7829618255e20304b203f9a5b0cac4355abd0ee61b6b746af
4
+ data.tar.gz: 28d46c3fbfad77d1ae2bb15c8dec6e202e22d7ec5a511ecc927f8b34d033ba0e
5
5
  SHA512:
6
- metadata.gz: 2e503879494f7f052362920562cd597e152927aa55a21c901768f6add5813d1fd00ce247fe40d85a9fa38ffd92240cfad5333e1b9151405520c3cd662d107176
7
- data.tar.gz: c087fae16f8cf92877a48398f515f01093339172312568b4729fa434258b3cb3cd4adfc428314f7cabb478b8ac56ca770ef97515ddc68e06258b83654abccfb6
6
+ metadata.gz: 6f694b8ac82d2b3d75f5ec50e9ab0b523d2283cf7580154b12df6ba8eb5459bba1834328f2dada48bf67f772438df29154cbc3411564a7d2036073a7071d8ca9
7
+ data.tar.gz: 1443d3f3e5c990d56ed1d8a284bc9a449f5c5525d2daf53f4e754018c67e5e6fe65edfffef373383bd49a35812cd330c8fea461b90bece4728593cbb3c9dc3c2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.7.3
4
+
5
+ - Add require in gemspec
6
+
7
+ ## 0.7.2
8
+
9
+ - Add `Typeable` extension
10
+
11
+ ## 0.7.1
12
+
13
+ - Use `Value` instead of `Any`
14
+
3
15
  ## 0.7.0
4
16
 
5
17
  - Added `echo` to `Meta`
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "primary_connect_proto"
8
- s.version = "0.7.0"
8
+ s.version = "0.7.3"
9
9
  s.authors = ["Primary.Health"]
10
10
  s.email = ["sam@primary.health"]
11
11
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/protobuf/any_pb'
6
+ require 'google/protobuf/struct_pb'
7
7
  require 'google/protobuf/timestamp_pb'
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("meta.proto", :syntax => :proto3) do
@@ -16,7 +16,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
16
16
  optional :message, :message, 6, "primary.connect.Meta.Message"
17
17
  optional :transmission, :message, 7, "primary.connect.Meta.Transmission"
18
18
  optional :facility_code, :string, 8
19
- map :echo, :string, :message, 9, "google.protobuf.Any"
19
+ map :echo, :string, :message, 9, "google.protobuf.Value"
20
20
  end
21
21
  add_message "primary.connect.Meta.Source" do
22
22
  optional :id, :string, 1
@@ -32,7 +32,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
32
32
  add_message "primary.connect.Meta.Destination" do
33
33
  optional :id, :string, 1
34
34
  optional :name, :string, 2
35
- map :config, :string, :message, 3, "google.protobuf.Any"
35
+ map :config, :string, :message, 3, "google.protobuf.Value"
36
36
  end
37
37
  add_enum "primary.connect.Meta.EventType" do
38
38
  value :EVENT_TYPE_NEW, 0
@@ -2,7 +2,7 @@
2
2
  syntax = "proto3";
3
3
  package primary.connect;
4
4
 
5
- import "google/protobuf/any.proto";
5
+ import "google/protobuf/struct.proto";
6
6
  import "google/protobuf/timestamp.proto";
7
7
 
8
8
  message Meta {
@@ -31,7 +31,7 @@ message Meta {
31
31
  message Destination {
32
32
  string id = 1;
33
33
  string name = 2;
34
- map<string, google.protobuf.Any> config = 3;
34
+ map<string, google.protobuf.Value> config = 3;
35
35
  }
36
36
 
37
37
  EventType event_type = 1;
@@ -42,5 +42,5 @@ message Meta {
42
42
  Message message = 6;
43
43
  Transmission transmission = 7;
44
44
  string facility_code = 8;
45
- map<string, google.protobuf.Any> echo = 9;
45
+ map<string, google.protobuf.Value> echo = 9;
46
46
  }
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConnectProto
4
+ module Extensions
5
+ module Valueable
6
+ def self.to_value(value)
7
+ case value
8
+ when String then Google::Protobuf::Value.new(string_value: value)
9
+ when Numeric then Google::Protobuf::Value.new(number_value: value)
10
+ when NilClass then Google::Protobuf::Value.new(null_value: :NULL_VALUE)
11
+ else
12
+ raise TypeError, "Invalid type #{value.class} for value #{value}"
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -18,6 +18,7 @@ require 'visit_pb'
18
18
 
19
19
  require 'full_nameable'
20
20
  require 'phone_numberable'
21
+ require 'valueable'
21
22
 
22
23
  Primary::Connect::Name.include(ConnectProto::Extensions::FullNameable)
23
24
  [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primary_connect_proto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Primary.Health
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-15 00:00:00.000000000 Z
11
+ date: 2022-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -117,6 +117,7 @@ files:
117
117
  - lib/connect_proto/src/visit.proto
118
118
  - lib/extensions/full_nameable.rb
119
119
  - lib/extensions/phone_numberable.rb
120
+ - lib/extensions/valueable.rb
120
121
  - lib/primary_connect_proto.rb
121
122
  - spec/protobuf/demographics_spec.rb
122
123
  - spec/protobuf/name_spec.rb