alula-ruby 2.1.2 → 2.3.0

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: 2a5c030dc25e12e66dfeba3db613a92b54fdc53e821351a51e78da43efd2d9be
4
- data.tar.gz: f869b4408ac1b0179baf1114b6fe6cc380d8d76e40fb7652614968ee3f05d3c2
3
+ metadata.gz: 7d96970881def7032eaa1f4566fb622a802b8f3172763f1f36155edd41782628
4
+ data.tar.gz: 77247c2916538c0812ac65975c0c4ad674e540152c7f26ea1f91d2d3749e2a7a
5
5
  SHA512:
6
- metadata.gz: 3045b8f512ce320edfbc6e8b79392e83fbcda4fd2adef9cc5403e7979025d075bb3ebeafa8ff00e7e69e3ba40858f0a4883021a49116d0127139a4632ccc50de
7
- data.tar.gz: 6a5dd45a244df7c4e98eb5412a245025018debf109ea9524dc41e0ba6ec2a40fa7ff1fa45ea13e78a0abd122a5fbf7df00bd09c9883e61d4c3009c8e28cc675d
6
+ metadata.gz: 5ba5ea055c0d1ccc7a4cea560440302ba0021142f248afff1d291a59b87a8e661e1ea36d2081bebe5f7f2939a0bbc32dd47fe811c1aaa256892a7186c57aac12
7
+ data.tar.gz: de8fc218f6b8f5875247bc9f5e96c1042f4f9691c5644b516262cecd70e69ec8e5a257191c3f8ac62ec66fa3206284abdac9a40dc9c2dc3f21adcdc6ddf5e869
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.3.6
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:3.3.5-alpine
1
+ FROM ruby:3.3.6-alpine
2
2
 
3
3
  RUN gem install bundler
4
4
 
data/VERSION.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  | Version | Date | Description |
4
4
  | ------- | ------------| --------------------------------------------------------------------------- |
5
+ | v2.3.0 | 2024-12-17 | Add Video Register Proc |
6
+ | v2.2.0 | 2024-12-10 | Add SMS Limit to Device model and the Device Feature Price model |
5
7
  | v2.1.2 | 2024-11-12 | Add CameraGetFirmwareVersionProc |
6
8
  | v2.1.1 | 2024-11-12 | Add device record attribute |
7
9
  | v2.1.0 | 2024-10-24 | Bump multiple dependencies |
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ # qrCode: string
5
+ # accountId: string
6
+ # customerId: string
7
+ # serialNumber: string
8
+ # verificationCode: string
9
+ # brand: string
10
+ # model: string
11
+ #
12
+ # Method: video.register
13
+ module Alula
14
+ class VideoRegisterProc < Alula::RpcResource
15
+ class Response < Alula::RpcResponse
16
+ end
17
+
18
+ def self.call(**kwargs)
19
+ payload = {
20
+ qrCode: kwargs[:qr_code],
21
+ accountId: kwargs[:account_id],
22
+ customerId: kwargs[:customer_id],
23
+ serialNumber: kwargs[:serial_number],
24
+ verificationCode: kwargs[:verification_code],
25
+ brand: kwargs[:brand],
26
+ model: kwargs[:model]
27
+ }
28
+
29
+ request(
30
+ http_method: :post,
31
+ path: '/rpc/v1/video/register',
32
+ payload:,
33
+ handler: Response
34
+ )
35
+ end
36
+ end
37
+ end
@@ -73,6 +73,8 @@ module Alula
73
73
  value ? Util.underscore(value).to_sym : nil
74
74
  elsif opts[:hex_convert_required] == true
75
75
  Util.convert_hex_crc?(self.program_id) ? value.to_s(16) : value
76
+ elsif opts[:type] == :number
77
+ value&.to_i
76
78
  else
77
79
  value
78
80
  end
@@ -40,6 +40,7 @@ module Alula
40
40
  relationship :notifications, type: 'devices-notifications', cardinality: 'To-many'
41
41
  relationship :video_verification_cameras, type: 'video-verification-cameras', cardinality: 'To-many'
42
42
  relationship :users, type: 'devices-users', cardinality: 'To-many'
43
+ relationship :features_prices, type: 'devices-features-prices', cardinality: 'To-one'
43
44
  # relationship :features_supported, type: 'devices-features-supported', cardinality: 'To-one'
44
45
  # relationship :features_disabled, type: 'devices-features-disabled', cardinality: 'To-one'
45
46
 
@@ -705,5 +706,12 @@ module Alula
705
706
  filterable: false,
706
707
  creatable_by: [],
707
708
  patchable_by: [:system]
709
+
710
+ field :sms_limit,
711
+ type: :number,
712
+ sortable: false,
713
+ filterable: false,
714
+ creatable_by: [],
715
+ patchable_by: %i[system station dealer]
708
716
  end
709
717
  end
@@ -0,0 +1,242 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alula
4
+ class DeviceFeaturePrice < Alula::RestResource
5
+ extend Alula::ResourceAttributes
6
+ extend Alula::RelationshipAttributes
7
+ extend Alula::ApiOperations::Request
8
+ extend Alula::ApiOperations::List
9
+ extend Alula::ApiOperations::Save
10
+
11
+ # SMS Notification object
12
+ class SmsNotification < Alula::ObjectField
13
+ field :unit_price, type: :number
14
+ field :unit_type, type: :string
15
+ field :units, type: :number
16
+ field :subtotal, type: :number
17
+ end
18
+
19
+ resource_path 'devices/features/prices'
20
+ type 'devices-features-prices'
21
+
22
+ relationship :device, type: 'devices', cardinality: 'To-one'
23
+
24
+ field :id,
25
+ type: :string,
26
+ sortable: false,
27
+ filterable: false,
28
+ creatable_by: [],
29
+ patchable_by: []
30
+
31
+ field :activation,
32
+ type: :number,
33
+ sortable: false,
34
+ filterable: false,
35
+ creatable_by: [],
36
+ patchable_by: []
37
+
38
+ field :alarm_notifications,
39
+ type: :number,
40
+ sortable: false,
41
+ filterable: false,
42
+ creatable_by: [],
43
+ patchable_by: []
44
+
45
+ field :alarm_transmission,
46
+ type: :number,
47
+ sortable: false,
48
+ filterable: false,
49
+ creatable_by: [],
50
+ patchable_by: []
51
+
52
+ field :alarm_verification,
53
+ type: :number,
54
+ sortable: false,
55
+ filterable: false,
56
+ creatable_by: [],
57
+ patchable_by: []
58
+
59
+ field :alula_messenger,
60
+ type: :number,
61
+ sortable: false,
62
+ filterable: false,
63
+ creatable_by: [],
64
+ patchable_by: []
65
+
66
+ field :base,
67
+ type: :number,
68
+ sortable: false,
69
+ filterable: false,
70
+ creatable_by: [],
71
+ patchable_by: []
72
+
73
+ field :billing_custom,
74
+ type: :number,
75
+ sortable: false,
76
+ filterable: false,
77
+ creatable_by: [],
78
+ patchable_by: []
79
+
80
+ field :home_automation,
81
+ type: :number,
82
+ sortable: false,
83
+ filterable: false,
84
+ creatable_by: [],
85
+ patchable_by: []
86
+
87
+ field :interactive_services,
88
+ type: :number,
89
+ sortable: false,
90
+ filterable: false,
91
+ creatable_by: [],
92
+ patchable_by: []
93
+
94
+ field :intrude_impair,
95
+ type: :number,
96
+ sortable: false,
97
+ filterable: false,
98
+ creatable_by: [],
99
+ patchable_by: []
100
+
101
+ field :onvif_video_hub,
102
+ type: :number,
103
+ sortable: false,
104
+ filterable: false,
105
+ creatable_by: [],
106
+ patchable_by: []
107
+
108
+ field :panel_downloading,
109
+ type: :number,
110
+ sortable: false,
111
+ filterable: false,
112
+ creatable_by: [],
113
+ patchable_by: []
114
+
115
+ field :program_fee,
116
+ type: :number,
117
+ sortable: false,
118
+ filterable: false,
119
+ creatable_by: [],
120
+ patchable_by: []
121
+
122
+ field :super_gte_12_hour,
123
+ type: :number,
124
+ sortable: false,
125
+ filterable: false,
126
+ creatable_by: [],
127
+ patchable_by: []
128
+
129
+ field :super_gte_14_day,
130
+ type: :number,
131
+ sortable: false,
132
+ filterable: false,
133
+ creatable_by: [],
134
+ patchable_by: []
135
+
136
+ field :super_gte_15_min,
137
+ type: :number,
138
+ sortable: false,
139
+ filterable: false,
140
+ creatable_by: [],
141
+ patchable_by: []
142
+
143
+ field :super_gte_1_hour,
144
+ type: :number,
145
+ sortable: false,
146
+ filterable: false,
147
+ creatable_by: [],
148
+ patchable_by: []
149
+
150
+ field :super_gte_200_sec,
151
+ type: :number,
152
+ sortable: false,
153
+ filterable: false,
154
+ creatable_by: [],
155
+ patchable_by: []
156
+
157
+ field :super_gte_24_hour,
158
+ type: :number,
159
+ sortable: false,
160
+ filterable: false,
161
+ creatable_by: [],
162
+ patchable_by: []
163
+
164
+ field :super_gte_30_day,
165
+ type: :number,
166
+ sortable: false,
167
+ filterable: false,
168
+ creatable_by: [],
169
+ patchable_by: []
170
+
171
+ field :super_gte_5_min,
172
+ type: :number,
173
+ sortable: false,
174
+ filterable: false,
175
+ creatable_by: [],
176
+ patchable_by: []
177
+
178
+ field :super_gte_6_hour,
179
+ type: :number,
180
+ sortable: false,
181
+ filterable: false,
182
+ creatable_by: [],
183
+ patchable_by: []
184
+
185
+ field :super_gte_7_day,
186
+ type: :number,
187
+ sortable: false,
188
+ filterable: false,
189
+ creatable_by: [],
190
+ patchable_by: []
191
+
192
+ field :super_lt_200_sec,
193
+ type: :number,
194
+ sortable: false,
195
+ filterable: false,
196
+ creatable_by: [],
197
+ patchable_by: []
198
+
199
+ field :two_way_voice,
200
+ type: :number,
201
+ sortable: false,
202
+ filterable: false,
203
+ creatable_by: [],
204
+ patchable_by: []
205
+
206
+ field :video_verification,
207
+ type: :number,
208
+ sortable: false,
209
+ filterable: false,
210
+ creatable_by: [],
211
+ patchable_by: []
212
+
213
+ field :vigilance,
214
+ type: :number,
215
+ sortable: false,
216
+ filterable: false,
217
+ creatable_by: [],
218
+ patchable_by: []
219
+
220
+ field :weather_alerts,
221
+ type: :number,
222
+ sortable: false,
223
+ filterable: false,
224
+ creatable_by: [],
225
+ patchable_by: []
226
+
227
+ field :weather_forecast,
228
+ type: :number,
229
+ sortable: false,
230
+ filterable: false,
231
+ creatable_by: [],
232
+ patchable_by: []
233
+
234
+ field :sms_notification,
235
+ type: :object,
236
+ sortable: false,
237
+ filterable: false,
238
+ creatable_by: [],
239
+ patchable_by: [],
240
+ use: SmsNotification
241
+ end
242
+ end
@@ -6,7 +6,7 @@ module Alula
6
6
  extend Alula::ApiOperations::Save
7
7
 
8
8
  resource_path 'features/prices'
9
- type 'feature-prices'
9
+ type 'features-prices'
10
10
 
11
11
  field :id,
12
12
  type: :string,
data/lib/alula/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alula
4
- VERSION = '2.1.2'
4
+ VERSION = '2.3.0'
5
5
  end
data/lib/alula.rb CHANGED
@@ -60,6 +60,7 @@ require_relative 'alula/resources/station'
60
60
  require_relative 'alula/resources/oauth_client'
61
61
  require_relative 'alula/resources/device_alias'
62
62
  require_relative 'alula/resources/device_notification'
63
+ require_relative 'alula/resources/device_feature_price'
63
64
  require_relative 'alula/resources/video_verification_camera'
64
65
  require_relative 'alula/resources/video_verification_event'
65
66
  require_relative 'alula/resources/feature_plan'
@@ -93,6 +94,7 @@ require_relative 'alula/procedures/user_plansvideo_price_get'
93
94
  require_relative 'alula/procedures/user_get_locked_proc'
94
95
  require_relative 'alula/procedures/user_unlock_proc'
95
96
  require_relative 'alula/procedures/user_password_reset_proc'
97
+ require_relative 'alula/procedures/video_register_proc'
96
98
  require_relative 'alula/procedures/video_unregister_proc'
97
99
  require_relative 'alula/procedures/camera_get_wifi_proc'
98
100
  require_relative 'alula/procedures/camera_get_sd_status_proc'
@@ -125,6 +127,7 @@ module Alula
125
127
  Alula::DeviceCharge,
126
128
  Alula::DeviceCredit,
127
129
  Alula::DeviceEventLog,
130
+ Alula::DeviceFeaturePrice,
128
131
  Alula::DeviceNotification,
129
132
  Alula::DeviceUser,
130
133
  Alula::VideoVerificationCamera,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alula-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Johnson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-12 00:00:00.000000000 Z
11
+ date: 2024-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -252,6 +252,7 @@ files:
252
252
  - lib/alula/procedures/user_transfer_reject.rb
253
253
  - lib/alula/procedures/user_transfer_request.rb
254
254
  - lib/alula/procedures/user_unlock_proc.rb
255
+ - lib/alula/procedures/video_register_proc.rb
255
256
  - lib/alula/procedures/video_unregister_proc.rb
256
257
  - lib/alula/query_interface.rb
257
258
  - lib/alula/rate_limit.rb
@@ -271,6 +272,7 @@ files:
271
272
  - lib/alula/resources/device_charge.rb
272
273
  - lib/alula/resources/device_credit.rb
273
274
  - lib/alula/resources/device_event_log.rb
275
+ - lib/alula/resources/device_feature_price.rb
274
276
  - lib/alula/resources/device_notification.rb
275
277
  - lib/alula/resources/device_program.rb
276
278
  - lib/alula/resources/device_user.rb
@@ -308,10 +310,10 @@ files:
308
310
  - lib/parser.rb
309
311
  - utils/mariadb/conf/custom.cnf
310
312
  - utils/mongodb/init/00_users.sh
311
- homepage:
313
+ homepage:
312
314
  licenses: []
313
315
  metadata: {}
314
- post_install_message:
316
+ post_install_message:
315
317
  rdoc_options: []
316
318
  require_paths:
317
319
  - lib
@@ -327,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
327
329
  version: '0'
328
330
  requirements: []
329
331
  rubygems_version: 3.0.3.1
330
- signing_key:
332
+ signing_key:
331
333
  specification_version: 4
332
334
  summary: Ruby bindings for the Alula API
333
335
  test_files: []