test-pack-1 1.0.0 → 1.0.2

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -768
  3. data/lib/test_pack_1.rb +2 -30
  4. data/lib/test_pack_1/configuration.rb +5 -17
  5. data/lib/test_pack_1/controllers/simple_calculator_controller.rb +53 -0
  6. data/lib/test_pack_1/models/operation_type_enum.rb +23 -0
  7. data/lib/test_pack_1/test_pack1_client.rb +4 -34
  8. data/test/controllers/test_simple_calculator_controller.rb +33 -0
  9. metadata +6 -64
  10. data/lib/test_pack_1/controllers/alerts_controller.rb +0 -381
  11. data/lib/test_pack_1/controllers/assets_controller.rb +0 -227
  12. data/lib/test_pack_1/controllers/configuration_data_controller.rb +0 -76
  13. data/lib/test_pack_1/controllers/data_controller.rb +0 -349
  14. data/lib/test_pack_1/controllers/statuses_controller.rb +0 -215
  15. data/lib/test_pack_1/http/auth/custom_query_auth.rb +0 -16
  16. data/lib/test_pack_1/models/aggregate_mode_enum.rb +0 -23
  17. data/lib/test_pack_1/models/alert_item.rb +0 -104
  18. data/lib/test_pack_1/models/calculation_mode_enum.rb +0 -20
  19. data/lib/test_pack_1/models/client_configuration.rb +0 -62
  20. data/lib/test_pack_1/models/configuration_item.rb +0 -55
  21. data/lib/test_pack_1/models/data_item.rb +0 -92
  22. data/lib/test_pack_1/models/data_per_category_item.rb +0 -82
  23. data/lib/test_pack_1/models/data_per_category_response.rb +0 -63
  24. data/lib/test_pack_1/models/data_real_time_item.rb +0 -83
  25. data/lib/test_pack_1/models/data_signal.rb +0 -53
  26. data/lib/test_pack_1/models/data_signal_configuration.rb +0 -66
  27. data/lib/test_pack_1/models/data_signal_item.rb +0 -62
  28. data/lib/test_pack_1/models/device.rb +0 -208
  29. data/lib/test_pack_1/models/device_model.rb +0 -53
  30. data/lib/test_pack_1/models/metadata_field.rb +0 -44
  31. data/lib/test_pack_1/models/power_curve.rb +0 -60
  32. data/lib/test_pack_1/models/power_curve_value.rb +0 -44
  33. data/lib/test_pack_1/models/resolution_enum.rb +0 -41
  34. data/lib/test_pack_1/models/site.rb +0 -44
  35. data/lib/test_pack_1/models/site_with_data.rb +0 -78
  36. data/lib/test_pack_1/models/status_category_enum.rb +0 -26
  37. data/lib/test_pack_1/models/status_item.rb +0 -161
  38. data/lib/test_pack_1/models/time_zone_configuration.rb +0 -76
  39. data/lib/test_pack_1/models/turbine_type.rb +0 -89
  40. data/test/controllers/test_assets_controller.rb +0 -46
  41. data/test/controllers/test_configuration_data_controller.rb +0 -44
@@ -1,44 +0,0 @@
1
- # test_pack_1
2
- #
3
- # This file was automatically generated by APIMATIC v2.0 (
4
- # https://apimatic.io ).
5
-
6
- module TestPack1
7
- # Site Model.
8
- class Site < BaseModel
9
- # The id of a site.
10
- # @return [Integer]
11
- attr_accessor :site_id
12
-
13
- # The id of a site.
14
- # @return [String]
15
- attr_accessor :title
16
-
17
- # A mapping from model property names to API property names.
18
- def self.names
19
- @_hash = {} if @_hash.nil?
20
- @_hash['site_id'] = 'siteId'
21
- @_hash['title'] = 'title'
22
- @_hash
23
- end
24
-
25
- def initialize(site_id = nil,
26
- title = nil)
27
- @site_id = site_id
28
- @title = title
29
- end
30
-
31
- # Creates an instance of the object from a hash.
32
- def self.from_hash(hash)
33
- return nil unless hash
34
-
35
- # Extract variables from the hash.
36
- site_id = hash['siteId']
37
- title = hash['title']
38
-
39
- # Create object from extracted values.
40
- Site.new(site_id,
41
- title)
42
- end
43
- end
44
- end
@@ -1,78 +0,0 @@
1
- # test_pack_1
2
- #
3
- # This file was automatically generated by APIMATIC v2.0 (
4
- # https://apimatic.io ).
5
-
6
- module TestPack1
7
- # SiteWithData Model.
8
- class SiteWithData < BaseModel
9
- # The id of a site.
10
- # @return [Integer]
11
- attr_accessor :site_id
12
-
13
- # The id of a site.
14
- # @return [String]
15
- attr_accessor :title
16
-
17
- # The id of a site.
18
- # @return [String]
19
- attr_accessor :country
20
-
21
- # The id of a site.
22
- # @return [String]
23
- attr_accessor :identity
24
-
25
- # A list of metadata fields and their values.
26
- # @return [List of MetadataField]
27
- attr_accessor :metadata
28
-
29
- # A mapping from model property names to API property names.
30
- def self.names
31
- @_hash = {} if @_hash.nil?
32
- @_hash['site_id'] = 'siteId'
33
- @_hash['title'] = 'title'
34
- @_hash['country'] = 'country'
35
- @_hash['identity'] = 'identity'
36
- @_hash['metadata'] = 'metadata'
37
- @_hash
38
- end
39
-
40
- def initialize(site_id = nil,
41
- title = nil,
42
- country = nil,
43
- identity = nil,
44
- metadata = nil)
45
- @site_id = site_id
46
- @title = title
47
- @country = country
48
- @identity = identity
49
- @metadata = metadata
50
- end
51
-
52
- # Creates an instance of the object from a hash.
53
- def self.from_hash(hash)
54
- return nil unless hash
55
-
56
- # Extract variables from the hash.
57
- site_id = hash['siteId']
58
- title = hash['title']
59
- country = hash['country']
60
- identity = hash['identity']
61
- # Parameter is an array, so we need to iterate through it
62
- metadata = nil
63
- unless hash['metadata'].nil?
64
- metadata = []
65
- hash['metadata'].each do |structure|
66
- metadata << (MetadataField.from_hash(structure) if structure)
67
- end
68
- end
69
-
70
- # Create object from extracted values.
71
- SiteWithData.new(site_id,
72
- title,
73
- country,
74
- identity,
75
- metadata)
76
- end
77
- end
78
- end
@@ -1,26 +0,0 @@
1
- # test_pack_1
2
- #
3
- # This file was automatically generated by APIMATIC v2.0 (
4
- # https://apimatic.io ).
5
-
6
- module TestPack1
7
- # The category a status belongs to.
8
- class StatusCategoryEnum
9
- STATUS_CATEGORY_ENUM = [
10
- # TODO: Write general description for STOP
11
- STOP = 'stop'.freeze,
12
-
13
- # TODO: Write general description for WARNING
14
- WARNING = 'warning'.freeze,
15
-
16
- # TODO: Write general description for INFORMATIONAL
17
- INFORMATIONAL = 'informational'.freeze,
18
-
19
- # TODO: Write general description for COMMUNICATION
20
- COMMUNICATION = 'communication'.freeze,
21
-
22
- # TODO: Write general description for CURTAILMENT
23
- CURTAILMENT = 'curtailment'.freeze
24
- ].freeze
25
- end
26
- end
@@ -1,161 +0,0 @@
1
- # test_pack_1
2
- #
3
- # This file was automatically generated by APIMATIC v2.0 (
4
- # https://apimatic.io ).
5
-
6
- require 'date'
7
- module TestPack1
8
- # A status that may contain statuses of the same type as sub-statuses. Note
9
- # that for sub-statuses the fields `categoryIec`, `categoryContract`, and
10
- # `subStatus` will always be null.
11
- class StatusItem < BaseModel
12
- # The id of the device affected by the status.
13
- # @return [Integer]
14
- attr_accessor :device_id
15
-
16
- # The timestamp when the status began. The timestamp is in your
17
- # system-configured time zone without UTC offset.
18
- # @return [DateTime]
19
- attr_accessor :timestamp_start
20
-
21
- # The timestamp when the status ended. The timestamp is in your
22
- # system-configured time zone without UTC offset.
23
- # @return [DateTime]
24
- attr_accessor :timestamp_end
25
-
26
- # Indicates whether the status has a duration.
27
- # @return [Boolean]
28
- attr_accessor :has_timestamp_end
29
-
30
- # The category a status belongs to.
31
- # @return [StatusCategoryEnum]
32
- attr_accessor :category
33
-
34
- # The status code.
35
- # @return [Float]
36
- attr_accessor :code
37
-
38
- # A description of the status code.
39
- # @return [String]
40
- attr_accessor :message
41
-
42
- # A user comment associated with the status.
43
- # @return [String]
44
- attr_accessor :comment
45
-
46
- # The lost production in kWh associated with the status. This field
47
- # will be null if the caller is not authorized for the system-configured
48
- # lost production signal. The configured lost production signal is available
49
- # via the `/configuration.json` endpoint (`DataSignalConfiguration` schema).
50
- # @return [Float]
51
- attr_accessor :lost_production
52
-
53
- # The status category as defined by the IEC.
54
- # @return [String]
55
- attr_accessor :category_iec
56
-
57
- # The status category as defined the availability contract assigned to the
58
- # site.
59
- # @return [Object]
60
- attr_accessor :category_contract
61
-
62
- # Statuses of the same type that have been grouped under this status.
63
- # @return [List of StatusItem]
64
- attr_accessor :sub_status
65
-
66
- # Indicates whether the status has been acknowledged.
67
- # @return [Boolean]
68
- attr_accessor :acknowledged
69
-
70
- # A mapping from model property names to API property names.
71
- def self.names
72
- @_hash = {} if @_hash.nil?
73
- @_hash['device_id'] = 'deviceId'
74
- @_hash['timestamp_start'] = 'timestampStart'
75
- @_hash['timestamp_end'] = 'timestampEnd'
76
- @_hash['has_timestamp_end'] = 'hasTimestampEnd'
77
- @_hash['category'] = 'category'
78
- @_hash['code'] = 'code'
79
- @_hash['message'] = 'message'
80
- @_hash['comment'] = 'comment'
81
- @_hash['lost_production'] = 'lostProduction'
82
- @_hash['category_iec'] = 'categoryIec'
83
- @_hash['category_contract'] = 'categoryContract'
84
- @_hash['sub_status'] = 'subStatus'
85
- @_hash['acknowledged'] = 'acknowledged'
86
- @_hash
87
- end
88
-
89
- def initialize(device_id = nil,
90
- timestamp_start = nil,
91
- timestamp_end = nil,
92
- has_timestamp_end = nil,
93
- category = nil,
94
- code = nil,
95
- message = nil,
96
- comment = nil,
97
- lost_production = nil,
98
- category_iec = nil,
99
- category_contract = nil,
100
- sub_status = nil,
101
- acknowledged = nil)
102
- @device_id = device_id
103
- @timestamp_start = timestamp_start
104
- @timestamp_end = timestamp_end
105
- @has_timestamp_end = has_timestamp_end
106
- @category = category
107
- @code = code
108
- @message = message
109
- @comment = comment
110
- @lost_production = lost_production
111
- @category_iec = category_iec
112
- @category_contract = category_contract
113
- @sub_status = sub_status
114
- @acknowledged = acknowledged
115
- end
116
-
117
- # Creates an instance of the object from a hash.
118
- def self.from_hash(hash)
119
- return nil unless hash
120
-
121
- # Extract variables from the hash.
122
- device_id = hash['deviceId']
123
- timestamp_start = APIHelper.rfc3339(hash['timestampStart']) if
124
- hash['timestampStart']
125
- timestamp_end = APIHelper.rfc3339(hash['timestampEnd']) if
126
- hash['timestampEnd']
127
- has_timestamp_end = hash['hasTimestampEnd']
128
- category = hash['category']
129
- code = hash['code']
130
- message = hash['message']
131
- comment = hash['comment']
132
- lost_production = hash['lostProduction']
133
- category_iec = hash['categoryIec']
134
- category_contract = hash['categoryContract']
135
- # Parameter is an array, so we need to iterate through it
136
- sub_status = nil
137
- unless hash['subStatus'].nil?
138
- sub_status = []
139
- hash['subStatus'].each do |structure|
140
- sub_status << (StatusItem.from_hash(structure) if structure)
141
- end
142
- end
143
- acknowledged = hash['acknowledged']
144
-
145
- # Create object from extracted values.
146
- StatusItem.new(device_id,
147
- timestamp_start,
148
- timestamp_end,
149
- has_timestamp_end,
150
- category,
151
- code,
152
- message,
153
- comment,
154
- lost_production,
155
- category_iec,
156
- category_contract,
157
- sub_status,
158
- acknowledged)
159
- end
160
- end
161
- end
@@ -1,76 +0,0 @@
1
- # test_pack_1
2
- #
3
- # This file was automatically generated by APIMATIC v2.0 (
4
- # https://apimatic.io ).
5
-
6
- require 'date'
7
- module TestPack1
8
- # your system-configured time zone configuration.
9
- class TimeZoneConfiguration < BaseModel
10
- # The title of the time zone.
11
- # @return [String]
12
- attr_accessor :title
13
-
14
- # The UTC offset for the time zone.
15
- # @return [Float]
16
- attr_accessor :utc_offset
17
-
18
- # The UTC offset for the time zone during daylight savings time.
19
- # @return [Float]
20
- attr_accessor :utc_offset_dst
21
-
22
- # The start of daylight savings time in the time zone. This timestamp is
23
- # given in the UTC time zone.
24
- # @return [DateTime]
25
- attr_accessor :dst_timestamp_start
26
-
27
- # The end of daylight savings time in the time zone. This timestamp is given
28
- # in the UTC time zone.
29
- # @return [DateTime]
30
- attr_accessor :dst_timestamp_end
31
-
32
- # A mapping from model property names to API property names.
33
- def self.names
34
- @_hash = {} if @_hash.nil?
35
- @_hash['title'] = 'title'
36
- @_hash['utc_offset'] = 'utcOffset'
37
- @_hash['utc_offset_dst'] = 'utcOffsetDst'
38
- @_hash['dst_timestamp_start'] = 'dstTimestampStart'
39
- @_hash['dst_timestamp_end'] = 'dstTimestampEnd'
40
- @_hash
41
- end
42
-
43
- def initialize(title = nil,
44
- utc_offset = nil,
45
- utc_offset_dst = nil,
46
- dst_timestamp_start = nil,
47
- dst_timestamp_end = nil)
48
- @title = title
49
- @utc_offset = utc_offset
50
- @utc_offset_dst = utc_offset_dst
51
- @dst_timestamp_start = dst_timestamp_start
52
- @dst_timestamp_end = dst_timestamp_end
53
- end
54
-
55
- # Creates an instance of the object from a hash.
56
- def self.from_hash(hash)
57
- return nil unless hash
58
-
59
- # Extract variables from the hash.
60
- title = hash['title']
61
- utc_offset = hash['utcOffset']
62
- utc_offset_dst = hash['utcOffsetDst']
63
- dst_timestamp_start = APIHelper.rfc3339(hash['dstTimestampStart']) if
64
- hash['dstTimestampStart']
65
- dst_timestamp_end = APIHelper.rfc3339(hash['dstTimestampEnd']) if
66
- hash['dstTimestampEnd']
67
-
68
- # Create object from extracted values.
69
- TimeZoneConfiguration.new(title,
70
- utc_offset,
71
- utc_offset_dst,
72
- dst_timestamp_start,
73
- dst_timestamp_end)
74
- end
75
- end
76
- end
@@ -1,89 +0,0 @@
1
- # test_pack_1
2
- #
3
- # This file was automatically generated by APIMATIC v2.0 (
4
- # https://apimatic.io ).
5
-
6
- module TestPack1
7
- # Turbine-specific type information.
8
- class TurbineType < BaseModel
9
- # TODO: Write general description for this method
10
- # @return [Integer]
11
- attr_accessor :turbine_type_id
12
-
13
- # TODO: Write general description for this method
14
- # @return [String]
15
- attr_accessor :title
16
-
17
- # TODO: Write general description for this method
18
- # @return [String]
19
- attr_accessor :manufacturer
20
-
21
- # TODO: Write general description for this method
22
- # @return [String]
23
- attr_accessor :model
24
-
25
- # The model of the turbine controller.
26
- # @return [String]
27
- attr_accessor :controller
28
-
29
- # The model of the turbine controller.
30
- # @return [Integer]
31
- attr_accessor :rated_power
32
-
33
- # The model of the turbine controller.
34
- # @return [Float]
35
- attr_accessor :max_rotor_speed
36
-
37
- # A mapping from model property names to API property names.
38
- def self.names
39
- @_hash = {} if @_hash.nil?
40
- @_hash['turbine_type_id'] = 'turbineTypeId'
41
- @_hash['title'] = 'title'
42
- @_hash['manufacturer'] = 'manufacturer'
43
- @_hash['model'] = 'model'
44
- @_hash['controller'] = 'controller'
45
- @_hash['rated_power'] = 'ratedPower'
46
- @_hash['max_rotor_speed'] = 'maxRotorSpeed'
47
- @_hash
48
- end
49
-
50
- def initialize(turbine_type_id = nil,
51
- title = nil,
52
- manufacturer = nil,
53
- model = nil,
54
- controller = nil,
55
- rated_power = nil,
56
- max_rotor_speed = nil)
57
- @turbine_type_id = turbine_type_id
58
- @title = title
59
- @manufacturer = manufacturer
60
- @model = model
61
- @controller = controller
62
- @rated_power = rated_power
63
- @max_rotor_speed = max_rotor_speed
64
- end
65
-
66
- # Creates an instance of the object from a hash.
67
- def self.from_hash(hash)
68
- return nil unless hash
69
-
70
- # Extract variables from the hash.
71
- turbine_type_id = hash['turbineTypeId']
72
- title = hash['title']
73
- manufacturer = hash['manufacturer']
74
- model = hash['model']
75
- controller = hash['controller']
76
- rated_power = hash['ratedPower']
77
- max_rotor_speed = hash['maxRotorSpeed']
78
-
79
- # Create object from extracted values.
80
- TurbineType.new(turbine_type_id,
81
- title,
82
- manufacturer,
83
- model,
84
- controller,
85
- rated_power,
86
- max_rotor_speed)
87
- end
88
- end
89
- end