SematextCloud 0.1.2 → 0.3.0
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/README.md +80 -69
- 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/apps_api.rb +52 -0
- 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.rb +128 -0
- 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/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 -150
- data/assets/octi-blue.png +0 -0
@@ -0,0 +1,347 @@
|
|
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 NotificationIntegration
|
16
|
+
attr_accessor :applicability
|
17
|
+
|
18
|
+
attr_accessor :create_date
|
19
|
+
|
20
|
+
attr_accessor :created_by_owner
|
21
|
+
|
22
|
+
attr_accessor :creator_id
|
23
|
+
|
24
|
+
attr_accessor :id
|
25
|
+
|
26
|
+
attr_accessor :integration_type
|
27
|
+
|
28
|
+
attr_accessor :name
|
29
|
+
|
30
|
+
attr_accessor :params
|
31
|
+
|
32
|
+
attr_accessor :state
|
33
|
+
|
34
|
+
attr_accessor :user_id
|
35
|
+
|
36
|
+
class EnumAttributeValidator
|
37
|
+
attr_reader :datatype
|
38
|
+
attr_reader :allowable_values
|
39
|
+
|
40
|
+
def initialize(datatype, allowable_values)
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
42
|
+
case datatype.to_s
|
43
|
+
when /Integer/i
|
44
|
+
value.to_i
|
45
|
+
when /Float/i
|
46
|
+
value.to_f
|
47
|
+
else
|
48
|
+
value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def valid?(value)
|
54
|
+
!value || allowable_values.include?(value)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
59
|
+
def self.attribute_map
|
60
|
+
{
|
61
|
+
:'applicability' => :'applicability',
|
62
|
+
:'create_date' => :'createDate',
|
63
|
+
:'created_by_owner' => :'createdByOwner',
|
64
|
+
:'creator_id' => :'creatorId',
|
65
|
+
:'id' => :'id',
|
66
|
+
:'integration_type' => :'integrationType',
|
67
|
+
:'name' => :'name',
|
68
|
+
:'params' => :'params',
|
69
|
+
:'state' => :'state',
|
70
|
+
:'user_id' => :'userId'
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
# Attribute type mapping.
|
75
|
+
def self.openapi_types
|
76
|
+
{
|
77
|
+
:'applicability' => :'Object',
|
78
|
+
:'create_date' => :'Object',
|
79
|
+
:'created_by_owner' => :'Object',
|
80
|
+
:'creator_id' => :'Object',
|
81
|
+
:'id' => :'Object',
|
82
|
+
:'integration_type' => :'Object',
|
83
|
+
:'name' => :'Object',
|
84
|
+
:'params' => :'Object',
|
85
|
+
:'state' => :'Object',
|
86
|
+
:'user_id' => :'Object'
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
# List of attributes with nullable: true
|
91
|
+
def self.openapi_nullable
|
92
|
+
Set.new([
|
93
|
+
])
|
94
|
+
end
|
95
|
+
|
96
|
+
# Initializes the object
|
97
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
98
|
+
def initialize(attributes = {})
|
99
|
+
if (!attributes.is_a?(Hash))
|
100
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `stcloud::NotificationIntegration` initialize method"
|
101
|
+
end
|
102
|
+
|
103
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
104
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
105
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
106
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `stcloud::NotificationIntegration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
107
|
+
end
|
108
|
+
h[k.to_sym] = v
|
109
|
+
}
|
110
|
+
|
111
|
+
if attributes.key?(:'applicability')
|
112
|
+
self.applicability = attributes[:'applicability']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'create_date')
|
116
|
+
self.create_date = attributes[:'create_date']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:'created_by_owner')
|
120
|
+
self.created_by_owner = attributes[:'created_by_owner']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:'creator_id')
|
124
|
+
self.creator_id = attributes[:'creator_id']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.key?(:'id')
|
128
|
+
self.id = attributes[:'id']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.key?(:'integration_type')
|
132
|
+
self.integration_type = attributes[:'integration_type']
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.key?(:'name')
|
136
|
+
self.name = attributes[:'name']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.key?(:'params')
|
140
|
+
if (value = attributes[:'params']).is_a?(Hash)
|
141
|
+
self.params = value
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.key?(:'state')
|
146
|
+
self.state = attributes[:'state']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.key?(:'user_id')
|
150
|
+
self.user_id = attributes[:'user_id']
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
155
|
+
# @return Array for valid properties with the reasons
|
156
|
+
def list_invalid_properties
|
157
|
+
invalid_properties = Array.new
|
158
|
+
invalid_properties
|
159
|
+
end
|
160
|
+
|
161
|
+
# Check to see if the all the properties in the model are valid
|
162
|
+
# @return true if the model is valid
|
163
|
+
def valid?
|
164
|
+
applicability_validator = EnumAttributeValidator.new('Object', ['NONE', 'USE_ALWAYS'])
|
165
|
+
return false unless applicability_validator.valid?(@applicability)
|
166
|
+
integration_type_validator = EnumAttributeValidator.new('Object', ['PAGER_DUTY', 'NAGIOS', 'WEB_HOOKS', 'WEB_HOOKS_TEMPLATE', 'HIP_CHAT', 'EMAIL_LIST', 'TEMPORARY_EMAIL_LIST'])
|
167
|
+
return false unless integration_type_validator.valid?(@integration_type)
|
168
|
+
state_validator = EnumAttributeValidator.new('Object', ['ACTIVE', 'DISABLED', 'DELETED'])
|
169
|
+
return false unless state_validator.valid?(@state)
|
170
|
+
true
|
171
|
+
end
|
172
|
+
|
173
|
+
# Custom attribute writer method checking allowed values (enum).
|
174
|
+
# @param [Object] applicability Object to be assigned
|
175
|
+
def applicability=(applicability)
|
176
|
+
validator = EnumAttributeValidator.new('Object', ['NONE', 'USE_ALWAYS'])
|
177
|
+
unless validator.valid?(applicability)
|
178
|
+
fail ArgumentError, "invalid value for \"applicability\", must be one of #{validator.allowable_values}."
|
179
|
+
end
|
180
|
+
@applicability = applicability
|
181
|
+
end
|
182
|
+
|
183
|
+
# Custom attribute writer method checking allowed values (enum).
|
184
|
+
# @param [Object] integration_type Object to be assigned
|
185
|
+
def integration_type=(integration_type)
|
186
|
+
validator = EnumAttributeValidator.new('Object', ['PAGER_DUTY', 'NAGIOS', 'WEB_HOOKS', 'WEB_HOOKS_TEMPLATE', 'HIP_CHAT', 'EMAIL_LIST', 'TEMPORARY_EMAIL_LIST'])
|
187
|
+
unless validator.valid?(integration_type)
|
188
|
+
fail ArgumentError, "invalid value for \"integration_type\", must be one of #{validator.allowable_values}."
|
189
|
+
end
|
190
|
+
@integration_type = integration_type
|
191
|
+
end
|
192
|
+
|
193
|
+
# Custom attribute writer method checking allowed values (enum).
|
194
|
+
# @param [Object] state Object to be assigned
|
195
|
+
def state=(state)
|
196
|
+
validator = EnumAttributeValidator.new('Object', ['ACTIVE', 'DISABLED', 'DELETED'])
|
197
|
+
unless validator.valid?(state)
|
198
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
|
199
|
+
end
|
200
|
+
@state = state
|
201
|
+
end
|
202
|
+
|
203
|
+
# Checks equality by comparing each attribute.
|
204
|
+
# @param [Object] Object to be compared
|
205
|
+
def ==(o)
|
206
|
+
return true if self.equal?(o)
|
207
|
+
self.class == o.class &&
|
208
|
+
applicability == o.applicability &&
|
209
|
+
create_date == o.create_date &&
|
210
|
+
created_by_owner == o.created_by_owner &&
|
211
|
+
creator_id == o.creator_id &&
|
212
|
+
id == o.id &&
|
213
|
+
integration_type == o.integration_type &&
|
214
|
+
name == o.name &&
|
215
|
+
params == o.params &&
|
216
|
+
state == o.state &&
|
217
|
+
user_id == o.user_id
|
218
|
+
end
|
219
|
+
|
220
|
+
# @see the `==` method
|
221
|
+
# @param [Object] Object to be compared
|
222
|
+
def eql?(o)
|
223
|
+
self == o
|
224
|
+
end
|
225
|
+
|
226
|
+
# Calculates hash code according to all attributes.
|
227
|
+
# @return [Integer] Hash code
|
228
|
+
def hash
|
229
|
+
[applicability, create_date, created_by_owner, creator_id, id, integration_type, name, params, state, user_id].hash
|
230
|
+
end
|
231
|
+
|
232
|
+
# Builds the object from hash
|
233
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
234
|
+
# @return [Object] Returns the model itself
|
235
|
+
def self.build_from_hash(attributes)
|
236
|
+
new.build_from_hash(attributes)
|
237
|
+
end
|
238
|
+
|
239
|
+
# Builds the object from hash
|
240
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
241
|
+
# @return [Object] Returns the model itself
|
242
|
+
def build_from_hash(attributes)
|
243
|
+
return nil unless attributes.is_a?(Hash)
|
244
|
+
self.class.openapi_types.each_pair do |key, type|
|
245
|
+
if type =~ /\AArray<(.*)>/i
|
246
|
+
# check to ensure the input is an array given that the attribute
|
247
|
+
# is documented as an array but the input is not
|
248
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
249
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
250
|
+
end
|
251
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
252
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
253
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
254
|
+
self.send("#{key}=", nil)
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
self
|
259
|
+
end
|
260
|
+
|
261
|
+
# Deserializes the data based on type
|
262
|
+
# @param string type Data type
|
263
|
+
# @param string value Value to be deserialized
|
264
|
+
# @return [Object] Deserialized data
|
265
|
+
def _deserialize(type, value)
|
266
|
+
case type.to_sym
|
267
|
+
when :DateTime
|
268
|
+
DateTime.parse(value)
|
269
|
+
when :Date
|
270
|
+
Date.parse(value)
|
271
|
+
when :String
|
272
|
+
value.to_s
|
273
|
+
when :Integer
|
274
|
+
value.to_i
|
275
|
+
when :Float
|
276
|
+
value.to_f
|
277
|
+
when :Boolean
|
278
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
279
|
+
true
|
280
|
+
else
|
281
|
+
false
|
282
|
+
end
|
283
|
+
when :Object
|
284
|
+
# generic object (usually a Hash), return directly
|
285
|
+
value
|
286
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
287
|
+
inner_type = Regexp.last_match[:inner_type]
|
288
|
+
value.map { |v| _deserialize(inner_type, v) }
|
289
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
290
|
+
k_type = Regexp.last_match[:k_type]
|
291
|
+
v_type = Regexp.last_match[:v_type]
|
292
|
+
{}.tap do |hash|
|
293
|
+
value.each do |k, v|
|
294
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
295
|
+
end
|
296
|
+
end
|
297
|
+
else # model
|
298
|
+
stcloud.const_get(type).build_from_hash(value)
|
299
|
+
end
|
300
|
+
end
|
301
|
+
|
302
|
+
# Returns the string representation of the object
|
303
|
+
# @return [String] String presentation of the object
|
304
|
+
def to_s
|
305
|
+
to_hash.to_s
|
306
|
+
end
|
307
|
+
|
308
|
+
# to_body is an alias to to_hash (backward compatibility)
|
309
|
+
# @return [Hash] Returns the object in the form of hash
|
310
|
+
def to_body
|
311
|
+
to_hash
|
312
|
+
end
|
313
|
+
|
314
|
+
# Returns the object in the form of hash
|
315
|
+
# @return [Hash] Returns the object in the form of hash
|
316
|
+
def to_hash
|
317
|
+
hash = {}
|
318
|
+
self.class.attribute_map.each_pair do |attr, param|
|
319
|
+
value = self.send(attr)
|
320
|
+
if value.nil?
|
321
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
322
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
323
|
+
end
|
324
|
+
|
325
|
+
hash[param] = _to_hash(value)
|
326
|
+
end
|
327
|
+
hash
|
328
|
+
end
|
329
|
+
|
330
|
+
# Outputs non-array value in the form of hash
|
331
|
+
# For object, use to_hash. Otherwise, just return the value
|
332
|
+
# @param [Object] value Any valid value
|
333
|
+
# @return [Hash] Returns the value in the form of hash
|
334
|
+
def _to_hash(value)
|
335
|
+
if value.is_a?(Array)
|
336
|
+
value.compact.map { |v| _to_hash(v) }
|
337
|
+
elsif value.is_a?(Hash)
|
338
|
+
{}.tap do |hash|
|
339
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
340
|
+
end
|
341
|
+
elsif value.respond_to? :to_hash
|
342
|
+
value.to_hash
|
343
|
+
else
|
344
|
+
value
|
345
|
+
end
|
346
|
+
end end
|
347
|
+
end
|
@@ -0,0 +1,235 @@
|
|
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 NotificationsResponse
|
16
|
+
attr_accessor :data
|
17
|
+
|
18
|
+
attr_accessor :errors
|
19
|
+
|
20
|
+
attr_accessor :message
|
21
|
+
|
22
|
+
attr_accessor :success
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'data' => :'data',
|
28
|
+
:'errors' => :'errors',
|
29
|
+
:'message' => :'message',
|
30
|
+
:'success' => :'success'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.openapi_types
|
36
|
+
{
|
37
|
+
:'data' => :'Object',
|
38
|
+
:'errors' => :'Object',
|
39
|
+
:'message' => :'Object',
|
40
|
+
:'success' => :'Object'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# List of attributes with nullable: true
|
45
|
+
def self.openapi_nullable
|
46
|
+
Set.new([
|
47
|
+
])
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `stcloud::NotificationsResponse` initialize method"
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `stcloud::NotificationsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
h[k.to_sym] = v
|
63
|
+
}
|
64
|
+
|
65
|
+
if attributes.key?(:'data')
|
66
|
+
self.data = attributes[:'data']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'errors')
|
70
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
71
|
+
self.errors = value
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.key?(:'message')
|
76
|
+
self.message = attributes[:'message']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'success')
|
80
|
+
self.success = attributes[:'success']
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
85
|
+
# @return Array for valid properties with the reasons
|
86
|
+
def list_invalid_properties
|
87
|
+
invalid_properties = Array.new
|
88
|
+
invalid_properties
|
89
|
+
end
|
90
|
+
|
91
|
+
# Check to see if the all the properties in the model are valid
|
92
|
+
# @return true if the model is valid
|
93
|
+
def valid?
|
94
|
+
true
|
95
|
+
end
|
96
|
+
|
97
|
+
# Checks equality by comparing each attribute.
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def ==(o)
|
100
|
+
return true if self.equal?(o)
|
101
|
+
self.class == o.class &&
|
102
|
+
data == o.data &&
|
103
|
+
errors == o.errors &&
|
104
|
+
message == o.message &&
|
105
|
+
success == o.success
|
106
|
+
end
|
107
|
+
|
108
|
+
# @see the `==` method
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def eql?(o)
|
111
|
+
self == o
|
112
|
+
end
|
113
|
+
|
114
|
+
# Calculates hash code according to all attributes.
|
115
|
+
# @return [Integer] Hash code
|
116
|
+
def hash
|
117
|
+
[data, errors, message, success].hash
|
118
|
+
end
|
119
|
+
|
120
|
+
# Builds the object from hash
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
122
|
+
# @return [Object] Returns the model itself
|
123
|
+
def self.build_from_hash(attributes)
|
124
|
+
new.build_from_hash(attributes)
|
125
|
+
end
|
126
|
+
|
127
|
+
# Builds the object from hash
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
+
# @return [Object] Returns the model itself
|
130
|
+
def build_from_hash(attributes)
|
131
|
+
return nil unless attributes.is_a?(Hash)
|
132
|
+
self.class.openapi_types.each_pair do |key, type|
|
133
|
+
if type =~ /\AArray<(.*)>/i
|
134
|
+
# check to ensure the input is an array given that the attribute
|
135
|
+
# is documented as an array but the input is not
|
136
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
137
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
138
|
+
end
|
139
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
140
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
141
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
142
|
+
self.send("#{key}=", nil)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
self
|
147
|
+
end
|
148
|
+
|
149
|
+
# Deserializes the data based on type
|
150
|
+
# @param string type Data type
|
151
|
+
# @param string value Value to be deserialized
|
152
|
+
# @return [Object] Deserialized data
|
153
|
+
def _deserialize(type, value)
|
154
|
+
case type.to_sym
|
155
|
+
when :DateTime
|
156
|
+
DateTime.parse(value)
|
157
|
+
when :Date
|
158
|
+
Date.parse(value)
|
159
|
+
when :String
|
160
|
+
value.to_s
|
161
|
+
when :Integer
|
162
|
+
value.to_i
|
163
|
+
when :Float
|
164
|
+
value.to_f
|
165
|
+
when :Boolean
|
166
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
|
+
true
|
168
|
+
else
|
169
|
+
false
|
170
|
+
end
|
171
|
+
when :Object
|
172
|
+
# generic object (usually a Hash), return directly
|
173
|
+
value
|
174
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
175
|
+
inner_type = Regexp.last_match[:inner_type]
|
176
|
+
value.map { |v| _deserialize(inner_type, v) }
|
177
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
178
|
+
k_type = Regexp.last_match[:k_type]
|
179
|
+
v_type = Regexp.last_match[:v_type]
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each do |k, v|
|
182
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
else # model
|
186
|
+
stcloud.const_get(type).build_from_hash(value)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the string representation of the object
|
191
|
+
# @return [String] String presentation of the object
|
192
|
+
def to_s
|
193
|
+
to_hash.to_s
|
194
|
+
end
|
195
|
+
|
196
|
+
# to_body is an alias to to_hash (backward compatibility)
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_body
|
199
|
+
to_hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the object in the form of hash
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_hash
|
205
|
+
hash = {}
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
207
|
+
value = self.send(attr)
|
208
|
+
if value.nil?
|
209
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
210
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
211
|
+
end
|
212
|
+
|
213
|
+
hash[param] = _to_hash(value)
|
214
|
+
end
|
215
|
+
hash
|
216
|
+
end
|
217
|
+
|
218
|
+
# Outputs non-array value in the form of hash
|
219
|
+
# For object, use to_hash. Otherwise, just return the value
|
220
|
+
# @param [Object] value Any valid value
|
221
|
+
# @return [Hash] Returns the value in the form of hash
|
222
|
+
def _to_hash(value)
|
223
|
+
if value.is_a?(Array)
|
224
|
+
value.compact.map { |v| _to_hash(v) }
|
225
|
+
elsif value.is_a?(Hash)
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
228
|
+
end
|
229
|
+
elsif value.respond_to? :to_hash
|
230
|
+
value.to_hash
|
231
|
+
else
|
232
|
+
value
|
233
|
+
end
|
234
|
+
end end
|
235
|
+
end
|