approveapi_swagger 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.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +8 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +105 -0
  5. data/Rakefile +10 -0
  6. data/approveapi_swagger.gemspec +45 -0
  7. data/docs/AnswerMetadata.md +10 -0
  8. data/docs/ApproveApi.md +162 -0
  9. data/docs/CreatePromptRequest.md +14 -0
  10. data/docs/Error.md +8 -0
  11. data/docs/Prompt.md +11 -0
  12. data/docs/PromptAnswer.md +10 -0
  13. data/docs/PromptMetadata.md +12 -0
  14. data/docs/PromptStatus.md +8 -0
  15. data/git_push.sh +55 -0
  16. data/lib/approveapi_swagger.rb +47 -0
  17. data/lib/approveapi_swagger/api/approve_api.rb +187 -0
  18. data/lib/approveapi_swagger/api_client.rb +387 -0
  19. data/lib/approveapi_swagger/api_error.rb +38 -0
  20. data/lib/approveapi_swagger/configuration.rb +251 -0
  21. data/lib/approveapi_swagger/models/answer_metadata.rb +209 -0
  22. data/lib/approveapi_swagger/models/create_prompt_request.rb +261 -0
  23. data/lib/approveapi_swagger/models/error.rb +197 -0
  24. data/lib/approveapi_swagger/models/prompt.rb +230 -0
  25. data/lib/approveapi_swagger/models/prompt_answer.rb +221 -0
  26. data/lib/approveapi_swagger/models/prompt_metadata.rb +232 -0
  27. data/lib/approveapi_swagger/models/prompt_status.rb +197 -0
  28. data/lib/approveapi_swagger/version.rb +15 -0
  29. data/pkg/approveapi_swagger-1.0.0.gem +0 -0
  30. data/spec/api/approve_api_spec.rb +72 -0
  31. data/spec/api_client_spec.rb +226 -0
  32. data/spec/configuration_spec.rb +42 -0
  33. data/spec/models/answer_metadata_spec.rb +53 -0
  34. data/spec/models/create_prompt_request_spec.rb +77 -0
  35. data/spec/models/error_spec.rb +41 -0
  36. data/spec/models/prompt_answer_spec.rb +53 -0
  37. data/spec/models/prompt_metadata_spec.rb +65 -0
  38. data/spec/models/prompt_spec.rb +59 -0
  39. data/spec/models/prompt_status_spec.rb +41 -0
  40. data/spec/spec_helper.rb +111 -0
  41. metadata +274 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 54b1705a3c13f772a5ade7298e09ed30c2888514d8df397146bba7fc91dc2609
4
+ data.tar.gz: cfa7f0e50ef8c24481d5e6cddaf07f7f6476f7002f80db73eb6c16abe7e1f519
5
+ SHA512:
6
+ metadata.gz: c2cc4d7e5166679dc59d0d14cc33bd896b0af07fa1bfae5554d9a79fe1a3e3acf295889b0188781d9b4067158a2ee35d14019e70977abdb4849199184303d019
7
+ data.tar.gz: 104ac051dfe45426b1f5f3faa4c61fbdef19cf380d6beb0ad86e90660bb2a6538412ad50cc501a8ff2b56e57c5da7748d90b825baefc60411b0480348c6e88ca
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 12.0.0'
7
+ gem 'pry-byebug'
8
+ end
@@ -0,0 +1,79 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ approveapi_swagger (1.0.0)
5
+ json (~> 2.1, >= 2.1.0)
6
+ typhoeus (~> 1.0, >= 1.0.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ZenTest (4.11.1)
12
+ addressable (2.5.2)
13
+ public_suffix (>= 2.0.2, < 4.0)
14
+ autotest (4.4.6)
15
+ ZenTest (>= 4.4.1)
16
+ autotest-fsevent (0.2.14)
17
+ sys-uname
18
+ autotest-growl (0.2.16)
19
+ autotest-rails-pure (4.1.2)
20
+ byebug (10.0.2)
21
+ coderay (1.1.2)
22
+ crack (0.4.3)
23
+ safe_yaml (~> 1.0.0)
24
+ diff-lcs (1.3)
25
+ ethon (0.11.0)
26
+ ffi (>= 1.3.0)
27
+ ffi (1.9.25)
28
+ hashdiff (0.3.7)
29
+ json (2.1.0)
30
+ method_source (0.9.0)
31
+ pry (0.11.3)
32
+ coderay (~> 1.1.0)
33
+ method_source (~> 0.9.0)
34
+ pry-byebug (3.6.0)
35
+ byebug (~> 10.0)
36
+ pry (~> 0.10)
37
+ public_suffix (3.0.3)
38
+ rake (12.0.0)
39
+ rspec (3.8.0)
40
+ rspec-core (~> 3.8.0)
41
+ rspec-expectations (~> 3.8.0)
42
+ rspec-mocks (~> 3.8.0)
43
+ rspec-core (3.8.0)
44
+ rspec-support (~> 3.8.0)
45
+ rspec-expectations (3.8.1)
46
+ diff-lcs (>= 1.2.0, < 2.0)
47
+ rspec-support (~> 3.8.0)
48
+ rspec-mocks (3.8.0)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.8.0)
51
+ rspec-support (3.8.0)
52
+ safe_yaml (1.0.4)
53
+ sys-uname (1.0.3)
54
+ ffi (>= 1.0.0)
55
+ typhoeus (1.3.0)
56
+ ethon (>= 0.9.0)
57
+ vcr (3.0.3)
58
+ webmock (1.24.6)
59
+ addressable (>= 2.3.6)
60
+ crack (>= 0.3.2)
61
+ hashdiff
62
+
63
+ PLATFORMS
64
+ ruby
65
+
66
+ DEPENDENCIES
67
+ autotest (~> 4.4, >= 4.4.6)
68
+ autotest-fsevent (~> 0.2, >= 0.2.12)
69
+ autotest-growl (~> 0.2, >= 0.2.16)
70
+ autotest-rails-pure (~> 4.1, >= 4.1.2)
71
+ approveapi_swagger!
72
+ pry-byebug
73
+ rake (~> 12.0.0)
74
+ rspec (~> 3.6, >= 3.6.0)
75
+ vcr (~> 3.0, >= 3.0.1)
76
+ webmock (~> 1.24, >= 1.24.3)
77
+
78
+ BUNDLED WITH
79
+ 1.16.1
@@ -0,0 +1,105 @@
1
+ # approveapi_swagger
2
+
3
+ ApproveAPISwagger - the Ruby gem for the ApproveAPISwagger
4
+
5
+ The simple API to request a user's approval on anything via email + sms.
6
+
7
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
+
9
+ - API version: 1.0.0
10
+ - Package version: 1.0.0
11
+ - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
+
13
+ ## Installation
14
+
15
+ ### Build a gem
16
+
17
+ To build the Ruby code into a gem:
18
+
19
+ ```shell
20
+ gem build approveapi_swagger.gemspec
21
+ ```
22
+
23
+ Then either install the gem locally:
24
+
25
+ ```shell
26
+ gem install ./approveapi_swagger-1.0.0.gem
27
+ ```
28
+ (for development, run `gem install --dev ./approveapi_swagger-1.0.0.gem` to install the development dependencies)
29
+
30
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
+
32
+ Finally add this to the Gemfile:
33
+
34
+ gem 'approveapi_swagger', '~> 1.0.0'
35
+
36
+ ### Install from Git
37
+
38
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
39
+
40
+ gem 'approveapi_swagger', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
41
+
42
+ ### Include the Ruby code directly
43
+
44
+ Include the Ruby code directly using `-I` as follows:
45
+
46
+ ```shell
47
+ ruby -Ilib script.rb
48
+ ```
49
+
50
+ ## Getting Started
51
+
52
+ Please follow the [installation](#installation) procedure and then run the following code:
53
+ ```ruby
54
+ # Load the gem
55
+ require 'approveapi_swagger'
56
+
57
+ # Setup authorization
58
+ ApproveAPISwagger.configure do |config|
59
+ # Configure HTTP basic authorization: apiKey
60
+ config.username = 'YOUR USERNAME'
61
+ config.password = 'YOUR PASSWORD'
62
+ end
63
+
64
+ api_instance = ApproveAPISwagger::ApproveApi.new
65
+ create_prompt_request = ApproveAPISwagger::CreatePromptRequest.new # CreatePromptRequest |
66
+
67
+ begin
68
+ #Sending a prompt
69
+ result = api_instance.create_prompt(create_prompt_request)
70
+ p result
71
+ rescue ApproveAPISwagger::ApiError => e
72
+ puts "Exception when calling ApproveApi->create_prompt: #{e}"
73
+ end
74
+
75
+ ```
76
+
77
+ ## Documentation for API Endpoints
78
+
79
+ All URIs are relative to *https://approve.sh*
80
+
81
+ Class | Method | HTTP request | Description
82
+ ------------ | ------------- | ------------- | -------------
83
+ *ApproveAPISwagger::ApproveApi* | [**create_prompt**](docs/ApproveApi.md#create_prompt) | **POST** /prompt | Sending a prompt
84
+ *ApproveAPISwagger::ApproveApi* | [**get_prompt**](docs/ApproveApi.md#get_prompt) | **GET** /prompt/{id} | Retrieve a prompt
85
+ *ApproveAPISwagger::ApproveApi* | [**get_prompt_status**](docs/ApproveApi.md#get_prompt_status) | **GET** /prompt/{id}/status | Check prompt status
86
+
87
+
88
+ ## Documentation for Models
89
+
90
+ - [ApproveAPISwagger::AnswerMetadata](docs/AnswerMetadata.md)
91
+ - [ApproveAPISwagger::CreatePromptRequest](docs/CreatePromptRequest.md)
92
+ - [ApproveAPISwagger::Error](docs/Error.md)
93
+ - [ApproveAPISwagger::Prompt](docs/Prompt.md)
94
+ - [ApproveAPISwagger::PromptAnswer](docs/PromptAnswer.md)
95
+ - [ApproveAPISwagger::PromptMetadata](docs/PromptMetadata.md)
96
+ - [ApproveAPISwagger::PromptStatus](docs/PromptStatus.md)
97
+
98
+
99
+ ## Documentation for Authorization
100
+
101
+
102
+ ### apiKey
103
+
104
+ - **Type**: HTTP basic authentication
105
+
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ task default: :spec
8
+ rescue LoadError
9
+ # no rspec available
10
+ end
@@ -0,0 +1,45 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ #ApproveAPISwagger
5
+
6
+ #The simple API to request a user's approval on anything via email + sms.
7
+
8
+ OpenAPI spec version: 1.0.0
9
+ Contact: dev@approveapi.com
10
+ Generated by: https://openapi-generator.tech
11
+ OpenAPI Generator version: 4.0.0-SNAPSHOT
12
+
13
+ =end
14
+
15
+ $:.push File.expand_path("../lib", __FILE__)
16
+ require "approveapi_swagger/version"
17
+
18
+ Gem::Specification.new do |s|
19
+ s.name = "approveapi_swagger"
20
+ s.version = ApproveAPISwagger::VERSION
21
+ s.platform = Gem::Platform::RUBY
22
+ s.authors = ["ApproveAPI"]
23
+ s.email = ["hello@approveapi.com"]
24
+ s.homepage = "https://approveapi.com"
25
+ s.summary = "OpenAPI generated client, used internally by the official ruby client &#39;approveapi&#39; gem."
26
+ s.description = "The simple API to request a user's approval on anything via email + sms."
27
+ s.license = "Unlicense"
28
+ s.required_ruby_version = ">= 1.9"
29
+
30
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
31
+ s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
32
+
33
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
34
+ s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
35
+ s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
36
+ s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
37
+ s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
38
+ s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
39
+ s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
40
+
41
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
42
+ s.test_files = `find spec/*`.split("\n")
43
+ s.executables = []
44
+ s.require_paths = ["lib"]
45
+ end
@@ -0,0 +1,10 @@
1
+ # ApproveAPISwagger::AnswerMetadata
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **operating_system** | **String** | | [optional]
7
+ **ip_address** | **String** | | [optional]
8
+ **browser** | **String** | | [optional]
9
+
10
+
@@ -0,0 +1,162 @@
1
+ # ApproveAPISwagger::ApproveApi
2
+
3
+ All URIs are relative to *https://approve.sh*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**create_prompt**](ApproveApi.md#create_prompt) | **POST** /prompt | Sending a prompt
8
+ [**get_prompt**](ApproveApi.md#get_prompt) | **GET** /prompt/{id} | Retrieve a prompt
9
+ [**get_prompt_status**](ApproveApi.md#get_prompt_status) | **GET** /prompt/{id}/status | Check prompt status
10
+
11
+
12
+ # **create_prompt**
13
+ > Prompt create_prompt(create_prompt_request)
14
+
15
+ Sending a prompt
16
+
17
+ Creates a prompt and pushes it to the user (sends via email, sms, or other supported protocols).
18
+
19
+ ### Example
20
+ ```ruby
21
+ # load the gem
22
+ require 'approveapi_swagger'
23
+ # setup authorization
24
+ ApproveAPISwagger.configure do |config|
25
+ # Configure HTTP basic authorization: apiKey
26
+ config.username = 'YOUR USERNAME'
27
+ config.password = 'YOUR PASSWORD'
28
+ end
29
+
30
+ api_instance = ApproveAPISwagger::ApproveApi.new
31
+ create_prompt_request = ApproveAPISwagger::CreatePromptRequest.new # CreatePromptRequest |
32
+
33
+ begin
34
+ #Sending a prompt
35
+ result = api_instance.create_prompt(create_prompt_request)
36
+ p result
37
+ rescue ApproveAPISwagger::ApiError => e
38
+ puts "Exception when calling ApproveApi->create_prompt: #{e}"
39
+ end
40
+ ```
41
+
42
+ ### Parameters
43
+
44
+ Name | Type | Description | Notes
45
+ ------------- | ------------- | ------------- | -------------
46
+ **create_prompt_request** | [**CreatePromptRequest**](CreatePromptRequest.md)| |
47
+
48
+ ### Return type
49
+
50
+ [**Prompt**](Prompt.md)
51
+
52
+ ### Authorization
53
+
54
+ [apiKey](../README.md#apiKey)
55
+
56
+ ### HTTP request headers
57
+
58
+ - **Content-Type**: application/json
59
+ - **Accept**: application/json
60
+
61
+
62
+
63
+ # **get_prompt**
64
+ > Prompt get_prompt(id, opts)
65
+
66
+ Retrieve a prompt
67
+
68
+ Retrieve the prompt object with the given ID.
69
+
70
+ ### Example
71
+ ```ruby
72
+ # load the gem
73
+ require 'approveapi_swagger'
74
+ # setup authorization
75
+ ApproveAPISwagger.configure do |config|
76
+ # Configure HTTP basic authorization: apiKey
77
+ config.username = 'YOUR USERNAME'
78
+ config.password = 'YOUR PASSWORD'
79
+ end
80
+
81
+ api_instance = ApproveAPISwagger::ApproveApi.new
82
+ id = 'id_example' # String | The identifier for a pending or completed prompt. This is returned when you create a prompt.
83
+ opts = {
84
+ long_poll: true # BOOLEAN | If true, the request waits (long-polls) until the user responds to the prompt or more than 10 minutes pass. Defaults to false.
85
+ }
86
+
87
+ begin
88
+ #Retrieve a prompt
89
+ result = api_instance.get_prompt(id, opts)
90
+ p result
91
+ rescue ApproveAPISwagger::ApiError => e
92
+ puts "Exception when calling ApproveApi->get_prompt: #{e}"
93
+ end
94
+ ```
95
+
96
+ ### Parameters
97
+
98
+ Name | Type | Description | Notes
99
+ ------------- | ------------- | ------------- | -------------
100
+ **id** | **String**| The identifier for a pending or completed prompt. This is returned when you create a prompt. |
101
+ **long_poll** | **BOOLEAN**| If true, the request waits (long-polls) until the user responds to the prompt or more than 10 minutes pass. Defaults to false. | [optional]
102
+
103
+ ### Return type
104
+
105
+ [**Prompt**](Prompt.md)
106
+
107
+ ### Authorization
108
+
109
+ [apiKey](../README.md#apiKey)
110
+
111
+ ### HTTP request headers
112
+
113
+ - **Content-Type**: Not defined
114
+ - **Accept**: application/json
115
+
116
+
117
+
118
+ # **get_prompt_status**
119
+ > PromptStatus get_prompt_status(id)
120
+
121
+ Check prompt status
122
+
123
+ Returns whether a prompt has been completed by the user. This request does not require authentication, and so can be used client-side without sharing API credentials.
124
+
125
+ ### Example
126
+ ```ruby
127
+ # load the gem
128
+ require 'approveapi_swagger'
129
+
130
+ api_instance = ApproveAPISwagger::ApproveApi.new
131
+ id = 'id_example' # String | The prompt identifier.
132
+
133
+ begin
134
+ #Check prompt status
135
+ result = api_instance.get_prompt_status(id)
136
+ p result
137
+ rescue ApproveAPISwagger::ApiError => e
138
+ puts "Exception when calling ApproveApi->get_prompt_status: #{e}"
139
+ end
140
+ ```
141
+
142
+ ### Parameters
143
+
144
+ Name | Type | Description | Notes
145
+ ------------- | ------------- | ------------- | -------------
146
+ **id** | **String**| The prompt identifier. |
147
+
148
+ ### Return type
149
+
150
+ [**PromptStatus**](PromptStatus.md)
151
+
152
+ ### Authorization
153
+
154
+ No authorization required
155
+
156
+ ### HTTP request headers
157
+
158
+ - **Content-Type**: Not defined
159
+ - **Accept**: application/json
160
+
161
+
162
+
@@ -0,0 +1,14 @@
1
+ # ApproveAPISwagger::CreatePromptRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **body** | **String** | The body of the approval request to show the user. |
7
+ **user** | **String** | The user to send the approval request to. Can be either an email address or a phone number. |
8
+ **title** | **String** | The title of an approval request. Defaults to an empty string. | [optional]
9
+ **reject_text** | **String** | The reject action text. Defaults to &#39;Reject&#39;. | [optional]
10
+ **approve_text** | **String** | The approve action text. Defaults to &#39;Approve&#39;. | [optional]
11
+ **metadata** | [**PromptMetadata**](PromptMetadata.md) | | [optional]
12
+ **long_poll** | **BOOLEAN** | If true, the request waits (long-polls) until the user responds to the prompt or more than 10 minutes pass. Defaults to false. | [optional]
13
+
14
+