agentcat-api 0.0.1 → 0.0.3
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 +4 -4
- data/Gemfile +9 -0
- data/README.md +101 -16
- data/Rakefile +10 -0
- data/agentcat-api.gemspec +40 -33
- data/docs/AlertsApi.md +141 -0
- data/docs/EmailChannelVerifyRequest.md +18 -0
- data/docs/EmailChannelVerifyResponse.md +20 -0
- data/docs/Error.md +18 -0
- data/docs/EventAcceptedResponse.md +18 -0
- data/docs/EventsApi.md +81 -0
- data/docs/NotificationsApi.md +143 -0
- data/docs/PublishEventRequest.md +72 -0
- data/docs/QueryTimeout.md +20 -0
- data/docs/UnsubscribeRequestRequest.md +18 -0
- data/docs/ValidationErrorValue.md +49 -0
- data/lib/agentcat-api/api/alerts_api.rb +142 -0
- data/lib/agentcat-api/api/events_api.rb +86 -0
- data/lib/agentcat-api/api/notifications_api.rb +154 -0
- data/lib/agentcat-api/api_client.rb +437 -0
- data/lib/agentcat-api/api_error.rb +58 -0
- data/lib/agentcat-api/configuration.rb +392 -0
- data/lib/agentcat-api/models/email_channel_verify_request.rb +239 -0
- data/lib/agentcat-api/models/email_channel_verify_response.rb +263 -0
- data/lib/agentcat-api/models/error.rb +237 -0
- data/lib/agentcat-api/models/event_accepted_response.rb +222 -0
- data/lib/agentcat-api/models/publish_event_request.rb +545 -0
- data/lib/agentcat-api/models/query_timeout.rb +287 -0
- data/lib/agentcat-api/models/unsubscribe_request_request.rb +239 -0
- data/lib/agentcat-api/models/validation_error_value.rb +105 -0
- data/lib/agentcat-api/version.rb +15 -0
- data/lib/agentcat-api.rb +50 -0
- data/spec/api/alerts_api_spec.rb +59 -0
- data/spec/api/events_api_spec.rb +47 -0
- data/spec/api/notifications_api_spec.rb +60 -0
- data/spec/models/email_channel_verify_request_spec.rb +36 -0
- data/spec/models/email_channel_verify_response_spec.rb +42 -0
- data/spec/models/error_spec.rb +36 -0
- data/spec/models/event_accepted_response_spec.rb +36 -0
- data/spec/models/publish_event_request_spec.rb +202 -0
- data/spec/models/query_timeout_spec.rb +46 -0
- data/spec/models/unsubscribe_request_request_spec.rb +36 -0
- data/spec/models/validation_error_value_spec.rb +32 -0
- data/spec/spec_helper.rb +111 -0
- metadata +135 -23
- data/LICENSE +0 -21
- data/lib/agentcat/api/version.rb +0 -7
- data/lib/agentcat/api.rb +0 -30
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# AgentCatApi::PublishEventRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | ID of the event, typically auto-generated by the AgentCat Agent | [optional] |
|
|
8
|
+
| **project_id** | **String** | ID of the project this event belongs to | |
|
|
9
|
+
| **session_id** | **String** | ID of the session this event belongs to. Null for stateless mode (server assigns session). | [optional] |
|
|
10
|
+
| **actor_id** | **String** | Optional actor ID | [optional] |
|
|
11
|
+
| **event_id** | **String** | Optional custom event ID (must be unique) | [optional] |
|
|
12
|
+
| **event_type** | **String** | Type of event (e.g., mcp:tools/call, agentcat:identify) | [optional] |
|
|
13
|
+
| **is_error** | **Boolean** | Whether this event represents an error | [optional] |
|
|
14
|
+
| **error** | **Object** | Error details if is_error is true | [optional] |
|
|
15
|
+
| **resource_name** | **String** | Name of the resource accessed (for resource events) | [optional] |
|
|
16
|
+
| **duration** | **Integer** | Duration of the operation in milliseconds | [optional] |
|
|
17
|
+
| **input_tokens** | **Integer** | Token count of the request side as measured by the SDK. When absent, the server estimates it from the stored parameters. | [optional] |
|
|
18
|
+
| **output_tokens** | **Integer** | Token count of the response side as measured by the SDK. When absent, the server estimates it from the stored response. Drives the oversized-tool-response rule. | [optional] |
|
|
19
|
+
| **timestamp** | **Time** | Agent-provided timestamp of when the event occurred | [optional] |
|
|
20
|
+
| **user_intent** | **String** | Captured explanation of why the actor made this request | [optional] |
|
|
21
|
+
| **parameters** | **Object** | Parameters sent with the request | [optional] |
|
|
22
|
+
| **response** | **Object** | Response data from the operation | [optional] |
|
|
23
|
+
| **identify_actor_given_id** | **String** | Actor ID for agentcat:identify events | [optional] |
|
|
24
|
+
| **identify_actor_name** | **String** | Actor name for agentcat:identify events | [optional] |
|
|
25
|
+
| **identify_data** | **Object** | Additional data for agentcat:identify events | [optional] |
|
|
26
|
+
| **tags** | **Hash<String, String>** | Custom string key-value pairs. Keys: max 32 chars, alphanumeric/underscore/period/colon/dash/dollar-sign only. Values: max 200 chars, no newlines. Max 50 entries. | [optional] |
|
|
27
|
+
| **properties** | **Object** | Custom structured data. Keys are strings, values can be string, number, boolean, array, object, or null (null values are filtered out). | [optional] |
|
|
28
|
+
| **ip_address** | **String** | IP address of the client | [optional] |
|
|
29
|
+
| **sdk_language** | **String** | Programming language of the SDK used | [optional] |
|
|
30
|
+
| **agentcat_version** | **String** | Version of AgentCat being used | [optional] |
|
|
31
|
+
| **server_name** | **String** | Name of the MCP server | [optional] |
|
|
32
|
+
| **server_version** | **String** | Version of the MCP server | [optional] |
|
|
33
|
+
| **client_name** | **String** | Name of the MCP client | [optional] |
|
|
34
|
+
| **client_version** | **String** | Version of the MCP client | [optional] |
|
|
35
|
+
|
|
36
|
+
## Example
|
|
37
|
+
|
|
38
|
+
```ruby
|
|
39
|
+
require 'agentcat-api'
|
|
40
|
+
|
|
41
|
+
instance = AgentCatApi::PublishEventRequest.new(
|
|
42
|
+
id: null,
|
|
43
|
+
project_id: null,
|
|
44
|
+
session_id: null,
|
|
45
|
+
actor_id: null,
|
|
46
|
+
event_id: null,
|
|
47
|
+
event_type: null,
|
|
48
|
+
is_error: null,
|
|
49
|
+
error: null,
|
|
50
|
+
resource_name: null,
|
|
51
|
+
duration: null,
|
|
52
|
+
input_tokens: null,
|
|
53
|
+
output_tokens: null,
|
|
54
|
+
timestamp: null,
|
|
55
|
+
user_intent: null,
|
|
56
|
+
parameters: null,
|
|
57
|
+
response: null,
|
|
58
|
+
identify_actor_given_id: null,
|
|
59
|
+
identify_actor_name: null,
|
|
60
|
+
identify_data: null,
|
|
61
|
+
tags: null,
|
|
62
|
+
properties: null,
|
|
63
|
+
ip_address: null,
|
|
64
|
+
sdk_language: null,
|
|
65
|
+
agentcat_version: null,
|
|
66
|
+
server_name: null,
|
|
67
|
+
server_version: null,
|
|
68
|
+
client_name: null,
|
|
69
|
+
client_version: null
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# AgentCatApi::QueryTimeout
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **detail** | **String** | | |
|
|
8
|
+
| **code** | **String** | | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'agentcat-api'
|
|
14
|
+
|
|
15
|
+
instance = AgentCatApi::QueryTimeout.new(
|
|
16
|
+
detail: null,
|
|
17
|
+
code: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# AgentCatApi::UnsubscribeRequestRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **token** | **String** | | [optional] |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'agentcat-api'
|
|
13
|
+
|
|
14
|
+
instance = AgentCatApi::UnsubscribeRequestRequest.new(
|
|
15
|
+
token: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# AgentCatApi::ValidationErrorValue
|
|
2
|
+
|
|
3
|
+
## Class instance methods
|
|
4
|
+
|
|
5
|
+
### `openapi_one_of`
|
|
6
|
+
|
|
7
|
+
Returns the list of classes defined in oneOf.
|
|
8
|
+
|
|
9
|
+
#### Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'agentcat-api'
|
|
13
|
+
|
|
14
|
+
AgentCatApi::ValidationErrorValue.openapi_one_of
|
|
15
|
+
# =>
|
|
16
|
+
# [
|
|
17
|
+
# :'Array<String>',
|
|
18
|
+
# :'String'
|
|
19
|
+
# ]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### build
|
|
23
|
+
|
|
24
|
+
Find the appropriate object from the `openapi_one_of` list and casts the data into it.
|
|
25
|
+
|
|
26
|
+
#### Example
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
require 'agentcat-api'
|
|
30
|
+
|
|
31
|
+
AgentCatApi::ValidationErrorValue.build(data)
|
|
32
|
+
# => #<Array<String>:0x00007fdd4aab02a0>
|
|
33
|
+
|
|
34
|
+
AgentCatApi::ValidationErrorValue.build(data_that_doesnt_match)
|
|
35
|
+
# => nil
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### Parameters
|
|
39
|
+
|
|
40
|
+
| Name | Type | Description |
|
|
41
|
+
| ---- | ---- | ----------- |
|
|
42
|
+
| **data** | **Mixed** | data to be matched against the list of oneOf items |
|
|
43
|
+
|
|
44
|
+
#### Return type
|
|
45
|
+
|
|
46
|
+
- `Array<String>`
|
|
47
|
+
- `String`
|
|
48
|
+
- `nil` (if no type matches)
|
|
49
|
+
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#AgentCat API
|
|
3
|
+
|
|
4
|
+
#API for AgentCat application
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module AgentCatApi
|
|
16
|
+
class AlertsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Show the confirmation page for removing an email address from one alert rule
|
|
23
|
+
# GET, the link in the email, shows a confirmation page and changes nothing, because mail scanners fetch links. POST removes the address from the rule; the page's form and the List-Unsubscribe-Post header both send it. POST is idempotent.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :token
|
|
26
|
+
# @return [String]
|
|
27
|
+
def unsubscribe_alert_get(opts = {})
|
|
28
|
+
data, _status_code, _headers = unsubscribe_alert_get_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Show the confirmation page for removing an email address from one alert rule
|
|
33
|
+
# GET, the link in the email, shows a confirmation page and changes nothing, because mail scanners fetch links. POST removes the address from the rule; the page's form and the List-Unsubscribe-Post header both send it. POST is idempotent.
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @option opts [String] :token
|
|
36
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
|
37
|
+
def unsubscribe_alert_get_with_http_info(opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: AlertsApi.unsubscribe_alert_get ...'
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/v1/public/alerts/unsubscribe'
|
|
43
|
+
|
|
44
|
+
# query parameters
|
|
45
|
+
query_params = opts[:query_params] || {}
|
|
46
|
+
query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
|
|
47
|
+
|
|
48
|
+
# header parameters
|
|
49
|
+
header_params = opts[:header_params] || {}
|
|
50
|
+
# HTTP header 'Accept' (if needed)
|
|
51
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/html', 'text/plain', 'application/json']) unless header_params['Accept']
|
|
52
|
+
|
|
53
|
+
# form parameters
|
|
54
|
+
form_params = opts[:form_params] || {}
|
|
55
|
+
|
|
56
|
+
# http body (model)
|
|
57
|
+
post_body = opts[:debug_body]
|
|
58
|
+
|
|
59
|
+
# return_type
|
|
60
|
+
return_type = opts[:debug_return_type] || 'String'
|
|
61
|
+
|
|
62
|
+
# auth_names
|
|
63
|
+
auth_names = opts[:debug_auth_names] || []
|
|
64
|
+
|
|
65
|
+
new_options = opts.merge(
|
|
66
|
+
:operation => :"AlertsApi.unsubscribe_alert_get",
|
|
67
|
+
:header_params => header_params,
|
|
68
|
+
:query_params => query_params,
|
|
69
|
+
:form_params => form_params,
|
|
70
|
+
:body => post_body,
|
|
71
|
+
:auth_names => auth_names,
|
|
72
|
+
:return_type => return_type
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
76
|
+
if @api_client.config.debugging
|
|
77
|
+
@api_client.config.logger.debug "API called: AlertsApi#unsubscribe_alert_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
|
+
end
|
|
79
|
+
return data, status_code, headers
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Remove an email address from one alert rule (List-Unsubscribe-Post and the confirmation form)
|
|
83
|
+
# GET, the link in the email, shows a confirmation page and changes nothing, because mail scanners fetch links. POST removes the address from the rule; the page's form and the List-Unsubscribe-Post header both send it. POST is idempotent.
|
|
84
|
+
# @param [Hash] opts the optional parameters
|
|
85
|
+
# @option opts [String] :token
|
|
86
|
+
# @return [String]
|
|
87
|
+
def unsubscribe_alert_post(opts = {})
|
|
88
|
+
data, _status_code, _headers = unsubscribe_alert_post_with_http_info(opts)
|
|
89
|
+
data
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Remove an email address from one alert rule (List-Unsubscribe-Post and the confirmation form)
|
|
93
|
+
# GET, the link in the email, shows a confirmation page and changes nothing, because mail scanners fetch links. POST removes the address from the rule; the page's form and the List-Unsubscribe-Post header both send it. POST is idempotent.
|
|
94
|
+
# @param [Hash] opts the optional parameters
|
|
95
|
+
# @option opts [String] :token
|
|
96
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
|
97
|
+
def unsubscribe_alert_post_with_http_info(opts = {})
|
|
98
|
+
if @api_client.config.debugging
|
|
99
|
+
@api_client.config.logger.debug 'Calling API: AlertsApi.unsubscribe_alert_post ...'
|
|
100
|
+
end
|
|
101
|
+
# resource path
|
|
102
|
+
local_var_path = '/v1/public/alerts/unsubscribe'
|
|
103
|
+
|
|
104
|
+
# query parameters
|
|
105
|
+
query_params = opts[:query_params] || {}
|
|
106
|
+
query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
|
|
107
|
+
|
|
108
|
+
# header parameters
|
|
109
|
+
header_params = opts[:header_params] || {}
|
|
110
|
+
# HTTP header 'Accept' (if needed)
|
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json']) unless header_params['Accept']
|
|
112
|
+
|
|
113
|
+
# form parameters
|
|
114
|
+
form_params = opts[:form_params] || {}
|
|
115
|
+
|
|
116
|
+
# http body (model)
|
|
117
|
+
post_body = opts[:debug_body]
|
|
118
|
+
|
|
119
|
+
# return_type
|
|
120
|
+
return_type = opts[:debug_return_type] || 'String'
|
|
121
|
+
|
|
122
|
+
# auth_names
|
|
123
|
+
auth_names = opts[:debug_auth_names] || []
|
|
124
|
+
|
|
125
|
+
new_options = opts.merge(
|
|
126
|
+
:operation => :"AlertsApi.unsubscribe_alert_post",
|
|
127
|
+
:header_params => header_params,
|
|
128
|
+
:query_params => query_params,
|
|
129
|
+
:form_params => form_params,
|
|
130
|
+
:body => post_body,
|
|
131
|
+
:auth_names => auth_names,
|
|
132
|
+
:return_type => return_type
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
136
|
+
if @api_client.config.debugging
|
|
137
|
+
@api_client.config.logger.debug "API called: AlertsApi#unsubscribe_alert_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
138
|
+
end
|
|
139
|
+
return data, status_code, headers
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#AgentCat API
|
|
3
|
+
|
|
4
|
+
#API for AgentCat application
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module AgentCatApi
|
|
16
|
+
class EventsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Publish analytics event
|
|
23
|
+
# Submit analytics events for a project. Returns immediately with 202 Accepted.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [PublishEventRequest] :publish_event_request
|
|
26
|
+
# @return [EventAcceptedResponse]
|
|
27
|
+
def publish_event(opts = {})
|
|
28
|
+
data, _status_code, _headers = publish_event_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Publish analytics event
|
|
33
|
+
# Submit analytics events for a project. Returns immediately with 202 Accepted.
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @option opts [PublishEventRequest] :publish_event_request
|
|
36
|
+
# @return [Array<(EventAcceptedResponse, Integer, Hash)>] EventAcceptedResponse data, response status code and response headers
|
|
37
|
+
def publish_event_with_http_info(opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.publish_event ...'
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/v1/public/events/'
|
|
43
|
+
|
|
44
|
+
# query parameters
|
|
45
|
+
query_params = opts[:query_params] || {}
|
|
46
|
+
|
|
47
|
+
# header parameters
|
|
48
|
+
header_params = opts[:header_params] || {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
51
|
+
# HTTP header 'Content-Type'
|
|
52
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
53
|
+
if !content_type.nil?
|
|
54
|
+
header_params['Content-Type'] = content_type
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# form parameters
|
|
58
|
+
form_params = opts[:form_params] || {}
|
|
59
|
+
|
|
60
|
+
# http body (model)
|
|
61
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'publish_event_request'])
|
|
62
|
+
|
|
63
|
+
# return_type
|
|
64
|
+
return_type = opts[:debug_return_type] || 'EventAcceptedResponse'
|
|
65
|
+
|
|
66
|
+
# auth_names
|
|
67
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
68
|
+
|
|
69
|
+
new_options = opts.merge(
|
|
70
|
+
:operation => :"EventsApi.publish_event",
|
|
71
|
+
:header_params => header_params,
|
|
72
|
+
:query_params => query_params,
|
|
73
|
+
:form_params => form_params,
|
|
74
|
+
:body => post_body,
|
|
75
|
+
:auth_names => auth_names,
|
|
76
|
+
:return_type => return_type
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
80
|
+
if @api_client.config.debugging
|
|
81
|
+
@api_client.config.logger.debug "API called: EventsApi#publish_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
82
|
+
end
|
|
83
|
+
return data, status_code, headers
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#AgentCat API
|
|
3
|
+
|
|
4
|
+
#API for AgentCat application
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module AgentCatApi
|
|
16
|
+
class NotificationsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Disable an email notification type for the token's user
|
|
23
|
+
# Anonymous endpoint reached from email unsubscribe links and the List-Unsubscribe header POST. The token encodes the user and the notification type to disable. Response bodies are plain text.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :token Signed unsubscribe token. May also be passed in the request body.
|
|
26
|
+
# @option opts [UnsubscribeRequestRequest] :unsubscribe_request_request
|
|
27
|
+
# @return [String]
|
|
28
|
+
def unsubscribe_notification(opts = {})
|
|
29
|
+
data, _status_code, _headers = unsubscribe_notification_with_http_info(opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Disable an email notification type for the token's user
|
|
34
|
+
# Anonymous endpoint reached from email unsubscribe links and the List-Unsubscribe header POST. The token encodes the user and the notification type to disable. Response bodies are plain text.
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @option opts [String] :token Signed unsubscribe token. May also be passed in the request body.
|
|
37
|
+
# @option opts [UnsubscribeRequestRequest] :unsubscribe_request_request
|
|
38
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
|
39
|
+
def unsubscribe_notification_with_http_info(opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: NotificationsApi.unsubscribe_notification ...'
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/v1/public/notifications/unsubscribe'
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
|
|
49
|
+
|
|
50
|
+
# header parameters
|
|
51
|
+
header_params = opts[:header_params] || {}
|
|
52
|
+
# HTTP header 'Accept' (if needed)
|
|
53
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json']) unless header_params['Accept']
|
|
54
|
+
# HTTP header 'Content-Type'
|
|
55
|
+
content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
|
|
56
|
+
if !content_type.nil?
|
|
57
|
+
header_params['Content-Type'] = content_type
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# form parameters
|
|
61
|
+
form_params = opts[:form_params] || {}
|
|
62
|
+
|
|
63
|
+
# http body (model)
|
|
64
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'unsubscribe_request_request'])
|
|
65
|
+
|
|
66
|
+
# return_type
|
|
67
|
+
return_type = opts[:debug_return_type] || 'String'
|
|
68
|
+
|
|
69
|
+
# auth_names
|
|
70
|
+
auth_names = opts[:debug_auth_names] || []
|
|
71
|
+
|
|
72
|
+
new_options = opts.merge(
|
|
73
|
+
:operation => :"NotificationsApi.unsubscribe_notification",
|
|
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(:POST, local_var_path, new_options)
|
|
83
|
+
if @api_client.config.debugging
|
|
84
|
+
@api_client.config.logger.debug "API called: NotificationsApi#unsubscribe_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
85
|
+
end
|
|
86
|
+
return data, status_code, headers
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Activate an email channel from its verification link
|
|
90
|
+
# @param [Hash] opts the optional parameters
|
|
91
|
+
# @option opts [String] :token
|
|
92
|
+
# @option opts [EmailChannelVerifyRequest] :email_channel_verify_request
|
|
93
|
+
# @return [EmailChannelVerifyResponse]
|
|
94
|
+
def verify_email_channel(opts = {})
|
|
95
|
+
data, _status_code, _headers = verify_email_channel_with_http_info(opts)
|
|
96
|
+
data
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Activate an email channel from its verification link
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @option opts [String] :token
|
|
102
|
+
# @option opts [EmailChannelVerifyRequest] :email_channel_verify_request
|
|
103
|
+
# @return [Array<(EmailChannelVerifyResponse, Integer, Hash)>] EmailChannelVerifyResponse data, response status code and response headers
|
|
104
|
+
def verify_email_channel_with_http_info(opts = {})
|
|
105
|
+
if @api_client.config.debugging
|
|
106
|
+
@api_client.config.logger.debug 'Calling API: NotificationsApi.verify_email_channel ...'
|
|
107
|
+
end
|
|
108
|
+
# resource path
|
|
109
|
+
local_var_path = '/v1/public/notifications/channels/verify'
|
|
110
|
+
|
|
111
|
+
# query parameters
|
|
112
|
+
query_params = opts[:query_params] || {}
|
|
113
|
+
query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
|
|
114
|
+
|
|
115
|
+
# header parameters
|
|
116
|
+
header_params = opts[:header_params] || {}
|
|
117
|
+
# HTTP header 'Accept' (if needed)
|
|
118
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
119
|
+
# HTTP header 'Content-Type'
|
|
120
|
+
content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
|
|
121
|
+
if !content_type.nil?
|
|
122
|
+
header_params['Content-Type'] = content_type
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# form parameters
|
|
126
|
+
form_params = opts[:form_params] || {}
|
|
127
|
+
|
|
128
|
+
# http body (model)
|
|
129
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'email_channel_verify_request'])
|
|
130
|
+
|
|
131
|
+
# return_type
|
|
132
|
+
return_type = opts[:debug_return_type] || 'EmailChannelVerifyResponse'
|
|
133
|
+
|
|
134
|
+
# auth_names
|
|
135
|
+
auth_names = opts[:debug_auth_names] || []
|
|
136
|
+
|
|
137
|
+
new_options = opts.merge(
|
|
138
|
+
:operation => :"NotificationsApi.verify_email_channel",
|
|
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(:POST, local_var_path, new_options)
|
|
148
|
+
if @api_client.config.debugging
|
|
149
|
+
@api_client.config.logger.debug "API called: NotificationsApi#verify_email_channel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
150
|
+
end
|
|
151
|
+
return data, status_code, headers
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|