alula-ruby 0.59.0 → 0.62.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0319d0525b473484d4edf6bd98d868e171849bf675aa2915c4bbdd1e9a4ae641'
4
- data.tar.gz: bdaa5a675fd63d425efffb93a788401e857b649f92dac99677a38efe35eb183a
3
+ metadata.gz: a246e78d1616e522c836789bc42b4b25ae9fd2cebe5f02dc5e313da5381160bb
4
+ data.tar.gz: 15b6ef116f8077c04031ab496b3af2d30064195783c4374b11c7f4a85343406f
5
5
  SHA512:
6
- metadata.gz: f31fca437531095c65a5961fc86439d081aca664737a17fdc93962941189dfe0d4461496bc4acd824ab015ccd98c62f7f19eea559caea9fe0d5c6965d4fe2c13
7
- data.tar.gz: 395260abac1f85c7237d1094f26b3fcf342f56e057f3cfed0879f4c308829b295a1d64278f4ad0653002d1849c2138580c5eb7ba5a2fca34eec3f8790997f60f
6
+ metadata.gz: 4e4de08d349e609eac3af8e72d787cb1b80518dc69bbf528ffe7ee5cff090a426c4995544b30b84d9fd2486a87d2653753ae3be23e9a6fa81fd9a8d8f5f67021
7
+ data.tar.gz: d01f91727be30d67fd5c00189bb2cc6a71e17c5961db0c2f58d69035e3468485b417e9328a63bfe43a19ba33920c2c20b0c3d213b4b084788b2e7fa6314f4a7b
data/VERSION.md CHANGED
@@ -91,3 +91,6 @@
91
91
  | v0.57.0 | 2022-07-19 | Add Alula Messenger to device object |
92
92
  | v0.58.0 | 2022-07-21 | Add clone method, that creates a copy of a resource |
93
93
  | v0.59.0 | 2022-08-10 | Add clone RPC method for Feature Plans |
94
+ | v0.60.0 | 2022-08-16 | Add Device Credits resource |
95
+ | v0.61.0 | 2022-08-19 | User hidden resource |
96
+ | v0.62.0 | 2022-08-19 | Remove Admin User resource map |
@@ -0,0 +1,70 @@
1
+ module Alula
2
+ class DeviceCredit < Alula::RestResource
3
+ extend Alula::ResourceAttributes
4
+ extend Alula::ApiOperations::Request
5
+ extend Alula::ApiOperations::List
6
+ extend Alula::ApiOperations::Save
7
+
8
+ resource_path 'devices/credits'
9
+ type 'devices-credit'
10
+
11
+ # Resource Fields
12
+ # Not all params are used at the moment. See Alula::ResourceAttributes for details
13
+ # on how params are parsed,
14
+ field :id,
15
+ type: :string,
16
+ sortable: true,
17
+ filterable: true,
18
+ creatable_by: [],
19
+ patchable_by: []
20
+
21
+ field :device_id,
22
+ type: :string,
23
+ sortable: true,
24
+ filterable: true,
25
+ creatable_by: [:system],
26
+ patchable_by: []
27
+
28
+ field :credit_type,
29
+ type: :string,
30
+ sortable: true,
31
+ filterable: true,
32
+ creatable_by: [:system],
33
+ patchable_by: []
34
+
35
+ field :initial_amount,
36
+ type: :number,
37
+ sortable: true,
38
+ filterable: false,
39
+ creatable_by: [:system],
40
+ patchable_by: [:system]
41
+
42
+ field :used_amount,
43
+ type: :number,
44
+ sortable: true,
45
+ filterable: false,
46
+ creatable_by: [],
47
+ patchable_by: [:system]
48
+
49
+ field :date_modified,
50
+ type: :date,
51
+ sortable: true,
52
+ filterable: false,
53
+ creatable_by: [],
54
+ patchable_by: []
55
+
56
+ field :date_created,
57
+ type: :date,
58
+ sortable: true,
59
+ filterable: false,
60
+ creatable_by: [],
61
+ patchable_by: []
62
+
63
+ field :expiration_date,
64
+ type: :date,
65
+ sortable: true,
66
+ filterable: false,
67
+ creatable_by: [:system],
68
+ patchable_by: [:system]
69
+ end
70
+ end
@@ -198,6 +198,17 @@ module Alula
198
198
  creatable_by: %i[system station dealer technician user],
199
199
  patchable_by: %i[system station dealer technician user sub_user]
200
200
 
201
+ field :hidden,
202
+ type: :string,
203
+ sortable: false,
204
+ filterable: true,
205
+ creatable_by: [],
206
+ patchable_by: %i[system]
207
+
208
+ def hidden?
209
+ hidden == '1'
210
+ end
211
+
201
212
  def user_role
202
213
  # pre-alula api users will be u_type 32, newer ones are 96. need to differentiate
203
214
  # between account users and account owners by checking if they own themselves
data/lib/alula/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alula
4
- VERSION = '0.59.0'
4
+ VERSION = '0.62.0'
5
5
  end
data/lib/alula.rb CHANGED
@@ -32,6 +32,7 @@ require_relative 'alula/helpers/device_attribute_translations'
32
32
  require_relative 'alula/resources/billing_program'
33
33
  require_relative 'alula/resources/device'
34
34
  require_relative 'alula/resources/device_charge'
35
+ require_relative 'alula/resources/device_credit'
35
36
  require_relative 'alula/resources/device_event_log'
36
37
  require_relative 'alula/resources/device_cellular_status'
37
38
  require_relative 'alula/resources/device_program'
@@ -43,7 +44,6 @@ require_relative 'alula/resources/event_trigger'
43
44
  require_relative 'alula/resources/event_webhook'
44
45
  require_relative 'alula/resources/self'
45
46
  require_relative 'alula/resources/user'
46
- require_relative 'alula/resources/admin_user'
47
47
  require_relative 'alula/resources/user_phone'
48
48
  require_relative 'alula/resources/user_address'
49
49
  require_relative 'alula/resources/user_pushtoken'
@@ -99,6 +99,7 @@ module Alula
99
99
  Alula::BillingProgram,
100
100
  Alula::Device,
101
101
  Alula::DeviceCharge,
102
+ Alula::DeviceCredit,
102
103
  Alula::DeviceEventLog,
103
104
  Alula::DeviceProgram,
104
105
  Alula::DealerAddress,
@@ -106,7 +107,6 @@ module Alula
106
107
  Alula::DeviceCellularStatus,
107
108
  Alula::Self,
108
109
  Alula::User,
109
- Alula::AdminUser,
110
110
  Alula::UserPhone,
111
111
  Alula::UserAddress,
112
112
  Alula::UserPushtoken,
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: 0.59.0
4
+ version: 0.62.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Johnson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-15 00:00:00.000000000 Z
11
+ date: 2022-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -235,7 +235,6 @@ files:
235
235
  - lib/alula/rate_limit.rb
236
236
  - lib/alula/relationship_attributes.rb
237
237
  - lib/alula/resource_attributes.rb
238
- - lib/alula/resources/admin_user.rb
239
238
  - lib/alula/resources/billing_program.rb
240
239
  - lib/alula/resources/dealer.rb
241
240
  - lib/alula/resources/dealer_account_transfer.rb
@@ -246,6 +245,7 @@ files:
246
245
  - lib/alula/resources/device.rb
247
246
  - lib/alula/resources/device_cellular_status.rb
248
247
  - lib/alula/resources/device_charge.rb
248
+ - lib/alula/resources/device_credit.rb
249
249
  - lib/alula/resources/device_event_log.rb
250
250
  - lib/alula/resources/device_program.rb
251
251
  - lib/alula/resources/event_trigger.rb
@@ -1,207 +0,0 @@
1
- module Alula
2
- class AdminUser < Alula::User
3
- extend Alula::ResourceAttributes
4
- extend Alula::RelationshipAttributes
5
- extend Alula::ApiOperations::Request
6
- extend Alula::ApiOperations::List
7
- extend Alula::ApiOperations::Save
8
-
9
- resource_path 'admins/users'
10
- type 'admins-users'
11
-
12
- relationship :devices, type: 'devices', cardinality: 'To-many'
13
- relationship :dealer, type: 'dealers', cardinality: 'To-one'
14
- relationship :phone, type: 'users-phones', cardinality: 'To-one'
15
- relationship :address, type: 'users-addresses', cardinality: 'To-one'
16
- relationship :pushtokens, type: 'users-pushtokens', cardinality: 'To-many'
17
- relationship :preferences, type: 'users-preferences', cardinality: 'To-one'
18
- relationship :videoprofiles, type: 'users-videoprofiles', cardinality: 'To-many'
19
-
20
- # Resource Fields
21
- # Not all params are used at the moment. See Alula::ResourceAttributes for details
22
- # on how params are parsed,
23
- field :id,
24
- type: :string,
25
- sortable: false,
26
- filterable: false,
27
- creatable_by: [],
28
- patchable_by: []
29
-
30
- field :username,
31
- type: :string,
32
- sortable: true,
33
- filterable: true,
34
- creatable_by: [:system, :station, :dealer, :technician, :user],
35
- patchable_by: [:system, :station, :dealer, :technician, :user, :sub_user]
36
-
37
- field :password,
38
- type: :string,
39
- sortable: false,
40
- filterable: false,
41
- creatable_by: [:system, :station, :dealer, :technician, :user],
42
- patchable_by: []
43
-
44
- field :u_type,
45
- type: :string,
46
- sortable: false,
47
- filterable: true,
48
- creatable_by: [:system, :station, :dealer, :technician, :user],
49
- patchable_by: []
50
-
51
- field :user_type,
52
- type: :string,
53
- sortable: false,
54
- filterable: true,
55
- creatable_by: [:system, :station, :dealer, :technician, :user],
56
- patchable_by: [],
57
- symbolize: true
58
-
59
- field :u_level,
60
- type: :string,
61
- sortable: false,
62
- filterable: false,
63
- creatable_by: [],
64
- patchable_by: []
65
-
66
- field :parent_id,
67
- type: :string,
68
- sortable: false,
69
- filterable: true,
70
- creatable_by: [:system, :station, :dealer, :technician, :user],
71
- patchable_by: []
72
-
73
- field :dealer_id,
74
- type: :string,
75
- sortable: false,
76
- filterable: true,
77
- creatable_by: [:system, :station, :dealer, :technician, :user],
78
- patchable_by: []
79
-
80
- field :station_id,
81
- type: :string,
82
- sortable: false,
83
- filterable: true,
84
- creatable_by: [],
85
- patchable_by: []
86
-
87
- field :last_login,
88
- type: :string,
89
- sortable: false,
90
- filterable: false,
91
- creatable_by: [],
92
- patchable_by: []
93
-
94
- field :date_entered,
95
- type: :date,
96
- sortable: true,
97
- filterable: true,
98
- creatable_by: [],
99
- patchable_by: []
100
-
101
- field :date_modified,
102
- type: :date,
103
- sortable: true,
104
- filterable: true,
105
- creatable_by: [],
106
- patchable_by: []
107
-
108
- field :entered_by,
109
- type: :string,
110
- sortable: false,
111
- filterable: false,
112
- creatable_by: [],
113
- patchable_by: []
114
-
115
- field :modified_by,
116
- type: :string,
117
- sortable: false,
118
- filterable: false,
119
- creatable_by: [],
120
- patchable_by: []
121
-
122
- field :pwch,
123
- type: :string,
124
- sortable: false,
125
- filterable: false,
126
- creatable_by: [],
127
- patchable_by: []
128
-
129
- field :features_selected,
130
- type: :object,
131
- sortable: false,
132
- filterable: false,
133
- creatable_by: [:system, :station, :dealer, :technician],
134
- patchable_by: [:system, :station, :dealer, :technician]
135
-
136
- field :eula,
137
- type: :string,
138
- sortable: false,
139
- filterable: false,
140
- creatable_by: [],
141
- patchable_by: [:system, :station, :dealer, :technician, :user, :sub_user]
142
-
143
- field :def_mod,
144
- type: :string,
145
- sortable: false,
146
- filterable: false,
147
- creatable_by: [],
148
- patchable_by: []
149
-
150
- field :rg_activated,
151
- type: :string,
152
- sortable: false,
153
- filterable: false,
154
- creatable_by: [],
155
- patchable_by: []
156
-
157
- field :company_name,
158
- type: :string,
159
- sortable: false,
160
- filterable: false,
161
- creatable_by: [],
162
- patchable_by: []
163
-
164
- field :name_first,
165
- type: :string,
166
- sortable: true,
167
- filterable: true,
168
- creatable_by: [:system, :station, :dealer, :technician, :user],
169
- patchable_by: [:system, :station, :dealer, :technician, :user, :sub_user]
170
-
171
- field :name_last,
172
- type: :string,
173
- sortable: true,
174
- filterable: true,
175
- creatable_by: [:system, :station, :dealer, :technician, :user],
176
- patchable_by: [:system, :station, :dealer, :technician, :user, :sub_user]
177
-
178
- field :email,
179
- type: :string,
180
- sortable: true,
181
- filterable: true,
182
- creatable_by: [:system, :station, :dealer, :technician, :user],
183
- patchable_by: [:system, :station, :dealer, :technician, :user, :sub_user]
184
-
185
- field :time_offset,
186
- type: :string,
187
- sortable: false,
188
- filterable: false,
189
- creatable_by: [],
190
- patchable_by: []
191
-
192
- field :timezone,
193
- type: :string,
194
- sortable: false,
195
- filterable: false,
196
- creatable_by: [:system, :station, :dealer, :technician, :user],
197
- patchable_by: [:system, :station, :dealer, :technician, :user, :sub_user]
198
-
199
- field :hidden,
200
- type: :boolean,
201
- sortable: true,
202
- filterable: true,
203
- creatable_by: [:system],
204
- patchable_by: [:system]
205
-
206
- end
207
- end