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,92 +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
- # An object containing time-series data for a specific aggregate, data signal
8
- # and interval.
9
- class DataItem < BaseModel
10
- # How data is aggregated in the asset structure.
11
- # @return [AggregateModeEnum]
12
- attr_accessor :aggregate
13
-
14
- # The id of this aggregate group: device id, site id, or the constant -1 for
15
- # portfolio
16
- # @return [Integer]
17
- attr_accessor :aggregate_id
18
-
19
- # The ids of the devices in this aggregate group.
20
- # @return [List of Integer]
21
- attr_accessor :device_ids
22
-
23
- # The resolution for time-series data.
24
- # @return [ResolutionEnum]
25
- attr_accessor :resolution
26
-
27
- # Which operation to use when aggregating data.
28
- # @return [CalculationModeEnum]
29
- attr_accessor :calculation
30
-
31
- # A data signal.
32
- # @return [DataSignal]
33
- attr_accessor :data_signal
34
-
35
- # A data signal.
36
- # @return [Array<String, Float>]
37
- attr_accessor :data
38
-
39
- # A mapping from model property names to API property names.
40
- def self.names
41
- @_hash = {} if @_hash.nil?
42
- @_hash['aggregate'] = 'aggregate'
43
- @_hash['aggregate_id'] = 'aggregateId'
44
- @_hash['device_ids'] = 'deviceIds'
45
- @_hash['resolution'] = 'resolution'
46
- @_hash['calculation'] = 'calculation'
47
- @_hash['data_signal'] = 'dataSignal'
48
- @_hash['data'] = 'data'
49
- @_hash
50
- end
51
-
52
- def initialize(aggregate = nil,
53
- aggregate_id = nil,
54
- device_ids = nil,
55
- resolution = nil,
56
- calculation = nil,
57
- data_signal = nil,
58
- data = nil)
59
- @aggregate = aggregate
60
- @aggregate_id = aggregate_id
61
- @device_ids = device_ids
62
- @resolution = resolution
63
- @calculation = calculation
64
- @data_signal = data_signal
65
- @data = data
66
- end
67
-
68
- # Creates an instance of the object from a hash.
69
- def self.from_hash(hash)
70
- return nil unless hash
71
-
72
- # Extract variables from the hash.
73
- aggregate = hash['aggregate']
74
- aggregate_id = hash['aggregateId']
75
- device_ids = hash['deviceIds']
76
- resolution = hash['resolution']
77
- calculation = hash['calculation']
78
- data_signal = DataSignal.from_hash(hash['dataSignal']) if
79
- hash['dataSignal']
80
- data = hash['data']
81
-
82
- # Create object from extracted values.
83
- DataItem.new(aggregate,
84
- aggregate_id,
85
- device_ids,
86
- resolution,
87
- calculation,
88
- data_signal,
89
- data)
90
- end
91
- end
92
- end
@@ -1,82 +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
- # Data for a single aggregate group and contract category combination.
8
- class DataPerCategoryItem < BaseModel
9
- # The id of this aggregate group: device id, site id, or the constant -1 for
10
- # portfolio
11
- # @return [Integer]
12
- attr_accessor :aggregate_id
13
-
14
- # The ids of the devices in this aggregate group.
15
- # @return [List of Integer]
16
- attr_accessor :device_ids
17
-
18
- # The ids of the devices in this aggregate group.
19
- # @return [String]
20
- attr_accessor :contract_title
21
-
22
- # The ids of the devices in this aggregate group.
23
- # @return [String]
24
- attr_accessor :category_title
25
-
26
- # The aggregated value of the selected data signal.
27
- # @return [Float]
28
- attr_accessor :value
29
-
30
- # The summed duration in seconds allocated to this contract category and
31
- # aggregate group.
32
- # @return [Float]
33
- attr_accessor :duration
34
-
35
- # A mapping from model property names to API property names.
36
- def self.names
37
- @_hash = {} if @_hash.nil?
38
- @_hash['aggregate_id'] = 'aggregateId'
39
- @_hash['device_ids'] = 'deviceIds'
40
- @_hash['contract_title'] = 'contractTitle'
41
- @_hash['category_title'] = 'categoryTitle'
42
- @_hash['value'] = 'value'
43
- @_hash['duration'] = 'duration'
44
- @_hash
45
- end
46
-
47
- def initialize(aggregate_id = nil,
48
- device_ids = nil,
49
- contract_title = nil,
50
- category_title = nil,
51
- value = nil,
52
- duration = nil)
53
- @aggregate_id = aggregate_id
54
- @device_ids = device_ids
55
- @contract_title = contract_title
56
- @category_title = category_title
57
- @value = value
58
- @duration = duration
59
- end
60
-
61
- # Creates an instance of the object from a hash.
62
- def self.from_hash(hash)
63
- return nil unless hash
64
-
65
- # Extract variables from the hash.
66
- aggregate_id = hash['aggregateId']
67
- device_ids = hash['deviceIds']
68
- contract_title = hash['contractTitle']
69
- category_title = hash['categoryTitle']
70
- value = hash['value']
71
- duration = hash['duration']
72
-
73
- # Create object from extracted values.
74
- DataPerCategoryItem.new(aggregate_id,
75
- device_ids,
76
- contract_title,
77
- category_title,
78
- value,
79
- duration)
80
- end
81
- end
82
- end
@@ -1,63 +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
- # An object containing data grouped by contract category and aggregate.
8
- class DataPerCategoryResponse < BaseModel
9
- # A data signal.
10
- # @return [DataSignal]
11
- attr_accessor :data_signal
12
-
13
- # Which operation to use when aggregating data.
14
- # @return [CalculationModeEnum]
15
- attr_accessor :calculation
16
-
17
- # A list of objects: one per combination of
18
- # * aggregate
19
- # * contract category
20
- # @return [List of DataPerCategoryItem]
21
- attr_accessor :data
22
-
23
- # A mapping from model property names to API property names.
24
- def self.names
25
- @_hash = {} if @_hash.nil?
26
- @_hash['data_signal'] = 'dataSignal'
27
- @_hash['calculation'] = 'calculation'
28
- @_hash['data'] = 'data'
29
- @_hash
30
- end
31
-
32
- def initialize(data_signal = nil,
33
- calculation = nil,
34
- data = nil)
35
- @data_signal = data_signal
36
- @calculation = calculation
37
- @data = data
38
- end
39
-
40
- # Creates an instance of the object from a hash.
41
- def self.from_hash(hash)
42
- return nil unless hash
43
-
44
- # Extract variables from the hash.
45
- data_signal = DataSignal.from_hash(hash['dataSignal']) if
46
- hash['dataSignal']
47
- calculation = hash['calculation']
48
- # Parameter is an array, so we need to iterate through it
49
- data = nil
50
- unless hash['data'].nil?
51
- data = []
52
- hash['data'].each do |structure|
53
- data << (DataPerCategoryItem.from_hash(structure) if structure)
54
- end
55
- end
56
-
57
- # Create object from extracted values.
58
- DataPerCategoryResponse.new(data_signal,
59
- calculation,
60
- data)
61
- end
62
- end
63
- end
@@ -1,83 +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
- # An object containing a single data point for a specific aggregate, data
8
- # signal and interval.
9
- class DataRealTimeItem < BaseModel
10
- # How data is aggregated in the asset structure.
11
- # @return [AggregateModeEnum]
12
- attr_accessor :aggregate
13
-
14
- # The id of this aggregate group: device id, site id, or the constant -1 for
15
- # portfolio
16
- # @return [Integer]
17
- attr_accessor :aggregate_id
18
-
19
- # The ids of the devices in this aggregate group.
20
- # @return [List of Integer]
21
- attr_accessor :device_ids
22
-
23
- # Which operation to use when aggregating data.
24
- # @return [CalculationModeEnum]
25
- attr_accessor :calculation
26
-
27
- # A data signal.
28
- # @return [DataSignal]
29
- attr_accessor :data_signal
30
-
31
- # A data signal.
32
- # @return [Array<String, Float>]
33
- attr_accessor :data
34
-
35
- # A mapping from model property names to API property names.
36
- def self.names
37
- @_hash = {} if @_hash.nil?
38
- @_hash['aggregate'] = 'aggregate'
39
- @_hash['aggregate_id'] = 'aggregateId'
40
- @_hash['device_ids'] = 'deviceIds'
41
- @_hash['calculation'] = 'calculation'
42
- @_hash['data_signal'] = 'dataSignal'
43
- @_hash['data'] = 'data'
44
- @_hash
45
- end
46
-
47
- def initialize(aggregate = nil,
48
- aggregate_id = nil,
49
- device_ids = nil,
50
- calculation = nil,
51
- data_signal = nil,
52
- data = nil)
53
- @aggregate = aggregate
54
- @aggregate_id = aggregate_id
55
- @device_ids = device_ids
56
- @calculation = calculation
57
- @data_signal = data_signal
58
- @data = data
59
- end
60
-
61
- # Creates an instance of the object from a hash.
62
- def self.from_hash(hash)
63
- return nil unless hash
64
-
65
- # Extract variables from the hash.
66
- aggregate = hash['aggregate']
67
- aggregate_id = hash['aggregateId']
68
- device_ids = hash['deviceIds']
69
- calculation = hash['calculation']
70
- data_signal = DataSignal.from_hash(hash['dataSignal']) if
71
- hash['dataSignal']
72
- data = hash['data']
73
-
74
- # Create object from extracted values.
75
- DataRealTimeItem.new(aggregate,
76
- aggregate_id,
77
- device_ids,
78
- calculation,
79
- data_signal,
80
- data)
81
- end
82
- end
83
- end
@@ -1,53 +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
- # A data signal.
8
- class DataSignal < BaseModel
9
- # The unique id of a data signal.
10
- # @return [Integer]
11
- attr_accessor :data_signal_id
12
-
13
- # The unique id of a data signal.
14
- # @return [String]
15
- attr_accessor :title
16
-
17
- # The unique id of a data signal.
18
- # @return [String]
19
- attr_accessor :unit
20
-
21
- # A mapping from model property names to API property names.
22
- def self.names
23
- @_hash = {} if @_hash.nil?
24
- @_hash['data_signal_id'] = 'dataSignalId'
25
- @_hash['title'] = 'title'
26
- @_hash['unit'] = 'unit'
27
- @_hash
28
- end
29
-
30
- def initialize(data_signal_id = nil,
31
- title = nil,
32
- unit = nil)
33
- @data_signal_id = data_signal_id
34
- @title = title
35
- @unit = unit
36
- end
37
-
38
- # Creates an instance of the object from a hash.
39
- def self.from_hash(hash)
40
- return nil unless hash
41
-
42
- # Extract variables from the hash.
43
- data_signal_id = hash['dataSignalId']
44
- title = hash['title']
45
- unit = hash['unit']
46
-
47
- # Create object from extracted values.
48
- DataSignal.new(data_signal_id,
49
- title,
50
- unit)
51
- end
52
- end
53
- end
@@ -1,66 +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
- # Your data signal configuration. These only apply to wind devices.
8
- class DataSignalConfiguration < BaseModel
9
- # The id of the data signal used for time-based availability data.
10
- # @return [Integer]
11
- attr_accessor :availability_time_data_signal_id
12
-
13
- # The id of the data signal used for production-based availability data.
14
- # @return [Integer]
15
- attr_accessor :availability_production_data_signal_id
16
-
17
- # The id of the data signal used for lost production data.
18
- # @return [Integer]
19
- attr_accessor :lost_production_data_signal_id
20
-
21
- # The id of the data signal used for performance data.
22
- # @return [Integer]
23
- attr_accessor :performance_data_signal_id
24
-
25
- # A mapping from model property names to API property names.
26
- def self.names
27
- @_hash = {} if @_hash.nil?
28
- @_hash['availability_time_data_signal_id'] =
29
- 'availabilityTimeDataSignalId'
30
- @_hash['availability_production_data_signal_id'] =
31
- 'availabilityProductionDataSignalId'
32
- @_hash['lost_production_data_signal_id'] = 'lostProductionDataSignalId'
33
- @_hash['performance_data_signal_id'] = 'performanceDataSignalId'
34
- @_hash
35
- end
36
-
37
- def initialize(availability_time_data_signal_id = nil,
38
- availability_production_data_signal_id = nil,
39
- lost_production_data_signal_id = nil,
40
- performance_data_signal_id = nil)
41
- @availability_time_data_signal_id = availability_time_data_signal_id
42
- @availability_production_data_signal_id =
43
- availability_production_data_signal_id
44
- @lost_production_data_signal_id = lost_production_data_signal_id
45
- @performance_data_signal_id = performance_data_signal_id
46
- end
47
-
48
- # Creates an instance of the object from a hash.
49
- def self.from_hash(hash)
50
- return nil unless hash
51
-
52
- # Extract variables from the hash.
53
- availability_time_data_signal_id = hash['availabilityTimeDataSignalId']
54
- availability_production_data_signal_id =
55
- hash['availabilityProductionDataSignalId']
56
- lost_production_data_signal_id = hash['lostProductionDataSignalId']
57
- performance_data_signal_id = hash['performanceDataSignalId']
58
-
59
- # Create object from extracted values.
60
- DataSignalConfiguration.new(availability_time_data_signal_id,
61
- availability_production_data_signal_id,
62
- lost_production_data_signal_id,
63
- performance_data_signal_id)
64
- end
65
- end
66
- end
@@ -1,62 +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
- # A data signal, including type.
8
- class DataSignalItem < BaseModel
9
- # The unique id of a data signal.
10
- # @return [Integer]
11
- attr_accessor :data_signal_id
12
-
13
- # The unique id of a data signal.
14
- # @return [String]
15
- attr_accessor :title
16
-
17
- # The unique id of a data signal.
18
- # @return [String]
19
- attr_accessor :type
20
-
21
- # The unique id of a data signal.
22
- # @return [String]
23
- attr_accessor :unit
24
-
25
- # A mapping from model property names to API property names.
26
- def self.names
27
- @_hash = {} if @_hash.nil?
28
- @_hash['data_signal_id'] = 'dataSignalId'
29
- @_hash['title'] = 'title'
30
- @_hash['type'] = 'type'
31
- @_hash['unit'] = 'unit'
32
- @_hash
33
- end
34
-
35
- def initialize(data_signal_id = nil,
36
- title = nil,
37
- type = nil,
38
- unit = nil)
39
- @data_signal_id = data_signal_id
40
- @title = title
41
- @type = type
42
- @unit = unit
43
- end
44
-
45
- # Creates an instance of the object from a hash.
46
- def self.from_hash(hash)
47
- return nil unless hash
48
-
49
- # Extract variables from the hash.
50
- data_signal_id = hash['dataSignalId']
51
- title = hash['title']
52
- type = hash['type']
53
- unit = hash['unit']
54
-
55
- # Create object from extracted values.
56
- DataSignalItem.new(data_signal_id,
57
- title,
58
- type,
59
- unit)
60
- end
61
- end
62
- end