SematextCloud 0.1.4 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Gemfile.lock +70 -0
- data/README.md +76 -65
- data/SematextCloud.gemspec +0 -6
- data/docs/AlertNotification.md +12 -0
- data/docs/AlertNotificationRequest.md +7 -7
- data/docs/AlertNotificationsApi.md +33 -37
- data/docs/AlertRule.md +51 -51
- data/docs/AlertRuleResponse.md +9 -0
- data/docs/AlertRuleResponseEntry.md +6 -0
- data/docs/AlertRuleScheduleTimeRangeDto.md +5 -5
- data/docs/AlertRuleScheduleWeekdayDto.md +8 -8
- data/docs/AlertRulesResponse.md +9 -0
- data/docs/AlertRulesResponseEntry.md +6 -0
- data/docs/AlertsApi.md +60 -66
- data/docs/App.md +35 -30
- data/docs/AppDescription.md +4 -4
- data/docs/AppMetadata.md +8 -8
- data/docs/AppResponse.md +9 -0
- data/docs/AppResponseEntry.md +6 -0
- data/docs/AppTypesResponse.md +9 -0
- data/docs/AppTypesResponseEntry.md +6 -0
- data/docs/AppsApi.md +135 -90
- data/docs/AppsResponse.md +9 -0
- data/docs/AppsResponseEntry.md +6 -0
- data/docs/AwsSettingsControllerApi.md +19 -22
- data/docs/BasicAuthMethodDto.md +5 -5
- data/docs/BasicOrganizationDto.md +7 -7
- data/docs/BillingApi.md +47 -54
- data/docs/BillingInfo.md +6 -6
- data/docs/ChargesDetailsResponseDto.md +12 -0
- data/docs/CloudWatchSettings.md +7 -7
- data/docs/CloudWatchSettingsResponse.md +9 -0
- data/docs/CloudWatchSettingsResponseEntry.md +6 -0
- data/docs/CreateAppInfo.md +8 -8
- data/docs/CreateTokenDto.md +8 -0
- data/docs/DailyDto.md +9 -0
- data/docs/DataSeriesFilter.md +5 -5
- data/docs/DataSeriesRequest.md +9 -9
- data/docs/DayUsageData.md +26 -0
- data/docs/Dimension.md +7 -0
- data/docs/Error.md +5 -5
- data/docs/EventDto.md +8 -0
- data/docs/FilterValue.md +9 -9
- data/docs/GenericApiResponse.md +7 -7
- data/docs/GenericMapBasedApiResponse.md +9 -0
- data/docs/Invitation.md +13 -13
- data/docs/Invoice.md +11 -0
- data/docs/InvoiceResponse.md +9 -0
- data/docs/InvoiceResponseEntry.md +6 -0
- data/docs/LimitChangeEventDTO.md +8 -0
- data/docs/LogsAppApi.md +16 -18
- data/docs/LogsUsageApiControllerApi.md +60 -0
- data/docs/MailReportResponse.md +9 -0
- data/docs/MailReportResponseResponseEntry.md +6 -0
- data/docs/MetricsApi.md +20 -20
- data/docs/MinPeriodFeePeriod.md +16 -0
- data/docs/MonitoringAppApi.md +16 -18
- data/docs/NotificationIntegration.md +13 -13
- data/docs/NotificationsResponse.md +9 -0
- data/docs/NotificationsResponseEntry.md +8 -0
- data/docs/Plan.md +16 -16
- data/docs/PlansResponse.md +9 -0
- data/docs/PlansResponseEntry.md +6 -0
- data/docs/ReportInfo.md +11 -11
- data/docs/ResetPasswordApi.md +16 -18
- data/docs/SavedQueriesApi.md +19 -19
- data/docs/SavedQuery.md +15 -15
- data/docs/ServiceIntegration.md +15 -15
- data/docs/Subscription.md +20 -0
- data/docs/SubscriptionDashboardDto.md +16 -0
- data/docs/SubscriptionDto.md +17 -0
- data/docs/SubscriptionResponse.md +9 -0
- data/docs/SubscriptionResponseEntry.md +6 -0
- data/docs/SubscriptionsApi.md +455 -36
- data/docs/SubscriptionsResponse.md +9 -0
- data/docs/SubscriptionsResponseEntry.md +6 -0
- data/docs/TagApiControllerApi.md +63 -72
- data/docs/TagNamesResponse.md +6 -0
- data/docs/TokenDto.md +12 -0
- data/docs/TokenResponse.md +9 -0
- data/docs/TokenResponseEntry.md +6 -0
- data/docs/TokensApiControllerApi.md +274 -0
- data/docs/TokensResponse.md +9 -0
- data/docs/TokensResponseEntry.md +6 -0
- data/docs/UpdateAppInfo.md +12 -12
- data/docs/UpdatePlanResponse.md +9 -0
- data/docs/UpdatePlanResponseDto.md +7 -0
- data/docs/UpdatePlanResponseEntry.md +6 -0
- data/docs/UpdateSubscriptionDto.md +6 -0
- data/docs/UpdateTokenDto.md +7 -0
- data/docs/UsageDto.md +16 -0
- data/docs/UsageMultiResponse.md +9 -0
- data/docs/UsageMultiResponseEntry.md +6 -0
- data/docs/UsageResponse.md +9 -0
- data/docs/UsageResponseEntry.md +6 -0
- data/docs/UserInfo.md +4 -4
- data/docs/UserPermissions.md +6 -6
- data/docs/UserRole.md +6 -6
- data/lib/SematextCloud/api/subscriptions_api.rb +463 -17
- data/lib/SematextCloud/api/tokens_api_controller_api.rb +313 -0
- data/lib/SematextCloud/models/create_token_dto.rb +201 -0
- data/lib/SematextCloud/models/subscription_dashboard_dto.rb +319 -0
- data/lib/SematextCloud/models/subscription_dto.rb +328 -0
- data/lib/SematextCloud/models/update_subscription_dto.rb +183 -0
- data/lib/SematextCloud/models/update_token_dto.rb +192 -0
- data/lib/SematextCloud/version.rb +1 -1
- data/lib/stcloud/api/alert_notifications_api.rb +142 -0
- data/lib/stcloud/api/alerts_api.rb +292 -0
- data/lib/stcloud/api/apps_api.rb +452 -0
- data/lib/stcloud/api/aws_settings_controller_api.rb +84 -0
- data/lib/stcloud/api/billing_api.rb +202 -0
- data/lib/stcloud/api/logs_app_api.rb +76 -0
- data/lib/stcloud/api/logs_usage_api_controller_api.rb +86 -0
- data/lib/stcloud/api/monitoring_app_api.rb +76 -0
- data/lib/stcloud/api/reset_password_api.rb +76 -0
- data/lib/stcloud/api/subscriptions_api.rb +610 -0
- data/lib/stcloud/api/tag_api_controller_api.rb +250 -0
- data/lib/stcloud/api/tokens_api_controller_api.rb +324 -0
- data/lib/stcloud/api_client.rb +388 -0
- data/lib/stcloud/api_error.rb +57 -0
- data/lib/stcloud/configuration.rb +205 -0
- data/lib/stcloud/models/alert_notification.rb +260 -0
- data/lib/stcloud/models/alert_notification_request.rb +235 -0
- data/lib/stcloud/models/alert_rule.rb +675 -0
- data/lib/stcloud/models/alert_rule_response.rb +235 -0
- data/lib/stcloud/models/alert_rule_response_entry.rb +206 -0
- data/lib/stcloud/models/alert_rule_schedule_time_range_dto.rb +215 -0
- data/lib/stcloud/models/alert_rule_schedule_weekday_dto.rb +244 -0
- data/lib/stcloud/models/alert_rules_response.rb +235 -0
- data/lib/stcloud/models/alert_rules_response_entry.rb +208 -0
- data/lib/stcloud/models/app.rb +489 -0
- data/lib/stcloud/models/app_description.rb +206 -0
- data/lib/stcloud/models/app_metadata.rb +291 -0
- data/lib/stcloud/models/app_response.rb +235 -0
- data/lib/stcloud/models/app_response_entry.rb +206 -0
- data/lib/stcloud/models/app_types_response.rb +235 -0
- data/lib/stcloud/models/app_types_response_entry.rb +208 -0
- data/lib/stcloud/models/apps_response.rb +235 -0
- data/lib/stcloud/models/apps_response_entry.rb +208 -0
- data/lib/stcloud/models/basic_auth_method_dto.rb +249 -0
- data/lib/stcloud/models/basic_organization_dto.rb +269 -0
- data/lib/stcloud/models/billing_info.rb +224 -0
- data/lib/stcloud/models/charges_details_response_dto.rb +298 -0
- data/lib/stcloud/models/cloud_watch_settings.rb +279 -0
- data/lib/stcloud/models/cloud_watch_settings_response.rb +235 -0
- data/lib/stcloud/models/cloud_watch_settings_response_entry.rb +206 -0
- data/lib/stcloud/models/create_app_info.rb +242 -0
- data/lib/stcloud/models/create_token_dto.rb +224 -0
- data/lib/stcloud/models/daily_dto.rb +233 -0
- data/lib/stcloud/models/day_usage_data.rb +411 -0
- data/lib/stcloud/models/dimension.rb +227 -0
- data/lib/stcloud/models/error.rb +215 -0
- data/lib/stcloud/models/event_dto.rb +258 -0
- data/lib/stcloud/models/filter_value.rb +253 -0
- data/lib/stcloud/models/generic_api_response.rb +236 -0
- data/lib/stcloud/models/generic_map_based_api_response.rb +236 -0
- data/lib/stcloud/models/invitation.rb +348 -0
- data/lib/stcloud/models/invoice.rb +253 -0
- data/lib/stcloud/models/invoice_response.rb +235 -0
- data/lib/stcloud/models/invoice_response_entry.rb +206 -0
- data/lib/stcloud/models/limit_change_event_dto.rb +224 -0
- data/lib/stcloud/models/mail_report_response.rb +235 -0
- data/lib/stcloud/models/mail_report_response_response_entry.rb +206 -0
- data/lib/stcloud/models/min_period_fee_period.rb +296 -0
- data/lib/stcloud/models/notification_integration.rb +347 -0
- data/lib/stcloud/models/notifications_response.rb +235 -0
- data/lib/stcloud/models/notifications_response_entry.rb +226 -0
- data/lib/stcloud/models/plan.rb +360 -0
- data/lib/stcloud/models/plans_response.rb +235 -0
- data/lib/stcloud/models/plans_response_entry.rb +208 -0
- data/lib/stcloud/models/report_info.rb +270 -0
- data/lib/stcloud/models/service_integration.rb +305 -0
- data/lib/stcloud/models/subscription.rb +378 -0
- data/lib/stcloud/models/subscription_dashboard_dto.rb +342 -0
- data/lib/stcloud/models/subscription_dto.rb +351 -0
- data/lib/stcloud/models/subscription_response.rb +235 -0
- data/lib/stcloud/models/subscription_response_entry.rb +206 -0
- data/lib/stcloud/models/subscriptions_response.rb +235 -0
- data/lib/stcloud/models/subscriptions_response_entry.rb +208 -0
- data/lib/stcloud/models/tag_names_response.rb +213 -0
- data/lib/stcloud/models/token_dto.rb +260 -0
- data/lib/stcloud/models/token_response.rb +235 -0
- data/lib/stcloud/models/token_response_entry.rb +206 -0
- data/lib/stcloud/models/tokens_response.rb +235 -0
- data/lib/stcloud/models/tokens_response_entry.rb +208 -0
- data/lib/stcloud/models/update_app_info.rb +312 -0
- data/lib/stcloud/models/update_plan_response.rb +235 -0
- data/lib/stcloud/models/update_plan_response_dto.rb +217 -0
- data/lib/stcloud/models/update_plan_response_entry.rb +206 -0
- data/lib/stcloud/models/update_subscription_dto.rb +206 -0
- data/lib/stcloud/models/update_token_dto.rb +215 -0
- data/lib/stcloud/models/usage_dto.rb +302 -0
- data/lib/stcloud/models/usage_multi_response.rb +235 -0
- data/lib/stcloud/models/usage_multi_response_entry.rb +206 -0
- data/lib/stcloud/models/usage_response.rb +235 -0
- data/lib/stcloud/models/usage_response_entry.rb +206 -0
- data/lib/stcloud/models/user_info.rb +206 -0
- data/lib/stcloud/models/user_permissions.rb +224 -0
- data/lib/stcloud/models/user_role.rb +270 -0
- data/lib/stcloud/version.rb +14 -0
- data/lib/stcloud.rb +128 -0
- data/spec/api/alert_notifications_api_spec.rb +12 -13
- data/spec/api/alerts_api_spec.rb +10 -11
- data/spec/api/apps_api_spec.rb +31 -21
- data/spec/api/aws_settings_controller_api_spec.rb +9 -10
- data/spec/api/billing_api_spec.rb +12 -13
- data/spec/api/logs_app_api_spec.rb +6 -7
- data/spec/api/logs_usage_api_controller_api_spec.rb +47 -0
- data/spec/api/monitoring_app_api_spec.rb +6 -7
- data/spec/api/reset_password_api_spec.rb +6 -7
- data/spec/api/subscriptions_api_spec.rb +106 -14
- data/spec/api/tag_api_controller_api_spec.rb +11 -12
- data/spec/api/tokens_api_controller_api_spec.rb +94 -0
- data/spec/api_client_spec.rb +30 -31
- data/spec/base_object_spec.rb +109 -0
- data/spec/configuration_spec.rb +7 -8
- data/spec/models/alert_notification_request_spec.rb +1 -2
- data/spec/models/alert_notification_spec.rb +76 -0
- data/spec/models/alert_rule_response_entry_spec.rb +40 -0
- data/spec/models/alert_rule_response_spec.rb +58 -0
- data/spec/models/alert_rule_schedule_time_range_dto_spec.rb +1 -2
- data/spec/models/alert_rule_schedule_weekday_dto_spec.rb +1 -2
- data/spec/models/alert_rule_spec.rb +1 -2
- data/spec/models/alert_rules_response_entry_spec.rb +40 -0
- data/spec/models/alert_rules_response_spec.rb +58 -0
- data/spec/models/app_description_spec.rb +1 -2
- data/spec/models/app_metadata_spec.rb +1 -2
- data/spec/models/app_response_entry_spec.rb +40 -0
- data/spec/models/app_response_spec.rb +58 -0
- data/spec/models/app_spec.rb +31 -2
- data/spec/models/app_types_response_entry_spec.rb +40 -0
- data/spec/models/app_types_response_spec.rb +58 -0
- data/spec/models/apps_response_entry_spec.rb +40 -0
- data/spec/models/apps_response_spec.rb +58 -0
- data/spec/models/basic_auth_method_dto_spec.rb +1 -2
- data/spec/models/basic_organization_dto_spec.rb +1 -2
- data/spec/models/billing_info_spec.rb +1 -2
- data/spec/models/charges_details_response_dto_spec.rb +80 -0
- data/spec/models/cloud_watch_settings_response_entry_spec.rb +40 -0
- data/spec/models/cloud_watch_settings_response_spec.rb +58 -0
- data/spec/models/cloud_watch_settings_spec.rb +1 -2
- data/spec/models/create_app_info_spec.rb +1 -2
- data/spec/models/create_token_dto_spec.rb +52 -0
- data/spec/models/daily_dto_spec.rb +58 -0
- data/spec/models/day_usage_data_spec.rb +158 -0
- data/spec/models/dimension_spec.rb +46 -0
- data/spec/models/error_spec.rb +1 -2
- data/spec/models/event_dto_spec.rb +56 -0
- data/spec/models/filter_value_spec.rb +1 -2
- data/spec/models/generic_api_response_spec.rb +1 -2
- data/spec/models/generic_map_based_api_response_spec.rb +58 -0
- data/spec/models/invitation_spec.rb +1 -2
- data/spec/models/invoice_response_entry_spec.rb +40 -0
- data/spec/models/invoice_response_spec.rb +58 -0
- data/spec/models/invoice_spec.rb +70 -0
- data/spec/models/limit_change_event_dto_spec.rb +52 -0
- data/spec/models/mail_report_response_response_entry_spec.rb +40 -0
- data/spec/models/mail_report_response_spec.rb +58 -0
- data/spec/models/min_period_fee_period_spec.rb +100 -0
- data/spec/models/notification_integration_spec.rb +1 -2
- data/spec/models/notifications_response_entry_spec.rb +52 -0
- data/spec/models/notifications_response_spec.rb +58 -0
- data/spec/models/plan_spec.rb +2 -3
- data/spec/models/plans_response_entry_spec.rb +40 -0
- data/spec/models/plans_response_spec.rb +58 -0
- data/spec/models/report_info_spec.rb +1 -2
- data/spec/models/service_integration_spec.rb +1 -2
- data/spec/models/subscription_dashboard_dto_spec.rb +108 -0
- data/spec/models/subscription_dto_spec.rb +114 -0
- data/spec/models/subscription_response_entry_spec.rb +40 -0
- data/spec/models/subscription_response_spec.rb +58 -0
- data/spec/models/subscription_spec.rb +132 -0
- data/spec/models/subscriptions_response_entry_spec.rb +40 -0
- data/spec/models/subscriptions_response_spec.rb +58 -0
- data/spec/models/tag_names_response_spec.rb +40 -0
- data/spec/models/token_dto_spec.rb +76 -0
- data/spec/models/token_response_entry_spec.rb +40 -0
- data/spec/models/token_response_spec.rb +58 -0
- data/spec/models/tokens_response_entry_spec.rb +40 -0
- data/spec/models/tokens_response_spec.rb +58 -0
- data/spec/models/update_app_info_spec.rb +1 -2
- data/spec/models/update_plan_response_dto_spec.rb +46 -0
- data/spec/models/update_plan_response_entry_spec.rb +40 -0
- data/spec/models/update_plan_response_spec.rb +58 -0
- data/spec/models/update_subscription_dto_spec.rb +40 -0
- data/spec/models/update_token_dto_spec.rb +46 -0
- data/spec/models/usage_dto_spec.rb +100 -0
- data/spec/models/usage_multi_response_entry_spec.rb +40 -0
- data/spec/models/usage_multi_response_spec.rb +58 -0
- data/spec/models/usage_response_entry_spec.rb +40 -0
- data/spec/models/usage_response_spec.rb +58 -0
- data/spec/models/user_info_spec.rb +1 -2
- data/spec/models/user_permissions_spec.rb +1 -2
- data/spec/models/user_role_spec.rb +1 -2
- data/spec/spec_helper.rb +2 -3
- metadata +300 -148
@@ -0,0 +1,675 @@
|
|
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: 3.0.25
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module stcloud
|
15
|
+
class AlertRule
|
16
|
+
attr_accessor :account_email
|
17
|
+
|
18
|
+
attr_accessor :allowed_app_types
|
19
|
+
|
20
|
+
attr_accessor :analyzing_time
|
21
|
+
|
22
|
+
attr_accessor :app_display_state
|
23
|
+
|
24
|
+
attr_accessor :app_id
|
25
|
+
|
26
|
+
attr_accessor :app_name
|
27
|
+
|
28
|
+
attr_accessor :app_state
|
29
|
+
|
30
|
+
attr_accessor :app_token
|
31
|
+
|
32
|
+
attr_accessor :app_type
|
33
|
+
|
34
|
+
attr_accessor :back_to_normal_needed
|
35
|
+
|
36
|
+
attr_accessor :chart_key
|
37
|
+
|
38
|
+
attr_accessor :color
|
39
|
+
|
40
|
+
attr_accessor :creator_email
|
41
|
+
|
42
|
+
attr_accessor :default_agg_type
|
43
|
+
|
44
|
+
attr_accessor :description
|
45
|
+
|
46
|
+
attr_accessor :disallowed_app_types
|
47
|
+
|
48
|
+
attr_accessor :enabled
|
49
|
+
|
50
|
+
attr_accessor :estimate_operation
|
51
|
+
|
52
|
+
attr_accessor :estimate_value
|
53
|
+
|
54
|
+
attr_accessor :filter_values
|
55
|
+
|
56
|
+
attr_accessor :filter_values_obj
|
57
|
+
|
58
|
+
attr_accessor :ignore_regular_events_enabled
|
59
|
+
|
60
|
+
attr_accessor :integrations
|
61
|
+
|
62
|
+
attr_accessor :last_data_received_date
|
63
|
+
|
64
|
+
attr_accessor :last_sent
|
65
|
+
|
66
|
+
attr_accessor :last_triggered
|
67
|
+
|
68
|
+
attr_accessor :metadata
|
69
|
+
|
70
|
+
attr_accessor :metric_key
|
71
|
+
|
72
|
+
attr_accessor :metric_label
|
73
|
+
|
74
|
+
attr_accessor :min_delay_between_notifications_in_minutes
|
75
|
+
|
76
|
+
attr_accessor :name
|
77
|
+
|
78
|
+
attr_accessor :notification_emails
|
79
|
+
|
80
|
+
attr_accessor :notification_integrations
|
81
|
+
|
82
|
+
attr_accessor :notifications_enabled
|
83
|
+
|
84
|
+
attr_accessor :query
|
85
|
+
|
86
|
+
attr_accessor :report_name
|
87
|
+
|
88
|
+
attr_accessor :rule_key
|
89
|
+
|
90
|
+
attr_accessor :rule_type
|
91
|
+
|
92
|
+
attr_accessor :runbook
|
93
|
+
|
94
|
+
attr_accessor :saved_query_id
|
95
|
+
|
96
|
+
attr_accessor :schedule
|
97
|
+
|
98
|
+
attr_accessor :sematext_service
|
99
|
+
|
100
|
+
attr_accessor :send_to_email
|
101
|
+
|
102
|
+
attr_accessor :timezone
|
103
|
+
|
104
|
+
attr_accessor :use_only_alert_rule_integrations
|
105
|
+
|
106
|
+
attr_accessor :user_permissions
|
107
|
+
|
108
|
+
attr_accessor :value_column_name
|
109
|
+
|
110
|
+
attr_accessor :value_name
|
111
|
+
|
112
|
+
class EnumAttributeValidator
|
113
|
+
attr_reader :datatype
|
114
|
+
attr_reader :allowable_values
|
115
|
+
|
116
|
+
def initialize(datatype, allowable_values)
|
117
|
+
@allowable_values = allowable_values.map do |value|
|
118
|
+
case datatype.to_s
|
119
|
+
when /Integer/i
|
120
|
+
value.to_i
|
121
|
+
when /Float/i
|
122
|
+
value.to_f
|
123
|
+
else
|
124
|
+
value
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
def valid?(value)
|
130
|
+
!value || allowable_values.include?(value)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
135
|
+
def self.attribute_map
|
136
|
+
{
|
137
|
+
:'account_email' => :'accountEmail',
|
138
|
+
:'allowed_app_types' => :'allowedAppTypes',
|
139
|
+
:'analyzing_time' => :'analyzingTime',
|
140
|
+
:'app_display_state' => :'appDisplayState',
|
141
|
+
:'app_id' => :'appId',
|
142
|
+
:'app_name' => :'appName',
|
143
|
+
:'app_state' => :'appState',
|
144
|
+
:'app_token' => :'appToken',
|
145
|
+
:'app_type' => :'appType',
|
146
|
+
:'back_to_normal_needed' => :'backToNormalNeeded',
|
147
|
+
:'chart_key' => :'chartKey',
|
148
|
+
:'color' => :'color',
|
149
|
+
:'creator_email' => :'creatorEmail',
|
150
|
+
:'default_agg_type' => :'defaultAggType',
|
151
|
+
:'description' => :'description',
|
152
|
+
:'disallowed_app_types' => :'disallowedAppTypes',
|
153
|
+
:'enabled' => :'enabled',
|
154
|
+
:'estimate_operation' => :'estimateOperation',
|
155
|
+
:'estimate_value' => :'estimateValue',
|
156
|
+
:'filter_values' => :'filterValues',
|
157
|
+
:'filter_values_obj' => :'filterValuesObj',
|
158
|
+
:'ignore_regular_events_enabled' => :'ignoreRegularEventsEnabled',
|
159
|
+
:'integrations' => :'integrations',
|
160
|
+
:'last_data_received_date' => :'lastDataReceivedDate',
|
161
|
+
:'last_sent' => :'lastSent',
|
162
|
+
:'last_triggered' => :'lastTriggered',
|
163
|
+
:'metadata' => :'metadata',
|
164
|
+
:'metric_key' => :'metricKey',
|
165
|
+
:'metric_label' => :'metricLabel',
|
166
|
+
:'min_delay_between_notifications_in_minutes' => :'minDelayBetweenNotificationsInMinutes',
|
167
|
+
:'name' => :'name',
|
168
|
+
:'notification_emails' => :'notificationEmails',
|
169
|
+
:'notification_integrations' => :'notificationIntegrations',
|
170
|
+
:'notifications_enabled' => :'notificationsEnabled',
|
171
|
+
:'query' => :'query',
|
172
|
+
:'report_name' => :'reportName',
|
173
|
+
:'rule_key' => :'ruleKey',
|
174
|
+
:'rule_type' => :'ruleType',
|
175
|
+
:'runbook' => :'runbook',
|
176
|
+
:'saved_query_id' => :'savedQueryId',
|
177
|
+
:'schedule' => :'schedule',
|
178
|
+
:'sematext_service' => :'sematextService',
|
179
|
+
:'send_to_email' => :'sendToEmail',
|
180
|
+
:'timezone' => :'timezone',
|
181
|
+
:'use_only_alert_rule_integrations' => :'useOnlyAlertRuleIntegrations',
|
182
|
+
:'user_permissions' => :'userPermissions',
|
183
|
+
:'value_column_name' => :'valueColumnName',
|
184
|
+
:'value_name' => :'valueName'
|
185
|
+
}
|
186
|
+
end
|
187
|
+
|
188
|
+
# Attribute type mapping.
|
189
|
+
def self.openapi_types
|
190
|
+
{
|
191
|
+
:'account_email' => :'Object',
|
192
|
+
:'allowed_app_types' => :'Object',
|
193
|
+
:'analyzing_time' => :'Object',
|
194
|
+
:'app_display_state' => :'Object',
|
195
|
+
:'app_id' => :'Object',
|
196
|
+
:'app_name' => :'Object',
|
197
|
+
:'app_state' => :'Object',
|
198
|
+
:'app_token' => :'Object',
|
199
|
+
:'app_type' => :'Object',
|
200
|
+
:'back_to_normal_needed' => :'Object',
|
201
|
+
:'chart_key' => :'Object',
|
202
|
+
:'color' => :'Object',
|
203
|
+
:'creator_email' => :'Object',
|
204
|
+
:'default_agg_type' => :'Object',
|
205
|
+
:'description' => :'Object',
|
206
|
+
:'disallowed_app_types' => :'Object',
|
207
|
+
:'enabled' => :'Object',
|
208
|
+
:'estimate_operation' => :'Object',
|
209
|
+
:'estimate_value' => :'Object',
|
210
|
+
:'filter_values' => :'Object',
|
211
|
+
:'filter_values_obj' => :'Object',
|
212
|
+
:'ignore_regular_events_enabled' => :'Object',
|
213
|
+
:'integrations' => :'Object',
|
214
|
+
:'last_data_received_date' => :'Object',
|
215
|
+
:'last_sent' => :'Object',
|
216
|
+
:'last_triggered' => :'Object',
|
217
|
+
:'metadata' => :'Object',
|
218
|
+
:'metric_key' => :'Object',
|
219
|
+
:'metric_label' => :'Object',
|
220
|
+
:'min_delay_between_notifications_in_minutes' => :'Object',
|
221
|
+
:'name' => :'Object',
|
222
|
+
:'notification_emails' => :'Object',
|
223
|
+
:'notification_integrations' => :'Object',
|
224
|
+
:'notifications_enabled' => :'Object',
|
225
|
+
:'query' => :'Object',
|
226
|
+
:'report_name' => :'Object',
|
227
|
+
:'rule_key' => :'Object',
|
228
|
+
:'rule_type' => :'Object',
|
229
|
+
:'runbook' => :'Object',
|
230
|
+
:'saved_query_id' => :'Object',
|
231
|
+
:'schedule' => :'Object',
|
232
|
+
:'sematext_service' => :'Object',
|
233
|
+
:'send_to_email' => :'Object',
|
234
|
+
:'timezone' => :'Object',
|
235
|
+
:'use_only_alert_rule_integrations' => :'Object',
|
236
|
+
:'user_permissions' => :'Object',
|
237
|
+
:'value_column_name' => :'Object',
|
238
|
+
:'value_name' => :'Object'
|
239
|
+
}
|
240
|
+
end
|
241
|
+
|
242
|
+
# List of attributes with nullable: true
|
243
|
+
def self.openapi_nullable
|
244
|
+
Set.new([
|
245
|
+
])
|
246
|
+
end
|
247
|
+
|
248
|
+
# Initializes the object
|
249
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
250
|
+
def initialize(attributes = {})
|
251
|
+
if (!attributes.is_a?(Hash))
|
252
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `stcloud::AlertRule` initialize method"
|
253
|
+
end
|
254
|
+
|
255
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
256
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
257
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
258
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `stcloud::AlertRule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
259
|
+
end
|
260
|
+
h[k.to_sym] = v
|
261
|
+
}
|
262
|
+
|
263
|
+
if attributes.key?(:'account_email')
|
264
|
+
self.account_email = attributes[:'account_email']
|
265
|
+
end
|
266
|
+
|
267
|
+
if attributes.key?(:'allowed_app_types')
|
268
|
+
if (value = attributes[:'allowed_app_types']).is_a?(Array)
|
269
|
+
self.allowed_app_types = value
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
if attributes.key?(:'analyzing_time')
|
274
|
+
self.analyzing_time = attributes[:'analyzing_time']
|
275
|
+
end
|
276
|
+
|
277
|
+
if attributes.key?(:'app_display_state')
|
278
|
+
self.app_display_state = attributes[:'app_display_state']
|
279
|
+
end
|
280
|
+
|
281
|
+
if attributes.key?(:'app_id')
|
282
|
+
self.app_id = attributes[:'app_id']
|
283
|
+
end
|
284
|
+
|
285
|
+
if attributes.key?(:'app_name')
|
286
|
+
self.app_name = attributes[:'app_name']
|
287
|
+
end
|
288
|
+
|
289
|
+
if attributes.key?(:'app_state')
|
290
|
+
self.app_state = attributes[:'app_state']
|
291
|
+
end
|
292
|
+
|
293
|
+
if attributes.key?(:'app_token')
|
294
|
+
self.app_token = attributes[:'app_token']
|
295
|
+
end
|
296
|
+
|
297
|
+
if attributes.key?(:'app_type')
|
298
|
+
self.app_type = attributes[:'app_type']
|
299
|
+
end
|
300
|
+
|
301
|
+
if attributes.key?(:'back_to_normal_needed')
|
302
|
+
self.back_to_normal_needed = attributes[:'back_to_normal_needed']
|
303
|
+
end
|
304
|
+
|
305
|
+
if attributes.key?(:'chart_key')
|
306
|
+
self.chart_key = attributes[:'chart_key']
|
307
|
+
end
|
308
|
+
|
309
|
+
if attributes.key?(:'color')
|
310
|
+
self.color = attributes[:'color']
|
311
|
+
end
|
312
|
+
|
313
|
+
if attributes.key?(:'creator_email')
|
314
|
+
self.creator_email = attributes[:'creator_email']
|
315
|
+
end
|
316
|
+
|
317
|
+
if attributes.key?(:'default_agg_type')
|
318
|
+
self.default_agg_type = attributes[:'default_agg_type']
|
319
|
+
end
|
320
|
+
|
321
|
+
if attributes.key?(:'description')
|
322
|
+
self.description = attributes[:'description']
|
323
|
+
end
|
324
|
+
|
325
|
+
if attributes.key?(:'disallowed_app_types')
|
326
|
+
if (value = attributes[:'disallowed_app_types']).is_a?(Array)
|
327
|
+
self.disallowed_app_types = value
|
328
|
+
end
|
329
|
+
end
|
330
|
+
|
331
|
+
if attributes.key?(:'enabled')
|
332
|
+
self.enabled = attributes[:'enabled']
|
333
|
+
end
|
334
|
+
|
335
|
+
if attributes.key?(:'estimate_operation')
|
336
|
+
self.estimate_operation = attributes[:'estimate_operation']
|
337
|
+
end
|
338
|
+
|
339
|
+
if attributes.key?(:'estimate_value')
|
340
|
+
self.estimate_value = attributes[:'estimate_value']
|
341
|
+
end
|
342
|
+
|
343
|
+
if attributes.key?(:'filter_values')
|
344
|
+
self.filter_values = attributes[:'filter_values']
|
345
|
+
end
|
346
|
+
|
347
|
+
if attributes.key?(:'filter_values_obj')
|
348
|
+
if (value = attributes[:'filter_values_obj']).is_a?(Array)
|
349
|
+
self.filter_values_obj = value
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
if attributes.key?(:'ignore_regular_events_enabled')
|
354
|
+
self.ignore_regular_events_enabled = attributes[:'ignore_regular_events_enabled']
|
355
|
+
end
|
356
|
+
|
357
|
+
if attributes.key?(:'integrations')
|
358
|
+
self.integrations = attributes[:'integrations']
|
359
|
+
end
|
360
|
+
|
361
|
+
if attributes.key?(:'last_data_received_date')
|
362
|
+
self.last_data_received_date = attributes[:'last_data_received_date']
|
363
|
+
end
|
364
|
+
|
365
|
+
if attributes.key?(:'last_sent')
|
366
|
+
self.last_sent = attributes[:'last_sent']
|
367
|
+
end
|
368
|
+
|
369
|
+
if attributes.key?(:'last_triggered')
|
370
|
+
self.last_triggered = attributes[:'last_triggered']
|
371
|
+
end
|
372
|
+
|
373
|
+
if attributes.key?(:'metadata')
|
374
|
+
self.metadata = attributes[:'metadata']
|
375
|
+
end
|
376
|
+
|
377
|
+
if attributes.key?(:'metric_key')
|
378
|
+
self.metric_key = attributes[:'metric_key']
|
379
|
+
end
|
380
|
+
|
381
|
+
if attributes.key?(:'metric_label')
|
382
|
+
self.metric_label = attributes[:'metric_label']
|
383
|
+
end
|
384
|
+
|
385
|
+
if attributes.key?(:'min_delay_between_notifications_in_minutes')
|
386
|
+
self.min_delay_between_notifications_in_minutes = attributes[:'min_delay_between_notifications_in_minutes']
|
387
|
+
end
|
388
|
+
|
389
|
+
if attributes.key?(:'name')
|
390
|
+
self.name = attributes[:'name']
|
391
|
+
end
|
392
|
+
|
393
|
+
if attributes.key?(:'notification_emails')
|
394
|
+
if (value = attributes[:'notification_emails']).is_a?(Array)
|
395
|
+
self.notification_emails = value
|
396
|
+
end
|
397
|
+
end
|
398
|
+
|
399
|
+
if attributes.key?(:'notification_integrations')
|
400
|
+
if (value = attributes[:'notification_integrations']).is_a?(Array)
|
401
|
+
self.notification_integrations = value
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
if attributes.key?(:'notifications_enabled')
|
406
|
+
self.notifications_enabled = attributes[:'notifications_enabled']
|
407
|
+
end
|
408
|
+
|
409
|
+
if attributes.key?(:'query')
|
410
|
+
self.query = attributes[:'query']
|
411
|
+
end
|
412
|
+
|
413
|
+
if attributes.key?(:'report_name')
|
414
|
+
self.report_name = attributes[:'report_name']
|
415
|
+
end
|
416
|
+
|
417
|
+
if attributes.key?(:'rule_key')
|
418
|
+
self.rule_key = attributes[:'rule_key']
|
419
|
+
end
|
420
|
+
|
421
|
+
if attributes.key?(:'rule_type')
|
422
|
+
self.rule_type = attributes[:'rule_type']
|
423
|
+
end
|
424
|
+
|
425
|
+
if attributes.key?(:'runbook')
|
426
|
+
self.runbook = attributes[:'runbook']
|
427
|
+
end
|
428
|
+
|
429
|
+
if attributes.key?(:'saved_query_id')
|
430
|
+
self.saved_query_id = attributes[:'saved_query_id']
|
431
|
+
end
|
432
|
+
|
433
|
+
if attributes.key?(:'schedule')
|
434
|
+
if (value = attributes[:'schedule']).is_a?(Array)
|
435
|
+
self.schedule = value
|
436
|
+
end
|
437
|
+
end
|
438
|
+
|
439
|
+
if attributes.key?(:'sematext_service')
|
440
|
+
self.sematext_service = attributes[:'sematext_service']
|
441
|
+
end
|
442
|
+
|
443
|
+
if attributes.key?(:'send_to_email')
|
444
|
+
self.send_to_email = attributes[:'send_to_email']
|
445
|
+
end
|
446
|
+
|
447
|
+
if attributes.key?(:'timezone')
|
448
|
+
self.timezone = attributes[:'timezone']
|
449
|
+
end
|
450
|
+
|
451
|
+
if attributes.key?(:'use_only_alert_rule_integrations')
|
452
|
+
self.use_only_alert_rule_integrations = attributes[:'use_only_alert_rule_integrations']
|
453
|
+
end
|
454
|
+
|
455
|
+
if attributes.key?(:'user_permissions')
|
456
|
+
self.user_permissions = attributes[:'user_permissions']
|
457
|
+
end
|
458
|
+
|
459
|
+
if attributes.key?(:'value_column_name')
|
460
|
+
self.value_column_name = attributes[:'value_column_name']
|
461
|
+
end
|
462
|
+
|
463
|
+
if attributes.key?(:'value_name')
|
464
|
+
self.value_name = attributes[:'value_name']
|
465
|
+
end
|
466
|
+
end
|
467
|
+
|
468
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
469
|
+
# @return Array for valid properties with the reasons
|
470
|
+
def list_invalid_properties
|
471
|
+
invalid_properties = Array.new
|
472
|
+
invalid_properties
|
473
|
+
end
|
474
|
+
|
475
|
+
# Check to see if the all the properties in the model are valid
|
476
|
+
# @return true if the model is valid
|
477
|
+
def valid?
|
478
|
+
estimate_operation_validator = EnumAttributeValidator.new('Object', ['LESS', 'MORE', 'EQUAL', 'UN_EQUAL', 'LESS_OR_EQUAL', 'MORE_OR_EQUAL'])
|
479
|
+
return false unless estimate_operation_validator.valid?(@estimate_operation)
|
480
|
+
true
|
481
|
+
end
|
482
|
+
|
483
|
+
# Custom attribute writer method checking allowed values (enum).
|
484
|
+
# @param [Object] estimate_operation Object to be assigned
|
485
|
+
def estimate_operation=(estimate_operation)
|
486
|
+
validator = EnumAttributeValidator.new('Object', ['LESS', 'MORE', 'EQUAL', 'UN_EQUAL', 'LESS_OR_EQUAL', 'MORE_OR_EQUAL'])
|
487
|
+
unless validator.valid?(estimate_operation)
|
488
|
+
fail ArgumentError, "invalid value for \"estimate_operation\", must be one of #{validator.allowable_values}."
|
489
|
+
end
|
490
|
+
@estimate_operation = estimate_operation
|
491
|
+
end
|
492
|
+
|
493
|
+
# Checks equality by comparing each attribute.
|
494
|
+
# @param [Object] Object to be compared
|
495
|
+
def ==(o)
|
496
|
+
return true if self.equal?(o)
|
497
|
+
self.class == o.class &&
|
498
|
+
account_email == o.account_email &&
|
499
|
+
allowed_app_types == o.allowed_app_types &&
|
500
|
+
analyzing_time == o.analyzing_time &&
|
501
|
+
app_display_state == o.app_display_state &&
|
502
|
+
app_id == o.app_id &&
|
503
|
+
app_name == o.app_name &&
|
504
|
+
app_state == o.app_state &&
|
505
|
+
app_token == o.app_token &&
|
506
|
+
app_type == o.app_type &&
|
507
|
+
back_to_normal_needed == o.back_to_normal_needed &&
|
508
|
+
chart_key == o.chart_key &&
|
509
|
+
color == o.color &&
|
510
|
+
creator_email == o.creator_email &&
|
511
|
+
default_agg_type == o.default_agg_type &&
|
512
|
+
description == o.description &&
|
513
|
+
disallowed_app_types == o.disallowed_app_types &&
|
514
|
+
enabled == o.enabled &&
|
515
|
+
estimate_operation == o.estimate_operation &&
|
516
|
+
estimate_value == o.estimate_value &&
|
517
|
+
filter_values == o.filter_values &&
|
518
|
+
filter_values_obj == o.filter_values_obj &&
|
519
|
+
ignore_regular_events_enabled == o.ignore_regular_events_enabled &&
|
520
|
+
integrations == o.integrations &&
|
521
|
+
last_data_received_date == o.last_data_received_date &&
|
522
|
+
last_sent == o.last_sent &&
|
523
|
+
last_triggered == o.last_triggered &&
|
524
|
+
metadata == o.metadata &&
|
525
|
+
metric_key == o.metric_key &&
|
526
|
+
metric_label == o.metric_label &&
|
527
|
+
min_delay_between_notifications_in_minutes == o.min_delay_between_notifications_in_minutes &&
|
528
|
+
name == o.name &&
|
529
|
+
notification_emails == o.notification_emails &&
|
530
|
+
notification_integrations == o.notification_integrations &&
|
531
|
+
notifications_enabled == o.notifications_enabled &&
|
532
|
+
query == o.query &&
|
533
|
+
report_name == o.report_name &&
|
534
|
+
rule_key == o.rule_key &&
|
535
|
+
rule_type == o.rule_type &&
|
536
|
+
runbook == o.runbook &&
|
537
|
+
saved_query_id == o.saved_query_id &&
|
538
|
+
schedule == o.schedule &&
|
539
|
+
sematext_service == o.sematext_service &&
|
540
|
+
send_to_email == o.send_to_email &&
|
541
|
+
timezone == o.timezone &&
|
542
|
+
use_only_alert_rule_integrations == o.use_only_alert_rule_integrations &&
|
543
|
+
user_permissions == o.user_permissions &&
|
544
|
+
value_column_name == o.value_column_name &&
|
545
|
+
value_name == o.value_name
|
546
|
+
end
|
547
|
+
|
548
|
+
# @see the `==` method
|
549
|
+
# @param [Object] Object to be compared
|
550
|
+
def eql?(o)
|
551
|
+
self == o
|
552
|
+
end
|
553
|
+
|
554
|
+
# Calculates hash code according to all attributes.
|
555
|
+
# @return [Integer] Hash code
|
556
|
+
def hash
|
557
|
+
[account_email, allowed_app_types, analyzing_time, app_display_state, app_id, app_name, app_state, app_token, app_type, back_to_normal_needed, chart_key, color, creator_email, default_agg_type, description, disallowed_app_types, enabled, estimate_operation, estimate_value, filter_values, filter_values_obj, ignore_regular_events_enabled, integrations, last_data_received_date, last_sent, last_triggered, metadata, metric_key, metric_label, min_delay_between_notifications_in_minutes, name, notification_emails, notification_integrations, notifications_enabled, query, report_name, rule_key, rule_type, runbook, saved_query_id, schedule, sematext_service, send_to_email, timezone, use_only_alert_rule_integrations, user_permissions, value_column_name, value_name].hash
|
558
|
+
end
|
559
|
+
|
560
|
+
# Builds the object from hash
|
561
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
562
|
+
# @return [Object] Returns the model itself
|
563
|
+
def self.build_from_hash(attributes)
|
564
|
+
new.build_from_hash(attributes)
|
565
|
+
end
|
566
|
+
|
567
|
+
# Builds the object from hash
|
568
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
569
|
+
# @return [Object] Returns the model itself
|
570
|
+
def build_from_hash(attributes)
|
571
|
+
return nil unless attributes.is_a?(Hash)
|
572
|
+
self.class.openapi_types.each_pair do |key, type|
|
573
|
+
if type =~ /\AArray<(.*)>/i
|
574
|
+
# check to ensure the input is an array given that the attribute
|
575
|
+
# is documented as an array but the input is not
|
576
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
577
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
578
|
+
end
|
579
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
580
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
581
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
582
|
+
self.send("#{key}=", nil)
|
583
|
+
end
|
584
|
+
end
|
585
|
+
|
586
|
+
self
|
587
|
+
end
|
588
|
+
|
589
|
+
# Deserializes the data based on type
|
590
|
+
# @param string type Data type
|
591
|
+
# @param string value Value to be deserialized
|
592
|
+
# @return [Object] Deserialized data
|
593
|
+
def _deserialize(type, value)
|
594
|
+
case type.to_sym
|
595
|
+
when :DateTime
|
596
|
+
DateTime.parse(value)
|
597
|
+
when :Date
|
598
|
+
Date.parse(value)
|
599
|
+
when :String
|
600
|
+
value.to_s
|
601
|
+
when :Integer
|
602
|
+
value.to_i
|
603
|
+
when :Float
|
604
|
+
value.to_f
|
605
|
+
when :Boolean
|
606
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
607
|
+
true
|
608
|
+
else
|
609
|
+
false
|
610
|
+
end
|
611
|
+
when :Object
|
612
|
+
# generic object (usually a Hash), return directly
|
613
|
+
value
|
614
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
615
|
+
inner_type = Regexp.last_match[:inner_type]
|
616
|
+
value.map { |v| _deserialize(inner_type, v) }
|
617
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
618
|
+
k_type = Regexp.last_match[:k_type]
|
619
|
+
v_type = Regexp.last_match[:v_type]
|
620
|
+
{}.tap do |hash|
|
621
|
+
value.each do |k, v|
|
622
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
623
|
+
end
|
624
|
+
end
|
625
|
+
else # model
|
626
|
+
stcloud.const_get(type).build_from_hash(value)
|
627
|
+
end
|
628
|
+
end
|
629
|
+
|
630
|
+
# Returns the string representation of the object
|
631
|
+
# @return [String] String presentation of the object
|
632
|
+
def to_s
|
633
|
+
to_hash.to_s
|
634
|
+
end
|
635
|
+
|
636
|
+
# to_body is an alias to to_hash (backward compatibility)
|
637
|
+
# @return [Hash] Returns the object in the form of hash
|
638
|
+
def to_body
|
639
|
+
to_hash
|
640
|
+
end
|
641
|
+
|
642
|
+
# Returns the object in the form of hash
|
643
|
+
# @return [Hash] Returns the object in the form of hash
|
644
|
+
def to_hash
|
645
|
+
hash = {}
|
646
|
+
self.class.attribute_map.each_pair do |attr, param|
|
647
|
+
value = self.send(attr)
|
648
|
+
if value.nil?
|
649
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
650
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
651
|
+
end
|
652
|
+
|
653
|
+
hash[param] = _to_hash(value)
|
654
|
+
end
|
655
|
+
hash
|
656
|
+
end
|
657
|
+
|
658
|
+
# Outputs non-array value in the form of hash
|
659
|
+
# For object, use to_hash. Otherwise, just return the value
|
660
|
+
# @param [Object] value Any valid value
|
661
|
+
# @return [Hash] Returns the value in the form of hash
|
662
|
+
def _to_hash(value)
|
663
|
+
if value.is_a?(Array)
|
664
|
+
value.compact.map { |v| _to_hash(v) }
|
665
|
+
elsif value.is_a?(Hash)
|
666
|
+
{}.tap do |hash|
|
667
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
668
|
+
end
|
669
|
+
elsif value.respond_to? :to_hash
|
670
|
+
value.to_hash
|
671
|
+
else
|
672
|
+
value
|
673
|
+
end
|
674
|
+
end end
|
675
|
+
end
|