alula-ruby 0.55.0 → 0.58.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: 7c65ba0c26beba1371c3637219cc8e0177f6b2f75d21d74a1f08173f7ddd9ae4
4
- data.tar.gz: f53a3c944df2be8b2db9b6c13caddcf919706de53b38f3c18c7d5621bbb3b48e
3
+ metadata.gz: 911939bc3e4bcf671c33629537486291a1b1788a352ba80b7dae91fcab553eec
4
+ data.tar.gz: 857657d8eaef5dd34c922e47bfeeb722d356d90b6177b290c0453615719f4b0b
5
5
  SHA512:
6
- metadata.gz: c63fd1baee26d1c821a2787fd7f2ab26ed76292e11c74b6148a1f567b1c25a282d28509d3cd3ed4e8be9b55b4f89dfd1e4374377588af2c59e87179975678387
7
- data.tar.gz: 296cde15d36f05120a947fcaaedaf9f8dfe0f95d60bce233178ff84eca65f2c881ab301bf1830594166b8079e445bc3144afc5f2b5147091193014dbdaee397f
6
+ metadata.gz: ac1d5c2a78d373c258d4cfae8428ce9717c099ff9ebef5e8553c4655b50b86de394c5e3bd5fc92eda605e58f3dade181e1faf1130f325f00b4ff568814b0ab8d
7
+ data.tar.gz: 8393d161bd94feb80e86ab313b1bd58bbb8b43f53cca057c0ea679ed137a33fe1dcc7cd3b1fe827fc41b5c5e75212aad95a42346b964561f8f61ae6386bf86bb
data/VERSION.md CHANGED
@@ -87,3 +87,6 @@
87
87
  | v0.53.0 | 2022-06-15 | Filter feature plans on name |
88
88
  | v0.54.0 | 2022-06-21 | Add support for devices from the video API |
89
89
  | v0.55.0 | 2022-06-25 | Add some devices helpers and improves specs |
90
+ | v0.56.0 | 2022-07-08 | Add save! that raises an exception |
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 |
@@ -24,6 +24,10 @@ module Alula
24
24
  handle_errors(response)
25
25
  end
26
26
 
27
+ def save!
28
+ save || raise(ValidationError.new(self.errors))
29
+ end
30
+
27
31
  def create
28
32
  data = {
29
33
  attributes: as_patchable_json
@@ -78,4 +82,4 @@ module Alula
78
82
  end
79
83
  end
80
84
  end
81
- end
85
+ end
@@ -19,6 +19,10 @@ module Alula
19
19
  )
20
20
  end
21
21
 
22
+ def clone
23
+ self.class.new(nil, @raw_data['attributes'])
24
+ end
25
+
22
26
  #
23
27
  # Construct a new resource, ready to receive attributes, with
24
28
  # empty values for all attrs.
data/lib/alula/errors.rb CHANGED
@@ -166,4 +166,12 @@ module Alula
166
166
  false
167
167
  end
168
168
  end
169
+
170
+ class ValidationError < AlulaError
171
+ attr_reader :errors
172
+
173
+ def initialize(errors)
174
+ @errors = errors
175
+ end
176
+ end
169
177
  end
@@ -712,5 +712,12 @@ module Alula
712
712
  filterable: true,
713
713
  creatable_by: [],
714
714
  patchable_by: []
715
+
716
+ field 'features_selected.alula_messenger'.to_sym,
717
+ type: :boolean,
718
+ sortable: false,
719
+ filterable: true,
720
+ creatable_by: [],
721
+ patchable_by: []
715
722
  end
716
723
  end
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.55.0'
4
+ VERSION = '0.58.0'
5
5
  end
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.55.0
4
+ version: 0.58.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-06-27 00:00:00.000000000 Z
11
+ date: 2022-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty