emailguard_sdk 1.0.5 → 1.2.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 +4 -4
- data/LICENSE +21 -0
- data/README.md +16 -2
- data/examples/detect-email.rb +5 -0
- data/examples/get-billing-usage.rb +5 -0
- data/examples/get-team.rb +5 -0
- data/examples/list-notification-channels.rb +5 -0
- data/examples/list-pending-team-invites.rb +5 -0
- data/lib/emailguard_sdk/api/billing_api.rb +7 -7
- data/lib/emailguard_sdk/api/channels_api.rb +105 -105
- data/lib/emailguard_sdk/api/email_api.rb +11 -11
- data/lib/emailguard_sdk/api/events_api.rb +7 -7
- data/lib/emailguard_sdk/api/invites_api.rb +60 -60
- data/lib/emailguard_sdk/api/members_api.rb +27 -27
- data/lib/emailguard_sdk/api/rules_api.rb +71 -71
- data/lib/emailguard_sdk/api/teams_api.rb +14 -14
- data/lib/emailguard_sdk/api_client.rb +1 -1
- data/lib/emailguard_sdk/api_error.rb +1 -1
- data/lib/emailguard_sdk/api_model_base.rb +1 -1
- data/lib/emailguard_sdk/configuration.rb +3 -3
- data/lib/emailguard_sdk/facade.rb +191 -0
- data/lib/emailguard_sdk/models/base_response.rb +3 -3
- data/lib/emailguard_sdk/models/billing_usage_event.rb +1 -1
- data/lib/emailguard_sdk/models/billing_usage_item.rb +1 -1
- data/lib/emailguard_sdk/models/billing_usage_response.rb +3 -3
- data/lib/emailguard_sdk/models/create_notification_channel_input.rb +1 -1
- data/lib/emailguard_sdk/models/create_notification_rule_input.rb +1 -1
- data/lib/emailguard_sdk/models/email_detect_data.rb +68 -6
- data/lib/emailguard_sdk/models/email_detect_evidence.rb +1 -1
- data/lib/emailguard_sdk/models/email_detect_matched_rule.rb +165 -0
- data/lib/emailguard_sdk/models/email_detect_response.rb +3 -3
- data/lib/emailguard_sdk/models/get_notification_channel_response.rb +3 -3
- data/lib/emailguard_sdk/models/get_notification_channels_response.rb +3 -3
- data/lib/emailguard_sdk/models/get_notification_events_response.rb +3 -3
- data/lib/emailguard_sdk/models/get_notification_rules_response.rb +3 -3
- data/lib/emailguard_sdk/models/get_public_team_response.rb +3 -3
- data/lib/emailguard_sdk/models/id_data_response.rb +3 -3
- data/lib/emailguard_sdk/models/id_data_struct.rb +1 -1
- data/lib/emailguard_sdk/models/invite_team_member_input.rb +1 -1
- data/lib/emailguard_sdk/models/list_public_team_invites_response.rb +3 -3
- data/lib/emailguard_sdk/models/list_public_team_members_response.rb +3 -3
- data/lib/emailguard_sdk/models/message_response.rb +3 -3
- data/lib/emailguard_sdk/models/notification_channel_response.rb +1 -1
- data/lib/emailguard_sdk/models/notification_rule_channel_input.rb +1 -1
- data/lib/emailguard_sdk/models/notification_rule_channel_response.rb +1 -1
- data/lib/emailguard_sdk/models/notification_rule_response.rb +1 -1
- data/lib/emailguard_sdk/models/public_team_invite_response.rb +1 -1
- data/lib/emailguard_sdk/models/public_team_member_response.rb +1 -1
- data/lib/emailguard_sdk/models/public_team_response.rb +1 -1
- data/lib/emailguard_sdk/models/{update_team_member_input.rb → public_update_team_member_input.rb} +5 -32
- data/lib/emailguard_sdk/models/update_notification_channel_input.rb +1 -1
- data/lib/emailguard_sdk/models/update_notification_rule_input.rb +1 -1
- data/lib/emailguard_sdk/models/update_team_input.rb +1 -1
- data/lib/emailguard_sdk/version.rb +2 -2
- data/lib/emailguard_sdk.rb +4 -2
- data/spec/facade_contract_spec.rb +340 -0
- data/spec/spec_helper.rb +1 -111
- metadata +15 -126
- data/Gemfile +0 -9
- data/Rakefile +0 -10
- data/docs/BaseResponse.md +0 -20
- data/docs/BillingApi.md +0 -85
- data/docs/BillingUsageEvent.md +0 -26
- data/docs/BillingUsageItem.md +0 -28
- data/docs/BillingUsageResponse.md +0 -22
- data/docs/ChannelsApi.md +0 -366
- data/docs/CreateNotificationChannelInput.md +0 -22
- data/docs/CreateNotificationRuleInput.md +0 -28
- data/docs/EmailApi.md +0 -72
- data/docs/EmailDetectData.md +0 -48
- data/docs/EmailDetectEvidence.md +0 -22
- data/docs/EmailDetectResponse.md +0 -22
- data/docs/EventsApi.md +0 -76
- data/docs/GetNotificationChannelResponse.md +0 -22
- data/docs/GetNotificationChannelsResponse.md +0 -22
- data/docs/GetNotificationEventsResponse.md +0 -22
- data/docs/GetNotificationRulesResponse.md +0 -22
- data/docs/GetPublicTeamResponse.md +0 -22
- data/docs/IdDataResponse.md +0 -22
- data/docs/IdDataStruct.md +0 -18
- data/docs/InviteTeamMemberInput.md +0 -20
- data/docs/InvitesApi.md +0 -220
- data/docs/ListPublicTeamInvitesResponse.md +0 -22
- data/docs/ListPublicTeamMembersResponse.md +0 -22
- data/docs/MembersApi.md +0 -222
- data/docs/MessageResponse.md +0 -20
- data/docs/NotificationChannelResponse.md +0 -28
- data/docs/NotificationRuleChannelInput.md +0 -22
- data/docs/NotificationRuleChannelResponse.md +0 -28
- data/docs/NotificationRuleResponse.md +0 -32
- data/docs/PublicTeamInviteResponse.md +0 -24
- data/docs/PublicTeamMemberResponse.md +0 -34
- data/docs/PublicTeamResponse.md +0 -28
- data/docs/RulesApi.md +0 -294
- data/docs/TeamsApi.md +0 -148
- data/docs/UpdateNotificationChannelInput.md +0 -20
- data/docs/UpdateNotificationRuleInput.md +0 -28
- data/docs/UpdateTeamInput.md +0 -24
- data/docs/UpdateTeamMemberInput.md +0 -22
- data/emailguard_sdk.gemspec +0 -44
- data/git_push.sh +0 -57
- data/spec/api/billing_api_spec.rb +0 -49
- data/spec/api/channels_api_spec.rb +0 -95
- data/spec/api/email_api_spec.rb +0 -47
- data/spec/api/events_api_spec.rb +0 -46
- data/spec/api/invites_api_spec.rb +0 -70
- data/spec/api/members_api_spec.rb +0 -71
- data/spec/api/rules_api_spec.rb +0 -83
- data/spec/api/teams_api_spec.rb +0 -58
- data/spec/models/base_response_spec.rb +0 -42
- data/spec/models/billing_usage_event_spec.rb +0 -60
- data/spec/models/billing_usage_item_spec.rb +0 -66
- data/spec/models/billing_usage_response_spec.rb +0 -48
- data/spec/models/create_notification_channel_input_spec.rb +0 -48
- data/spec/models/create_notification_rule_input_spec.rb +0 -66
- data/spec/models/email_detect_data_spec.rb +0 -126
- data/spec/models/email_detect_evidence_spec.rb +0 -48
- data/spec/models/email_detect_response_spec.rb +0 -48
- data/spec/models/get_notification_channel_response_spec.rb +0 -48
- data/spec/models/get_notification_channels_response_spec.rb +0 -48
- data/spec/models/get_notification_events_response_spec.rb +0 -48
- data/spec/models/get_notification_rules_response_spec.rb +0 -48
- data/spec/models/get_public_team_response_spec.rb +0 -48
- data/spec/models/id_data_response_spec.rb +0 -48
- data/spec/models/id_data_struct_spec.rb +0 -36
- data/spec/models/invite_team_member_input_spec.rb +0 -42
- data/spec/models/list_public_team_invites_response_spec.rb +0 -48
- data/spec/models/list_public_team_members_response_spec.rb +0 -48
- data/spec/models/message_response_spec.rb +0 -42
- data/spec/models/notification_channel_response_spec.rb +0 -66
- data/spec/models/notification_rule_channel_input_spec.rb +0 -48
- data/spec/models/notification_rule_channel_response_spec.rb +0 -66
- data/spec/models/notification_rule_response_spec.rb +0 -78
- data/spec/models/public_team_invite_response_spec.rb +0 -54
- data/spec/models/public_team_member_response_spec.rb +0 -84
- data/spec/models/public_team_response_spec.rb +0 -66
- data/spec/models/update_notification_channel_input_spec.rb +0 -42
- data/spec/models/update_notification_rule_input_spec.rb +0 -66
- data/spec/models/update_team_input_spec.rb +0 -54
- data/spec/models/update_team_member_input_spec.rb +0 -48
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Team-scoped REST API at /api/v1. Authenticate with `Authorization: Bearer egsk_live_...` or `X-API-Key`. Forks may register custom routes under /api/v1/tools/* (requires `tools:read` / `tools:write` scopes). Async tool jobs return a `job_id` — poll `GET .../{jobId}/results` until complete. See /docs/api-reference.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.3
|
|
7
7
|
Contact: dev@emailguard.co
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0
|
|
@@ -19,22 +19,28 @@ module Emailguard
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
-
#
|
|
23
|
-
#
|
|
22
|
+
# Create notification rule
|
|
23
|
+
# Creates a rule that delivers matching events to the specified channels. At least one event type and one channel target are required.
|
|
24
|
+
# @param create_notification_rule_input [CreateNotificationRuleInput] Rule name, event types, and channel targets
|
|
24
25
|
# @param [Hash] opts the optional parameters
|
|
25
|
-
# @return [
|
|
26
|
-
def
|
|
27
|
-
data, _status_code, _headers =
|
|
26
|
+
# @return [IdDataResponse]
|
|
27
|
+
def create_notification_rule(create_notification_rule_input, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_notification_rule_with_http_info(create_notification_rule_input, opts)
|
|
28
29
|
data
|
|
29
30
|
end
|
|
30
31
|
|
|
31
|
-
#
|
|
32
|
-
#
|
|
32
|
+
# Create notification rule
|
|
33
|
+
# Creates a rule that delivers matching events to the specified channels. At least one event type and one channel target are required.
|
|
34
|
+
# @param create_notification_rule_input [CreateNotificationRuleInput] Rule name, event types, and channel targets
|
|
33
35
|
# @param [Hash] opts the optional parameters
|
|
34
|
-
# @return [Array<(
|
|
35
|
-
def
|
|
36
|
+
# @return [Array<(IdDataResponse, Integer, Hash)>] IdDataResponse data, response status code and response headers
|
|
37
|
+
def create_notification_rule_with_http_info(create_notification_rule_input, opts = {})
|
|
36
38
|
if @api_client.config.debugging
|
|
37
|
-
@api_client.config.logger.debug 'Calling API: RulesApi.
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: RulesApi.create_notification_rule ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'create_notification_rule_input' is set
|
|
42
|
+
if @api_client.config.client_side_validation && create_notification_rule_input.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'create_notification_rule_input' when calling RulesApi.create_notification_rule"
|
|
38
44
|
end
|
|
39
45
|
# resource path
|
|
40
46
|
local_var_path = '/api/v1/team/notifications/rules'
|
|
@@ -46,21 +52,26 @@ module Emailguard
|
|
|
46
52
|
header_params = opts[:header_params] || {}
|
|
47
53
|
# HTTP header 'Accept' (if needed)
|
|
48
54
|
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
49
60
|
|
|
50
61
|
# form parameters
|
|
51
62
|
form_params = opts[:form_params] || {}
|
|
52
63
|
|
|
53
64
|
# http body (model)
|
|
54
|
-
post_body = opts[:debug_body]
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_notification_rule_input)
|
|
55
66
|
|
|
56
67
|
# return_type
|
|
57
|
-
return_type = opts[:debug_return_type] || '
|
|
68
|
+
return_type = opts[:debug_return_type] || 'IdDataResponse'
|
|
58
69
|
|
|
59
70
|
# auth_names
|
|
60
71
|
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
61
72
|
|
|
62
73
|
new_options = opts.merge(
|
|
63
|
-
:operation => :"RulesApi.
|
|
74
|
+
:operation => :"RulesApi.create_notification_rule",
|
|
64
75
|
:header_params => header_params,
|
|
65
76
|
:query_params => query_params,
|
|
66
77
|
:form_params => form_params,
|
|
@@ -69,38 +80,38 @@ module Emailguard
|
|
|
69
80
|
:return_type => return_type
|
|
70
81
|
)
|
|
71
82
|
|
|
72
|
-
data, status_code, headers = @api_client.call_api(:
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
73
84
|
if @api_client.config.debugging
|
|
74
|
-
@api_client.config.logger.debug "API called: RulesApi#
|
|
85
|
+
@api_client.config.logger.debug "API called: RulesApi#create_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
75
86
|
end
|
|
76
87
|
return data, status_code, headers
|
|
77
88
|
end
|
|
78
89
|
|
|
79
|
-
#
|
|
80
|
-
#
|
|
81
|
-
# @param
|
|
90
|
+
# Delete notification rule
|
|
91
|
+
# Permanently deletes a routing rule and its channel assignments.
|
|
92
|
+
# @param rule_id [String] UUID of the notification rule to delete
|
|
82
93
|
# @param [Hash] opts the optional parameters
|
|
83
|
-
# @return [
|
|
84
|
-
def
|
|
85
|
-
data, _status_code, _headers =
|
|
94
|
+
# @return [MessageResponse]
|
|
95
|
+
def delete_notification_rule(rule_id, opts = {})
|
|
96
|
+
data, _status_code, _headers = delete_notification_rule_with_http_info(rule_id, opts)
|
|
86
97
|
data
|
|
87
98
|
end
|
|
88
99
|
|
|
89
|
-
#
|
|
90
|
-
#
|
|
91
|
-
# @param
|
|
100
|
+
# Delete notification rule
|
|
101
|
+
# Permanently deletes a routing rule and its channel assignments.
|
|
102
|
+
# @param rule_id [String] UUID of the notification rule to delete
|
|
92
103
|
# @param [Hash] opts the optional parameters
|
|
93
|
-
# @return [Array<(
|
|
94
|
-
def
|
|
104
|
+
# @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
|
|
105
|
+
def delete_notification_rule_with_http_info(rule_id, opts = {})
|
|
95
106
|
if @api_client.config.debugging
|
|
96
|
-
@api_client.config.logger.debug 'Calling API: RulesApi.
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: RulesApi.delete_notification_rule ...'
|
|
97
108
|
end
|
|
98
|
-
# verify the required parameter '
|
|
99
|
-
if @api_client.config.client_side_validation &&
|
|
100
|
-
fail ArgumentError, "Missing the required parameter '
|
|
109
|
+
# verify the required parameter 'rule_id' is set
|
|
110
|
+
if @api_client.config.client_side_validation && rule_id.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'rule_id' when calling RulesApi.delete_notification_rule"
|
|
101
112
|
end
|
|
102
113
|
# resource path
|
|
103
|
-
local_var_path = '/api/v1/team/notifications/rules'
|
|
114
|
+
local_var_path = '/api/v1/team/notifications/rules/{ruleId}'.sub('{ruleId}', CGI.escape(rule_id.to_s))
|
|
104
115
|
|
|
105
116
|
# query parameters
|
|
106
117
|
query_params = opts[:query_params] || {}
|
|
@@ -109,26 +120,21 @@ module Emailguard
|
|
|
109
120
|
header_params = opts[:header_params] || {}
|
|
110
121
|
# HTTP header 'Accept' (if needed)
|
|
111
122
|
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
112
|
-
# HTTP header 'Content-Type'
|
|
113
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
114
|
-
if !content_type.nil?
|
|
115
|
-
header_params['Content-Type'] = content_type
|
|
116
|
-
end
|
|
117
123
|
|
|
118
124
|
# form parameters
|
|
119
125
|
form_params = opts[:form_params] || {}
|
|
120
126
|
|
|
121
127
|
# http body (model)
|
|
122
|
-
post_body = opts[:debug_body]
|
|
128
|
+
post_body = opts[:debug_body]
|
|
123
129
|
|
|
124
130
|
# return_type
|
|
125
|
-
return_type = opts[:debug_return_type] || '
|
|
131
|
+
return_type = opts[:debug_return_type] || 'MessageResponse'
|
|
126
132
|
|
|
127
133
|
# auth_names
|
|
128
134
|
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
129
135
|
|
|
130
136
|
new_options = opts.merge(
|
|
131
|
-
:operation => :"RulesApi.
|
|
137
|
+
:operation => :"RulesApi.delete_notification_rule",
|
|
132
138
|
:header_params => header_params,
|
|
133
139
|
:query_params => query_params,
|
|
134
140
|
:form_params => form_params,
|
|
@@ -137,38 +143,32 @@ module Emailguard
|
|
|
137
143
|
:return_type => return_type
|
|
138
144
|
)
|
|
139
145
|
|
|
140
|
-
data, status_code, headers = @api_client.call_api(:
|
|
146
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
141
147
|
if @api_client.config.debugging
|
|
142
|
-
@api_client.config.logger.debug "API called: RulesApi#
|
|
148
|
+
@api_client.config.logger.debug "API called: RulesApi#delete_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
143
149
|
end
|
|
144
150
|
return data, status_code, headers
|
|
145
151
|
end
|
|
146
152
|
|
|
147
|
-
#
|
|
148
|
-
#
|
|
149
|
-
# @param rule_id [String] UUID of the notification rule to delete
|
|
153
|
+
# List notification rules
|
|
154
|
+
# Returns routing rules that map event types to one or more delivery channels. Each rule includes its enabled state and channel targets.
|
|
150
155
|
# @param [Hash] opts the optional parameters
|
|
151
|
-
# @return [
|
|
152
|
-
def
|
|
153
|
-
data, _status_code, _headers =
|
|
156
|
+
# @return [GetNotificationRulesResponse]
|
|
157
|
+
def list_notification_rules(opts = {})
|
|
158
|
+
data, _status_code, _headers = list_notification_rules_with_http_info(opts)
|
|
154
159
|
data
|
|
155
160
|
end
|
|
156
161
|
|
|
157
|
-
#
|
|
158
|
-
#
|
|
159
|
-
# @param rule_id [String] UUID of the notification rule to delete
|
|
162
|
+
# List notification rules
|
|
163
|
+
# Returns routing rules that map event types to one or more delivery channels. Each rule includes its enabled state and channel targets.
|
|
160
164
|
# @param [Hash] opts the optional parameters
|
|
161
|
-
# @return [Array<(
|
|
162
|
-
def
|
|
165
|
+
# @return [Array<(GetNotificationRulesResponse, Integer, Hash)>] GetNotificationRulesResponse data, response status code and response headers
|
|
166
|
+
def list_notification_rules_with_http_info(opts = {})
|
|
163
167
|
if @api_client.config.debugging
|
|
164
|
-
@api_client.config.logger.debug 'Calling API: RulesApi.
|
|
165
|
-
end
|
|
166
|
-
# verify the required parameter 'rule_id' is set
|
|
167
|
-
if @api_client.config.client_side_validation && rule_id.nil?
|
|
168
|
-
fail ArgumentError, "Missing the required parameter 'rule_id' when calling RulesApi.api_v1_team_notifications_rules_rule_id_delete"
|
|
168
|
+
@api_client.config.logger.debug 'Calling API: RulesApi.list_notification_rules ...'
|
|
169
169
|
end
|
|
170
170
|
# resource path
|
|
171
|
-
local_var_path = '/api/v1/team/notifications/rules
|
|
171
|
+
local_var_path = '/api/v1/team/notifications/rules'
|
|
172
172
|
|
|
173
173
|
# query parameters
|
|
174
174
|
query_params = opts[:query_params] || {}
|
|
@@ -185,13 +185,13 @@ module Emailguard
|
|
|
185
185
|
post_body = opts[:debug_body]
|
|
186
186
|
|
|
187
187
|
# return_type
|
|
188
|
-
return_type = opts[:debug_return_type] || '
|
|
188
|
+
return_type = opts[:debug_return_type] || 'GetNotificationRulesResponse'
|
|
189
189
|
|
|
190
190
|
# auth_names
|
|
191
191
|
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
192
192
|
|
|
193
193
|
new_options = opts.merge(
|
|
194
|
-
:operation => :"RulesApi.
|
|
194
|
+
:operation => :"RulesApi.list_notification_rules",
|
|
195
195
|
:header_params => header_params,
|
|
196
196
|
:query_params => query_params,
|
|
197
197
|
:form_params => form_params,
|
|
@@ -200,9 +200,9 @@ module Emailguard
|
|
|
200
200
|
:return_type => return_type
|
|
201
201
|
)
|
|
202
202
|
|
|
203
|
-
data, status_code, headers = @api_client.call_api(:
|
|
203
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
204
204
|
if @api_client.config.debugging
|
|
205
|
-
@api_client.config.logger.debug "API called: RulesApi#
|
|
205
|
+
@api_client.config.logger.debug "API called: RulesApi#list_notification_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
206
206
|
end
|
|
207
207
|
return data, status_code, headers
|
|
208
208
|
end
|
|
@@ -213,8 +213,8 @@ module Emailguard
|
|
|
213
213
|
# @param update_notification_rule_input [UpdateNotificationRuleInput] Fields to update on the rule
|
|
214
214
|
# @param [Hash] opts the optional parameters
|
|
215
215
|
# @return [MessageResponse]
|
|
216
|
-
def
|
|
217
|
-
data, _status_code, _headers =
|
|
216
|
+
def update_notification_rule(rule_id, update_notification_rule_input, opts = {})
|
|
217
|
+
data, _status_code, _headers = update_notification_rule_with_http_info(rule_id, update_notification_rule_input, opts)
|
|
218
218
|
data
|
|
219
219
|
end
|
|
220
220
|
|
|
@@ -224,17 +224,17 @@ module Emailguard
|
|
|
224
224
|
# @param update_notification_rule_input [UpdateNotificationRuleInput] Fields to update on the rule
|
|
225
225
|
# @param [Hash] opts the optional parameters
|
|
226
226
|
# @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
|
|
227
|
-
def
|
|
227
|
+
def update_notification_rule_with_http_info(rule_id, update_notification_rule_input, opts = {})
|
|
228
228
|
if @api_client.config.debugging
|
|
229
|
-
@api_client.config.logger.debug 'Calling API: RulesApi.
|
|
229
|
+
@api_client.config.logger.debug 'Calling API: RulesApi.update_notification_rule ...'
|
|
230
230
|
end
|
|
231
231
|
# verify the required parameter 'rule_id' is set
|
|
232
232
|
if @api_client.config.client_side_validation && rule_id.nil?
|
|
233
|
-
fail ArgumentError, "Missing the required parameter 'rule_id' when calling RulesApi.
|
|
233
|
+
fail ArgumentError, "Missing the required parameter 'rule_id' when calling RulesApi.update_notification_rule"
|
|
234
234
|
end
|
|
235
235
|
# verify the required parameter 'update_notification_rule_input' is set
|
|
236
236
|
if @api_client.config.client_side_validation && update_notification_rule_input.nil?
|
|
237
|
-
fail ArgumentError, "Missing the required parameter 'update_notification_rule_input' when calling RulesApi.
|
|
237
|
+
fail ArgumentError, "Missing the required parameter 'update_notification_rule_input' when calling RulesApi.update_notification_rule"
|
|
238
238
|
end
|
|
239
239
|
# resource path
|
|
240
240
|
local_var_path = '/api/v1/team/notifications/rules/{ruleId}'.sub('{ruleId}', CGI.escape(rule_id.to_s))
|
|
@@ -265,7 +265,7 @@ module Emailguard
|
|
|
265
265
|
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
266
266
|
|
|
267
267
|
new_options = opts.merge(
|
|
268
|
-
:operation => :"RulesApi.
|
|
268
|
+
:operation => :"RulesApi.update_notification_rule",
|
|
269
269
|
:header_params => header_params,
|
|
270
270
|
:query_params => query_params,
|
|
271
271
|
:form_params => form_params,
|
|
@@ -276,7 +276,7 @@ module Emailguard
|
|
|
276
276
|
|
|
277
277
|
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
278
278
|
if @api_client.config.debugging
|
|
279
|
-
@api_client.config.logger.debug "API called: RulesApi#
|
|
279
|
+
@api_client.config.logger.debug "API called: RulesApi#update_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
280
280
|
end
|
|
281
281
|
return data, status_code, headers
|
|
282
282
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Team-scoped REST API at /api/v1. Authenticate with `Authorization: Bearer egsk_live_...` or `X-API-Key`. Forks may register custom routes under /api/v1/tools/* (requires `tools:read` / `tools:write` scopes). Async tool jobs return a `job_id` — poll `GET .../{jobId}/results` until complete. See /docs/api-reference.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.3
|
|
7
7
|
Contact: dev@emailguard.co
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0
|
|
@@ -23,8 +23,8 @@ module Emailguard
|
|
|
23
23
|
# Returns profile fields for the team associated with your API key.
|
|
24
24
|
# @param [Hash] opts the optional parameters
|
|
25
25
|
# @return [GetPublicTeamResponse]
|
|
26
|
-
def
|
|
27
|
-
data, _status_code, _headers =
|
|
26
|
+
def get_team(opts = {})
|
|
27
|
+
data, _status_code, _headers = get_team_with_http_info(opts)
|
|
28
28
|
data
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -32,9 +32,9 @@ module Emailguard
|
|
|
32
32
|
# Returns profile fields for the team associated with your API key.
|
|
33
33
|
# @param [Hash] opts the optional parameters
|
|
34
34
|
# @return [Array<(GetPublicTeamResponse, Integer, Hash)>] GetPublicTeamResponse data, response status code and response headers
|
|
35
|
-
def
|
|
35
|
+
def get_team_with_http_info(opts = {})
|
|
36
36
|
if @api_client.config.debugging
|
|
37
|
-
@api_client.config.logger.debug 'Calling API: TeamsApi.
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: TeamsApi.get_team ...'
|
|
38
38
|
end
|
|
39
39
|
# resource path
|
|
40
40
|
local_var_path = '/api/v1/team'
|
|
@@ -60,7 +60,7 @@ module Emailguard
|
|
|
60
60
|
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
61
61
|
|
|
62
62
|
new_options = opts.merge(
|
|
63
|
-
:operation => :"TeamsApi.
|
|
63
|
+
:operation => :"TeamsApi.get_team",
|
|
64
64
|
:header_params => header_params,
|
|
65
65
|
:query_params => query_params,
|
|
66
66
|
:form_params => form_params,
|
|
@@ -71,7 +71,7 @@ module Emailguard
|
|
|
71
71
|
|
|
72
72
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
73
73
|
if @api_client.config.debugging
|
|
74
|
-
@api_client.config.logger.debug "API called: TeamsApi#
|
|
74
|
+
@api_client.config.logger.debug "API called: TeamsApi#get_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
75
75
|
end
|
|
76
76
|
return data, status_code, headers
|
|
77
77
|
end
|
|
@@ -81,8 +81,8 @@ module Emailguard
|
|
|
81
81
|
# @param update_team_input [UpdateTeamInput] Team profile fields to update
|
|
82
82
|
# @param [Hash] opts the optional parameters
|
|
83
83
|
# @return [GetPublicTeamResponse]
|
|
84
|
-
def
|
|
85
|
-
data, _status_code, _headers =
|
|
84
|
+
def update_team(update_team_input, opts = {})
|
|
85
|
+
data, _status_code, _headers = update_team_with_http_info(update_team_input, opts)
|
|
86
86
|
data
|
|
87
87
|
end
|
|
88
88
|
|
|
@@ -91,13 +91,13 @@ module Emailguard
|
|
|
91
91
|
# @param update_team_input [UpdateTeamInput] Team profile fields to update
|
|
92
92
|
# @param [Hash] opts the optional parameters
|
|
93
93
|
# @return [Array<(GetPublicTeamResponse, Integer, Hash)>] GetPublicTeamResponse data, response status code and response headers
|
|
94
|
-
def
|
|
94
|
+
def update_team_with_http_info(update_team_input, opts = {})
|
|
95
95
|
if @api_client.config.debugging
|
|
96
|
-
@api_client.config.logger.debug 'Calling API: TeamsApi.
|
|
96
|
+
@api_client.config.logger.debug 'Calling API: TeamsApi.update_team ...'
|
|
97
97
|
end
|
|
98
98
|
# verify the required parameter 'update_team_input' is set
|
|
99
99
|
if @api_client.config.client_side_validation && update_team_input.nil?
|
|
100
|
-
fail ArgumentError, "Missing the required parameter 'update_team_input' when calling TeamsApi.
|
|
100
|
+
fail ArgumentError, "Missing the required parameter 'update_team_input' when calling TeamsApi.update_team"
|
|
101
101
|
end
|
|
102
102
|
# resource path
|
|
103
103
|
local_var_path = '/api/v1/team'
|
|
@@ -128,7 +128,7 @@ module Emailguard
|
|
|
128
128
|
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
129
129
|
|
|
130
130
|
new_options = opts.merge(
|
|
131
|
-
:operation => :"TeamsApi.
|
|
131
|
+
:operation => :"TeamsApi.update_team",
|
|
132
132
|
:header_params => header_params,
|
|
133
133
|
:query_params => query_params,
|
|
134
134
|
:form_params => form_params,
|
|
@@ -139,7 +139,7 @@ module Emailguard
|
|
|
139
139
|
|
|
140
140
|
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
141
141
|
if @api_client.config.debugging
|
|
142
|
-
@api_client.config.logger.debug "API called: TeamsApi#
|
|
142
|
+
@api_client.config.logger.debug "API called: TeamsApi#update_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
143
143
|
end
|
|
144
144
|
return data, status_code, headers
|
|
145
145
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Team-scoped REST API at /api/v1. Authenticate with `Authorization: Bearer egsk_live_...` or `X-API-Key`. Forks may register custom routes under /api/v1/tools/* (requires `tools:read` / `tools:write` scopes). Async tool jobs return a `job_id` — poll `GET .../{jobId}/results` until complete. See /docs/api-reference.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.3
|
|
7
7
|
Contact: dev@emailguard.co
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Team-scoped REST API at /api/v1. Authenticate with `Authorization: Bearer egsk_live_...` or `X-API-Key`. Forks may register custom routes under /api/v1/tools/* (requires `tools:read` / `tools:write` scopes). Async tool jobs return a `job_id` — poll `GET .../{jobId}/results` until complete. See /docs/api-reference.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.3
|
|
7
7
|
Contact: dev@emailguard.co
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Team-scoped REST API at /api/v1. Authenticate with `Authorization: Bearer egsk_live_...` or `X-API-Key`. Forks may register custom routes under /api/v1/tools/* (requires `tools:read` / `tools:write` scopes). Async tool jobs return a `job_id` — poll `GET .../{jobId}/results` until complete. See /docs/api-reference.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.3
|
|
7
7
|
Contact: dev@emailguard.co
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Team-scoped REST API at /api/v1. Authenticate with `Authorization: Bearer egsk_live_...` or `X-API-Key`. Forks may register custom routes under /api/v1/tools/* (requires `tools:read` / `tools:write` scopes). Async tool jobs return a `job_id` — poll `GET .../{jobId}/results` until complete. See /docs/api-reference.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.3
|
|
7
7
|
Contact: dev@emailguard.co
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0
|
|
@@ -157,7 +157,7 @@ module Emailguard
|
|
|
157
157
|
attr_accessor :force_ending_format
|
|
158
158
|
|
|
159
159
|
def initialize
|
|
160
|
-
@scheme = '
|
|
160
|
+
@scheme = 'https'
|
|
161
161
|
@host = 'api.emailguard.co'
|
|
162
162
|
@base_path = ''
|
|
163
163
|
@server_index = nil
|
|
@@ -272,7 +272,7 @@ module Emailguard
|
|
|
272
272
|
def server_settings
|
|
273
273
|
[
|
|
274
274
|
{
|
|
275
|
-
url: "
|
|
275
|
+
url: "https://api.emailguard.co",
|
|
276
276
|
description: "No description provided",
|
|
277
277
|
}
|
|
278
278
|
]
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Code generated by scripts/clients/generate-language-facades.mjs; DO NOT EDIT.
|
|
2
|
+
require "uri"
|
|
3
|
+
|
|
4
|
+
module Emailguard
|
|
5
|
+
class APIError < StandardError
|
|
6
|
+
attr_reader :status, :code
|
|
7
|
+
def initialize(message, status: 0, code: nil)
|
|
8
|
+
super(message)
|
|
9
|
+
@status = status
|
|
10
|
+
@code = code
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class ResourceClient
|
|
15
|
+
private
|
|
16
|
+
def unwrap
|
|
17
|
+
envelope = yield
|
|
18
|
+
raise APIError.new("API returned an empty response", code: "INVALID_RESPONSE") if envelope.nil?
|
|
19
|
+
raise APIError.new(envelope.message || "API returned an unsuccessful response", status: 200, code: envelope.code) unless envelope.code == "SUCCESS"
|
|
20
|
+
return nil unless envelope.respond_to?(:data)
|
|
21
|
+
raise APIError.new("API response did not include data", status: 200, code: "INVALID_RESPONSE") if envelope.data.nil?
|
|
22
|
+
envelope.data
|
|
23
|
+
rescue ApiError => error
|
|
24
|
+
body = error.response_body.to_s
|
|
25
|
+
begin
|
|
26
|
+
payload = JSON.parse(body.empty? ? "{}" : body)
|
|
27
|
+
invalid_response = false
|
|
28
|
+
rescue JSON::ParserError
|
|
29
|
+
payload = {}
|
|
30
|
+
invalid_response = true
|
|
31
|
+
end
|
|
32
|
+
raise APIError.new(
|
|
33
|
+
invalid_response ? "API returned an invalid response" : (payload["message"] || error.message),
|
|
34
|
+
status: error.code || 0,
|
|
35
|
+
code: invalid_response ? "INVALID_RESPONSE" : payload["code"]
|
|
36
|
+
)
|
|
37
|
+
rescue JSON::ParserError, TypeError => error
|
|
38
|
+
raise APIError.new("API returned an invalid response", code: "INVALID_RESPONSE")
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
class InvitesClient < ResourceClient
|
|
43
|
+
def initialize(api_client)
|
|
44
|
+
@api = InvitesApi.new(api_client)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def cancel_pending_invite(invite_id:)
|
|
48
|
+
unwrap { @api.cancel_pending_invite(invite_id) }
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def invite_team_member(input:)
|
|
52
|
+
unwrap { @api.invite_team_member(input) }
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def list_pending_team_invites()
|
|
56
|
+
unwrap { @api.list_pending_team_invites() }
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
class ChannelsClient < ResourceClient
|
|
61
|
+
def initialize(api_client)
|
|
62
|
+
@api = ChannelsApi.new(api_client)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def create_notification_channel(input:)
|
|
66
|
+
unwrap { @api.create_notification_channel(input) }
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def delete_notification_channel(channel_id:)
|
|
70
|
+
unwrap { @api.delete_notification_channel(channel_id) }
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def list_notification_channels()
|
|
74
|
+
unwrap { @api.list_notification_channels() }
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def test_notification_channel(channel_id:)
|
|
78
|
+
unwrap { @api.test_notification_channel(channel_id) }
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def update_notification_channel(channel_id:, input:)
|
|
82
|
+
unwrap { @api.update_notification_channel(channel_id, input) }
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
class RulesClient < ResourceClient
|
|
87
|
+
def initialize(api_client)
|
|
88
|
+
@api = RulesApi.new(api_client)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def create_notification_rule(input:)
|
|
92
|
+
unwrap { @api.create_notification_rule(input) }
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def delete_notification_rule(rule_id:)
|
|
96
|
+
unwrap { @api.delete_notification_rule(rule_id) }
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def list_notification_rules()
|
|
100
|
+
unwrap { @api.list_notification_rules() }
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def update_notification_rule(rule_id:, input:)
|
|
104
|
+
unwrap { @api.update_notification_rule(rule_id, input) }
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
class EmailClient < ResourceClient
|
|
109
|
+
def initialize(api_client)
|
|
110
|
+
@api = EmailApi.new(api_client)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def detect_email(email:)
|
|
114
|
+
unwrap { @api.detect_email(email: email) }
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
class BillingClient < ResourceClient
|
|
119
|
+
def initialize(api_client)
|
|
120
|
+
@api = BillingApi.new(api_client)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def get_billing_usage(range: nil, start: nil, _end: nil)
|
|
124
|
+
unwrap { @api.get_billing_usage(range: range, start: start, _end: _end) }
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
class TeamsClient < ResourceClient
|
|
129
|
+
def initialize(api_client)
|
|
130
|
+
@api = TeamsApi.new(api_client)
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def get_team()
|
|
134
|
+
unwrap { @api.get_team() }
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def update_team(input:)
|
|
138
|
+
unwrap { @api.update_team(input) }
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
class EventsClient < ResourceClient
|
|
143
|
+
def initialize(api_client)
|
|
144
|
+
@api = EventsApi.new(api_client)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def list_notification_events()
|
|
148
|
+
unwrap { @api.list_notification_events() }
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
class MembersClient < ResourceClient
|
|
153
|
+
def initialize(api_client)
|
|
154
|
+
@api = MembersApi.new(api_client)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def list_team_members()
|
|
158
|
+
unwrap { @api.list_team_members() }
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def remove_team_member(user_id:)
|
|
162
|
+
unwrap { @api.remove_team_member(user_id) }
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def update_team_member(user_id:, input:)
|
|
166
|
+
unwrap { @api.update_team_member(user_id, input) }
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
class Client
|
|
171
|
+
attr_reader :invites, :channels, :rules, :email, :billing, :teams, :events, :members
|
|
172
|
+
def initialize(api_key:, base_url: nil)
|
|
173
|
+
configuration = Configuration.default
|
|
174
|
+
if base_url
|
|
175
|
+
configuration.host = base_url
|
|
176
|
+
configuration.scheme = URI(base_url).scheme
|
|
177
|
+
end
|
|
178
|
+
configuration.api_key["Authorization"] = api_key
|
|
179
|
+
configuration.api_key_prefix["Authorization"] = "Bearer"
|
|
180
|
+
api_client = ApiClient.new(configuration)
|
|
181
|
+
@invites = InvitesClient.new(api_client)
|
|
182
|
+
@channels = ChannelsClient.new(api_client)
|
|
183
|
+
@rules = RulesClient.new(api_client)
|
|
184
|
+
@email = EmailClient.new(api_client)
|
|
185
|
+
@billing = BillingClient.new(api_client)
|
|
186
|
+
@teams = TeamsClient.new(api_client)
|
|
187
|
+
@events = EventsClient.new(api_client)
|
|
188
|
+
@members = MembersClient.new(api_client)
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Team-scoped REST API at /api/v1. Authenticate with `Authorization: Bearer egsk_live_...` or `X-API-Key`. Forks may register custom routes under /api/v1/tools/* (requires `tools:read` / `tools:write` scopes). Async tool jobs return a `job_id` — poll `GET .../{jobId}/results` until complete. See /docs/api-reference.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.3
|
|
7
7
|
Contact: dev@emailguard.co
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0
|
|
@@ -15,10 +15,10 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Emailguard
|
|
17
17
|
class BaseResponse < ApiModelBase
|
|
18
|
-
# Machine-readable status code (for example
|
|
18
|
+
# Machine-readable status code (for example SUCCESS or INVALID_BODY).
|
|
19
19
|
attr_accessor :code
|
|
20
20
|
|
|
21
|
-
# Human-readable detail when the code is not
|
|
21
|
+
# Human-readable detail when the code is not SUCCESS.
|
|
22
22
|
attr_accessor :message
|
|
23
23
|
|
|
24
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|