togglr-sdk 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/togglr/client.rb +2 -9
- data/lib/togglr/version.rb +1 -1
- metadata +1 -51
- data/generated/Gemfile +0 -9
- data/generated/README.md +0 -121
- data/generated/Rakefile +0 -10
- data/generated/docs/DefaultApi.md +0 -282
- data/generated/docs/Error.md +0 -18
- data/generated/docs/ErrorBadRequest.md +0 -18
- data/generated/docs/ErrorError.md +0 -18
- data/generated/docs/ErrorInternalServerError.md +0 -18
- data/generated/docs/ErrorNotFound.md +0 -18
- data/generated/docs/ErrorPermissionDenied.md +0 -18
- data/generated/docs/ErrorTooManyRequests.md +0 -18
- data/generated/docs/ErrorUnauthorized.md +0 -18
- data/generated/docs/EvaluateResponse.md +0 -22
- data/generated/docs/FeatureErrorReport.md +0 -22
- data/generated/docs/FeatureHealth.md +0 -30
- data/generated/docs/HealthResponse.md +0 -20
- data/generated/git_push.sh +0 -57
- data/generated/lib/togglr-client/api/default_api.rb +0 -284
- data/generated/lib/togglr-client/api_client.rb +0 -437
- data/generated/lib/togglr-client/api_error.rb +0 -58
- data/generated/lib/togglr-client/configuration.rb +0 -392
- data/generated/lib/togglr-client/models/error.rb +0 -237
- data/generated/lib/togglr-client/models/error_bad_request.rb +0 -244
- data/generated/lib/togglr-client/models/error_error.rb +0 -220
- data/generated/lib/togglr-client/models/error_internal_server_error.rb +0 -244
- data/generated/lib/togglr-client/models/error_not_found.rb +0 -244
- data/generated/lib/togglr-client/models/error_permission_denied.rb +0 -244
- data/generated/lib/togglr-client/models/error_too_many_requests.rb +0 -244
- data/generated/lib/togglr-client/models/error_unauthorized.rb +0 -244
- data/generated/lib/togglr-client/models/evaluate_response.rb +0 -289
- data/generated/lib/togglr-client/models/feature_error_report.rb +0 -274
- data/generated/lib/togglr-client/models/feature_health.rb +0 -342
- data/generated/lib/togglr-client/models/health_response.rb +0 -287
- data/generated/lib/togglr-client/version.rb +0 -15
- data/generated/lib/togglr-client.rb +0 -52
- data/generated/spec/api/default_api_spec.rb +0 -81
- data/generated/spec/models/error_bad_request_spec.rb +0 -36
- data/generated/spec/models/error_error_spec.rb +0 -36
- data/generated/spec/models/error_internal_server_error_spec.rb +0 -36
- data/generated/spec/models/error_not_found_spec.rb +0 -36
- data/generated/spec/models/error_permission_denied_spec.rb +0 -36
- data/generated/spec/models/error_spec.rb +0 -36
- data/generated/spec/models/error_too_many_requests_spec.rb +0 -36
- data/generated/spec/models/error_unauthorized_spec.rb +0 -36
- data/generated/spec/models/evaluate_response_spec.rb +0 -48
- data/generated/spec/models/feature_error_report_spec.rb +0 -48
- data/generated/spec/models/feature_health_spec.rb +0 -72
- data/generated/spec/models/health_response_spec.rb +0 -46
- data/generated/spec/spec_helper.rb +0 -111
- data/generated/togglr-client.gemspec +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ce77fe1dca77a6a4840f6a9b7494259a6119890f06658f48f1799522fe68a11
|
4
|
+
data.tar.gz: f6a5983a3162431cdd6a28f6b167c503f75bf6ded57a50150d39da6c98ba205c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cbd5ebbb7b93e9d34786b85da6197e313a09d3597b67a27122fd14a064c07746ac960106260ae6ff402dffceabb63d10e1485ba76a0893b0842995c03fc90a2
|
7
|
+
data.tar.gz: 1a5bc74155bed8a7998df7cac99269918f562a132e7298152a2c248ccc1d1ccd70d1f096b78e4254238bd782cd622362d0284876b100f80ed85ad0681cdc56ed
|
data/lib/togglr/client.rb
CHANGED
@@ -2,14 +2,8 @@ require 'json'
|
|
2
2
|
require 'retries'
|
3
3
|
require 'digest'
|
4
4
|
|
5
|
-
# Load generated client files
|
6
|
-
require_relative '../togglr-client
|
7
|
-
require_relative '../togglr-client/api_error'
|
8
|
-
require_relative '../togglr-client/version'
|
9
|
-
require_relative '../togglr-client/configuration'
|
10
|
-
require_relative '../togglr-client/models/feature_error_report'
|
11
|
-
require_relative '../togglr-client/models/feature_health'
|
12
|
-
require_relative '../togglr-client/api/default_api'
|
5
|
+
# Load generated client files through main entry point
|
6
|
+
require_relative '../togglr-client'
|
13
7
|
|
14
8
|
module Togglr
|
15
9
|
class Client
|
@@ -19,7 +13,6 @@ module Togglr
|
|
19
13
|
|
20
14
|
# Initialize generated API client
|
21
15
|
api_config = TogglrClient::Configuration.new
|
22
|
-
api_config.base_path = config.base_url
|
23
16
|
api_config.api_key['Authorization'] = config.api_key
|
24
17
|
api_config.ssl_verify = !config.insecure
|
25
18
|
@api_client = TogglrClient::DefaultApi.new(TogglrClient::ApiClient.new(api_config))
|
data/lib/togglr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: togglr-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman
|
@@ -90,56 +90,6 @@ files:
|
|
90
90
|
- Gemfile
|
91
91
|
- LICENSE
|
92
92
|
- README.md
|
93
|
-
- generated/Gemfile
|
94
|
-
- generated/README.md
|
95
|
-
- generated/Rakefile
|
96
|
-
- generated/docs/DefaultApi.md
|
97
|
-
- generated/docs/Error.md
|
98
|
-
- generated/docs/ErrorBadRequest.md
|
99
|
-
- generated/docs/ErrorError.md
|
100
|
-
- generated/docs/ErrorInternalServerError.md
|
101
|
-
- generated/docs/ErrorNotFound.md
|
102
|
-
- generated/docs/ErrorPermissionDenied.md
|
103
|
-
- generated/docs/ErrorTooManyRequests.md
|
104
|
-
- generated/docs/ErrorUnauthorized.md
|
105
|
-
- generated/docs/EvaluateResponse.md
|
106
|
-
- generated/docs/FeatureErrorReport.md
|
107
|
-
- generated/docs/FeatureHealth.md
|
108
|
-
- generated/docs/HealthResponse.md
|
109
|
-
- generated/git_push.sh
|
110
|
-
- generated/lib/togglr-client.rb
|
111
|
-
- generated/lib/togglr-client/api/default_api.rb
|
112
|
-
- generated/lib/togglr-client/api_client.rb
|
113
|
-
- generated/lib/togglr-client/api_error.rb
|
114
|
-
- generated/lib/togglr-client/configuration.rb
|
115
|
-
- generated/lib/togglr-client/models/error.rb
|
116
|
-
- generated/lib/togglr-client/models/error_bad_request.rb
|
117
|
-
- generated/lib/togglr-client/models/error_error.rb
|
118
|
-
- generated/lib/togglr-client/models/error_internal_server_error.rb
|
119
|
-
- generated/lib/togglr-client/models/error_not_found.rb
|
120
|
-
- generated/lib/togglr-client/models/error_permission_denied.rb
|
121
|
-
- generated/lib/togglr-client/models/error_too_many_requests.rb
|
122
|
-
- generated/lib/togglr-client/models/error_unauthorized.rb
|
123
|
-
- generated/lib/togglr-client/models/evaluate_response.rb
|
124
|
-
- generated/lib/togglr-client/models/feature_error_report.rb
|
125
|
-
- generated/lib/togglr-client/models/feature_health.rb
|
126
|
-
- generated/lib/togglr-client/models/health_response.rb
|
127
|
-
- generated/lib/togglr-client/version.rb
|
128
|
-
- generated/spec/api/default_api_spec.rb
|
129
|
-
- generated/spec/models/error_bad_request_spec.rb
|
130
|
-
- generated/spec/models/error_error_spec.rb
|
131
|
-
- generated/spec/models/error_internal_server_error_spec.rb
|
132
|
-
- generated/spec/models/error_not_found_spec.rb
|
133
|
-
- generated/spec/models/error_permission_denied_spec.rb
|
134
|
-
- generated/spec/models/error_spec.rb
|
135
|
-
- generated/spec/models/error_too_many_requests_spec.rb
|
136
|
-
- generated/spec/models/error_unauthorized_spec.rb
|
137
|
-
- generated/spec/models/evaluate_response_spec.rb
|
138
|
-
- generated/spec/models/feature_error_report_spec.rb
|
139
|
-
- generated/spec/models/feature_health_spec.rb
|
140
|
-
- generated/spec/models/health_response_spec.rb
|
141
|
-
- generated/spec/spec_helper.rb
|
142
|
-
- generated/togglr-client.gemspec
|
143
93
|
- lib/togglr-client.rb
|
144
94
|
- lib/togglr-client/api/default_api.rb
|
145
95
|
- lib/togglr-client/api_client.rb
|
data/generated/Gemfile
DELETED
data/generated/README.md
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
# togglr-client
|
2
|
-
|
3
|
-
TogglrClient - the Ruby gem for the SDK API
|
4
|
-
|
5
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
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
|
-
- Generator version: 7.15.0
|
12
|
-
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
13
|
-
|
14
|
-
## Installation
|
15
|
-
|
16
|
-
### Build a gem
|
17
|
-
|
18
|
-
To build the Ruby code into a gem:
|
19
|
-
|
20
|
-
```shell
|
21
|
-
gem build togglr-client.gemspec
|
22
|
-
```
|
23
|
-
|
24
|
-
Then either install the gem locally:
|
25
|
-
|
26
|
-
```shell
|
27
|
-
gem install ./togglr-client-1.0.0.gem
|
28
|
-
```
|
29
|
-
|
30
|
-
(for development, run `gem install --dev ./togglr-client-1.0.0.gem` to install the development dependencies)
|
31
|
-
|
32
|
-
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
|
-
|
34
|
-
Finally add this to the Gemfile:
|
35
|
-
|
36
|
-
gem 'togglr-client', '~> 1.0.0'
|
37
|
-
|
38
|
-
### Install from Git
|
39
|
-
|
40
|
-
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:
|
41
|
-
|
42
|
-
gem 'togglr-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
43
|
-
|
44
|
-
### Include the Ruby code directly
|
45
|
-
|
46
|
-
Include the Ruby code directly using `-I` as follows:
|
47
|
-
|
48
|
-
```shell
|
49
|
-
ruby -Ilib script.rb
|
50
|
-
```
|
51
|
-
|
52
|
-
## Getting Started
|
53
|
-
|
54
|
-
Please follow the [installation](#installation) procedure and then run the following code:
|
55
|
-
|
56
|
-
```ruby
|
57
|
-
# Load the gem
|
58
|
-
require 'togglr-client'
|
59
|
-
|
60
|
-
# Setup authorization
|
61
|
-
TogglrClient.configure do |config|
|
62
|
-
# Configure API key authorization: ApiKeyAuth
|
63
|
-
config.api_key['Authorization'] = 'YOUR API KEY'
|
64
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
65
|
-
# config.api_key_prefix['Authorization'] = 'Bearer'
|
66
|
-
# Configure faraday connection
|
67
|
-
config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
|
68
|
-
end
|
69
|
-
|
70
|
-
api_instance = TogglrClient::DefaultApi.new
|
71
|
-
feature_key = 'feature_key_example' # String |
|
72
|
-
|
73
|
-
begin
|
74
|
-
#Get health status of feature (including auto-disable state)
|
75
|
-
result = api_instance.get_feature_health(feature_key)
|
76
|
-
p result
|
77
|
-
rescue TogglrClient::ApiError => e
|
78
|
-
puts "Exception when calling DefaultApi->get_feature_health: #{e}"
|
79
|
-
end
|
80
|
-
|
81
|
-
```
|
82
|
-
|
83
|
-
## Documentation for API Endpoints
|
84
|
-
|
85
|
-
All URIs are relative to *http://localhost:8090*
|
86
|
-
|
87
|
-
Class | Method | HTTP request | Description
|
88
|
-
------------ | ------------- | ------------- | -------------
|
89
|
-
*TogglrClient::DefaultApi* | [**get_feature_health**](docs/DefaultApi.md#get_feature_health) | **GET** /sdk/v1/features/{feature_key}/health | Get health status of feature (including auto-disable state)
|
90
|
-
*TogglrClient::DefaultApi* | [**report_feature_error**](docs/DefaultApi.md#report_feature_error) | **POST** /sdk/v1/features/{feature_key}/report-error | Report feature execution error (for auto-disable)
|
91
|
-
*TogglrClient::DefaultApi* | [**sdk_v1_features_feature_key_evaluate_post**](docs/DefaultApi.md#sdk_v1_features_feature_key_evaluate_post) | **POST** /sdk/v1/features/{feature_key}/evaluate | Evaluate feature for given context
|
92
|
-
*TogglrClient::DefaultApi* | [**sdk_v1_health_get**](docs/DefaultApi.md#sdk_v1_health_get) | **GET** /sdk/v1/health | Health check for SDK server
|
93
|
-
|
94
|
-
|
95
|
-
## Documentation for Models
|
96
|
-
|
97
|
-
- [TogglrClient::Error](docs/Error.md)
|
98
|
-
- [TogglrClient::ErrorBadRequest](docs/ErrorBadRequest.md)
|
99
|
-
- [TogglrClient::ErrorError](docs/ErrorError.md)
|
100
|
-
- [TogglrClient::ErrorInternalServerError](docs/ErrorInternalServerError.md)
|
101
|
-
- [TogglrClient::ErrorNotFound](docs/ErrorNotFound.md)
|
102
|
-
- [TogglrClient::ErrorPermissionDenied](docs/ErrorPermissionDenied.md)
|
103
|
-
- [TogglrClient::ErrorTooManyRequests](docs/ErrorTooManyRequests.md)
|
104
|
-
- [TogglrClient::ErrorUnauthorized](docs/ErrorUnauthorized.md)
|
105
|
-
- [TogglrClient::EvaluateResponse](docs/EvaluateResponse.md)
|
106
|
-
- [TogglrClient::FeatureErrorReport](docs/FeatureErrorReport.md)
|
107
|
-
- [TogglrClient::FeatureHealth](docs/FeatureHealth.md)
|
108
|
-
- [TogglrClient::HealthResponse](docs/HealthResponse.md)
|
109
|
-
|
110
|
-
|
111
|
-
## Documentation for Authorization
|
112
|
-
|
113
|
-
|
114
|
-
Authentication schemes defined for the API:
|
115
|
-
### ApiKeyAuth
|
116
|
-
|
117
|
-
|
118
|
-
- **Type**: API key
|
119
|
-
- **API key parameter name**: Authorization
|
120
|
-
- **Location**: HTTP header
|
121
|
-
|
data/generated/Rakefile
DELETED
@@ -1,282 +0,0 @@
|
|
1
|
-
# TogglrClient::DefaultApi
|
2
|
-
|
3
|
-
All URIs are relative to *http://localhost:8090*
|
4
|
-
|
5
|
-
| Method | HTTP request | Description |
|
6
|
-
| ------ | ------------ | ----------- |
|
7
|
-
| [**get_feature_health**](DefaultApi.md#get_feature_health) | **GET** /sdk/v1/features/{feature_key}/health | Get health status of feature (including auto-disable state) |
|
8
|
-
| [**report_feature_error**](DefaultApi.md#report_feature_error) | **POST** /sdk/v1/features/{feature_key}/report-error | Report feature execution error (for auto-disable) |
|
9
|
-
| [**sdk_v1_features_feature_key_evaluate_post**](DefaultApi.md#sdk_v1_features_feature_key_evaluate_post) | **POST** /sdk/v1/features/{feature_key}/evaluate | Evaluate feature for given context |
|
10
|
-
| [**sdk_v1_health_get**](DefaultApi.md#sdk_v1_health_get) | **GET** /sdk/v1/health | Health check for SDK server |
|
11
|
-
|
12
|
-
|
13
|
-
## get_feature_health
|
14
|
-
|
15
|
-
> <FeatureHealth> get_feature_health(feature_key)
|
16
|
-
|
17
|
-
Get health status of feature (including auto-disable state)
|
18
|
-
|
19
|
-
### Examples
|
20
|
-
|
21
|
-
```ruby
|
22
|
-
require 'time'
|
23
|
-
require 'togglr-client'
|
24
|
-
# setup authorization
|
25
|
-
TogglrClient.configure do |config|
|
26
|
-
# Configure API key authorization: ApiKeyAuth
|
27
|
-
config.api_key['Authorization'] = 'YOUR API KEY'
|
28
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
29
|
-
# config.api_key_prefix['Authorization'] = 'Bearer'
|
30
|
-
end
|
31
|
-
|
32
|
-
api_instance = TogglrClient::DefaultApi.new
|
33
|
-
feature_key = 'feature_key_example' # String |
|
34
|
-
|
35
|
-
begin
|
36
|
-
# Get health status of feature (including auto-disable state)
|
37
|
-
result = api_instance.get_feature_health(feature_key)
|
38
|
-
p result
|
39
|
-
rescue TogglrClient::ApiError => e
|
40
|
-
puts "Error when calling DefaultApi->get_feature_health: #{e}"
|
41
|
-
end
|
42
|
-
```
|
43
|
-
|
44
|
-
#### Using the get_feature_health_with_http_info variant
|
45
|
-
|
46
|
-
This returns an Array which contains the response data, status code and headers.
|
47
|
-
|
48
|
-
> <Array(<FeatureHealth>, Integer, Hash)> get_feature_health_with_http_info(feature_key)
|
49
|
-
|
50
|
-
```ruby
|
51
|
-
begin
|
52
|
-
# Get health status of feature (including auto-disable state)
|
53
|
-
data, status_code, headers = api_instance.get_feature_health_with_http_info(feature_key)
|
54
|
-
p status_code # => 2xx
|
55
|
-
p headers # => { ... }
|
56
|
-
p data # => <FeatureHealth>
|
57
|
-
rescue TogglrClient::ApiError => e
|
58
|
-
puts "Error when calling DefaultApi->get_feature_health_with_http_info: #{e}"
|
59
|
-
end
|
60
|
-
```
|
61
|
-
|
62
|
-
### Parameters
|
63
|
-
|
64
|
-
| Name | Type | Description | Notes |
|
65
|
-
| ---- | ---- | ----------- | ----- |
|
66
|
-
| **feature_key** | **String** | | |
|
67
|
-
|
68
|
-
### Return type
|
69
|
-
|
70
|
-
[**FeatureHealth**](FeatureHealth.md)
|
71
|
-
|
72
|
-
### Authorization
|
73
|
-
|
74
|
-
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
75
|
-
|
76
|
-
### HTTP request headers
|
77
|
-
|
78
|
-
- **Content-Type**: Not defined
|
79
|
-
- **Accept**: application/json
|
80
|
-
|
81
|
-
|
82
|
-
## report_feature_error
|
83
|
-
|
84
|
-
> report_feature_error(feature_key, feature_error_report)
|
85
|
-
|
86
|
-
Report feature execution error (for auto-disable)
|
87
|
-
|
88
|
-
### Examples
|
89
|
-
|
90
|
-
```ruby
|
91
|
-
require 'time'
|
92
|
-
require 'togglr-client'
|
93
|
-
# setup authorization
|
94
|
-
TogglrClient.configure do |config|
|
95
|
-
# Configure API key authorization: ApiKeyAuth
|
96
|
-
config.api_key['Authorization'] = 'YOUR API KEY'
|
97
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
98
|
-
# config.api_key_prefix['Authorization'] = 'Bearer'
|
99
|
-
end
|
100
|
-
|
101
|
-
api_instance = TogglrClient::DefaultApi.new
|
102
|
-
feature_key = 'feature_key_example' # String |
|
103
|
-
feature_error_report = TogglrClient::FeatureErrorReport.new({error_type: 'timeout', error_message: 'Service X did not respond in 5s'}) # FeatureErrorReport |
|
104
|
-
|
105
|
-
begin
|
106
|
-
# Report feature execution error (for auto-disable)
|
107
|
-
api_instance.report_feature_error(feature_key, feature_error_report)
|
108
|
-
rescue TogglrClient::ApiError => e
|
109
|
-
puts "Error when calling DefaultApi->report_feature_error: #{e}"
|
110
|
-
end
|
111
|
-
```
|
112
|
-
|
113
|
-
#### Using the report_feature_error_with_http_info variant
|
114
|
-
|
115
|
-
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
116
|
-
|
117
|
-
> <Array(nil, Integer, Hash)> report_feature_error_with_http_info(feature_key, feature_error_report)
|
118
|
-
|
119
|
-
```ruby
|
120
|
-
begin
|
121
|
-
# Report feature execution error (for auto-disable)
|
122
|
-
data, status_code, headers = api_instance.report_feature_error_with_http_info(feature_key, feature_error_report)
|
123
|
-
p status_code # => 2xx
|
124
|
-
p headers # => { ... }
|
125
|
-
p data # => nil
|
126
|
-
rescue TogglrClient::ApiError => e
|
127
|
-
puts "Error when calling DefaultApi->report_feature_error_with_http_info: #{e}"
|
128
|
-
end
|
129
|
-
```
|
130
|
-
|
131
|
-
### Parameters
|
132
|
-
|
133
|
-
| Name | Type | Description | Notes |
|
134
|
-
| ---- | ---- | ----------- | ----- |
|
135
|
-
| **feature_key** | **String** | | |
|
136
|
-
| **feature_error_report** | [**FeatureErrorReport**](FeatureErrorReport.md) | | |
|
137
|
-
|
138
|
-
### Return type
|
139
|
-
|
140
|
-
nil (empty response body)
|
141
|
-
|
142
|
-
### Authorization
|
143
|
-
|
144
|
-
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
145
|
-
|
146
|
-
### HTTP request headers
|
147
|
-
|
148
|
-
- **Content-Type**: application/json
|
149
|
-
- **Accept**: application/json
|
150
|
-
|
151
|
-
|
152
|
-
## sdk_v1_features_feature_key_evaluate_post
|
153
|
-
|
154
|
-
> <EvaluateResponse> sdk_v1_features_feature_key_evaluate_post(feature_key, request_body)
|
155
|
-
|
156
|
-
Evaluate feature for given context
|
157
|
-
|
158
|
-
Returns feature evaluation result for given project and context. The project is derived from the API key.
|
159
|
-
|
160
|
-
### Examples
|
161
|
-
|
162
|
-
```ruby
|
163
|
-
require 'time'
|
164
|
-
require 'togglr-client'
|
165
|
-
# setup authorization
|
166
|
-
TogglrClient.configure do |config|
|
167
|
-
# Configure API key authorization: ApiKeyAuth
|
168
|
-
config.api_key['Authorization'] = 'YOUR API KEY'
|
169
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
170
|
-
# config.api_key_prefix['Authorization'] = 'Bearer'
|
171
|
-
end
|
172
|
-
|
173
|
-
api_instance = TogglrClient::DefaultApi.new
|
174
|
-
feature_key = 'feature_key_example' # String |
|
175
|
-
request_body = { key: 3.56} # Hash<String, Object> |
|
176
|
-
|
177
|
-
begin
|
178
|
-
# Evaluate feature for given context
|
179
|
-
result = api_instance.sdk_v1_features_feature_key_evaluate_post(feature_key, request_body)
|
180
|
-
p result
|
181
|
-
rescue TogglrClient::ApiError => e
|
182
|
-
puts "Error when calling DefaultApi->sdk_v1_features_feature_key_evaluate_post: #{e}"
|
183
|
-
end
|
184
|
-
```
|
185
|
-
|
186
|
-
#### Using the sdk_v1_features_feature_key_evaluate_post_with_http_info variant
|
187
|
-
|
188
|
-
This returns an Array which contains the response data, status code and headers.
|
189
|
-
|
190
|
-
> <Array(<EvaluateResponse>, Integer, Hash)> sdk_v1_features_feature_key_evaluate_post_with_http_info(feature_key, request_body)
|
191
|
-
|
192
|
-
```ruby
|
193
|
-
begin
|
194
|
-
# Evaluate feature for given context
|
195
|
-
data, status_code, headers = api_instance.sdk_v1_features_feature_key_evaluate_post_with_http_info(feature_key, request_body)
|
196
|
-
p status_code # => 2xx
|
197
|
-
p headers # => { ... }
|
198
|
-
p data # => <EvaluateResponse>
|
199
|
-
rescue TogglrClient::ApiError => e
|
200
|
-
puts "Error when calling DefaultApi->sdk_v1_features_feature_key_evaluate_post_with_http_info: #{e}"
|
201
|
-
end
|
202
|
-
```
|
203
|
-
|
204
|
-
### Parameters
|
205
|
-
|
206
|
-
| Name | Type | Description | Notes |
|
207
|
-
| ---- | ---- | ----------- | ----- |
|
208
|
-
| **feature_key** | **String** | | |
|
209
|
-
| **request_body** | [**Hash<String, Object>**](Object.md) | | |
|
210
|
-
|
211
|
-
### Return type
|
212
|
-
|
213
|
-
[**EvaluateResponse**](EvaluateResponse.md)
|
214
|
-
|
215
|
-
### Authorization
|
216
|
-
|
217
|
-
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
218
|
-
|
219
|
-
### HTTP request headers
|
220
|
-
|
221
|
-
- **Content-Type**: application/json
|
222
|
-
- **Accept**: application/json
|
223
|
-
|
224
|
-
|
225
|
-
## sdk_v1_health_get
|
226
|
-
|
227
|
-
> <HealthResponse> sdk_v1_health_get
|
228
|
-
|
229
|
-
Health check for SDK server
|
230
|
-
|
231
|
-
### Examples
|
232
|
-
|
233
|
-
```ruby
|
234
|
-
require 'time'
|
235
|
-
require 'togglr-client'
|
236
|
-
|
237
|
-
api_instance = TogglrClient::DefaultApi.new
|
238
|
-
|
239
|
-
begin
|
240
|
-
# Health check for SDK server
|
241
|
-
result = api_instance.sdk_v1_health_get
|
242
|
-
p result
|
243
|
-
rescue TogglrClient::ApiError => e
|
244
|
-
puts "Error when calling DefaultApi->sdk_v1_health_get: #{e}"
|
245
|
-
end
|
246
|
-
```
|
247
|
-
|
248
|
-
#### Using the sdk_v1_health_get_with_http_info variant
|
249
|
-
|
250
|
-
This returns an Array which contains the response data, status code and headers.
|
251
|
-
|
252
|
-
> <Array(<HealthResponse>, Integer, Hash)> sdk_v1_health_get_with_http_info
|
253
|
-
|
254
|
-
```ruby
|
255
|
-
begin
|
256
|
-
# Health check for SDK server
|
257
|
-
data, status_code, headers = api_instance.sdk_v1_health_get_with_http_info
|
258
|
-
p status_code # => 2xx
|
259
|
-
p headers # => { ... }
|
260
|
-
p data # => <HealthResponse>
|
261
|
-
rescue TogglrClient::ApiError => e
|
262
|
-
puts "Error when calling DefaultApi->sdk_v1_health_get_with_http_info: #{e}"
|
263
|
-
end
|
264
|
-
```
|
265
|
-
|
266
|
-
### Parameters
|
267
|
-
|
268
|
-
This endpoint does not need any parameter.
|
269
|
-
|
270
|
-
### Return type
|
271
|
-
|
272
|
-
[**HealthResponse**](HealthResponse.md)
|
273
|
-
|
274
|
-
### Authorization
|
275
|
-
|
276
|
-
No authorization required
|
277
|
-
|
278
|
-
### HTTP request headers
|
279
|
-
|
280
|
-
- **Content-Type**: Not defined
|
281
|
-
- **Accept**: application/json
|
282
|
-
|
data/generated/docs/Error.md
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# TogglrClient::Error
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **error** | [**ErrorError**](ErrorError.md) | | |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'togglr-client'
|
13
|
-
|
14
|
-
instance = TogglrClient::Error.new(
|
15
|
-
error: null
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# TogglrClient::ErrorBadRequest
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **error** | [**ErrorError**](ErrorError.md) | | |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'togglr-client'
|
13
|
-
|
14
|
-
instance = TogglrClient::ErrorBadRequest.new(
|
15
|
-
error: null
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# TogglrClient::ErrorError
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **message** | **String** | | [optional] |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'togglr-client'
|
13
|
-
|
14
|
-
instance = TogglrClient::ErrorError.new(
|
15
|
-
message: null
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# TogglrClient::ErrorInternalServerError
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **error** | [**ErrorError**](ErrorError.md) | | |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'togglr-client'
|
13
|
-
|
14
|
-
instance = TogglrClient::ErrorInternalServerError.new(
|
15
|
-
error: null
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# TogglrClient::ErrorNotFound
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **error** | [**ErrorError**](ErrorError.md) | | |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'togglr-client'
|
13
|
-
|
14
|
-
instance = TogglrClient::ErrorNotFound.new(
|
15
|
-
error: null
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# TogglrClient::ErrorPermissionDenied
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **error** | [**ErrorError**](ErrorError.md) | | |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'togglr-client'
|
13
|
-
|
14
|
-
instance = TogglrClient::ErrorPermissionDenied.new(
|
15
|
-
error: null
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# TogglrClient::ErrorTooManyRequests
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **error** | [**ErrorError**](ErrorError.md) | | |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'togglr-client'
|
13
|
-
|
14
|
-
instance = TogglrClient::ErrorTooManyRequests.new(
|
15
|
-
error: null
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# TogglrClient::ErrorUnauthorized
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **error** | [**ErrorError**](ErrorError.md) | | |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'togglr-client'
|
13
|
-
|
14
|
-
instance = TogglrClient::ErrorUnauthorized.new(
|
15
|
-
error: null
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|