drone_view_api 0.1.2 → 0.1.5

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: 07327bbcea7b1b0027da10f67071d182f2430ca84169105c217225f2abe24b6c
4
- data.tar.gz: efa3bbf51d6a83788fdab53e9732ebb21d4a8a996376d3f135c3f1d4955ca770
3
+ metadata.gz: 8d93d76bdcca6d2748e0eef31b5f09f7c4857ee623b4edfda918d3252a1be647
4
+ data.tar.gz: a3a70fb01a1ce776c90a6241a8f67695c5b4abb4148fcf19f5cce57d8ac66fac
5
5
  SHA512:
6
- metadata.gz: 5f6df4a17000cbc2e617f46518b6273e6c970db6a16b1c00021a42272a4575f10bf371b430fbaaf6408be24ac74e516edc30ca2173ef24e01ba98417dca7a688
7
- data.tar.gz: ef6aaa50d50ce2f97d45275cafceae10f0f146208ee433968e2a791bb99fd15a2847e61d994464a068959021df918a8e7ed2a1e1dc91f081aaade2efd442af8b
6
+ metadata.gz: 3cf43bd92de59cf2afa85df4f521f631c60d501cda40e1a38d72b413d9d71655d64f4af9ac97d878082afcb882bccd34fcf766e9364bd3532f604405c467217d
7
+ data.tar.gz: 4517ca63212509e605c95f8113fe13a8f6aba42c000d84729ed04bd4ddf2cd0d5fa1da986626f5c8162de858be2f36ba714a6cff72e4172c82e93179439616e6
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- drone_api (0.1.0)
4
+ drone_view_api (0.1.3)
5
+ jwt
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
@@ -30,7 +31,7 @@ PLATFORMS
30
31
 
31
32
  DEPENDENCIES
32
33
  byebug
33
- drone_api!
34
+ drone_view_api!
34
35
  json
35
36
  jwt
36
37
  rake (~> 12.0)
@@ -0,0 +1,44 @@
1
+ class DroneApi::Inspections::Create < DroneApi::Base
2
+ Params = Struct.new(
3
+ :name,
4
+ :inspection_date,
5
+ :building,
6
+ :building_id,
7
+ :client_id,
8
+ keyword_init: true
9
+ )
10
+
11
+ def initialize params={}
12
+ super()
13
+ @params = Params.new(params)
14
+ end
15
+
16
+ def process_response response
17
+ @response_data = JSON.parse(response)
18
+ end
19
+
20
+ private
21
+
22
+ def validate
23
+ @errors['name'] << 'Can\'t be blank' if @params.name.to_s.empty?
24
+ end
25
+
26
+ def api_path
27
+ "/api/v2/inspections"
28
+ end
29
+
30
+ def request_type
31
+ 'POST'
32
+ end
33
+
34
+ def payload
35
+ {
36
+ inspection: {
37
+ name: @params.email,
38
+ inspection_date: @params.inspection_date,
39
+ building: @params.building_id,
40
+ building: @params.building
41
+ }
42
+ }
43
+ end
44
+ end
@@ -0,0 +1,5 @@
1
+ module DroneApi::Inspections
2
+
3
+ end
4
+
5
+ require 'drone_api/inspections/create'
@@ -1,3 +1,3 @@
1
1
  module DroneApi
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.5"
3
3
  end
data/lib/drone_api.rb CHANGED
@@ -198,3 +198,4 @@ require 'drone_api/auth'
198
198
  require 'drone_api/accounts'
199
199
  require 'drone_api/clients'
200
200
  require 'drone_api/buildings'
201
+ require 'drone_api/inspections'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drone_view_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - saurabh gulati
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-03-16 00:00:00.000000000 Z
12
+ date: 2022-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jwt
@@ -58,6 +58,8 @@ files:
58
58
  - lib/drone_api/clients.rb
59
59
  - lib/drone_api/clients/create.rb
60
60
  - lib/drone_api/clients/show.rb
61
+ - lib/drone_api/inspections.rb
62
+ - lib/drone_api/inspections/create.rb
61
63
  - lib/drone_api/version.rb
62
64
  homepage: http://app.droneviewpro.com
63
65
  licenses: