alula-ruby 0.57.0 → 0.60.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 +4 -4
- data/VERSION.md +3 -0
- data/lib/alula/api_resource.rb +4 -0
- data/lib/alula/procedures/feature_plan_clone_proc.rb +48 -0
- data/lib/alula/resources/device_credit.rb +70 -0
- data/lib/alula/version.rb +1 -1
- data/lib/alula.rb +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9a76cd63fcee6932ae7741e92ed420b1df70c8f1241a96fe86b6cd0fdb44062
|
4
|
+
data.tar.gz: aeb4be51fd8ea443e31893791a68528110f9b3044a95f80c0c242dca3a0df179
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f19af99762ca90639aa4fc7a61794362bae766c9916c1b0be94535eeb6708ad8d3396a06f2693d799a3f57fd61c1518116f19087fb11b2ca73141c9751aa85a1
|
7
|
+
data.tar.gz: dda5c947375997cb8e1bc6456e67eea96f60976e83c87e83e8dbfd35e4aa0aba0d020b2ca6efec3ae3ded6b264e1fc8ef8b60c93b1e750505cfa53de1974f12f
|
data/VERSION.md
CHANGED
@@ -89,3 +89,6 @@
|
|
89
89
|
| v0.55.0 | 2022-06-25 | Add some devices helpers and improves specs |
|
90
90
|
| v0.56.0 | 2022-07-08 | Add save! that raises an exception |
|
91
91
|
| v0.57.0 | 2022-07-19 | Add Alula Messenger to device object |
|
92
|
+
| v0.58.0 | 2022-07-21 | Add clone method, that creates a copy of a resource |
|
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 |
|
data/lib/alula/api_resource.rb
CHANGED
@@ -0,0 +1,48 @@
|
|
1
|
+
##
|
2
|
+
# source_gp_id string The source feature id
|
3
|
+
# new_gp_id string New feature id
|
4
|
+
# name string New Feature Plan name
|
5
|
+
# description boolean New Feature Plan description
|
6
|
+
#
|
7
|
+
|
8
|
+
# Method: featurePlans.clone
|
9
|
+
module Alula
|
10
|
+
class FeaturePlanCloneProc < Alula::RpcResource
|
11
|
+
|
12
|
+
class Response < Alula::RpcResponse
|
13
|
+
def initialize(response)
|
14
|
+
super(response)
|
15
|
+
#
|
16
|
+
# This RPC response gives a new FeaturePlan item
|
17
|
+
data = response.data['result'][0]
|
18
|
+
attributes = {
|
19
|
+
id: data['id'],
|
20
|
+
gp_id: data['gp_id'],
|
21
|
+
name: data['name'],
|
22
|
+
description: data['description'],
|
23
|
+
}
|
24
|
+
@data = Alula::FeaturePlan.new(data['id'], attributes)
|
25
|
+
end
|
26
|
+
|
27
|
+
def ok?
|
28
|
+
@result.is_a?(Array) || (@result['errors'].nil? && @result['error'].nil?)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.call(source_gp_id:, new_gp_id:, name:, description: "")
|
33
|
+
payload = {
|
34
|
+
sourceGpId: source_gp_id,
|
35
|
+
newGpId: new_gp_id,
|
36
|
+
name: name,
|
37
|
+
description: description
|
38
|
+
}
|
39
|
+
|
40
|
+
request(
|
41
|
+
http_method: :post,
|
42
|
+
path: '/rpc/v1/features/clone',
|
43
|
+
payload: payload,
|
44
|
+
handler: Response
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -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
|
data/lib/alula/version.rb
CHANGED
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'
|
@@ -74,6 +75,7 @@ require_relative 'alula/procedures/device_unassign_proc'
|
|
74
75
|
require_relative 'alula/procedures/device_signal_add_proc'
|
75
76
|
require_relative 'alula/procedures/device_signal_update_proc'
|
76
77
|
require_relative 'alula/procedures/device_signal_delivered_proc'
|
78
|
+
require_relative 'alula/procedures/feature_plan_clone_proc'
|
77
79
|
require_relative 'alula/procedures/dealer_device_stats_proc'
|
78
80
|
require_relative 'alula/procedures/dealer_suspend_proc'
|
79
81
|
require_relative 'alula/procedures/dealer_restore_proc'
|
@@ -98,6 +100,7 @@ module Alula
|
|
98
100
|
Alula::BillingProgram,
|
99
101
|
Alula::Device,
|
100
102
|
Alula::DeviceCharge,
|
103
|
+
Alula::DeviceCredit,
|
101
104
|
Alula::DeviceEventLog,
|
102
105
|
Alula::DeviceProgram,
|
103
106
|
Alula::DealerAddress,
|
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.
|
4
|
+
version: 0.60.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-
|
11
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -222,6 +222,7 @@ files:
|
|
222
222
|
- lib/alula/procedures/device_signal_update_proc.rb
|
223
223
|
- lib/alula/procedures/device_unassign_proc.rb
|
224
224
|
- lib/alula/procedures/device_unregister_proc.rb
|
225
|
+
- lib/alula/procedures/feature_plan_clone_proc.rb
|
225
226
|
- lib/alula/procedures/upload_touchpad_branding_proc.rb
|
226
227
|
- lib/alula/procedures/user_plansvideo_price_get.rb
|
227
228
|
- lib/alula/procedures/user_transfer_accept.rb
|
@@ -245,6 +246,7 @@ files:
|
|
245
246
|
- lib/alula/resources/device.rb
|
246
247
|
- lib/alula/resources/device_cellular_status.rb
|
247
248
|
- lib/alula/resources/device_charge.rb
|
249
|
+
- lib/alula/resources/device_credit.rb
|
248
250
|
- lib/alula/resources/device_event_log.rb
|
249
251
|
- lib/alula/resources/device_program.rb
|
250
252
|
- lib/alula/resources/event_trigger.rb
|