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,308 @@
|
|
|
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 PreferencesApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# List service defaults and exact-type overrides
|
|
23
|
+
# @param organization_id [String]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [Array<ServicePreference>]
|
|
26
|
+
def list_preferences(organization_id, opts = {})
|
|
27
|
+
data, _status_code, _headers = list_preferences_with_http_info(organization_id, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# List service defaults and exact-type overrides
|
|
32
|
+
# @param organization_id [String]
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(Array<ServicePreference>, Integer, Hash)>] Array<ServicePreference> data, response status code and response headers
|
|
35
|
+
def list_preferences_with_http_info(organization_id, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: PreferencesApi.list_preferences ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'organization_id' is set
|
|
40
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling PreferencesApi.list_preferences"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/organizations/{organizationId}/preferences'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
53
|
+
|
|
54
|
+
# form parameters
|
|
55
|
+
form_params = opts[:form_params] || {}
|
|
56
|
+
|
|
57
|
+
# http body (model)
|
|
58
|
+
post_body = opts[:debug_body]
|
|
59
|
+
|
|
60
|
+
# return_type
|
|
61
|
+
return_type = opts[:debug_return_type] || 'Array<ServicePreference>'
|
|
62
|
+
|
|
63
|
+
# auth_names
|
|
64
|
+
auth_names = opts[:debug_auth_names] || ['UserOrAgent']
|
|
65
|
+
|
|
66
|
+
new_options = opts.merge(
|
|
67
|
+
:operation => :"PreferencesApi.list_preferences",
|
|
68
|
+
:header_params => header_params,
|
|
69
|
+
:query_params => query_params,
|
|
70
|
+
:form_params => form_params,
|
|
71
|
+
:body => post_body,
|
|
72
|
+
:auth_names => auth_names,
|
|
73
|
+
:return_type => return_type
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
77
|
+
if @api_client.config.debugging
|
|
78
|
+
@api_client.config.logger.debug "API called: PreferencesApi#list_preferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
79
|
+
end
|
|
80
|
+
return data, status_code, headers
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Remove an exact-type override so it inherits the service default
|
|
84
|
+
# @param service_id [String]
|
|
85
|
+
# @param type [String]
|
|
86
|
+
# @param [Hash] opts the optional parameters
|
|
87
|
+
# @return [InheritedResponse]
|
|
88
|
+
def remove_type_preference(service_id, type, opts = {})
|
|
89
|
+
data, _status_code, _headers = remove_type_preference_with_http_info(service_id, type, opts)
|
|
90
|
+
data
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Remove an exact-type override so it inherits the service default
|
|
94
|
+
# @param service_id [String]
|
|
95
|
+
# @param type [String]
|
|
96
|
+
# @param [Hash] opts the optional parameters
|
|
97
|
+
# @return [Array<(InheritedResponse, Integer, Hash)>] InheritedResponse data, response status code and response headers
|
|
98
|
+
def remove_type_preference_with_http_info(service_id, type, opts = {})
|
|
99
|
+
if @api_client.config.debugging
|
|
100
|
+
@api_client.config.logger.debug 'Calling API: PreferencesApi.remove_type_preference ...'
|
|
101
|
+
end
|
|
102
|
+
# verify the required parameter 'service_id' is set
|
|
103
|
+
if @api_client.config.client_side_validation && service_id.nil?
|
|
104
|
+
fail ArgumentError, "Missing the required parameter 'service_id' when calling PreferencesApi.remove_type_preference"
|
|
105
|
+
end
|
|
106
|
+
# verify the required parameter 'type' is set
|
|
107
|
+
if @api_client.config.client_side_validation && type.nil?
|
|
108
|
+
fail ArgumentError, "Missing the required parameter 'type' when calling PreferencesApi.remove_type_preference"
|
|
109
|
+
end
|
|
110
|
+
if @api_client.config.client_side_validation && type.to_s.length > 120
|
|
111
|
+
fail ArgumentError, 'invalid value for "type" when calling PreferencesApi.remove_type_preference, the character length must be smaller than or equal to 120.'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# resource path
|
|
115
|
+
local_var_path = '/services/{serviceId}/types/{type}/preference'.sub('{serviceId}', CGI.escape(service_id.to_s)).sub('{type}', CGI.escape(type.to_s))
|
|
116
|
+
|
|
117
|
+
# query parameters
|
|
118
|
+
query_params = opts[:query_params] || {}
|
|
119
|
+
|
|
120
|
+
# header parameters
|
|
121
|
+
header_params = opts[:header_params] || {}
|
|
122
|
+
# HTTP header 'Accept' (if needed)
|
|
123
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
124
|
+
|
|
125
|
+
# form parameters
|
|
126
|
+
form_params = opts[:form_params] || {}
|
|
127
|
+
|
|
128
|
+
# http body (model)
|
|
129
|
+
post_body = opts[:debug_body]
|
|
130
|
+
|
|
131
|
+
# return_type
|
|
132
|
+
return_type = opts[:debug_return_type] || 'InheritedResponse'
|
|
133
|
+
|
|
134
|
+
# auth_names
|
|
135
|
+
auth_names = opts[:debug_auth_names] || ['UserOrAgent']
|
|
136
|
+
|
|
137
|
+
new_options = opts.merge(
|
|
138
|
+
:operation => :"PreferencesApi.remove_type_preference",
|
|
139
|
+
:header_params => header_params,
|
|
140
|
+
:query_params => query_params,
|
|
141
|
+
:form_params => form_params,
|
|
142
|
+
:body => post_body,
|
|
143
|
+
:auth_names => auth_names,
|
|
144
|
+
:return_type => return_type
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
148
|
+
if @api_client.config.debugging
|
|
149
|
+
@api_client.config.logger.debug "API called: PreferencesApi#remove_type_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
150
|
+
end
|
|
151
|
+
return data, status_code, headers
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Enable or disable pushes for a service by default
|
|
155
|
+
# @param service_id [String]
|
|
156
|
+
# @param set_enabled_input [SetEnabledInput]
|
|
157
|
+
# @param [Hash] opts the optional parameters
|
|
158
|
+
# @return [PreferenceRecord]
|
|
159
|
+
def set_service_preference(service_id, set_enabled_input, opts = {})
|
|
160
|
+
data, _status_code, _headers = set_service_preference_with_http_info(service_id, set_enabled_input, opts)
|
|
161
|
+
data
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Enable or disable pushes for a service by default
|
|
165
|
+
# @param service_id [String]
|
|
166
|
+
# @param set_enabled_input [SetEnabledInput]
|
|
167
|
+
# @param [Hash] opts the optional parameters
|
|
168
|
+
# @return [Array<(PreferenceRecord, Integer, Hash)>] PreferenceRecord data, response status code and response headers
|
|
169
|
+
def set_service_preference_with_http_info(service_id, set_enabled_input, opts = {})
|
|
170
|
+
if @api_client.config.debugging
|
|
171
|
+
@api_client.config.logger.debug 'Calling API: PreferencesApi.set_service_preference ...'
|
|
172
|
+
end
|
|
173
|
+
# verify the required parameter 'service_id' is set
|
|
174
|
+
if @api_client.config.client_side_validation && service_id.nil?
|
|
175
|
+
fail ArgumentError, "Missing the required parameter 'service_id' when calling PreferencesApi.set_service_preference"
|
|
176
|
+
end
|
|
177
|
+
# verify the required parameter 'set_enabled_input' is set
|
|
178
|
+
if @api_client.config.client_side_validation && set_enabled_input.nil?
|
|
179
|
+
fail ArgumentError, "Missing the required parameter 'set_enabled_input' when calling PreferencesApi.set_service_preference"
|
|
180
|
+
end
|
|
181
|
+
# resource path
|
|
182
|
+
local_var_path = '/services/{serviceId}/preference'.sub('{serviceId}', CGI.escape(service_id.to_s))
|
|
183
|
+
|
|
184
|
+
# query parameters
|
|
185
|
+
query_params = opts[:query_params] || {}
|
|
186
|
+
|
|
187
|
+
# header parameters
|
|
188
|
+
header_params = opts[:header_params] || {}
|
|
189
|
+
# HTTP header 'Accept' (if needed)
|
|
190
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
191
|
+
# HTTP header 'Content-Type'
|
|
192
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
193
|
+
if !content_type.nil?
|
|
194
|
+
header_params['Content-Type'] = content_type
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# form parameters
|
|
198
|
+
form_params = opts[:form_params] || {}
|
|
199
|
+
|
|
200
|
+
# http body (model)
|
|
201
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(set_enabled_input)
|
|
202
|
+
|
|
203
|
+
# return_type
|
|
204
|
+
return_type = opts[:debug_return_type] || 'PreferenceRecord'
|
|
205
|
+
|
|
206
|
+
# auth_names
|
|
207
|
+
auth_names = opts[:debug_auth_names] || ['UserOrAgent']
|
|
208
|
+
|
|
209
|
+
new_options = opts.merge(
|
|
210
|
+
:operation => :"PreferencesApi.set_service_preference",
|
|
211
|
+
:header_params => header_params,
|
|
212
|
+
:query_params => query_params,
|
|
213
|
+
:form_params => form_params,
|
|
214
|
+
:body => post_body,
|
|
215
|
+
:auth_names => auth_names,
|
|
216
|
+
:return_type => return_type
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
220
|
+
if @api_client.config.debugging
|
|
221
|
+
@api_client.config.logger.debug "API called: PreferencesApi#set_service_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
222
|
+
end
|
|
223
|
+
return data, status_code, headers
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Override push delivery for one exact notification type
|
|
227
|
+
# @param service_id [String]
|
|
228
|
+
# @param type [String]
|
|
229
|
+
# @param set_enabled_input [SetEnabledInput]
|
|
230
|
+
# @param [Hash] opts the optional parameters
|
|
231
|
+
# @return [PreferenceRecord]
|
|
232
|
+
def set_type_preference(service_id, type, set_enabled_input, opts = {})
|
|
233
|
+
data, _status_code, _headers = set_type_preference_with_http_info(service_id, type, set_enabled_input, opts)
|
|
234
|
+
data
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Override push delivery for one exact notification type
|
|
238
|
+
# @param service_id [String]
|
|
239
|
+
# @param type [String]
|
|
240
|
+
# @param set_enabled_input [SetEnabledInput]
|
|
241
|
+
# @param [Hash] opts the optional parameters
|
|
242
|
+
# @return [Array<(PreferenceRecord, Integer, Hash)>] PreferenceRecord data, response status code and response headers
|
|
243
|
+
def set_type_preference_with_http_info(service_id, type, set_enabled_input, opts = {})
|
|
244
|
+
if @api_client.config.debugging
|
|
245
|
+
@api_client.config.logger.debug 'Calling API: PreferencesApi.set_type_preference ...'
|
|
246
|
+
end
|
|
247
|
+
# verify the required parameter 'service_id' is set
|
|
248
|
+
if @api_client.config.client_side_validation && service_id.nil?
|
|
249
|
+
fail ArgumentError, "Missing the required parameter 'service_id' when calling PreferencesApi.set_type_preference"
|
|
250
|
+
end
|
|
251
|
+
# verify the required parameter 'type' is set
|
|
252
|
+
if @api_client.config.client_side_validation && type.nil?
|
|
253
|
+
fail ArgumentError, "Missing the required parameter 'type' when calling PreferencesApi.set_type_preference"
|
|
254
|
+
end
|
|
255
|
+
if @api_client.config.client_side_validation && type.to_s.length > 120
|
|
256
|
+
fail ArgumentError, 'invalid value for "type" when calling PreferencesApi.set_type_preference, the character length must be smaller than or equal to 120.'
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# verify the required parameter 'set_enabled_input' is set
|
|
260
|
+
if @api_client.config.client_side_validation && set_enabled_input.nil?
|
|
261
|
+
fail ArgumentError, "Missing the required parameter 'set_enabled_input' when calling PreferencesApi.set_type_preference"
|
|
262
|
+
end
|
|
263
|
+
# resource path
|
|
264
|
+
local_var_path = '/services/{serviceId}/types/{type}/preference'.sub('{serviceId}', CGI.escape(service_id.to_s)).sub('{type}', CGI.escape(type.to_s))
|
|
265
|
+
|
|
266
|
+
# query parameters
|
|
267
|
+
query_params = opts[:query_params] || {}
|
|
268
|
+
|
|
269
|
+
# header parameters
|
|
270
|
+
header_params = opts[:header_params] || {}
|
|
271
|
+
# HTTP header 'Accept' (if needed)
|
|
272
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
273
|
+
# HTTP header 'Content-Type'
|
|
274
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
275
|
+
if !content_type.nil?
|
|
276
|
+
header_params['Content-Type'] = content_type
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# form parameters
|
|
280
|
+
form_params = opts[:form_params] || {}
|
|
281
|
+
|
|
282
|
+
# http body (model)
|
|
283
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(set_enabled_input)
|
|
284
|
+
|
|
285
|
+
# return_type
|
|
286
|
+
return_type = opts[:debug_return_type] || 'PreferenceRecord'
|
|
287
|
+
|
|
288
|
+
# auth_names
|
|
289
|
+
auth_names = opts[:debug_auth_names] || ['UserOrAgent']
|
|
290
|
+
|
|
291
|
+
new_options = opts.merge(
|
|
292
|
+
:operation => :"PreferencesApi.set_type_preference",
|
|
293
|
+
:header_params => header_params,
|
|
294
|
+
:query_params => query_params,
|
|
295
|
+
:form_params => form_params,
|
|
296
|
+
:body => post_body,
|
|
297
|
+
:auth_names => auth_names,
|
|
298
|
+
:return_type => return_type
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
302
|
+
if @api_client.config.debugging
|
|
303
|
+
@api_client.config.logger.debug "API called: PreferencesApi#set_type_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
304
|
+
end
|
|
305
|
+
return data, status_code, headers
|
|
306
|
+
end
|
|
307
|
+
end
|
|
308
|
+
end
|