SematextCloud 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/LICENSE +13 -0
  4. data/README.md +149 -0
  5. data/Rakefile +8 -0
  6. data/SematextCloud.gemspec +45 -0
  7. data/docs/AlertNotificationRequest.md +9 -0
  8. data/docs/AlertNotificationsApi.md +118 -0
  9. data/docs/AlertRule.md +53 -0
  10. data/docs/AlertRuleScheduleTimeRangeDto.md +7 -0
  11. data/docs/AlertRuleScheduleWeekdayDto.md +10 -0
  12. data/docs/AlertsApi.md +270 -0
  13. data/docs/App.md +32 -0
  14. data/docs/AppDescription.md +6 -0
  15. data/docs/AppMetadata.md +10 -0
  16. data/docs/AppsApi.md +369 -0
  17. data/docs/AwsSettingsControllerApi.md +63 -0
  18. data/docs/BasicAuthMethodDto.md +7 -0
  19. data/docs/BasicOrganizationDto.md +9 -0
  20. data/docs/BillingApi.md +176 -0
  21. data/docs/BillingInfo.md +8 -0
  22. data/docs/CloudWatchSettings.md +9 -0
  23. data/docs/CreateAppInfo.md +10 -0
  24. data/docs/DataSeriesFilter.md +8 -0
  25. data/docs/DataSeriesRequest.md +12 -0
  26. data/docs/Error.md +7 -0
  27. data/docs/FilterValue.md +11 -0
  28. data/docs/GenericApiResponse.md +9 -0
  29. data/docs/Invitation.md +15 -0
  30. data/docs/LogsAppApi.md +58 -0
  31. data/docs/MetricsApi.md +227 -0
  32. data/docs/MonitoringAppApi.md +58 -0
  33. data/docs/NotificationIntegration.md +15 -0
  34. data/docs/Plan.md +18 -0
  35. data/docs/ReportInfo.md +13 -0
  36. data/docs/ResetPasswordApi.md +58 -0
  37. data/docs/SavedQueriesApi.md +220 -0
  38. data/docs/SavedQuery.md +18 -0
  39. data/docs/ServiceIntegration.md +17 -0
  40. data/docs/SubscriptionsApi.md +114 -0
  41. data/docs/TagApiControllerApi.md +212 -0
  42. data/docs/UpdateAppInfo.md +14 -0
  43. data/docs/UserInfo.md +6 -0
  44. data/docs/UserPermissions.md +8 -0
  45. data/docs/UserRole.md +8 -0
  46. data/lib/SematextCloud.rb +78 -0
  47. data/lib/SematextCloud/api/alert_notifications_api.rb +137 -0
  48. data/lib/SematextCloud/api/alerts_api.rb +283 -0
  49. data/lib/SematextCloud/api/apps_api.rb +381 -0
  50. data/lib/SematextCloud/api/aws_settings_controller_api.rb +83 -0
  51. data/lib/SematextCloud/api/billing_api.rb +197 -0
  52. data/lib/SematextCloud/api/logs_app_api.rb +75 -0
  53. data/lib/SematextCloud/api/metrics_api.rb +247 -0
  54. data/lib/SematextCloud/api/monitoring_app_api.rb +75 -0
  55. data/lib/SematextCloud/api/reset_password_api.rb +75 -0
  56. data/lib/SematextCloud/api/saved_queries_api.rb +237 -0
  57. data/lib/SematextCloud/api/subscriptions_api.rb +133 -0
  58. data/lib/SematextCloud/api/tag_api_controller_api.rb +247 -0
  59. data/lib/SematextCloud/api_client.rb +389 -0
  60. data/lib/SematextCloud/api_error.rb +38 -0
  61. data/lib/SematextCloud/configuration.rb +209 -0
  62. data/lib/SematextCloud/models/alert_notification_request.rb +212 -0
  63. data/lib/SematextCloud/models/alert_rule.rb +652 -0
  64. data/lib/SematextCloud/models/alert_rule_schedule_time_range_dto.rb +192 -0
  65. data/lib/SematextCloud/models/alert_rule_schedule_weekday_dto.rb +221 -0
  66. data/lib/SematextCloud/models/app.rb +419 -0
  67. data/lib/SematextCloud/models/app_description.rb +183 -0
  68. data/lib/SematextCloud/models/app_metadata.rb +268 -0
  69. data/lib/SematextCloud/models/basic_auth_method_dto.rb +226 -0
  70. data/lib/SematextCloud/models/basic_organization_dto.rb +246 -0
  71. data/lib/SematextCloud/models/billing_info.rb +201 -0
  72. data/lib/SematextCloud/models/cloud_watch_settings.rb +256 -0
  73. data/lib/SematextCloud/models/create_app_info.rb +220 -0
  74. data/lib/SematextCloud/models/data_series_filter.rb +237 -0
  75. data/lib/SematextCloud/models/data_series_request.rb +283 -0
  76. data/lib/SematextCloud/models/error.rb +192 -0
  77. data/lib/SematextCloud/models/filter_value.rb +230 -0
  78. data/lib/SematextCloud/models/generic_api_response.rb +214 -0
  79. data/lib/SematextCloud/models/invitation.rb +326 -0
  80. data/lib/SematextCloud/models/notification_integration.rb +324 -0
  81. data/lib/SematextCloud/models/plan.rb +337 -0
  82. data/lib/SematextCloud/models/report_info.rb +247 -0
  83. data/lib/SematextCloud/models/saved_query.rb +291 -0
  84. data/lib/SematextCloud/models/service_integration.rb +282 -0
  85. data/lib/SematextCloud/models/update_app_info.rb +289 -0
  86. data/lib/SematextCloud/models/user_info.rb +183 -0
  87. data/lib/SematextCloud/models/user_permissions.rb +201 -0
  88. data/lib/SematextCloud/models/user_role.rb +247 -0
  89. data/lib/SematextCloud/version.rb +15 -0
  90. data/spec/api/alert_notifications_api_spec.rb +60 -0
  91. data/spec/api/alerts_api_spec.rb +90 -0
  92. data/spec/api/apps_api_spec.rb +113 -0
  93. data/spec/api/aws_settings_controller_api_spec.rb +48 -0
  94. data/spec/api/billing_api_spec.rb +72 -0
  95. data/spec/api/logs_app_api_spec.rb +46 -0
  96. data/spec/api/metrics_api_spec.rb +83 -0
  97. data/spec/api/monitoring_app_api_spec.rb +46 -0
  98. data/spec/api/reset_password_api_spec.rb +46 -0
  99. data/spec/api/saved_queries_api_spec.rb +80 -0
  100. data/spec/api/subscriptions_api_spec.rb +58 -0
  101. data/spec/api/tag_api_controller_api_spec.rb +88 -0
  102. data/spec/api_client_spec.rb +226 -0
  103. data/spec/configuration_spec.rb +42 -0
  104. data/spec/models/alert_notification_request_spec.rb +59 -0
  105. data/spec/models/alert_rule_schedule_time_range_dto_spec.rb +47 -0
  106. data/spec/models/alert_rule_schedule_weekday_dto_spec.rb +65 -0
  107. data/spec/models/alert_rule_spec.rb +327 -0
  108. data/spec/models/app_description_spec.rb +41 -0
  109. data/spec/models/app_metadata_spec.rb +77 -0
  110. data/spec/models/app_spec.rb +197 -0
  111. data/spec/models/basic_auth_method_dto_spec.rb +51 -0
  112. data/spec/models/basic_organization_dto_spec.rb +63 -0
  113. data/spec/models/billing_info_spec.rb +53 -0
  114. data/spec/models/cloud_watch_settings_spec.rb +67 -0
  115. data/spec/models/create_app_info_spec.rb +65 -0
  116. data/spec/models/data_series_filter_spec.rb +57 -0
  117. data/spec/models/data_series_request_spec.rb +81 -0
  118. data/spec/models/error_spec.rb +47 -0
  119. data/spec/models/filter_value_spec.rb +71 -0
  120. data/spec/models/generic_api_response_spec.rb +59 -0
  121. data/spec/models/invitation_spec.rb +107 -0
  122. data/spec/models/notification_integration_spec.rb +107 -0
  123. data/spec/models/plan_spec.rb +121 -0
  124. data/spec/models/report_info_spec.rb +83 -0
  125. data/spec/models/saved_query_spec.rb +113 -0
  126. data/spec/models/service_integration_spec.rb +107 -0
  127. data/spec/models/update_app_info_spec.rb +93 -0
  128. data/spec/models/user_info_spec.rb +41 -0
  129. data/spec/models/user_permissions_spec.rb +53 -0
  130. data/spec/models/user_role_spec.rb +61 -0
  131. data/spec/spec_helper.rb +111 -0
  132. metadata +395 -0
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #Sematext Cloud API
3
+
4
+ #API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
5
+
6
+ OpenAPI spec version: v3
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SematextCloud
16
+ class CreateAppInfo
17
+ attr_accessor :app_type
18
+
19
+ attr_accessor :discount_code
20
+
21
+ attr_accessor :initial_plan_id
22
+
23
+ # AWS app meta data. Applicable only for `aws` appType
24
+ attr_accessor :meta_data
25
+
26
+ attr_accessor :name
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'app_type' => :'appType',
32
+ :'discount_code' => :'discountCode',
33
+ :'initial_plan_id' => :'initialPlanId',
34
+ :'meta_data' => :'metaData',
35
+ :'name' => :'name'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'app_type' => :'String',
43
+ :'discount_code' => :'String',
44
+ :'initial_plan_id' => :'Integer',
45
+ :'meta_data' => :'AppMetadata',
46
+ :'name' => :'String'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'appType')
59
+ self.app_type = attributes[:'appType']
60
+ end
61
+
62
+ if attributes.has_key?(:'discountCode')
63
+ self.discount_code = attributes[:'discountCode']
64
+ end
65
+
66
+ if attributes.has_key?(:'initialPlanId')
67
+ self.initial_plan_id = attributes[:'initialPlanId']
68
+ end
69
+
70
+ if attributes.has_key?(:'metaData')
71
+ self.meta_data = attributes[:'metaData']
72
+ end
73
+
74
+ if attributes.has_key?(:'name')
75
+ self.name = attributes[:'name']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ app_type == o.app_type &&
98
+ discount_code == o.discount_code &&
99
+ initial_plan_id == o.initial_plan_id &&
100
+ meta_data == o.meta_data &&
101
+ name == o.name
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Fixnum] Hash code
112
+ def hash
113
+ [app_type, discount_code, initial_plan_id, meta_data, name].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.swagger_types.each_pair do |key, type|
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :DateTime
143
+ DateTime.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :BOOLEAN
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ temp_model = SematextCloud.const_get(type).new
174
+ temp_model.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ next if value.nil?
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+ end
220
+ end
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #Sematext Cloud API
3
+
4
+ #API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
5
+
6
+ OpenAPI spec version: v3
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SematextCloud
16
+ class DataSeriesFilter
17
+ attr_accessor :aggregation
18
+
19
+ attr_accessor :multi_value
20
+
21
+ attr_accessor :values
22
+
23
+ class EnumAttributeValidator
24
+ attr_reader :datatype
25
+ attr_reader :allowable_values
26
+
27
+ def initialize(datatype, allowable_values)
28
+ @allowable_values = allowable_values.map do |value|
29
+ case datatype.to_s
30
+ when /Integer/i
31
+ value.to_i
32
+ when /Float/i
33
+ value.to_f
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def valid?(value)
41
+ !value || allowable_values.include?(value)
42
+ end
43
+ end
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'aggregation' => :'aggregation',
49
+ :'multi_value' => :'multiValue',
50
+ :'values' => :'values'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.swagger_types
56
+ {
57
+ :'aggregation' => :'String',
58
+ :'multi_value' => :'BOOLEAN',
59
+ :'values' => :'Array<String>'
60
+ }
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ return unless attributes.is_a?(Hash)
67
+
68
+ # convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
70
+
71
+ if attributes.has_key?(:'aggregation')
72
+ self.aggregation = attributes[:'aggregation']
73
+ end
74
+
75
+ if attributes.has_key?(:'multiValue')
76
+ self.multi_value = attributes[:'multiValue']
77
+ end
78
+
79
+ if attributes.has_key?(:'values')
80
+ if (value = attributes[:'values']).is_a?(Array)
81
+ self.values = value
82
+ end
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ aggregation_validator = EnumAttributeValidator.new('String', ['NONE', 'SUM', 'AVG', 'MIN', 'MAX'])
97
+ return false unless aggregation_validator.valid?(@aggregation)
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method checking allowed values (enum).
102
+ # @param [Object] aggregation Object to be assigned
103
+ def aggregation=(aggregation)
104
+ validator = EnumAttributeValidator.new('String', ['NONE', 'SUM', 'AVG', 'MIN', 'MAX'])
105
+ unless validator.valid?(aggregation)
106
+ fail ArgumentError, 'invalid value for "aggregation", must be one of #{validator.allowable_values}.'
107
+ end
108
+ @aggregation = aggregation
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ aggregation == o.aggregation &&
117
+ multi_value == o.multi_value &&
118
+ values == o.values
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [aggregation, multi_value, values].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.swagger_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :BOOLEAN
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ temp_model = SematextCloud.const_get(type).new
191
+ temp_model.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ next if value.nil?
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+ end
237
+ end