agent_push_kit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +145 -0
- data/LICENSE +21 -0
- data/README.md +195 -0
- data/Rakefile +10 -0
- data/agent_push_kit.gemspec +39 -0
- data/docs/AcceptedResponse.md +18 -0
- data/docs/AccountApi.md +137 -0
- data/docs/AddMemberInput.md +18 -0
- data/docs/AgentToken.md +30 -0
- data/docs/AgentTokenCreated.md +32 -0
- data/docs/AgentTokensApi.md +279 -0
- data/docs/ApiKeySummary.md +22 -0
- data/docs/AuthResponse.md +24 -0
- data/docs/AuthenticationApi.md +385 -0
- data/docs/CreateAgentTokenInput.md +18 -0
- data/docs/CreateOrganizationInput.md +18 -0
- data/docs/CurrentAccount.md +20 -0
- data/docs/CustomerAccountsApi.md +348 -0
- data/docs/DeletedResponse.md +18 -0
- data/docs/DeliverySummary.md +24 -0
- data/docs/Device.md +28 -0
- data/docs/DevicesApi.md +344 -0
- data/docs/DisabledResponse.md +18 -0
- data/docs/ErrorResponse.md +22 -0
- data/docs/EventDetail.md +36 -0
- data/docs/EventFilter.md +53 -0
- data/docs/EventPage.md +20 -0
- data/docs/EventSummary.md +32 -0
- data/docs/EventsApi.md +505 -0
- data/docs/FilterGroup.md +20 -0
- data/docs/FilterNot.md +20 -0
- data/docs/HealthApi.md +67 -0
- data/docs/HealthResponse.md +20 -0
- data/docs/IngestionResult.md +22 -0
- data/docs/InheritedResponse.md +18 -0
- data/docs/Membership.md +24 -0
- data/docs/MembershipUser.md +22 -0
- data/docs/Organization.md +32 -0
- data/docs/OrganizationApiKeyCreated.md +24 -0
- data/docs/OrganizationCount.md +20 -0
- data/docs/OrganizationCreated.md +20 -0
- data/docs/OrganizationRecord.md +24 -0
- data/docs/PasswordLoginInput.md +20 -0
- data/docs/PasswordResetCompleteInput.md +20 -0
- data/docs/PasswordResetRequestInput.md +18 -0
- data/docs/PreferenceRecord.md +24 -0
- data/docs/PreferencesApi.md +287 -0
- data/docs/ProviderLoginInput.md +20 -0
- data/docs/RegisterDeviceInput.md +24 -0
- data/docs/RegisterInput.md +22 -0
- data/docs/RegisterWebPushSubscriptionInput.md +20 -0
- data/docs/RegisterWebPushSubscriptionInputKeys.md +20 -0
- data/docs/RevokedResponse.md +18 -0
- data/docs/SearchEventsInput.md +22 -0
- data/docs/SendEventInput.md +32 -0
- data/docs/Service.md +26 -0
- data/docs/ServiceAllOfCount.md +18 -0
- data/docs/ServicePreference.md +26 -0
- data/docs/ServiceSummary.md +22 -0
- data/docs/SetEnabledInput.md +18 -0
- data/docs/TextFilterCondition.md +22 -0
- data/docs/TimeFilterCondition.md +22 -0
- data/docs/TypeOverride.md +22 -0
- data/docs/User.md +28 -0
- data/docs/WebPushConfiguration.md +20 -0
- data/docs/WebPushSubscription.md +22 -0
- data/git_push.sh +57 -0
- data/lib/agent_push_kit/api/account_api.rb +132 -0
- data/lib/agent_push_kit/api/agent_tokens_api.rb +274 -0
- data/lib/agent_push_kit/api/authentication_api.rb +418 -0
- data/lib/agent_push_kit/api/customer_accounts_api.rb +339 -0
- data/lib/agent_push_kit/api/devices_api.rb +339 -0
- data/lib/agent_push_kit/api/events_api.rb +520 -0
- data/lib/agent_push_kit/api/health_api.rb +77 -0
- data/lib/agent_push_kit/api/preferences_api.rb +308 -0
- data/lib/agent_push_kit/api_client.rb +397 -0
- data/lib/agent_push_kit/api_error.rb +58 -0
- data/lib/agent_push_kit/api_model_base.rb +88 -0
- data/lib/agent_push_kit/configuration.rb +325 -0
- data/lib/agent_push_kit/models/accepted_response.rb +164 -0
- data/lib/agent_push_kit/models/add_member_input.rb +173 -0
- data/lib/agent_push_kit/models/agent_token.rb +292 -0
- data/lib/agent_push_kit/models/agent_token_created.rb +364 -0
- data/lib/agent_push_kit/models/api_key_summary.rb +165 -0
- data/lib/agent_push_kit/models/auth_response.rb +228 -0
- data/lib/agent_push_kit/models/create_agent_token_input.rb +182 -0
- data/lib/agent_push_kit/models/create_organization_input.rb +182 -0
- data/lib/agent_push_kit/models/current_account.rb +192 -0
- data/lib/agent_push_kit/models/deleted_response.rb +164 -0
- data/lib/agent_push_kit/models/delivery_summary.rb +242 -0
- data/lib/agent_push_kit/models/device.rb +304 -0
- data/lib/agent_push_kit/models/disabled_response.rb +164 -0
- data/lib/agent_push_kit/models/error_response.rb +199 -0
- data/lib/agent_push_kit/models/event_detail.rb +393 -0
- data/lib/agent_push_kit/models/event_filter.rb +106 -0
- data/lib/agent_push_kit/models/event_page.rb +178 -0
- data/lib/agent_push_kit/models/event_summary.rb +318 -0
- data/lib/agent_push_kit/models/filter_group.rb +234 -0
- data/lib/agent_push_kit/models/filter_not.rb +214 -0
- data/lib/agent_push_kit/models/health_response.rb +216 -0
- data/lib/agent_push_kit/models/ingestion_result.rb +216 -0
- data/lib/agent_push_kit/models/inherited_response.rb +164 -0
- data/lib/agent_push_kit/models/membership.rb +266 -0
- data/lib/agent_push_kit/models/membership_user.rb +202 -0
- data/lib/agent_push_kit/models/organization.rb +337 -0
- data/lib/agent_push_kit/models/organization_api_key_created.rb +253 -0
- data/lib/agent_push_kit/models/organization_count.rb +156 -0
- data/lib/agent_push_kit/models/organization_created.rb +201 -0
- data/lib/agent_push_kit/models/organization_record.rb +242 -0
- data/lib/agent_push_kit/models/password_login_input.rb +217 -0
- data/lib/agent_push_kit/models/password_reset_complete_input.rb +217 -0
- data/lib/agent_push_kit/models/password_reset_request_input.rb +173 -0
- data/lib/agent_push_kit/models/preference_record.rb +242 -0
- data/lib/agent_push_kit/models/provider_login_input.rb +201 -0
- data/lib/agent_push_kit/models/register_device_input.rb +304 -0
- data/lib/agent_push_kit/models/register_input.rb +245 -0
- data/lib/agent_push_kit/models/register_web_push_subscription_input.rb +199 -0
- data/lib/agent_push_kit/models/register_web_push_subscription_input_keys.rb +226 -0
- data/lib/agent_push_kit/models/revoked_response.rb +164 -0
- data/lib/agent_push_kit/models/search_events_input.rb +212 -0
- data/lib/agent_push_kit/models/send_event_input.rb +427 -0
- data/lib/agent_push_kit/models/service.rb +275 -0
- data/lib/agent_push_kit/models/service_all_of_count.rb +164 -0
- data/lib/agent_push_kit/models/service_preference.rb +270 -0
- data/lib/agent_push_kit/models/service_summary.rb +216 -0
- data/lib/agent_push_kit/models/set_enabled_input.rb +164 -0
- data/lib/agent_push_kit/models/text_filter_condition.rb +260 -0
- data/lib/agent_push_kit/models/time_filter_condition.rb +242 -0
- data/lib/agent_push_kit/models/type_override.rb +216 -0
- data/lib/agent_push_kit/models/user.rb +280 -0
- data/lib/agent_push_kit/models/web_push_configuration.rb +176 -0
- data/lib/agent_push_kit/models/web_push_subscription.rb +216 -0
- data/lib/agent_push_kit/version.rb +15 -0
- data/lib/agent_push_kit.rb +101 -0
- data/spec/api/account_api_spec.rb +55 -0
- data/spec/api/agent_tokens_api_spec.rb +80 -0
- data/spec/api/authentication_api_spec.rb +101 -0
- data/spec/api/customer_accounts_api_spec.rb +91 -0
- data/spec/api/devices_api_spec.rb +89 -0
- data/spec/api/events_api_spec.rb +121 -0
- data/spec/api/health_api_spec.rb +45 -0
- data/spec/api/preferences_api_spec.rb +83 -0
- data/spec/models/accepted_response_spec.rb +36 -0
- data/spec/models/add_member_input_spec.rb +36 -0
- data/spec/models/agent_token_created_spec.rb +78 -0
- data/spec/models/agent_token_spec.rb +72 -0
- data/spec/models/api_key_summary_spec.rb +48 -0
- data/spec/models/auth_response_spec.rb +54 -0
- data/spec/models/create_agent_token_input_spec.rb +36 -0
- data/spec/models/create_organization_input_spec.rb +36 -0
- data/spec/models/current_account_spec.rb +42 -0
- data/spec/models/deleted_response_spec.rb +36 -0
- data/spec/models/delivery_summary_spec.rb +54 -0
- data/spec/models/device_spec.rb +70 -0
- data/spec/models/disabled_response_spec.rb +36 -0
- data/spec/models/error_response_spec.rb +48 -0
- data/spec/models/event_detail_spec.rb +90 -0
- data/spec/models/event_filter_spec.rb +32 -0
- data/spec/models/event_page_spec.rb +42 -0
- data/spec/models/event_summary_spec.rb +78 -0
- data/spec/models/filter_group_spec.rb +46 -0
- data/spec/models/filter_not_spec.rb +46 -0
- data/spec/models/health_response_spec.rb +50 -0
- data/spec/models/ingestion_result_spec.rb +48 -0
- data/spec/models/inherited_response_spec.rb +36 -0
- data/spec/models/membership_spec.rb +58 -0
- data/spec/models/membership_user_spec.rb +48 -0
- data/spec/models/organization_api_key_created_spec.rb +54 -0
- data/spec/models/organization_count_spec.rb +42 -0
- data/spec/models/organization_created_spec.rb +42 -0
- data/spec/models/organization_record_spec.rb +54 -0
- data/spec/models/organization_spec.rb +82 -0
- data/spec/models/password_login_input_spec.rb +42 -0
- data/spec/models/password_reset_complete_input_spec.rb +42 -0
- data/spec/models/password_reset_request_input_spec.rb +36 -0
- data/spec/models/preference_record_spec.rb +54 -0
- data/spec/models/provider_login_input_spec.rb +42 -0
- data/spec/models/register_device_input_spec.rb +58 -0
- data/spec/models/register_input_spec.rb +48 -0
- data/spec/models/register_web_push_subscription_input_keys_spec.rb +42 -0
- data/spec/models/register_web_push_subscription_input_spec.rb +42 -0
- data/spec/models/revoked_response_spec.rb +36 -0
- data/spec/models/search_events_input_spec.rb +48 -0
- data/spec/models/send_event_input_spec.rb +78 -0
- data/spec/models/service_all_of_count_spec.rb +36 -0
- data/spec/models/service_preference_spec.rb +60 -0
- data/spec/models/service_spec.rb +60 -0
- data/spec/models/service_summary_spec.rb +48 -0
- data/spec/models/set_enabled_input_spec.rb +36 -0
- data/spec/models/text_filter_condition_spec.rb +56 -0
- data/spec/models/time_filter_condition_spec.rb +56 -0
- data/spec/models/type_override_spec.rb +48 -0
- data/spec/models/user_spec.rb +66 -0
- data/spec/models/web_push_configuration_spec.rb +42 -0
- data/spec/models/web_push_subscription_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- metadata +344 -0
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Agent Push Kit API
|
|
3
|
+
|
|
4
|
+
#The complete Agent Push Kit REST API. Application event ingestion uses an organization key beginning with `apk_`. Authenticated user operations accept either an Agent Push Kit login JWT or an agent access token beginning with `apt_`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module AgentPushKit
|
|
16
|
+
class EventsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get one event including metadata
|
|
23
|
+
# @param organization_id [String]
|
|
24
|
+
# @param event_id [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [EventDetail]
|
|
27
|
+
def get_event(organization_id, event_id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_event_with_http_info(organization_id, event_id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get one event including metadata
|
|
33
|
+
# @param organization_id [String]
|
|
34
|
+
# @param event_id [String]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(EventDetail, Integer, Hash)>] EventDetail data, response status code and response headers
|
|
37
|
+
def get_event_with_http_info(organization_id, event_id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.get_event ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'organization_id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling EventsApi.get_event"
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'event_id' is set
|
|
46
|
+
if @api_client.config.client_side_validation && event_id.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'event_id' when calling EventsApi.get_event"
|
|
48
|
+
end
|
|
49
|
+
# resource path
|
|
50
|
+
local_var_path = '/organizations/{organizationId}/events/{eventId}'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{eventId}', CGI.escape(event_id.to_s))
|
|
51
|
+
|
|
52
|
+
# query parameters
|
|
53
|
+
query_params = opts[:query_params] || {}
|
|
54
|
+
|
|
55
|
+
# header parameters
|
|
56
|
+
header_params = opts[:header_params] || {}
|
|
57
|
+
# HTTP header 'Accept' (if needed)
|
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
59
|
+
|
|
60
|
+
# form parameters
|
|
61
|
+
form_params = opts[:form_params] || {}
|
|
62
|
+
|
|
63
|
+
# http body (model)
|
|
64
|
+
post_body = opts[:debug_body]
|
|
65
|
+
|
|
66
|
+
# return_type
|
|
67
|
+
return_type = opts[:debug_return_type] || 'EventDetail'
|
|
68
|
+
|
|
69
|
+
# auth_names
|
|
70
|
+
auth_names = opts[:debug_auth_names] || ['UserOrAgent']
|
|
71
|
+
|
|
72
|
+
new_options = opts.merge(
|
|
73
|
+
:operation => :"EventsApi.get_event",
|
|
74
|
+
:header_params => header_params,
|
|
75
|
+
:query_params => query_params,
|
|
76
|
+
:form_params => form_params,
|
|
77
|
+
:body => post_body,
|
|
78
|
+
:auth_names => auth_names,
|
|
79
|
+
:return_type => return_type
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
83
|
+
if @api_client.config.debugging
|
|
84
|
+
@api_client.config.logger.debug "API called: EventsApi#get_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
85
|
+
end
|
|
86
|
+
return data, status_code, headers
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# List a paginated inbox
|
|
90
|
+
# @param organization_id [String]
|
|
91
|
+
# @param [Hash] opts the optional parameters
|
|
92
|
+
# @option opts [String] :service
|
|
93
|
+
# @option opts [String] :type
|
|
94
|
+
# @option opts [String] :search
|
|
95
|
+
# @option opts [String] :cursor
|
|
96
|
+
# @option opts [Integer] :limit (default to 50)
|
|
97
|
+
# @return [EventPage]
|
|
98
|
+
def list_events(organization_id, opts = {})
|
|
99
|
+
data, _status_code, _headers = list_events_with_http_info(organization_id, opts)
|
|
100
|
+
data
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# List a paginated inbox
|
|
104
|
+
# @param organization_id [String]
|
|
105
|
+
# @param [Hash] opts the optional parameters
|
|
106
|
+
# @option opts [String] :service
|
|
107
|
+
# @option opts [String] :type
|
|
108
|
+
# @option opts [String] :search
|
|
109
|
+
# @option opts [String] :cursor
|
|
110
|
+
# @option opts [Integer] :limit (default to 50)
|
|
111
|
+
# @return [Array<(EventPage, Integer, Hash)>] EventPage data, response status code and response headers
|
|
112
|
+
def list_events_with_http_info(organization_id, opts = {})
|
|
113
|
+
if @api_client.config.debugging
|
|
114
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.list_events ...'
|
|
115
|
+
end
|
|
116
|
+
# verify the required parameter 'organization_id' is set
|
|
117
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
118
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling EventsApi.list_events"
|
|
119
|
+
end
|
|
120
|
+
if @api_client.config.client_side_validation && !opts[:'service'].nil? && opts[:'service'].to_s.length > 120
|
|
121
|
+
fail ArgumentError, 'invalid value for "opts[:"service"]" when calling EventsApi.list_events, the character length must be smaller than or equal to 120.'
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if @api_client.config.client_side_validation && !opts[:'type'].nil? && opts[:'type'].to_s.length > 120
|
|
125
|
+
fail ArgumentError, 'invalid value for "opts[:"type"]" when calling EventsApi.list_events, the character length must be smaller than or equal to 120.'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 200
|
|
129
|
+
fail ArgumentError, 'invalid value for "opts[:"search"]" when calling EventsApi.list_events, the character length must be smaller than or equal to 200.'
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
133
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EventsApi.list_events, must be smaller than or equal to 100.'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
137
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EventsApi.list_events, must be greater than or equal to 1.'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# resource path
|
|
141
|
+
local_var_path = '/organizations/{organizationId}/events'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
142
|
+
|
|
143
|
+
# query parameters
|
|
144
|
+
query_params = opts[:query_params] || {}
|
|
145
|
+
query_params[:'service'] = opts[:'service'] if !opts[:'service'].nil?
|
|
146
|
+
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
|
|
147
|
+
query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
|
|
148
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
149
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
150
|
+
|
|
151
|
+
# header parameters
|
|
152
|
+
header_params = opts[:header_params] || {}
|
|
153
|
+
# HTTP header 'Accept' (if needed)
|
|
154
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
155
|
+
|
|
156
|
+
# form parameters
|
|
157
|
+
form_params = opts[:form_params] || {}
|
|
158
|
+
|
|
159
|
+
# http body (model)
|
|
160
|
+
post_body = opts[:debug_body]
|
|
161
|
+
|
|
162
|
+
# return_type
|
|
163
|
+
return_type = opts[:debug_return_type] || 'EventPage'
|
|
164
|
+
|
|
165
|
+
# auth_names
|
|
166
|
+
auth_names = opts[:debug_auth_names] || ['UserOrAgent']
|
|
167
|
+
|
|
168
|
+
new_options = opts.merge(
|
|
169
|
+
:operation => :"EventsApi.list_events",
|
|
170
|
+
:header_params => header_params,
|
|
171
|
+
:query_params => query_params,
|
|
172
|
+
:form_params => form_params,
|
|
173
|
+
:body => post_body,
|
|
174
|
+
:auth_names => auth_names,
|
|
175
|
+
:return_type => return_type
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
179
|
+
if @api_client.config.debugging
|
|
180
|
+
@api_client.config.logger.debug "API called: EventsApi#list_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
181
|
+
end
|
|
182
|
+
return data, status_code, headers
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# List distinct notification types
|
|
186
|
+
# @param organization_id [String]
|
|
187
|
+
# @param [Hash] opts the optional parameters
|
|
188
|
+
# @option opts [String] :service_id Optionally restrict types to one service ID.
|
|
189
|
+
# @return [Array<String>]
|
|
190
|
+
def list_notification_types(organization_id, opts = {})
|
|
191
|
+
data, _status_code, _headers = list_notification_types_with_http_info(organization_id, opts)
|
|
192
|
+
data
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# List distinct notification types
|
|
196
|
+
# @param organization_id [String]
|
|
197
|
+
# @param [Hash] opts the optional parameters
|
|
198
|
+
# @option opts [String] :service_id Optionally restrict types to one service ID.
|
|
199
|
+
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
|
200
|
+
def list_notification_types_with_http_info(organization_id, opts = {})
|
|
201
|
+
if @api_client.config.debugging
|
|
202
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.list_notification_types ...'
|
|
203
|
+
end
|
|
204
|
+
# verify the required parameter 'organization_id' is set
|
|
205
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
206
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling EventsApi.list_notification_types"
|
|
207
|
+
end
|
|
208
|
+
# resource path
|
|
209
|
+
local_var_path = '/organizations/{organizationId}/types'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
210
|
+
|
|
211
|
+
# query parameters
|
|
212
|
+
query_params = opts[:query_params] || {}
|
|
213
|
+
query_params[:'serviceId'] = opts[:'service_id'] if !opts[:'service_id'].nil?
|
|
214
|
+
|
|
215
|
+
# header parameters
|
|
216
|
+
header_params = opts[:header_params] || {}
|
|
217
|
+
# HTTP header 'Accept' (if needed)
|
|
218
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
219
|
+
|
|
220
|
+
# form parameters
|
|
221
|
+
form_params = opts[:form_params] || {}
|
|
222
|
+
|
|
223
|
+
# http body (model)
|
|
224
|
+
post_body = opts[:debug_body]
|
|
225
|
+
|
|
226
|
+
# return_type
|
|
227
|
+
return_type = opts[:debug_return_type] || 'Array<String>'
|
|
228
|
+
|
|
229
|
+
# auth_names
|
|
230
|
+
auth_names = opts[:debug_auth_names] || ['UserOrAgent']
|
|
231
|
+
|
|
232
|
+
new_options = opts.merge(
|
|
233
|
+
:operation => :"EventsApi.list_notification_types",
|
|
234
|
+
:header_params => header_params,
|
|
235
|
+
:query_params => query_params,
|
|
236
|
+
:form_params => form_params,
|
|
237
|
+
:body => post_body,
|
|
238
|
+
:auth_names => auth_names,
|
|
239
|
+
:return_type => return_type
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
243
|
+
if @api_client.config.debugging
|
|
244
|
+
@api_client.config.logger.debug "API called: EventsApi#list_notification_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
245
|
+
end
|
|
246
|
+
return data, status_code, headers
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# List services discovered from ingested events
|
|
250
|
+
# @param organization_id [String]
|
|
251
|
+
# @param [Hash] opts the optional parameters
|
|
252
|
+
# @return [Array<Service>]
|
|
253
|
+
def list_services(organization_id, opts = {})
|
|
254
|
+
data, _status_code, _headers = list_services_with_http_info(organization_id, opts)
|
|
255
|
+
data
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# List services discovered from ingested events
|
|
259
|
+
# @param organization_id [String]
|
|
260
|
+
# @param [Hash] opts the optional parameters
|
|
261
|
+
# @return [Array<(Array<Service>, Integer, Hash)>] Array<Service> data, response status code and response headers
|
|
262
|
+
def list_services_with_http_info(organization_id, opts = {})
|
|
263
|
+
if @api_client.config.debugging
|
|
264
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.list_services ...'
|
|
265
|
+
end
|
|
266
|
+
# verify the required parameter 'organization_id' is set
|
|
267
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
268
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling EventsApi.list_services"
|
|
269
|
+
end
|
|
270
|
+
# resource path
|
|
271
|
+
local_var_path = '/organizations/{organizationId}/services'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
272
|
+
|
|
273
|
+
# query parameters
|
|
274
|
+
query_params = opts[:query_params] || {}
|
|
275
|
+
|
|
276
|
+
# header parameters
|
|
277
|
+
header_params = opts[:header_params] || {}
|
|
278
|
+
# HTTP header 'Accept' (if needed)
|
|
279
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
280
|
+
|
|
281
|
+
# form parameters
|
|
282
|
+
form_params = opts[:form_params] || {}
|
|
283
|
+
|
|
284
|
+
# http body (model)
|
|
285
|
+
post_body = opts[:debug_body]
|
|
286
|
+
|
|
287
|
+
# return_type
|
|
288
|
+
return_type = opts[:debug_return_type] || 'Array<Service>'
|
|
289
|
+
|
|
290
|
+
# auth_names
|
|
291
|
+
auth_names = opts[:debug_auth_names] || ['UserOrAgent']
|
|
292
|
+
|
|
293
|
+
new_options = opts.merge(
|
|
294
|
+
:operation => :"EventsApi.list_services",
|
|
295
|
+
:header_params => header_params,
|
|
296
|
+
:query_params => query_params,
|
|
297
|
+
:form_params => form_params,
|
|
298
|
+
:body => post_body,
|
|
299
|
+
:auth_names => auth_names,
|
|
300
|
+
:return_type => return_type
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
304
|
+
if @api_client.config.debugging
|
|
305
|
+
@api_client.config.logger.debug "API called: EventsApi#list_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
306
|
+
end
|
|
307
|
+
return data, status_code, headers
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# Search events with a validated Boolean filter tree
|
|
311
|
+
# @param organization_id [String]
|
|
312
|
+
# @param search_events_input [SearchEventsInput]
|
|
313
|
+
# @param [Hash] opts the optional parameters
|
|
314
|
+
# @return [EventPage]
|
|
315
|
+
def search_events(organization_id, search_events_input, opts = {})
|
|
316
|
+
data, _status_code, _headers = search_events_with_http_info(organization_id, search_events_input, opts)
|
|
317
|
+
data
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# Search events with a validated Boolean filter tree
|
|
321
|
+
# @param organization_id [String]
|
|
322
|
+
# @param search_events_input [SearchEventsInput]
|
|
323
|
+
# @param [Hash] opts the optional parameters
|
|
324
|
+
# @return [Array<(EventPage, Integer, Hash)>] EventPage data, response status code and response headers
|
|
325
|
+
def search_events_with_http_info(organization_id, search_events_input, opts = {})
|
|
326
|
+
if @api_client.config.debugging
|
|
327
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.search_events ...'
|
|
328
|
+
end
|
|
329
|
+
# verify the required parameter 'organization_id' is set
|
|
330
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
331
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling EventsApi.search_events"
|
|
332
|
+
end
|
|
333
|
+
# verify the required parameter 'search_events_input' is set
|
|
334
|
+
if @api_client.config.client_side_validation && search_events_input.nil?
|
|
335
|
+
fail ArgumentError, "Missing the required parameter 'search_events_input' when calling EventsApi.search_events"
|
|
336
|
+
end
|
|
337
|
+
# resource path
|
|
338
|
+
local_var_path = '/organizations/{organizationId}/events/search'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
339
|
+
|
|
340
|
+
# query parameters
|
|
341
|
+
query_params = opts[:query_params] || {}
|
|
342
|
+
|
|
343
|
+
# header parameters
|
|
344
|
+
header_params = opts[:header_params] || {}
|
|
345
|
+
# HTTP header 'Accept' (if needed)
|
|
346
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
347
|
+
# HTTP header 'Content-Type'
|
|
348
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
349
|
+
if !content_type.nil?
|
|
350
|
+
header_params['Content-Type'] = content_type
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
# form parameters
|
|
354
|
+
form_params = opts[:form_params] || {}
|
|
355
|
+
|
|
356
|
+
# http body (model)
|
|
357
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(search_events_input)
|
|
358
|
+
|
|
359
|
+
# return_type
|
|
360
|
+
return_type = opts[:debug_return_type] || 'EventPage'
|
|
361
|
+
|
|
362
|
+
# auth_names
|
|
363
|
+
auth_names = opts[:debug_auth_names] || ['UserOrAgent']
|
|
364
|
+
|
|
365
|
+
new_options = opts.merge(
|
|
366
|
+
:operation => :"EventsApi.search_events",
|
|
367
|
+
:header_params => header_params,
|
|
368
|
+
:query_params => query_params,
|
|
369
|
+
:form_params => form_params,
|
|
370
|
+
:body => post_body,
|
|
371
|
+
:auth_names => auth_names,
|
|
372
|
+
:return_type => return_type
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
376
|
+
if @api_client.config.debugging
|
|
377
|
+
@api_client.config.logger.debug "API called: EventsApi#search_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
378
|
+
end
|
|
379
|
+
return data, status_code, headers
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
# Send an event using an application ingestion key
|
|
383
|
+
# @param send_event_input [SendEventInput]
|
|
384
|
+
# @param [Hash] opts the optional parameters
|
|
385
|
+
# @return [IngestionResult]
|
|
386
|
+
def send_event(send_event_input, opts = {})
|
|
387
|
+
data, _status_code, _headers = send_event_with_http_info(send_event_input, opts)
|
|
388
|
+
data
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# Send an event using an application ingestion key
|
|
392
|
+
# @param send_event_input [SendEventInput]
|
|
393
|
+
# @param [Hash] opts the optional parameters
|
|
394
|
+
# @return [Array<(IngestionResult, Integer, Hash)>] IngestionResult data, response status code and response headers
|
|
395
|
+
def send_event_with_http_info(send_event_input, opts = {})
|
|
396
|
+
if @api_client.config.debugging
|
|
397
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.send_event ...'
|
|
398
|
+
end
|
|
399
|
+
# verify the required parameter 'send_event_input' is set
|
|
400
|
+
if @api_client.config.client_side_validation && send_event_input.nil?
|
|
401
|
+
fail ArgumentError, "Missing the required parameter 'send_event_input' when calling EventsApi.send_event"
|
|
402
|
+
end
|
|
403
|
+
# resource path
|
|
404
|
+
local_var_path = '/events'
|
|
405
|
+
|
|
406
|
+
# query parameters
|
|
407
|
+
query_params = opts[:query_params] || {}
|
|
408
|
+
|
|
409
|
+
# header parameters
|
|
410
|
+
header_params = opts[:header_params] || {}
|
|
411
|
+
# HTTP header 'Accept' (if needed)
|
|
412
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
413
|
+
# HTTP header 'Content-Type'
|
|
414
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
415
|
+
if !content_type.nil?
|
|
416
|
+
header_params['Content-Type'] = content_type
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
# form parameters
|
|
420
|
+
form_params = opts[:form_params] || {}
|
|
421
|
+
|
|
422
|
+
# http body (model)
|
|
423
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(send_event_input)
|
|
424
|
+
|
|
425
|
+
# return_type
|
|
426
|
+
return_type = opts[:debug_return_type] || 'IngestionResult'
|
|
427
|
+
|
|
428
|
+
# auth_names
|
|
429
|
+
auth_names = opts[:debug_auth_names] || ['OrganizationApiKey']
|
|
430
|
+
|
|
431
|
+
new_options = opts.merge(
|
|
432
|
+
:operation => :"EventsApi.send_event",
|
|
433
|
+
:header_params => header_params,
|
|
434
|
+
:query_params => query_params,
|
|
435
|
+
:form_params => form_params,
|
|
436
|
+
:body => post_body,
|
|
437
|
+
:auth_names => auth_names,
|
|
438
|
+
:return_type => return_type
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
442
|
+
if @api_client.config.debugging
|
|
443
|
+
@api_client.config.logger.debug "API called: EventsApi#send_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
444
|
+
end
|
|
445
|
+
return data, status_code, headers
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
# Send an event as an authenticated user or agent
|
|
449
|
+
# @param organization_id [String]
|
|
450
|
+
# @param send_event_input [SendEventInput]
|
|
451
|
+
# @param [Hash] opts the optional parameters
|
|
452
|
+
# @return [IngestionResult]
|
|
453
|
+
def send_event_as_user(organization_id, send_event_input, opts = {})
|
|
454
|
+
data, _status_code, _headers = send_event_as_user_with_http_info(organization_id, send_event_input, opts)
|
|
455
|
+
data
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
# Send an event as an authenticated user or agent
|
|
459
|
+
# @param organization_id [String]
|
|
460
|
+
# @param send_event_input [SendEventInput]
|
|
461
|
+
# @param [Hash] opts the optional parameters
|
|
462
|
+
# @return [Array<(IngestionResult, Integer, Hash)>] IngestionResult data, response status code and response headers
|
|
463
|
+
def send_event_as_user_with_http_info(organization_id, send_event_input, opts = {})
|
|
464
|
+
if @api_client.config.debugging
|
|
465
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.send_event_as_user ...'
|
|
466
|
+
end
|
|
467
|
+
# verify the required parameter 'organization_id' is set
|
|
468
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
469
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling EventsApi.send_event_as_user"
|
|
470
|
+
end
|
|
471
|
+
# verify the required parameter 'send_event_input' is set
|
|
472
|
+
if @api_client.config.client_side_validation && send_event_input.nil?
|
|
473
|
+
fail ArgumentError, "Missing the required parameter 'send_event_input' when calling EventsApi.send_event_as_user"
|
|
474
|
+
end
|
|
475
|
+
# resource path
|
|
476
|
+
local_var_path = '/organizations/{organizationId}/events'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
477
|
+
|
|
478
|
+
# query parameters
|
|
479
|
+
query_params = opts[:query_params] || {}
|
|
480
|
+
|
|
481
|
+
# header parameters
|
|
482
|
+
header_params = opts[:header_params] || {}
|
|
483
|
+
# HTTP header 'Accept' (if needed)
|
|
484
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
485
|
+
# HTTP header 'Content-Type'
|
|
486
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
487
|
+
if !content_type.nil?
|
|
488
|
+
header_params['Content-Type'] = content_type
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
# form parameters
|
|
492
|
+
form_params = opts[:form_params] || {}
|
|
493
|
+
|
|
494
|
+
# http body (model)
|
|
495
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(send_event_input)
|
|
496
|
+
|
|
497
|
+
# return_type
|
|
498
|
+
return_type = opts[:debug_return_type] || 'IngestionResult'
|
|
499
|
+
|
|
500
|
+
# auth_names
|
|
501
|
+
auth_names = opts[:debug_auth_names] || ['UserOrAgent']
|
|
502
|
+
|
|
503
|
+
new_options = opts.merge(
|
|
504
|
+
:operation => :"EventsApi.send_event_as_user",
|
|
505
|
+
:header_params => header_params,
|
|
506
|
+
:query_params => query_params,
|
|
507
|
+
:form_params => form_params,
|
|
508
|
+
:body => post_body,
|
|
509
|
+
:auth_names => auth_names,
|
|
510
|
+
:return_type => return_type
|
|
511
|
+
)
|
|
512
|
+
|
|
513
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
514
|
+
if @api_client.config.debugging
|
|
515
|
+
@api_client.config.logger.debug "API called: EventsApi#send_event_as_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
516
|
+
end
|
|
517
|
+
return data, status_code, headers
|
|
518
|
+
end
|
|
519
|
+
end
|
|
520
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Agent Push Kit API
|
|
3
|
+
|
|
4
|
+
#The complete Agent Push Kit REST API. Application event ingestion uses an organization key beginning with `apk_`. Authenticated user operations accept either an Agent Push Kit login JWT or an agent access token beginning with `apt_`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module AgentPushKit
|
|
16
|
+
class HealthApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Check Agent Push Kit API health
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @return [HealthResponse]
|
|
25
|
+
def get_health(opts = {})
|
|
26
|
+
data, _status_code, _headers = get_health_with_http_info(opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Check Agent Push Kit API health
|
|
31
|
+
# @param [Hash] opts the optional parameters
|
|
32
|
+
# @return [Array<(HealthResponse, Integer, Hash)>] HealthResponse data, response status code and response headers
|
|
33
|
+
def get_health_with_http_info(opts = {})
|
|
34
|
+
if @api_client.config.debugging
|
|
35
|
+
@api_client.config.logger.debug 'Calling API: HealthApi.get_health ...'
|
|
36
|
+
end
|
|
37
|
+
# resource path
|
|
38
|
+
local_var_path = '/health'
|
|
39
|
+
|
|
40
|
+
# query parameters
|
|
41
|
+
query_params = opts[:query_params] || {}
|
|
42
|
+
|
|
43
|
+
# header parameters
|
|
44
|
+
header_params = opts[:header_params] || {}
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
47
|
+
|
|
48
|
+
# form parameters
|
|
49
|
+
form_params = opts[:form_params] || {}
|
|
50
|
+
|
|
51
|
+
# http body (model)
|
|
52
|
+
post_body = opts[:debug_body]
|
|
53
|
+
|
|
54
|
+
# return_type
|
|
55
|
+
return_type = opts[:debug_return_type] || 'HealthResponse'
|
|
56
|
+
|
|
57
|
+
# auth_names
|
|
58
|
+
auth_names = opts[:debug_auth_names] || []
|
|
59
|
+
|
|
60
|
+
new_options = opts.merge(
|
|
61
|
+
:operation => :"HealthApi.get_health",
|
|
62
|
+
:header_params => header_params,
|
|
63
|
+
:query_params => query_params,
|
|
64
|
+
:form_params => form_params,
|
|
65
|
+
:body => post_body,
|
|
66
|
+
:auth_names => auth_names,
|
|
67
|
+
:return_type => return_type
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
71
|
+
if @api_client.config.debugging
|
|
72
|
+
@api_client.config.logger.debug "API called: HealthApi#get_health\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
73
|
+
end
|
|
74
|
+
return data, status_code, headers
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|