ruby-miradore 2.1.4 → 2.2.7

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: 67c958b4edfb47eaded9bd961ccda1d2611e68bbd4f3c4a64cf31c549da5ec58
4
- data.tar.gz: 1638439010818c0d5ddef7aac0d3ae4ab8dd098bf8578b239059a2f8e3f68dc0
3
+ metadata.gz: fca67778e21e76a8fb1caa3ce6f8d3afec5ea3da041b67cce2e54948eff504e8
4
+ data.tar.gz: 32a0a508f6149c6b1dbdfa664c9b456bfc6a8aac83dcf4556d412b437e2ac037
5
5
  SHA512:
6
- metadata.gz: 5fca5b899740608d97377df42d0b2e36e6a6eb6606fc5284f6f44a0037eccfb5dcd73c43a6a824615985da2fea0bcb6af8e9367d46a8008c5953f77d1e2f07d3
7
- data.tar.gz: 30961cd5edab5e80416084d2ca51f227ad8a9fe173cbd41b13531ba8b4076265e75e30e7c34f9b7334eeab7c04b29e816e6f31ea0127f9d679a1d1353f36287e
6
+ metadata.gz: 3a92fdc54501ae36f96b1db4a745f258487fbbcf3b17602f9dd080e926d8b63e016f28f7a587d46960616578e2a553472f014f2429d57f0ccd400ffc77077197
7
+ data.tar.gz: 589a6e1121166c520fe9ed9c6cbfe3fbc408d44fd9ebb2f1dc154ccab32c5bc694f5f0893ad0d4fb0f1ace1f8afcd1736a090725f86feca46d871ba0ca67e724
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
  /.idea/
13
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-miradore (2.1.3)
4
+ ruby-miradore (2.2.6)
5
5
  activesupport (~> 6.1)
6
6
  builder (~> 3.1)
7
7
  crack (~> 0.4)
@@ -33,7 +33,7 @@ GEM
33
33
  httparty (0.20.0)
34
34
  mime-types (~> 3.0)
35
35
  multi_xml (>= 0.5.2)
36
- i18n (1.8.10)
36
+ i18n (1.8.11)
37
37
  concurrent-ruby (~> 1.0)
38
38
  mime-types (3.3.1)
39
39
  mime-types-data (~> 3.2015)
@@ -60,7 +60,7 @@ GEM
60
60
  rspec-mocks (3.10.2)
61
61
  diff-lcs (>= 1.2.0, < 2.0)
62
62
  rspec-support (~> 3.10.0)
63
- rspec-support (3.10.2)
63
+ rspec-support (3.10.3)
64
64
  rubocop (1.22.3)
65
65
  parallel (~> 1.10)
66
66
  parser (>= 3.0.0.0)
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://rzilient.online.miradore.com/API/v2/Device/1/location
5
+ uri: https://test634.online.miradore.com/API/v2/Device/13/location
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: "{}"
@@ -30,11 +30,11 @@ http_interactions:
30
30
  - SAMEORIGIN
31
31
  - SAMEORIGIN
32
32
  Date:
33
- - Fri, 29 Oct 2021 13:37:42 GMT
33
+ - Wed, 03 Nov 2021 10:37:03 GMT
34
34
  Content-Length:
35
- - '172'
35
+ - '173'
36
36
  body:
37
37
  encoding: UTF-8
38
- string: '{"assetID":1,"latitude":"41.37585082964286","longitude":"2.1679796580995383","fixTime":"2021-10-22T16:37:22","streetAddress":null,"zipCode":null,"city":null,"country":null}'
39
- recorded_at: Fri, 29 Oct 2021 13:37:40 GMT
38
+ string: '{"assetID":13,"latitude":"41.37582201297043","longitude":"2.1679371917816916","fixTime":"2021-11-03T10:26:09","streetAddress":null,"zipCode":null,"city":null,"country":null}'
39
+ recorded_at: Wed, 03 Nov 2021 10:37:04 GMT
40
40
  recorded_with: VCR 6.0.0
@@ -0,0 +1,41 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test634.online.miradore.com/API/v2/Device//
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"category":"Screens","manufacturer":"Apple","model":"AirPods Max","identifier":"34FGH45942FKL6","friendlyName":"airpod","userEmailAddress":"eduard@rzilient.club","ownership":"Unknown","ownershipStartDate":"2021-11-03
9
+ 09:19:04 +0100","organization":["Rzilient"],"location":["Barcelona"],"tags":["Accessories"],"customAttributes":{"contact":"Eduard"}}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept:
14
+ - application/json
15
+ X-Api-Key:
16
+ -
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ User-Agent:
20
+ - Ruby
21
+ response:
22
+ status:
23
+ code: 201
24
+ message: Created
25
+ headers:
26
+ Content-Type:
27
+ - application/json; charset=utf-8
28
+ Server:
29
+ - Microsoft-IIS/10.0
30
+ X-Frame-Options:
31
+ - SAMEORIGIN
32
+ - SAMEORIGIN
33
+ Date:
34
+ - Wed, 03 Nov 2021 08:19:05 GMT
35
+ Content-Length:
36
+ - '2'
37
+ body:
38
+ encoding: UTF-8
39
+ string: '12'
40
+ recorded_at: Wed, 03 Nov 2021 08:19:05 GMT
41
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://test634.online.miradore.com/API/Device?auth=&filters=(InvDevice.SerialNumber%20eq%2087DB6H2)&select=*,*
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ X-Api-Key:
15
+ - ''
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Cache-Control:
26
+ - no-cache
27
+ Pragma:
28
+ - no-cache
29
+ Content-Type:
30
+ - text/xml
31
+ Expires:
32
+ - "-1"
33
+ Vary:
34
+ - Accept-Encoding
35
+ Server:
36
+ - Microsoft-IIS/10.0
37
+ X-Aspnet-Version:
38
+ - 4.0.30319
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ Date:
42
+ - Wed, 03 Nov 2021 09:25:17 GMT
43
+ Content-Length:
44
+ - '995'
45
+ body:
46
+ encoding: ASCII-8BIT
47
+ string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="4"><Device><ID>2</ID><User><ID>1</ID></User><Enrollment><ID>6</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>04.10.2021
48
+ 10:00:00</LastReported><LastReportedDays>30</LastReportedDays><LastReportedHours>719</LastReportedHours><LastReportedMinutes>43165</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.13</LocalIPAddress><MACAddress>D4:81:D7:F8:52:85</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
49
+ 10 Pro (20H2)</OSVersionName><Client><ID>2</ID></Client><ConfigProfileDeployments
50
+ /><Status>Deleted</Status><Created>13.08.2021 13:19:37</Created><Modified>04.10.2021
51
+ 09:58:05</Modified><Source>MiradoreOnline</Source></Device><Device><ID>3</ID><Enrollment><ID>13</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>04.10.2021
52
+ 10:10:00</LastReported><LastReportedDays>30</LastReportedDays><LastReportedHours>719</LastReportedHours><LastReportedMinutes>43155</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.13</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
53
+ 10 Professionnel (20H2)</OSVersionName><Client><ID>3</ID></Client><ConfigProfileDeployments
54
+ /><Status>Deleted</Status><Created>04.10.2021 10:07:03</Created><Modified>05.10.2021
55
+ 16:16:52</Modified><Source>MiradoreOnline</Source></Device><Device><ID>4</ID><Enrollment><ID>17</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>12.10.2021
56
+ 10:51:10</LastReported><LastReportedDays>22</LastReportedDays><LastReportedHours>527</LastReportedHours><LastReportedMinutes>31594</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.16</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
57
+ 10 Pro (20H2)</OSVersionName><Client><ID>4</ID></Client><ConfigProfileDeployments
58
+ /><Status>Deleted</Status><Created>04.10.2021 10:26:25</Created><Modified>12.10.2021
59
+ 10:50:17</Modified><Source>MiradoreOnline</Source></Device><Device><ID>9</ID><User><ID>2</ID></User><Location><ID>1</ID></Location><Category><ID>3</ID></Category><Enrollment><ID>36</ID></Enrollment><OnlineStatus>Active</OnlineStatus><LastReported>02.11.2021
60
+ 13:40:06</LastReported><LastReportedDays>1</LastReportedDays><LastReportedHours>20</LastReportedHours><LastReportedMinutes>1185</LastReportedMinutes><IPAddress>185.212.21.34</IPAddress><LocalIPAddress>172.18.193.32</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><PurchaseDate>03.11.2021
61
+ 00:00:00</PurchaseDate><OSVersionName>Windows 10 Pro (20H2)</OSVersionName><Client><ID>9</ID></Client><ConfigProfileDeployments><ConfigProfileDeployment><ID>1</ID><ConfigProfile><ID>7</ID></ConfigProfile></ConfigProfileDeployment></ConfigProfileDeployments><Status>Active</Status><Created>27.10.2021
62
+ 08:10:37</Created><Modified>03.11.2021 09:16:54</Modified><Source>MiradoreOnline</Source></Device></Items></Content>
63
+ recorded_at: Wed, 03 Nov 2021 09:25:18 GMT
64
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,62 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://test634.online.miradore.com/API/Device?auth=1_8,Yo-TV8QyCiBUF&filters=(InvDevice.SerialNumber%20eq%2087DB6H2)&select=*,*
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Cache-Control:
24
+ - no-cache
25
+ Pragma:
26
+ - no-cache
27
+ Content-Type:
28
+ - text/xml
29
+ Expires:
30
+ - "-1"
31
+ Vary:
32
+ - Accept-Encoding
33
+ Server:
34
+ - Microsoft-IIS/10.0
35
+ X-Aspnet-Version:
36
+ - 4.0.30319
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ Date:
40
+ - Wed, 03 Nov 2021 13:29:28 GMT
41
+ Content-Length:
42
+ - '979'
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="4"><Device><ID>2</ID><User><ID>1</ID></User><Enrollment><ID>6</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>04.10.2021
46
+ 10:00:00</LastReported><LastReportedDays>30</LastReportedDays><LastReportedHours>723</LastReportedHours><LastReportedMinutes>43409</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.13</LocalIPAddress><MACAddress>D4:81:D7:F8:52:85</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
47
+ 10 Pro (20H2)</OSVersionName><Client><ID>2</ID></Client><ConfigProfileDeployments
48
+ /><Status>Deleted</Status><Created>13.08.2021 13:19:37</Created><Modified>04.10.2021
49
+ 09:58:05</Modified><Source>MiradoreOnline</Source></Device><Device><ID>3</ID><Enrollment><ID>13</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>04.10.2021
50
+ 10:10:00</LastReported><LastReportedDays>30</LastReportedDays><LastReportedHours>723</LastReportedHours><LastReportedMinutes>43399</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.13</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
51
+ 10 Professionnel (20H2)</OSVersionName><Client><ID>3</ID></Client><ConfigProfileDeployments
52
+ /><Status>Deleted</Status><Created>04.10.2021 10:07:03</Created><Modified>05.10.2021
53
+ 16:16:52</Modified><Source>MiradoreOnline</Source></Device><Device><ID>4</ID><Enrollment><ID>17</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>12.10.2021
54
+ 10:51:10</LastReported><LastReportedDays>22</LastReportedDays><LastReportedHours>531</LastReportedHours><LastReportedMinutes>31838</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.16</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
55
+ 10 Pro (20H2)</OSVersionName><Client><ID>4</ID></Client><ConfigProfileDeployments
56
+ /><Status>Deleted</Status><Created>04.10.2021 10:26:25</Created><Modified>12.10.2021
57
+ 10:50:17</Modified><Source>MiradoreOnline</Source></Device><Device><ID>9</ID><User><ID>4</ID></User><Location><ID>1</ID></Location><Category><ID>3</ID></Category><Enrollment><ID>36</ID></Enrollment><OnlineStatus>Active</OnlineStatus><LastReported>03.11.2021
58
+ 11:04:00</LastReported><LastReportedDays>0</LastReportedDays><LastReportedHours>2</LastReportedHours><LastReportedMinutes>145</LastReportedMinutes><IPAddress>185.212.21.34</IPAddress><LocalIPAddress>172.18.193.32</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><PurchaseDate>03.11.2021
59
+ 00:00:00</PurchaseDate><OSVersionName>Windows 10 Pro (20H2)</OSVersionName><Client><ID>9</ID></Client><ConfigProfileDeployments><ConfigProfileDeployment><ID>1</ID><ConfigProfile><ID>7</ID></ConfigProfile></ConfigProfileDeployment></ConfigProfileDeployments><Status>Active</Status><Created>27.10.2021
60
+ 08:10:37</Created><Modified>03.11.2021 11:09:57</Modified><Source>MiradoreOnline</Source></Device></Items></Content>
61
+ recorded_at: Wed, 03 Nov 2021 13:29:28 GMT
62
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,39 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: patch
5
+ uri: https://test634.online.miradore.com/API/v2/Device/9/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"category":"Laptops","friendlyname":"Eduard personal","userEmailAddress":"eduard@rzilient.club","location":["Barcelona"],"tags":["Personal"],"ownershipStartDate":"2021-11-03
9
+ 10:25:18 +0100"}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept:
14
+ - application/json
15
+ X-Api-Key:
16
+ -
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ User-Agent:
20
+ - Ruby
21
+ response:
22
+ status:
23
+ code: 200
24
+ message: OK
25
+ headers:
26
+ Server:
27
+ - Microsoft-IIS/10.0
28
+ X-Frame-Options:
29
+ - SAMEORIGIN
30
+ - SAMEORIGIN
31
+ Date:
32
+ - Wed, 03 Nov 2021 09:25:18 GMT
33
+ Content-Length:
34
+ - '0'
35
+ body:
36
+ encoding: UTF-8
37
+ string: ''
38
+ recorded_at: Wed, 03 Nov 2021 09:25:19 GMT
39
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://test634.online.miradore.com/API/v2/Device/9/category
6
+ body:
7
+ encoding: UTF-8
8
+ string: '"Laptops"'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ X-Api-Key:
15
+ -
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Server:
28
+ - Microsoft-IIS/10.0
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ - SAMEORIGIN
32
+ Date:
33
+ - Wed, 03 Nov 2021 10:48:33 GMT
34
+ Content-Length:
35
+ - '81'
36
+ body:
37
+ encoding: UTF-8
38
+ string: '{"categoryID":3,"name":"Laptops","description":null,"deviceCount":2,"image":null}'
39
+ recorded_at: Wed, 03 Nov 2021 10:48:34 GMT
40
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://test634.online.miradore.com/API/v2/Device/9/model
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"model":"test"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ X-Api-Key:
15
+ - 1_8,Yo-TV8QyCiBUF
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 400
23
+ message: Bad Request
24
+ headers:
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Server:
28
+ - Microsoft-IIS/10.0
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ - SAMEORIGIN
32
+ Date:
33
+ - Wed, 03 Nov 2021 13:30:26 GMT
34
+ Content-Length:
35
+ - '2'
36
+ body:
37
+ encoding: UTF-8
38
+ string: "{}"
39
+ recorded_at: Wed, 03 Nov 2021 13:30:27 GMT
40
+ recorded_with: VCR 6.0.0
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ruby
4
4
  module Miradore
5
- VERSION = "2.1.4"
5
+ VERSION = "2.2.7"
6
6
  end
7
7
  end
data/lib/ruby/miradore.rb CHANGED
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "miradore/version"
4
+ require "active_support/core_ext/hash/conversions"
4
5
  require "httparty"
5
6
  require "json"
6
7
  require "crack/xml"
7
- require "active_support/core_ext/hash/conversions"
8
8
  require "finest/builder"
9
9
 
10
+
10
11
  module Ruby
11
12
  module Miradore
12
13
 
@@ -24,11 +25,13 @@ module Ruby
24
25
  format :json
25
26
 
26
27
  attr_writer :subdomain, :auth
28
+ attr_accessor :json
27
29
 
28
30
  def initialize(json = {})
29
31
  super json
30
32
  @subdomain ||= json[:subdomain]
31
33
  @auth ||= json[:auth]
34
+ @json ||= json.to_json
32
35
  remove_instance_variable(:@subdomain) if @subdomain.nil?
33
36
  remove_instance_variable(:@auth) if @auth.nil?
34
37
  end
@@ -48,11 +51,11 @@ module Ruby
48
51
  )
49
52
  end
50
53
 
51
- def add(**args)
54
+ def call(**args)
52
55
  transform(
53
56
  Crack::XML.parse(
54
- http_method(args.merge(method: :post, attribute: "ID")).body
55
- )
57
+ http_method(args.merge( attribute: "ID")).body
58
+ )["Content"]
56
59
  )
57
60
  end
58
61
 
@@ -60,12 +63,12 @@ module Ruby
60
63
 
61
64
  def http_method(**args)
62
65
  url = Miradore.url[version] % args.merge(
63
- item: to_s.demodulize,
66
+ item: to_s.split("::").last,
64
67
  attribute: args.fetch(:attribute, "*"),
65
68
  auth: args.fetch(:auth, nil),
66
69
  filter: args.fetch(:filter, nil)
67
70
  )
68
- method(args.fetch(:method, :get)).call(url, body: args.fetch(:body, nil)&.to_xml(root: "Content"))
71
+ method(args.fetch(:method, :get)).call(url, body: args.fetch(:body, nil)&.to_xml(root: "Content", skip_types: true))
69
72
  end
70
73
 
71
74
  private
@@ -78,7 +81,7 @@ module Ruby
78
81
  end
79
82
  const_get(to_s).new(args.merge(res.values.first&.transform_keys(&:downcase)))
80
83
  rescue StandardError
81
- { error: "#{to_s.demodulize}(s) not found", status: :not_found }
84
+ { error: "#{to_s.split("::").last}(s) not found", status: :not_found }
82
85
  end
83
86
 
84
87
  def version
@@ -119,8 +122,12 @@ module Ruby
119
122
  http_method(args.merge(method: :get, action: __method__))
120
123
  end
121
124
 
122
- def patch(**args)
123
- http_method(args.merge(method: :patch))
125
+ def family(**args)
126
+ http_method(args.merge(method: :put, action: :category))
127
+ end
128
+
129
+ def model(**args)
130
+ http_method(args.merge(method: :put, action: __method__))
124
131
  end
125
132
 
126
133
  def device_serial_number
@@ -139,6 +146,14 @@ module Ruby
139
146
  !!invdevice&.imei
140
147
  end
141
148
 
149
+ def patch(**args)
150
+ http_method(args.merge(method: __method__))
151
+ end
152
+
153
+ def post(**args)
154
+ http_method(args.merge(method: __method__))
155
+ end
156
+
142
157
  private
143
158
 
144
159
  def http_method(**args)
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-miradore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduard Garcia Castelló
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-02 00:00:00.000000000 Z
11
+ date: 2021-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -150,16 +150,25 @@ files:
150
150
  - fixtures/vcr_cassettes/Get__Mobile_Device.yml
151
151
  - fixtures/vcr_cassettes/InvDevice.yml
152
152
  - fixtures/vcr_cassettes/LockDevice_all.yml
153
+ - fixtures/vcr_cassettes/add_new_other_device.yml
153
154
  - fixtures/vcr_cassettes/all_criteria.yml
154
155
  - fixtures/vcr_cassettes/auth_not_found.yml
155
156
  - fixtures/vcr_cassettes/error_by_serial_number.yml
156
157
  - fixtures/vcr_cassettes/full_list_and_details.yml
158
+ - fixtures/vcr_cassettes/get_computer_device_to_update.yml
159
+ - fixtures/vcr_cassettes/get_computer_device_to_update_2.yml
157
160
  - fixtures/vcr_cassettes/get_location.yml
158
161
  - fixtures/vcr_cassettes/get_user_from_miradore.yml
159
162
  - fixtures/vcr_cassettes/search_by_serial_number.yml
163
+ - fixtures/vcr_cassettes/update_model_of_a_computer_device.yml
164
+ - fixtures/vcr_cassettes/update_model_of_a_computer_device_v2.yml
165
+ - fixtures/vcr_cassettes/update_model_of_a_computer_device_v2_2.yml
160
166
  - fixtures/vcr_cassettes/user_alredy_exist_in_miradore.yml
161
167
  - lib/ruby/miradore.rb
162
168
  - lib/ruby/miradore/version.rb
169
+ - ruby-miradore-2.0.1.gem
170
+ - ruby-miradore-2.0.2.gem
171
+ - ruby-miradore-2.1.2.gem
163
172
  - ruby-miradore.gemspec
164
173
  homepage: https://github.com/eddygarcas/ruby-miradore
165
174
  licenses: