pingram 1.0.6 → 1.0.9
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.lock +2 -2
- data/lib/pingram/api/components_api.rb +2 -0
- data/lib/pingram/api/email_api.rb +88 -0
- data/lib/pingram/api/numbers_api.rb +4 -4
- data/lib/pingram/api/profile_api.rb +154 -0
- data/lib/pingram/api/push_settings_api.rb +4 -0
- data/lib/pingram/api/sms_api.rb +88 -0
- data/lib/pingram/api/templates_api.rb +2 -0
- data/lib/pingram/api/types_api.rb +2 -0
- data/lib/pingram/api/user_api.rb +4 -0
- data/lib/pingram/api/webhooks_api.rb +2 -0
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/api_error.rb +40 -4
- data/lib/pingram/client_wrapper.rb +32 -2
- data/lib/pingram/models/accept_invite_request.rb +164 -0
- data/lib/pingram/models/accept_invite_response.rb +225 -0
- data/lib/pingram/models/api_error_body.rb +223 -0
- data/lib/pingram/models/api_error_response.rb +192 -0
- data/lib/pingram/models/change_email_request.rb +164 -0
- data/lib/pingram/models/change_phone_request.rb +164 -0
- data/lib/pingram/models/get_logs_response_messages_inner.rb +13 -1
- data/lib/pingram/models/get_logs_response_messages_inner_media_inner.rb +173 -0
- data/lib/pingram/models/get_templates_list_response_inner.rb +2 -1
- data/lib/pingram/models/get_templates_list_response_inner_any_of2.rb +16 -4
- data/lib/pingram/models/get_templates_list_response_inner_any_of3.rb +16 -42
- data/lib/pingram/models/get_templates_list_response_inner_any_of4.rb +4 -22
- data/lib/pingram/models/get_templates_list_response_inner_any_of5.rb +42 -111
- data/lib/pingram/models/get_templates_list_response_inner_any_of6.rb +440 -0
- data/lib/pingram/models/{get_templates_list_response_inner_any_of5_metadata.rb → get_templates_list_response_inner_any_of6_metadata.rb} +4 -4
- data/lib/pingram/models/{get_templates_list_response_inner_any_of5_metadata_entities_inner.rb → get_templates_list_response_inner_any_of6_metadata_entities_inner.rb} +4 -4
- data/lib/pingram/models/{get_templates_list_response_inner_any_of5_metadata_entities_inner_external_ref.rb → get_templates_list_response_inner_any_of6_metadata_entities_inner_external_ref.rb} +3 -3
- data/lib/pingram/models/logs_get_response_logs_inner.rb +52 -21
- data/lib/pingram/models/send_email_api_response.rb +104 -0
- data/lib/pingram/models/send_email_api_response_any_of.rb +193 -0
- data/lib/pingram/models/send_email_api_response_any_of1.rb +191 -0
- data/lib/pingram/models/send_email_api_response_any_of1_error.rb +223 -0
- data/lib/pingram/models/send_email_request.rb +335 -0
- data/lib/pingram/models/{sender_post_body_options_email_attachments_inner_any_of1.rb → send_email_request_attachments_inner.rb} +19 -28
- data/lib/pingram/models/send_sms_request.rb +249 -0
- data/lib/pingram/models/send_sms_response.rb +104 -0
- data/lib/pingram/models/send_sms_response_any_of.rb +193 -0
- data/lib/pingram/models/send_sms_response_any_of1.rb +191 -0
- data/lib/pingram/models/send_sms_response_any_of1_error.rb +223 -0
- data/lib/pingram/models/sender_post_body_options_email_attachments_inner.rb +2 -2
- data/lib/pingram/models/sender_post_body_options_email_attachments_inner_any_of.rb +25 -16
- data/lib/pingram/models/sender_post_body_slack.rb +1 -1
- data/lib/pingram/models/sender_post_body_sms.rb +16 -4
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +25 -4
- data/vendor/bundle/ruby/3.2.0/cache/psych-5.4.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/mkmf.log +3 -3
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/gem_make.out +10 -10
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/README.md +2 -2
- data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_parser.c +14 -3
- data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/versions.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/{psych-5.3.1.gemspec → psych-5.4.0.gemspec} +2 -2
- metadata +87 -66
- data/vendor/bundle/ruby/3.2.0/cache/psych-5.3.1.gem +0 -0
- /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/gem.build_complete +0 -0
- /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/mkmf.log +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/CONTRIBUTING.md +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/LICENSE +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/Makefile +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/depend +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/extconf.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_emitter.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_emitter.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_parser.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_to_ruby.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_to_ruby.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_yaml_tree.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_yaml_tree.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/class_loader.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/coder.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/core_ext.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/exception.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/handler.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/handlers/document_stream.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/handlers/recorder.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/ruby_events.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/stream.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/tree_builder.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/yaml_events.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/alias.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/document.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/mapping.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/node.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/scalar.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/sequence.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/stream.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/omap.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/parser.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/scalar_scanner.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/set.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/stream.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/streaming.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/syntax_error.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/tree_builder.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/depth_first.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/emitter.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/json_tree.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/to_ruby.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/visitor.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/yaml_tree.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/y.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych.rb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4d92a9fe59994579dcbcbec394a85c59560372c79ab5d15877ec3ea99839b2ad
|
|
4
|
+
data.tar.gz: 336dd2cd85ca02c0e02f10e4458c677e39222a5b605b93213e9620c04d2757d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e04f8ef0c4a9ad04331b0cd121e3777c20873b238b7628edf460ccf46ae5fd851b205da356bfda173b030b7fd40336d50194014c65775c5345d10f687f79ba2a
|
|
7
|
+
data.tar.gz: 9ed3841babe3555369e40d9b8e40f1494225b2fbd14b8f100d70fc0026757ffa37b3c54865d18ea0437b41790621c97150ea20a23e63770f4c16ab44b5f65879
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
pingram (1.0.
|
|
4
|
+
pingram (1.0.9)
|
|
5
5
|
typhoeus (~> 1.0, >= 1.0.1)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -32,7 +32,7 @@ GEM
|
|
|
32
32
|
pry-byebug (3.12.0)
|
|
33
33
|
byebug (~> 13.0)
|
|
34
34
|
pry (>= 0.13, < 0.17)
|
|
35
|
-
psych (5.
|
|
35
|
+
psych (5.4.0)
|
|
36
36
|
date
|
|
37
37
|
stringio
|
|
38
38
|
racc (1.8.1)
|
|
@@ -114,6 +114,8 @@ module Pingram
|
|
|
114
114
|
|
|
115
115
|
# header parameters
|
|
116
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']
|
|
117
119
|
|
|
118
120
|
# form parameters
|
|
119
121
|
form_params = opts[:form_params] || {}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Pingram
|
|
3
|
+
|
|
4
|
+
#Internal API for notification delivery and management
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Pingram
|
|
16
|
+
class EmailApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Send an email notification directly without templates
|
|
23
|
+
# @param send_email_request [SendEmailRequest]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [SendEmailApiResponse]
|
|
26
|
+
def email_send(send_email_request, opts = {})
|
|
27
|
+
data, _status_code, _headers = email_send_with_http_info(send_email_request, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Send an email notification directly without templates
|
|
32
|
+
# @param send_email_request [SendEmailRequest]
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(SendEmailApiResponse, Integer, Hash)>] SendEmailApiResponse data, response status code and response headers
|
|
35
|
+
def email_send_with_http_info(send_email_request, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: EmailApi.email_send ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'send_email_request' is set
|
|
40
|
+
if @api_client.config.client_side_validation && send_email_request.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'send_email_request' when calling EmailApi.email_send"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/email'
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
53
|
+
# HTTP header 'Content-Type'
|
|
54
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
55
|
+
if !content_type.nil?
|
|
56
|
+
header_params['Content-Type'] = content_type
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# form parameters
|
|
60
|
+
form_params = opts[:form_params] || {}
|
|
61
|
+
|
|
62
|
+
# http body (model)
|
|
63
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(send_email_request)
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'SendEmailApiResponse'
|
|
67
|
+
|
|
68
|
+
# auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
|
|
69
|
+
auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"EmailApi.email_send",
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => return_type
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
82
|
+
if @api_client.config.debugging
|
|
83
|
+
@api_client.config.logger.debug "API called: EmailApi#email_send\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -74,7 +74,7 @@ module Pingram
|
|
|
74
74
|
return data, status_code, headers
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
# Purchase a
|
|
77
|
+
# Purchase a phone number for the authenticated account
|
|
78
78
|
# @param order_phone_number_request [OrderPhoneNumberRequest]
|
|
79
79
|
# @param [Hash] opts the optional parameters
|
|
80
80
|
# @return [OrderPhoneNumberResponse]
|
|
@@ -83,7 +83,7 @@ module Pingram
|
|
|
83
83
|
data
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
-
# Purchase a
|
|
86
|
+
# Purchase a phone number for the authenticated account
|
|
87
87
|
# @param order_phone_number_request [OrderPhoneNumberRequest]
|
|
88
88
|
# @param [Hash] opts the optional parameters
|
|
89
89
|
# @return [Array<(OrderPhoneNumberResponse, Integer, Hash)>] OrderPhoneNumberResponse data, response status code and response headers
|
|
@@ -140,7 +140,7 @@ module Pingram
|
|
|
140
140
|
return data, status_code, headers
|
|
141
141
|
end
|
|
142
142
|
|
|
143
|
-
# Search for available
|
|
143
|
+
# Search for available phone numbers
|
|
144
144
|
# @param country_code [String] ISO 3166-1 alpha-2 country code (e.g., US, CA)
|
|
145
145
|
# @param [Hash] opts the optional parameters
|
|
146
146
|
# @option opts [String] :features Comma-separated
|
|
@@ -152,7 +152,7 @@ module Pingram
|
|
|
152
152
|
data
|
|
153
153
|
end
|
|
154
154
|
|
|
155
|
-
# Search for available
|
|
155
|
+
# Search for available phone numbers
|
|
156
156
|
# @param country_code [String] ISO 3166-1 alpha-2 country code (e.g., US, CA)
|
|
157
157
|
# @param [Hash] opts the optional parameters
|
|
158
158
|
# @option opts [String] :features Comma-separated
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Pingram
|
|
3
|
+
|
|
4
|
+
#Internal API for notification delivery and management
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Pingram
|
|
16
|
+
class ProfileApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Accept a team invitation using a token
|
|
23
|
+
# @param accept_invite_request [AcceptInviteRequest]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [AcceptInviteResponse]
|
|
26
|
+
def profile_accept_invite(accept_invite_request, opts = {})
|
|
27
|
+
data, _status_code, _headers = profile_accept_invite_with_http_info(accept_invite_request, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Accept a team invitation using a token
|
|
32
|
+
# @param accept_invite_request [AcceptInviteRequest]
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(AcceptInviteResponse, Integer, Hash)>] AcceptInviteResponse data, response status code and response headers
|
|
35
|
+
def profile_accept_invite_with_http_info(accept_invite_request, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: ProfileApi.profile_accept_invite ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'accept_invite_request' is set
|
|
40
|
+
if @api_client.config.client_side_validation && accept_invite_request.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'accept_invite_request' when calling ProfileApi.profile_accept_invite"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/profile/accept_invite'
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
53
|
+
# HTTP header 'Content-Type'
|
|
54
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
55
|
+
if !content_type.nil?
|
|
56
|
+
header_params['Content-Type'] = content_type
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# form parameters
|
|
60
|
+
form_params = opts[:form_params] || {}
|
|
61
|
+
|
|
62
|
+
# http body (model)
|
|
63
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(accept_invite_request)
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'AcceptInviteResponse'
|
|
67
|
+
|
|
68
|
+
# auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
|
|
69
|
+
auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"ProfileApi.profile_accept_invite",
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => return_type
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
82
|
+
if @api_client.config.debugging
|
|
83
|
+
@api_client.config.logger.debug "API called: ProfileApi#profile_accept_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Change the email address of the authenticated user
|
|
89
|
+
# @param change_email_request [ChangeEmailRequest]
|
|
90
|
+
# @param [Hash] opts the optional parameters
|
|
91
|
+
# @return [SuccessResponse]
|
|
92
|
+
def profile_change_email(change_email_request, opts = {})
|
|
93
|
+
data, _status_code, _headers = profile_change_email_with_http_info(change_email_request, opts)
|
|
94
|
+
data
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Change the email address of the authenticated user
|
|
98
|
+
# @param change_email_request [ChangeEmailRequest]
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @return [Array<(SuccessResponse, Integer, Hash)>] SuccessResponse data, response status code and response headers
|
|
101
|
+
def profile_change_email_with_http_info(change_email_request, opts = {})
|
|
102
|
+
if @api_client.config.debugging
|
|
103
|
+
@api_client.config.logger.debug 'Calling API: ProfileApi.profile_change_email ...'
|
|
104
|
+
end
|
|
105
|
+
# verify the required parameter 'change_email_request' is set
|
|
106
|
+
if @api_client.config.client_side_validation && change_email_request.nil?
|
|
107
|
+
fail ArgumentError, "Missing the required parameter 'change_email_request' when calling ProfileApi.profile_change_email"
|
|
108
|
+
end
|
|
109
|
+
# resource path
|
|
110
|
+
local_var_path = '/profile/change-email'
|
|
111
|
+
|
|
112
|
+
# query parameters
|
|
113
|
+
query_params = opts[:query_params] || {}
|
|
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'])
|
|
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(change_email_request)
|
|
130
|
+
|
|
131
|
+
# return_type
|
|
132
|
+
return_type = opts[:debug_return_type] || 'SuccessResponse'
|
|
133
|
+
|
|
134
|
+
# auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
|
|
135
|
+
auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
|
|
136
|
+
|
|
137
|
+
new_options = opts.merge(
|
|
138
|
+
:operation => :"ProfileApi.profile_change_email",
|
|
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: ProfileApi#profile_change_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
150
|
+
end
|
|
151
|
+
return data, status_code, headers
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
@@ -42,6 +42,8 @@ module Pingram
|
|
|
42
42
|
|
|
43
43
|
# header parameters
|
|
44
44
|
header_params = opts[:header_params] || {}
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
45
47
|
|
|
46
48
|
# form parameters
|
|
47
49
|
form_params = opts[:form_params] || {}
|
|
@@ -95,6 +97,8 @@ module Pingram
|
|
|
95
97
|
|
|
96
98
|
# header parameters
|
|
97
99
|
header_params = opts[:header_params] || {}
|
|
100
|
+
# HTTP header 'Accept' (if needed)
|
|
101
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
98
102
|
|
|
99
103
|
# form parameters
|
|
100
104
|
form_params = opts[:form_params] || {}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Pingram
|
|
3
|
+
|
|
4
|
+
#Internal API for notification delivery and management
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Pingram
|
|
16
|
+
class SmsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Send an SMS notification directly without templates
|
|
23
|
+
# @param send_sms_request [SendSmsRequest]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [SendSmsResponse]
|
|
26
|
+
def sms_send(send_sms_request, opts = {})
|
|
27
|
+
data, _status_code, _headers = sms_send_with_http_info(send_sms_request, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Send an SMS notification directly without templates
|
|
32
|
+
# @param send_sms_request [SendSmsRequest]
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(SendSmsResponse, Integer, Hash)>] SendSmsResponse data, response status code and response headers
|
|
35
|
+
def sms_send_with_http_info(send_sms_request, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: SmsApi.sms_send ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'send_sms_request' is set
|
|
40
|
+
if @api_client.config.client_side_validation && send_sms_request.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'send_sms_request' when calling SmsApi.sms_send"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/sms'
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
53
|
+
# HTTP header 'Content-Type'
|
|
54
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
55
|
+
if !content_type.nil?
|
|
56
|
+
header_params['Content-Type'] = content_type
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# form parameters
|
|
60
|
+
form_params = opts[:form_params] || {}
|
|
61
|
+
|
|
62
|
+
# http body (model)
|
|
63
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(send_sms_request)
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'SendSmsResponse'
|
|
67
|
+
|
|
68
|
+
# auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
|
|
69
|
+
auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"SmsApi.sms_send",
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => return_type
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
82
|
+
if @api_client.config.debugging
|
|
83
|
+
@api_client.config.logger.debug "API called: SmsApi#sms_send\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -138,6 +138,8 @@ module Pingram
|
|
|
138
138
|
|
|
139
139
|
# header parameters
|
|
140
140
|
header_params = opts[:header_params] || {}
|
|
141
|
+
# HTTP header 'Accept' (if needed)
|
|
142
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
141
143
|
|
|
142
144
|
# form parameters
|
|
143
145
|
form_params = opts[:form_params] || {}
|
|
@@ -114,6 +114,8 @@ module Pingram
|
|
|
114
114
|
|
|
115
115
|
# header parameters
|
|
116
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']
|
|
117
119
|
|
|
118
120
|
# form parameters
|
|
119
121
|
form_params = opts[:form_params] || {}
|
data/lib/pingram/api/user_api.rb
CHANGED
|
@@ -54,6 +54,8 @@ module Pingram
|
|
|
54
54
|
|
|
55
55
|
# header parameters
|
|
56
56
|
header_params = opts[:header_params] || {}
|
|
57
|
+
# HTTP header 'Accept' (if needed)
|
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
57
59
|
# HTTP header 'Content-Type'
|
|
58
60
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
59
61
|
if !content_type.nil?
|
|
@@ -173,6 +175,8 @@ module Pingram
|
|
|
173
175
|
|
|
174
176
|
# header parameters
|
|
175
177
|
header_params = opts[:header_params] || {}
|
|
178
|
+
# HTTP header 'Accept' (if needed)
|
|
179
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
176
180
|
|
|
177
181
|
# form parameters
|
|
178
182
|
form_params = opts[:form_params] || {}
|
|
@@ -42,6 +42,8 @@ module Pingram
|
|
|
42
42
|
|
|
43
43
|
# header parameters
|
|
44
44
|
header_params = opts[:header_params] || {}
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
45
47
|
|
|
46
48
|
# form parameters
|
|
47
49
|
form_params = opts[:form_params] || {}
|
data/lib/pingram/api_client.rb
CHANGED
|
@@ -32,7 +32,7 @@ module Pingram
|
|
|
32
32
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
|
33
33
|
def initialize(config = Configuration.default)
|
|
34
34
|
@config = config
|
|
35
|
-
@user_agent = "pingram-ruby/1.0.
|
|
35
|
+
@user_agent = "pingram-ruby/1.0.9"
|
|
36
36
|
@default_headers = {
|
|
37
37
|
'Content-Type' => 'application/json',
|
|
38
38
|
'User-Agent' => @user_agent
|
data/lib/pingram/api_error.rb
CHANGED
|
@@ -11,9 +11,39 @@ Generator version: 7.19.0
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
module Pingram
|
|
14
|
+
require 'json'
|
|
14
15
|
class ApiError < StandardError
|
|
15
16
|
attr_reader :code, :response_headers, :response_body
|
|
16
17
|
|
|
18
|
+
def self.extract_api_error_detail(payload)
|
|
19
|
+
return nil if payload.nil?
|
|
20
|
+
|
|
21
|
+
raw = payload.is_a?(String) ? payload : payload.to_s
|
|
22
|
+
return nil if raw.strip.empty?
|
|
23
|
+
|
|
24
|
+
begin
|
|
25
|
+
h = JSON.parse(raw)
|
|
26
|
+
rescue JSON::ParserError
|
|
27
|
+
return nil
|
|
28
|
+
end
|
|
29
|
+
return nil unless h.is_a?(Hash)
|
|
30
|
+
|
|
31
|
+
err = h['error'] || h[:error]
|
|
32
|
+
if err.is_a?(Hash)
|
|
33
|
+
m = err['message'] || err[:message]
|
|
34
|
+
return m.to_s if m && !m.to_s.strip.empty?
|
|
35
|
+
end
|
|
36
|
+
m = h['message'] || h[:message]
|
|
37
|
+
return m.to_s if m && !m.to_s.strip.empty?
|
|
38
|
+
msgs = h['messages'] || h[:messages]
|
|
39
|
+
if msgs.is_a?(Array) && !msgs.empty?
|
|
40
|
+
first = msgs[0]
|
|
41
|
+
return first.to_s if first && !first.to_s.strip.empty?
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
nil
|
|
45
|
+
end
|
|
46
|
+
|
|
17
47
|
# Usage examples:
|
|
18
48
|
# ApiError.new
|
|
19
49
|
# ApiError.new("message")
|
|
@@ -42,10 +72,16 @@ module Pingram
|
|
|
42
72
|
end
|
|
43
73
|
|
|
44
74
|
def message
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
75
|
+
detail = self.class.extract_api_error_detail(@response_body)
|
|
76
|
+
msg = nil
|
|
77
|
+
msg = detail if detail && !detail.strip.empty?
|
|
78
|
+
|
|
79
|
+
if msg.nil?
|
|
80
|
+
if @message.nil?
|
|
81
|
+
msg = 'Error message: the server returns an error'
|
|
82
|
+
else
|
|
83
|
+
msg = @message.to_s
|
|
84
|
+
end
|
|
49
85
|
end
|
|
50
86
|
|
|
51
87
|
msg += "\nHTTP status code: #{code}" if code
|
|
@@ -19,6 +19,8 @@ require_relative 'api/domains_api'
|
|
|
19
19
|
|
|
20
20
|
require_relative 'api/editor_api'
|
|
21
21
|
|
|
22
|
+
require_relative 'api/email_api'
|
|
23
|
+
|
|
22
24
|
require_relative 'api/environments_api'
|
|
23
25
|
|
|
24
26
|
require_relative 'api/health_api'
|
|
@@ -35,10 +37,14 @@ require_relative 'api/numbers_api'
|
|
|
35
37
|
|
|
36
38
|
require_relative 'api/organization_api'
|
|
37
39
|
|
|
40
|
+
require_relative 'api/profile_api'
|
|
41
|
+
|
|
38
42
|
require_relative 'api/push_settings_api'
|
|
39
43
|
|
|
40
44
|
require_relative 'api/sender_api'
|
|
41
45
|
|
|
46
|
+
require_relative 'api/sms_api'
|
|
47
|
+
|
|
42
48
|
require_relative 'api/templates_api'
|
|
43
49
|
|
|
44
50
|
require_relative 'api/types_api'
|
|
@@ -81,6 +87,8 @@ module Pingram
|
|
|
81
87
|
|
|
82
88
|
@editor = Pingram::EditorApi.new(@api_client)
|
|
83
89
|
|
|
90
|
+
@email = Pingram::EmailApi.new(@api_client)
|
|
91
|
+
|
|
84
92
|
@environments = Pingram::EnvironmentsApi.new(@api_client)
|
|
85
93
|
|
|
86
94
|
@health = Pingram::HealthApi.new(@api_client)
|
|
@@ -97,10 +105,14 @@ module Pingram
|
|
|
97
105
|
|
|
98
106
|
@organization = Pingram::OrganizationApi.new(@api_client)
|
|
99
107
|
|
|
100
|
-
@
|
|
108
|
+
@profile = Pingram::ProfileApi.new(@api_client)
|
|
109
|
+
|
|
110
|
+
@push_settings = Pingram::PushSettingsApi.new(@api_client)
|
|
101
111
|
|
|
102
112
|
@sender = Pingram::SenderApi.new(@api_client)
|
|
103
113
|
|
|
114
|
+
@sms = Pingram::SmsApi.new(@api_client)
|
|
115
|
+
|
|
104
116
|
@templates = Pingram::TemplatesApi.new(@api_client)
|
|
105
117
|
|
|
106
118
|
@types = Pingram::TypesApi.new(@api_client)
|
|
@@ -150,6 +162,12 @@ module Pingram
|
|
|
150
162
|
end
|
|
151
163
|
|
|
152
164
|
|
|
165
|
+
# @return [Pingram::EmailApi]
|
|
166
|
+
def email
|
|
167
|
+
@email
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
|
|
153
171
|
# @return [Pingram::EnvironmentsApi]
|
|
154
172
|
def environments
|
|
155
173
|
@environments
|
|
@@ -198,7 +216,13 @@ module Pingram
|
|
|
198
216
|
end
|
|
199
217
|
|
|
200
218
|
|
|
201
|
-
# @return [Pingram::
|
|
219
|
+
# @return [Pingram::ProfileApi]
|
|
220
|
+
def profile
|
|
221
|
+
@profile
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
# @return [Pingram::PushSettingsApi]
|
|
202
226
|
def push_settings
|
|
203
227
|
@push_settings
|
|
204
228
|
end
|
|
@@ -210,6 +234,12 @@ module Pingram
|
|
|
210
234
|
end
|
|
211
235
|
|
|
212
236
|
|
|
237
|
+
# @return [Pingram::SmsApi]
|
|
238
|
+
def sms
|
|
239
|
+
@sms
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
|
|
213
243
|
# @return [Pingram::TemplatesApi]
|
|
214
244
|
def templates
|
|
215
245
|
@templates
|