emailguard_sdk 1.0.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/README.md +169 -0
- data/Rakefile +10 -0
- data/docs/BaseResponse.md +20 -0
- data/docs/BillingApi.md +85 -0
- data/docs/BillingUsageEvent.md +26 -0
- data/docs/BillingUsageItem.md +28 -0
- data/docs/BillingUsageResponse.md +22 -0
- data/docs/ChannelsApi.md +366 -0
- data/docs/CreateNotificationChannelInput.md +22 -0
- data/docs/CreateNotificationRuleInput.md +28 -0
- data/docs/EmailApi.md +72 -0
- data/docs/EmailDetectData.md +44 -0
- data/docs/EmailDetectResponse.md +22 -0
- data/docs/EventsApi.md +76 -0
- data/docs/GetNotificationChannelResponse.md +22 -0
- data/docs/GetNotificationChannelsResponse.md +22 -0
- data/docs/GetNotificationEventsResponse.md +22 -0
- data/docs/GetNotificationRulesResponse.md +22 -0
- data/docs/GetPublicTeamResponse.md +22 -0
- data/docs/IdDataResponse.md +22 -0
- data/docs/IdDataStruct.md +18 -0
- data/docs/InviteTeamMemberInput.md +20 -0
- data/docs/InvitesApi.md +220 -0
- data/docs/ListPublicTeamInvitesResponse.md +22 -0
- data/docs/ListPublicTeamMembersResponse.md +22 -0
- data/docs/MembersApi.md +222 -0
- data/docs/MessageResponse.md +20 -0
- data/docs/NotificationChannelResponse.md +28 -0
- data/docs/NotificationRuleChannelInput.md +22 -0
- data/docs/NotificationRuleChannelResponse.md +28 -0
- data/docs/NotificationRuleResponse.md +32 -0
- data/docs/PublicTeamInviteResponse.md +24 -0
- data/docs/PublicTeamMemberResponse.md +34 -0
- data/docs/PublicTeamResponse.md +28 -0
- data/docs/RulesApi.md +294 -0
- data/docs/TeamsApi.md +148 -0
- data/docs/UpdateNotificationChannelInput.md +20 -0
- data/docs/UpdateNotificationRuleInput.md +28 -0
- data/docs/UpdateTeamInput.md +24 -0
- data/docs/UpdateTeamMemberInput.md +22 -0
- data/emailguard_sdk.gemspec +39 -0
- data/git_push.sh +57 -0
- data/lib/emailguard_sdk/api/billing_api.rb +92 -0
- data/lib/emailguard_sdk/api/channels_api.rb +347 -0
- data/lib/emailguard_sdk/api/email_api.rb +86 -0
- data/lib/emailguard_sdk/api/events_api.rb +79 -0
- data/lib/emailguard_sdk/api/invites_api.rb +210 -0
- data/lib/emailguard_sdk/api/members_api.rb +216 -0
- data/lib/emailguard_sdk/api/rules_api.rb +284 -0
- data/lib/emailguard_sdk/api/teams_api.rb +147 -0
- data/lib/emailguard_sdk/api_client.rb +397 -0
- data/lib/emailguard_sdk/api_error.rb +58 -0
- data/lib/emailguard_sdk/api_model_base.rb +88 -0
- data/lib/emailguard_sdk/configuration.rb +322 -0
- data/lib/emailguard_sdk/models/base_response.rb +175 -0
- data/lib/emailguard_sdk/models/billing_usage_event.rb +268 -0
- data/lib/emailguard_sdk/models/billing_usage_item.rb +262 -0
- data/lib/emailguard_sdk/models/billing_usage_response.rb +186 -0
- data/lib/emailguard_sdk/models/create_notification_channel_input.rb +204 -0
- data/lib/emailguard_sdk/models/create_notification_rule_input.rb +264 -0
- data/lib/emailguard_sdk/models/email_detect_data.rb +266 -0
- data/lib/emailguard_sdk/models/email_detect_response.rb +184 -0
- data/lib/emailguard_sdk/models/get_notification_channel_response.rb +184 -0
- data/lib/emailguard_sdk/models/get_notification_channels_response.rb +186 -0
- data/lib/emailguard_sdk/models/get_notification_events_response.rb +186 -0
- data/lib/emailguard_sdk/models/get_notification_rules_response.rb +186 -0
- data/lib/emailguard_sdk/models/get_public_team_response.rb +184 -0
- data/lib/emailguard_sdk/models/id_data_response.rb +184 -0
- data/lib/emailguard_sdk/models/id_data_struct.rb +148 -0
- data/lib/emailguard_sdk/models/invite_team_member_input.rb +192 -0
- data/lib/emailguard_sdk/models/list_public_team_invites_response.rb +186 -0
- data/lib/emailguard_sdk/models/list_public_team_members_response.rb +186 -0
- data/lib/emailguard_sdk/models/message_response.rb +175 -0
- data/lib/emailguard_sdk/models/notification_channel_response.rb +200 -0
- data/lib/emailguard_sdk/models/notification_rule_channel_input.rb +168 -0
- data/lib/emailguard_sdk/models/notification_rule_channel_response.rb +198 -0
- data/lib/emailguard_sdk/models/notification_rule_response.rb +224 -0
- data/lib/emailguard_sdk/models/public_team_invite_response.rb +246 -0
- data/lib/emailguard_sdk/models/public_team_member_response.rb +347 -0
- data/lib/emailguard_sdk/models/public_team_response.rb +198 -0
- data/lib/emailguard_sdk/models/update_notification_channel_input.rb +160 -0
- data/lib/emailguard_sdk/models/update_notification_rule_input.rb +204 -0
- data/lib/emailguard_sdk/models/update_team_input.rb +195 -0
- data/lib/emailguard_sdk/models/update_team_member_input.rb +185 -0
- data/lib/emailguard_sdk/version.rb +15 -0
- data/lib/emailguard_sdk.rb +78 -0
- data/spec/api/billing_api_spec.rb +49 -0
- data/spec/api/channels_api_spec.rb +95 -0
- data/spec/api/email_api_spec.rb +47 -0
- data/spec/api/events_api_spec.rb +46 -0
- data/spec/api/invites_api_spec.rb +70 -0
- data/spec/api/members_api_spec.rb +71 -0
- data/spec/api/rules_api_spec.rb +83 -0
- data/spec/api/teams_api_spec.rb +58 -0
- data/spec/models/base_response_spec.rb +42 -0
- data/spec/models/billing_usage_event_spec.rb +60 -0
- data/spec/models/billing_usage_item_spec.rb +66 -0
- data/spec/models/billing_usage_response_spec.rb +48 -0
- data/spec/models/create_notification_channel_input_spec.rb +48 -0
- data/spec/models/create_notification_rule_input_spec.rb +66 -0
- data/spec/models/email_detect_data_spec.rb +114 -0
- data/spec/models/email_detect_response_spec.rb +48 -0
- data/spec/models/get_notification_channel_response_spec.rb +48 -0
- data/spec/models/get_notification_channels_response_spec.rb +48 -0
- data/spec/models/get_notification_events_response_spec.rb +48 -0
- data/spec/models/get_notification_rules_response_spec.rb +48 -0
- data/spec/models/get_public_team_response_spec.rb +48 -0
- data/spec/models/id_data_response_spec.rb +48 -0
- data/spec/models/id_data_struct_spec.rb +36 -0
- data/spec/models/invite_team_member_input_spec.rb +42 -0
- data/spec/models/list_public_team_invites_response_spec.rb +48 -0
- data/spec/models/list_public_team_members_response_spec.rb +48 -0
- data/spec/models/message_response_spec.rb +42 -0
- data/spec/models/notification_channel_response_spec.rb +66 -0
- data/spec/models/notification_rule_channel_input_spec.rb +48 -0
- data/spec/models/notification_rule_channel_response_spec.rb +66 -0
- data/spec/models/notification_rule_response_spec.rb +78 -0
- data/spec/models/public_team_invite_response_spec.rb +54 -0
- data/spec/models/public_team_member_response_spec.rb +84 -0
- data/spec/models/public_team_response_spec.rb +66 -0
- data/spec/models/update_notification_channel_input_spec.rb +42 -0
- data/spec/models/update_notification_rule_input_spec.rb +66 -0
- data/spec/models/update_team_input_spec.rb +54 -0
- data/spec/models/update_team_member_input_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- metadata +251 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
=begin
|
|
4
|
+
#EmailGuard Public API
|
|
5
|
+
|
|
6
|
+
#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.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: dev@emailguard.co
|
|
10
|
+
Generated by: https://openapi-generator.tech
|
|
11
|
+
Generator version: 7.23.0
|
|
12
|
+
|
|
13
|
+
=end
|
|
14
|
+
|
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
16
|
+
require "emailguard_sdk/version"
|
|
17
|
+
|
|
18
|
+
Gem::Specification.new do |s|
|
|
19
|
+
s.name = "emailguard_sdk"
|
|
20
|
+
s.version = Emailguard::VERSION
|
|
21
|
+
s.platform = Gem::Platform::RUBY
|
|
22
|
+
s.authors = ["EmailGuard"]
|
|
23
|
+
s.email = ["dev@emailguard.co"]
|
|
24
|
+
s.homepage = "https://emailguard.co"
|
|
25
|
+
s.summary = "EmailGuard Public API Ruby Gem"
|
|
26
|
+
s.description = "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."
|
|
27
|
+
s.license = "Unlicense"
|
|
28
|
+
s.required_ruby_version = ">= 2.7"
|
|
29
|
+
s.metadata = {}
|
|
30
|
+
|
|
31
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
|
32
|
+
|
|
33
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
|
34
|
+
|
|
35
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
|
36
|
+
s.test_files = `find spec/*`.split("\n")
|
|
37
|
+
s.executables = []
|
|
38
|
+
s.require_paths = ["lib"]
|
|
39
|
+
end
|
data/git_push.sh
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
|
3
|
+
#
|
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
|
5
|
+
|
|
6
|
+
git_user_id=$1
|
|
7
|
+
git_repo_id=$2
|
|
8
|
+
release_note=$3
|
|
9
|
+
git_host=$4
|
|
10
|
+
|
|
11
|
+
if [ "$git_host" = "" ]; then
|
|
12
|
+
git_host="github.com"
|
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
|
17
|
+
git_user_id="emailguard"
|
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
|
22
|
+
git_repo_id="emailguard-ruby"
|
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
if [ "$release_note" = "" ]; then
|
|
27
|
+
release_note="Minor update"
|
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Initialize the local directory as a Git repository
|
|
32
|
+
git init
|
|
33
|
+
|
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
|
35
|
+
git add .
|
|
36
|
+
|
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
|
38
|
+
git commit -m "$release_note"
|
|
39
|
+
|
|
40
|
+
# Sets the new remote
|
|
41
|
+
git_remote=$(git remote)
|
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
|
43
|
+
|
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
|
47
|
+
else
|
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
git pull origin master
|
|
54
|
+
|
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#EmailGuard Public API
|
|
3
|
+
|
|
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
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
Contact: dev@emailguard.co
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Emailguard
|
|
16
|
+
class BillingApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get billing usage
|
|
23
|
+
# Returns metered feature usage for the team's billing period. Defaults to the current period; use `range=previous` or `range=custom` with `start` and `end` to query other windows.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :range Period selector: current, previous, or custom
|
|
26
|
+
# @option opts [String] :start Custom range start (RFC3339 or YYYY-MM-DD); required when range=custom
|
|
27
|
+
# @option opts [String] :_end Custom range end (RFC3339 or YYYY-MM-DD); required when range=custom
|
|
28
|
+
# @return [BillingUsageResponse]
|
|
29
|
+
def api_v1_team_billing_usage_get(opts = {})
|
|
30
|
+
data, _status_code, _headers = api_v1_team_billing_usage_get_with_http_info(opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Get billing usage
|
|
35
|
+
# Returns metered feature usage for the team's billing period. Defaults to the current period; use `range=previous` or `range=custom` with `start` and `end` to query other windows.
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @option opts [String] :range Period selector: current, previous, or custom
|
|
38
|
+
# @option opts [String] :start Custom range start (RFC3339 or YYYY-MM-DD); required when range=custom
|
|
39
|
+
# @option opts [String] :_end Custom range end (RFC3339 or YYYY-MM-DD); required when range=custom
|
|
40
|
+
# @return [Array<(BillingUsageResponse, Integer, Hash)>] BillingUsageResponse data, response status code and response headers
|
|
41
|
+
def api_v1_team_billing_usage_get_with_http_info(opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: BillingApi.api_v1_team_billing_usage_get ...'
|
|
44
|
+
end
|
|
45
|
+
allowable_values = ["current", "previous", "custom"]
|
|
46
|
+
if @api_client.config.client_side_validation && opts[:'range'] && !allowable_values.include?(opts[:'range'])
|
|
47
|
+
fail ArgumentError, "invalid value for \"range\", must be one of #{allowable_values}"
|
|
48
|
+
end
|
|
49
|
+
# resource path
|
|
50
|
+
local_var_path = '/api/v1/team/billing/usage'
|
|
51
|
+
|
|
52
|
+
# query parameters
|
|
53
|
+
query_params = opts[:query_params] || {}
|
|
54
|
+
query_params[:'range'] = opts[:'range'] if !opts[:'range'].nil?
|
|
55
|
+
query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
|
|
56
|
+
query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil?
|
|
57
|
+
|
|
58
|
+
# header parameters
|
|
59
|
+
header_params = opts[:header_params] || {}
|
|
60
|
+
# HTTP header 'Accept' (if needed)
|
|
61
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
62
|
+
|
|
63
|
+
# form parameters
|
|
64
|
+
form_params = opts[:form_params] || {}
|
|
65
|
+
|
|
66
|
+
# http body (model)
|
|
67
|
+
post_body = opts[:debug_body]
|
|
68
|
+
|
|
69
|
+
# return_type
|
|
70
|
+
return_type = opts[:debug_return_type] || 'BillingUsageResponse'
|
|
71
|
+
|
|
72
|
+
# auth_names
|
|
73
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
74
|
+
|
|
75
|
+
new_options = opts.merge(
|
|
76
|
+
:operation => :"BillingApi.api_v1_team_billing_usage_get",
|
|
77
|
+
:header_params => header_params,
|
|
78
|
+
:query_params => query_params,
|
|
79
|
+
:form_params => form_params,
|
|
80
|
+
:body => post_body,
|
|
81
|
+
:auth_names => auth_names,
|
|
82
|
+
:return_type => return_type
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
86
|
+
if @api_client.config.debugging
|
|
87
|
+
@api_client.config.logger.debug "API called: BillingApi#api_v1_team_billing_usage_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
88
|
+
end
|
|
89
|
+
return data, status_code, headers
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#EmailGuard Public API
|
|
3
|
+
|
|
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
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
Contact: dev@emailguard.co
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Emailguard
|
|
16
|
+
class ChannelsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Delete notification channel
|
|
23
|
+
# Permanently deletes a channel and removes it from any rules that reference it.
|
|
24
|
+
# @param channel_id [String] UUID of the notification channel to delete
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [MessageResponse]
|
|
27
|
+
def api_v1_team_notifications_channels_channel_id_delete(channel_id, opts = {})
|
|
28
|
+
data, _status_code, _headers = api_v1_team_notifications_channels_channel_id_delete_with_http_info(channel_id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Delete notification channel
|
|
33
|
+
# Permanently deletes a channel and removes it from any rules that reference it.
|
|
34
|
+
# @param channel_id [String] UUID of the notification channel to delete
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
|
|
37
|
+
def api_v1_team_notifications_channels_channel_id_delete_with_http_info(channel_id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: ChannelsApi.api_v1_team_notifications_channels_channel_id_delete ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'channel_id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && channel_id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'channel_id' when calling ChannelsApi.api_v1_team_notifications_channels_channel_id_delete"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/v1/team/notifications/channels/{channelId}'.sub('{channelId}', CGI.escape(channel_id.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'MessageResponse'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"ChannelsApi.api_v1_team_notifications_channels_channel_id_delete",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: ChannelsApi#api_v1_team_notifications_channels_channel_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Update notification channel
|
|
86
|
+
# Updates a channel's display name or configuration. Send only fields you want to change.
|
|
87
|
+
# @param channel_id [String] UUID of the notification channel to update
|
|
88
|
+
# @param update_notification_channel_input [UpdateNotificationChannelInput] Updated channel name and/or configuration
|
|
89
|
+
# @param [Hash] opts the optional parameters
|
|
90
|
+
# @return [GetNotificationChannelResponse]
|
|
91
|
+
def api_v1_team_notifications_channels_channel_id_put(channel_id, update_notification_channel_input, opts = {})
|
|
92
|
+
data, _status_code, _headers = api_v1_team_notifications_channels_channel_id_put_with_http_info(channel_id, update_notification_channel_input, opts)
|
|
93
|
+
data
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Update notification channel
|
|
97
|
+
# Updates a channel's display name or configuration. Send only fields you want to change.
|
|
98
|
+
# @param channel_id [String] UUID of the notification channel to update
|
|
99
|
+
# @param update_notification_channel_input [UpdateNotificationChannelInput] Updated channel name and/or configuration
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @return [Array<(GetNotificationChannelResponse, Integer, Hash)>] GetNotificationChannelResponse data, response status code and response headers
|
|
102
|
+
def api_v1_team_notifications_channels_channel_id_put_with_http_info(channel_id, update_notification_channel_input, opts = {})
|
|
103
|
+
if @api_client.config.debugging
|
|
104
|
+
@api_client.config.logger.debug 'Calling API: ChannelsApi.api_v1_team_notifications_channels_channel_id_put ...'
|
|
105
|
+
end
|
|
106
|
+
# verify the required parameter 'channel_id' is set
|
|
107
|
+
if @api_client.config.client_side_validation && channel_id.nil?
|
|
108
|
+
fail ArgumentError, "Missing the required parameter 'channel_id' when calling ChannelsApi.api_v1_team_notifications_channels_channel_id_put"
|
|
109
|
+
end
|
|
110
|
+
# verify the required parameter 'update_notification_channel_input' is set
|
|
111
|
+
if @api_client.config.client_side_validation && update_notification_channel_input.nil?
|
|
112
|
+
fail ArgumentError, "Missing the required parameter 'update_notification_channel_input' when calling ChannelsApi.api_v1_team_notifications_channels_channel_id_put"
|
|
113
|
+
end
|
|
114
|
+
# resource path
|
|
115
|
+
local_var_path = '/api/v1/team/notifications/channels/{channelId}'.sub('{channelId}', CGI.escape(channel_id.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
|
+
# HTTP header 'Content-Type'
|
|
125
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
126
|
+
if !content_type.nil?
|
|
127
|
+
header_params['Content-Type'] = content_type
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# form parameters
|
|
131
|
+
form_params = opts[:form_params] || {}
|
|
132
|
+
|
|
133
|
+
# http body (model)
|
|
134
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_notification_channel_input)
|
|
135
|
+
|
|
136
|
+
# return_type
|
|
137
|
+
return_type = opts[:debug_return_type] || 'GetNotificationChannelResponse'
|
|
138
|
+
|
|
139
|
+
# auth_names
|
|
140
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
141
|
+
|
|
142
|
+
new_options = opts.merge(
|
|
143
|
+
:operation => :"ChannelsApi.api_v1_team_notifications_channels_channel_id_put",
|
|
144
|
+
:header_params => header_params,
|
|
145
|
+
:query_params => query_params,
|
|
146
|
+
:form_params => form_params,
|
|
147
|
+
:body => post_body,
|
|
148
|
+
:auth_names => auth_names,
|
|
149
|
+
:return_type => return_type
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
153
|
+
if @api_client.config.debugging
|
|
154
|
+
@api_client.config.logger.debug "API called: ChannelsApi#api_v1_team_notifications_channels_channel_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
155
|
+
end
|
|
156
|
+
return data, status_code, headers
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Test notification channel
|
|
160
|
+
# Sends a sample payload to a webhook channel to confirm the endpoint is reachable. On success the channel is marked verified.
|
|
161
|
+
# @param channel_id [String] UUID of the webhook channel to test
|
|
162
|
+
# @param [Hash] opts the optional parameters
|
|
163
|
+
# @return [MessageResponse]
|
|
164
|
+
def api_v1_team_notifications_channels_channel_id_test_post(channel_id, opts = {})
|
|
165
|
+
data, _status_code, _headers = api_v1_team_notifications_channels_channel_id_test_post_with_http_info(channel_id, opts)
|
|
166
|
+
data
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Test notification channel
|
|
170
|
+
# Sends a sample payload to a webhook channel to confirm the endpoint is reachable. On success the channel is marked verified.
|
|
171
|
+
# @param channel_id [String] UUID of the webhook channel to test
|
|
172
|
+
# @param [Hash] opts the optional parameters
|
|
173
|
+
# @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
|
|
174
|
+
def api_v1_team_notifications_channels_channel_id_test_post_with_http_info(channel_id, opts = {})
|
|
175
|
+
if @api_client.config.debugging
|
|
176
|
+
@api_client.config.logger.debug 'Calling API: ChannelsApi.api_v1_team_notifications_channels_channel_id_test_post ...'
|
|
177
|
+
end
|
|
178
|
+
# verify the required parameter 'channel_id' is set
|
|
179
|
+
if @api_client.config.client_side_validation && channel_id.nil?
|
|
180
|
+
fail ArgumentError, "Missing the required parameter 'channel_id' when calling ChannelsApi.api_v1_team_notifications_channels_channel_id_test_post"
|
|
181
|
+
end
|
|
182
|
+
# resource path
|
|
183
|
+
local_var_path = '/api/v1/team/notifications/channels/{channelId}/test'.sub('{channelId}', CGI.escape(channel_id.to_s))
|
|
184
|
+
|
|
185
|
+
# query parameters
|
|
186
|
+
query_params = opts[:query_params] || {}
|
|
187
|
+
|
|
188
|
+
# header parameters
|
|
189
|
+
header_params = opts[:header_params] || {}
|
|
190
|
+
# HTTP header 'Accept' (if needed)
|
|
191
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
192
|
+
|
|
193
|
+
# form parameters
|
|
194
|
+
form_params = opts[:form_params] || {}
|
|
195
|
+
|
|
196
|
+
# http body (model)
|
|
197
|
+
post_body = opts[:debug_body]
|
|
198
|
+
|
|
199
|
+
# return_type
|
|
200
|
+
return_type = opts[:debug_return_type] || 'MessageResponse'
|
|
201
|
+
|
|
202
|
+
# auth_names
|
|
203
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
204
|
+
|
|
205
|
+
new_options = opts.merge(
|
|
206
|
+
:operation => :"ChannelsApi.api_v1_team_notifications_channels_channel_id_test_post",
|
|
207
|
+
:header_params => header_params,
|
|
208
|
+
:query_params => query_params,
|
|
209
|
+
:form_params => form_params,
|
|
210
|
+
:body => post_body,
|
|
211
|
+
:auth_names => auth_names,
|
|
212
|
+
:return_type => return_type
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
216
|
+
if @api_client.config.debugging
|
|
217
|
+
@api_client.config.logger.debug "API called: ChannelsApi#api_v1_team_notifications_channels_channel_id_test_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
218
|
+
end
|
|
219
|
+
return data, status_code, headers
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# List notification channels
|
|
223
|
+
# Returns every delivery channel configured for the team (email, webhook, and other supported types). Use channel IDs when attaching targets to notification rules.
|
|
224
|
+
# @param [Hash] opts the optional parameters
|
|
225
|
+
# @return [GetNotificationChannelsResponse]
|
|
226
|
+
def api_v1_team_notifications_channels_get(opts = {})
|
|
227
|
+
data, _status_code, _headers = api_v1_team_notifications_channels_get_with_http_info(opts)
|
|
228
|
+
data
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# List notification channels
|
|
232
|
+
# Returns every delivery channel configured for the team (email, webhook, and other supported types). Use channel IDs when attaching targets to notification rules.
|
|
233
|
+
# @param [Hash] opts the optional parameters
|
|
234
|
+
# @return [Array<(GetNotificationChannelsResponse, Integer, Hash)>] GetNotificationChannelsResponse data, response status code and response headers
|
|
235
|
+
def api_v1_team_notifications_channels_get_with_http_info(opts = {})
|
|
236
|
+
if @api_client.config.debugging
|
|
237
|
+
@api_client.config.logger.debug 'Calling API: ChannelsApi.api_v1_team_notifications_channels_get ...'
|
|
238
|
+
end
|
|
239
|
+
# resource path
|
|
240
|
+
local_var_path = '/api/v1/team/notifications/channels'
|
|
241
|
+
|
|
242
|
+
# query parameters
|
|
243
|
+
query_params = opts[:query_params] || {}
|
|
244
|
+
|
|
245
|
+
# header parameters
|
|
246
|
+
header_params = opts[:header_params] || {}
|
|
247
|
+
# HTTP header 'Accept' (if needed)
|
|
248
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
249
|
+
|
|
250
|
+
# form parameters
|
|
251
|
+
form_params = opts[:form_params] || {}
|
|
252
|
+
|
|
253
|
+
# http body (model)
|
|
254
|
+
post_body = opts[:debug_body]
|
|
255
|
+
|
|
256
|
+
# return_type
|
|
257
|
+
return_type = opts[:debug_return_type] || 'GetNotificationChannelsResponse'
|
|
258
|
+
|
|
259
|
+
# auth_names
|
|
260
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
261
|
+
|
|
262
|
+
new_options = opts.merge(
|
|
263
|
+
:operation => :"ChannelsApi.api_v1_team_notifications_channels_get",
|
|
264
|
+
:header_params => header_params,
|
|
265
|
+
:query_params => query_params,
|
|
266
|
+
:form_params => form_params,
|
|
267
|
+
:body => post_body,
|
|
268
|
+
:auth_names => auth_names,
|
|
269
|
+
:return_type => return_type
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
273
|
+
if @api_client.config.debugging
|
|
274
|
+
@api_client.config.logger.debug "API called: ChannelsApi#api_v1_team_notifications_channels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
275
|
+
end
|
|
276
|
+
return data, status_code, headers
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Create notification channel
|
|
280
|
+
# Creates a delivery channel for the team. Email channels require verification; webhook channels can be verified with the test endpoint.
|
|
281
|
+
# @param create_notification_channel_input [CreateNotificationChannelInput] Channel name, type, and type-specific configuration
|
|
282
|
+
# @param [Hash] opts the optional parameters
|
|
283
|
+
# @return [GetNotificationChannelResponse]
|
|
284
|
+
def api_v1_team_notifications_channels_post(create_notification_channel_input, opts = {})
|
|
285
|
+
data, _status_code, _headers = api_v1_team_notifications_channels_post_with_http_info(create_notification_channel_input, opts)
|
|
286
|
+
data
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Create notification channel
|
|
290
|
+
# Creates a delivery channel for the team. Email channels require verification; webhook channels can be verified with the test endpoint.
|
|
291
|
+
# @param create_notification_channel_input [CreateNotificationChannelInput] Channel name, type, and type-specific configuration
|
|
292
|
+
# @param [Hash] opts the optional parameters
|
|
293
|
+
# @return [Array<(GetNotificationChannelResponse, Integer, Hash)>] GetNotificationChannelResponse data, response status code and response headers
|
|
294
|
+
def api_v1_team_notifications_channels_post_with_http_info(create_notification_channel_input, opts = {})
|
|
295
|
+
if @api_client.config.debugging
|
|
296
|
+
@api_client.config.logger.debug 'Calling API: ChannelsApi.api_v1_team_notifications_channels_post ...'
|
|
297
|
+
end
|
|
298
|
+
# verify the required parameter 'create_notification_channel_input' is set
|
|
299
|
+
if @api_client.config.client_side_validation && create_notification_channel_input.nil?
|
|
300
|
+
fail ArgumentError, "Missing the required parameter 'create_notification_channel_input' when calling ChannelsApi.api_v1_team_notifications_channels_post"
|
|
301
|
+
end
|
|
302
|
+
# resource path
|
|
303
|
+
local_var_path = '/api/v1/team/notifications/channels'
|
|
304
|
+
|
|
305
|
+
# query parameters
|
|
306
|
+
query_params = opts[:query_params] || {}
|
|
307
|
+
|
|
308
|
+
# header parameters
|
|
309
|
+
header_params = opts[:header_params] || {}
|
|
310
|
+
# HTTP header 'Accept' (if needed)
|
|
311
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
312
|
+
# HTTP header 'Content-Type'
|
|
313
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
314
|
+
if !content_type.nil?
|
|
315
|
+
header_params['Content-Type'] = content_type
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# form parameters
|
|
319
|
+
form_params = opts[:form_params] || {}
|
|
320
|
+
|
|
321
|
+
# http body (model)
|
|
322
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_notification_channel_input)
|
|
323
|
+
|
|
324
|
+
# return_type
|
|
325
|
+
return_type = opts[:debug_return_type] || 'GetNotificationChannelResponse'
|
|
326
|
+
|
|
327
|
+
# auth_names
|
|
328
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
329
|
+
|
|
330
|
+
new_options = opts.merge(
|
|
331
|
+
:operation => :"ChannelsApi.api_v1_team_notifications_channels_post",
|
|
332
|
+
:header_params => header_params,
|
|
333
|
+
:query_params => query_params,
|
|
334
|
+
:form_params => form_params,
|
|
335
|
+
:body => post_body,
|
|
336
|
+
:auth_names => auth_names,
|
|
337
|
+
:return_type => return_type
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
341
|
+
if @api_client.config.debugging
|
|
342
|
+
@api_client.config.logger.debug "API called: ChannelsApi#api_v1_team_notifications_channels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
343
|
+
end
|
|
344
|
+
return data, status_code, headers
|
|
345
|
+
end
|
|
346
|
+
end
|
|
347
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#EmailGuard Public API
|
|
3
|
+
|
|
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
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
Contact: dev@emailguard.co
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Emailguard
|
|
16
|
+
class EmailApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Detect email characteristics
|
|
23
|
+
# Analyzes an email for syntax, normalization, typo suggestions, role/public/relay/disposable signals. Invalid TLDs can return suggested_email and suggested_domain while syntax_validation remains false.
|
|
24
|
+
# @param email [String] Email address to analyze
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [EmailDetectResponse]
|
|
27
|
+
def api_v1_emails_detect_get(email, opts = {})
|
|
28
|
+
data, _status_code, _headers = api_v1_emails_detect_get_with_http_info(email, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Detect email characteristics
|
|
33
|
+
# Analyzes an email for syntax, normalization, typo suggestions, role/public/relay/disposable signals. Invalid TLDs can return suggested_email and suggested_domain while syntax_validation remains false.
|
|
34
|
+
# @param email [String] Email address to analyze
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(EmailDetectResponse, Integer, Hash)>] EmailDetectResponse data, response status code and response headers
|
|
37
|
+
def api_v1_emails_detect_get_with_http_info(email, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: EmailApi.api_v1_emails_detect_get ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'email' is set
|
|
42
|
+
if @api_client.config.client_side_validation && email.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'email' when calling EmailApi.api_v1_emails_detect_get"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/v1/emails/detect'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
query_params[:'email'] = email
|
|
51
|
+
|
|
52
|
+
# header parameters
|
|
53
|
+
header_params = opts[:header_params] || {}
|
|
54
|
+
# HTTP header 'Accept' (if needed)
|
|
55
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
56
|
+
|
|
57
|
+
# form parameters
|
|
58
|
+
form_params = opts[:form_params] || {}
|
|
59
|
+
|
|
60
|
+
# http body (model)
|
|
61
|
+
post_body = opts[:debug_body]
|
|
62
|
+
|
|
63
|
+
# return_type
|
|
64
|
+
return_type = opts[:debug_return_type] || 'EmailDetectResponse'
|
|
65
|
+
|
|
66
|
+
# auth_names
|
|
67
|
+
auth_names = opts[:debug_auth_names] || []
|
|
68
|
+
|
|
69
|
+
new_options = opts.merge(
|
|
70
|
+
:operation => :"EmailApi.api_v1_emails_detect_get",
|
|
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(:GET, local_var_path, new_options)
|
|
80
|
+
if @api_client.config.debugging
|
|
81
|
+
@api_client.config.logger.debug "API called: EmailApi#api_v1_emails_detect_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
82
|
+
end
|
|
83
|
+
return data, status_code, headers
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|