togglr-sdk 1.0.2 → 1.0.4

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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/togglr/client.rb +11 -17
  3. data/lib/togglr/version.rb +1 -1
  4. metadata +1 -51
  5. data/generated/Gemfile +0 -9
  6. data/generated/README.md +0 -121
  7. data/generated/Rakefile +0 -10
  8. data/generated/docs/DefaultApi.md +0 -282
  9. data/generated/docs/Error.md +0 -18
  10. data/generated/docs/ErrorBadRequest.md +0 -18
  11. data/generated/docs/ErrorError.md +0 -18
  12. data/generated/docs/ErrorInternalServerError.md +0 -18
  13. data/generated/docs/ErrorNotFound.md +0 -18
  14. data/generated/docs/ErrorPermissionDenied.md +0 -18
  15. data/generated/docs/ErrorTooManyRequests.md +0 -18
  16. data/generated/docs/ErrorUnauthorized.md +0 -18
  17. data/generated/docs/EvaluateResponse.md +0 -22
  18. data/generated/docs/FeatureErrorReport.md +0 -22
  19. data/generated/docs/FeatureHealth.md +0 -30
  20. data/generated/docs/HealthResponse.md +0 -20
  21. data/generated/git_push.sh +0 -57
  22. data/generated/lib/togglr-client/api/default_api.rb +0 -284
  23. data/generated/lib/togglr-client/api_client.rb +0 -437
  24. data/generated/lib/togglr-client/api_error.rb +0 -58
  25. data/generated/lib/togglr-client/configuration.rb +0 -392
  26. data/generated/lib/togglr-client/models/error.rb +0 -237
  27. data/generated/lib/togglr-client/models/error_bad_request.rb +0 -244
  28. data/generated/lib/togglr-client/models/error_error.rb +0 -220
  29. data/generated/lib/togglr-client/models/error_internal_server_error.rb +0 -244
  30. data/generated/lib/togglr-client/models/error_not_found.rb +0 -244
  31. data/generated/lib/togglr-client/models/error_permission_denied.rb +0 -244
  32. data/generated/lib/togglr-client/models/error_too_many_requests.rb +0 -244
  33. data/generated/lib/togglr-client/models/error_unauthorized.rb +0 -244
  34. data/generated/lib/togglr-client/models/evaluate_response.rb +0 -289
  35. data/generated/lib/togglr-client/models/feature_error_report.rb +0 -274
  36. data/generated/lib/togglr-client/models/feature_health.rb +0 -342
  37. data/generated/lib/togglr-client/models/health_response.rb +0 -287
  38. data/generated/lib/togglr-client/version.rb +0 -15
  39. data/generated/lib/togglr-client.rb +0 -52
  40. data/generated/spec/api/default_api_spec.rb +0 -81
  41. data/generated/spec/models/error_bad_request_spec.rb +0 -36
  42. data/generated/spec/models/error_error_spec.rb +0 -36
  43. data/generated/spec/models/error_internal_server_error_spec.rb +0 -36
  44. data/generated/spec/models/error_not_found_spec.rb +0 -36
  45. data/generated/spec/models/error_permission_denied_spec.rb +0 -36
  46. data/generated/spec/models/error_spec.rb +0 -36
  47. data/generated/spec/models/error_too_many_requests_spec.rb +0 -36
  48. data/generated/spec/models/error_unauthorized_spec.rb +0 -36
  49. data/generated/spec/models/evaluate_response_spec.rb +0 -48
  50. data/generated/spec/models/feature_error_report_spec.rb +0 -48
  51. data/generated/spec/models/feature_health_spec.rb +0 -72
  52. data/generated/spec/models/health_response_spec.rb +0 -46
  53. data/generated/spec/spec_helper.rb +0 -111
  54. data/generated/togglr-client.gemspec +0 -41
@@ -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
-
@@ -1,22 +0,0 @@
1
- # TogglrClient::EvaluateResponse
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **feature_key** | **String** | | |
8
- | **enabled** | **Boolean** | | |
9
- | **value** | **String** | | |
10
-
11
- ## Example
12
-
13
- ```ruby
14
- require 'togglr-client'
15
-
16
- instance = TogglrClient::EvaluateResponse.new(
17
- feature_key: null,
18
- enabled: null,
19
- value: null
20
- )
21
- ```
22
-
@@ -1,22 +0,0 @@
1
- # TogglrClient::FeatureErrorReport
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **error_type** | **String** | | |
8
- | **error_message** | **String** | | |
9
- | **context** | **Hash<String, Object>** | | [optional] |
10
-
11
- ## Example
12
-
13
- ```ruby
14
- require 'togglr-client'
15
-
16
- instance = TogglrClient::FeatureErrorReport.new(
17
- error_type: timeout,
18
- error_message: Service X did not respond in 5s,
19
- context: null
20
- )
21
- ```
22
-
@@ -1,30 +0,0 @@
1
- # TogglrClient::FeatureHealth
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **feature_key** | **String** | | |
8
- | **environment_key** | **String** | | |
9
- | **enabled** | **Boolean** | | |
10
- | **auto_disabled** | **Boolean** | | |
11
- | **error_rate** | **Float** | | [optional] |
12
- | **threshold** | **Float** | | [optional] |
13
- | **last_error_at** | **Time** | | [optional] |
14
-
15
- ## Example
16
-
17
- ```ruby
18
- require 'togglr-client'
19
-
20
- instance = TogglrClient::FeatureHealth.new(
21
- feature_key: null,
22
- environment_key: null,
23
- enabled: null,
24
- auto_disabled: null,
25
- error_rate: 0.15,
26
- threshold: 0.2,
27
- last_error_at: null
28
- )
29
- ```
30
-
@@ -1,20 +0,0 @@
1
- # TogglrClient::HealthResponse
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **status** | **String** | | |
8
- | **server_time** | **Time** | | |
9
-
10
- ## Example
11
-
12
- ```ruby
13
- require 'togglr-client'
14
-
15
- instance = TogglrClient::HealthResponse.new(
16
- status: null,
17
- server_time: null
18
- )
19
- ```
20
-
@@ -1,57 +0,0 @@
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="GIT_USER_ID"
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="GIT_REPO_ID"
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'
@@ -1,284 +0,0 @@
1
- =begin
2
- #SDK API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.15.0
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module TogglrClient
16
- class DefaultApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Get health status of feature (including auto-disable state)
23
- # @param feature_key [String]
24
- # @param [Hash] opts the optional parameters
25
- # @return [FeatureHealth]
26
- def get_feature_health(feature_key, opts = {})
27
- data, _status_code, _headers = get_feature_health_with_http_info(feature_key, opts)
28
- data
29
- end
30
-
31
- # Get health status of feature (including auto-disable state)
32
- # @param feature_key [String]
33
- # @param [Hash] opts the optional parameters
34
- # @return [Array<(FeatureHealth, Integer, Hash)>] FeatureHealth data, response status code and response headers
35
- def get_feature_health_with_http_info(feature_key, opts = {})
36
- if @api_client.config.debugging
37
- @api_client.config.logger.debug 'Calling API: DefaultApi.get_feature_health ...'
38
- end
39
- # verify the required parameter 'feature_key' is set
40
- if @api_client.config.client_side_validation && feature_key.nil?
41
- fail ArgumentError, "Missing the required parameter 'feature_key' when calling DefaultApi.get_feature_health"
42
- end
43
- # resource path
44
- local_var_path = '/sdk/v1/features/{feature_key}/health'.sub('{' + 'feature_key' + '}', CGI.escape(feature_key.to_s))
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
-
54
- # form parameters
55
- form_params = opts[:form_params] || {}
56
-
57
- # http body (model)
58
- post_body = opts[:debug_body]
59
-
60
- # return_type
61
- return_type = opts[:debug_return_type] || 'FeatureHealth'
62
-
63
- # auth_names
64
- auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
65
-
66
- new_options = opts.merge(
67
- :operation => :"DefaultApi.get_feature_health",
68
- :header_params => header_params,
69
- :query_params => query_params,
70
- :form_params => form_params,
71
- :body => post_body,
72
- :auth_names => auth_names,
73
- :return_type => return_type
74
- )
75
-
76
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
77
- if @api_client.config.debugging
78
- @api_client.config.logger.debug "API called: DefaultApi#get_feature_health\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
- end
80
- return data, status_code, headers
81
- end
82
-
83
- # Report feature execution error (for auto-disable)
84
- # @param feature_key [String]
85
- # @param feature_error_report [FeatureErrorReport]
86
- # @param [Hash] opts the optional parameters
87
- # @return [nil]
88
- def report_feature_error(feature_key, feature_error_report, opts = {})
89
- report_feature_error_with_http_info(feature_key, feature_error_report, opts)
90
- nil
91
- end
92
-
93
- # Report feature execution error (for auto-disable)
94
- # @param feature_key [String]
95
- # @param feature_error_report [FeatureErrorReport]
96
- # @param [Hash] opts the optional parameters
97
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
98
- def report_feature_error_with_http_info(feature_key, feature_error_report, opts = {})
99
- if @api_client.config.debugging
100
- @api_client.config.logger.debug 'Calling API: DefaultApi.report_feature_error ...'
101
- end
102
- # verify the required parameter 'feature_key' is set
103
- if @api_client.config.client_side_validation && feature_key.nil?
104
- fail ArgumentError, "Missing the required parameter 'feature_key' when calling DefaultApi.report_feature_error"
105
- end
106
- # verify the required parameter 'feature_error_report' is set
107
- if @api_client.config.client_side_validation && feature_error_report.nil?
108
- fail ArgumentError, "Missing the required parameter 'feature_error_report' when calling DefaultApi.report_feature_error"
109
- end
110
- # resource path
111
- local_var_path = '/sdk/v1/features/{feature_key}/report-error'.sub('{' + 'feature_key' + '}', CGI.escape(feature_key.to_s))
112
-
113
- # query parameters
114
- query_params = opts[:query_params] || {}
115
-
116
- # header parameters
117
- header_params = opts[:header_params] || {}
118
- # HTTP header 'Accept' (if needed)
119
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
120
- # HTTP header 'Content-Type'
121
- content_type = @api_client.select_header_content_type(['application/json'])
122
- if !content_type.nil?
123
- header_params['Content-Type'] = content_type
124
- end
125
-
126
- # form parameters
127
- form_params = opts[:form_params] || {}
128
-
129
- # http body (model)
130
- post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_error_report)
131
-
132
- # return_type
133
- return_type = opts[:debug_return_type]
134
-
135
- # auth_names
136
- auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
137
-
138
- new_options = opts.merge(
139
- :operation => :"DefaultApi.report_feature_error",
140
- :header_params => header_params,
141
- :query_params => query_params,
142
- :form_params => form_params,
143
- :body => post_body,
144
- :auth_names => auth_names,
145
- :return_type => return_type
146
- )
147
-
148
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
149
- if @api_client.config.debugging
150
- @api_client.config.logger.debug "API called: DefaultApi#report_feature_error\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
151
- end
152
- return data, status_code, headers
153
- end
154
-
155
- # Evaluate feature for given context
156
- # Returns feature evaluation result for given project and context. The project is derived from the API key.
157
- # @param feature_key [String]
158
- # @param request_body [Hash<String, Object>]
159
- # @param [Hash] opts the optional parameters
160
- # @return [EvaluateResponse]
161
- def sdk_v1_features_feature_key_evaluate_post(feature_key, request_body, opts = {})
162
- data, _status_code, _headers = sdk_v1_features_feature_key_evaluate_post_with_http_info(feature_key, request_body, opts)
163
- data
164
- end
165
-
166
- # Evaluate feature for given context
167
- # Returns feature evaluation result for given project and context. The project is derived from the API key.
168
- # @param feature_key [String]
169
- # @param request_body [Hash<String, Object>]
170
- # @param [Hash] opts the optional parameters
171
- # @return [Array<(EvaluateResponse, Integer, Hash)>] EvaluateResponse data, response status code and response headers
172
- def sdk_v1_features_feature_key_evaluate_post_with_http_info(feature_key, request_body, opts = {})
173
- if @api_client.config.debugging
174
- @api_client.config.logger.debug 'Calling API: DefaultApi.sdk_v1_features_feature_key_evaluate_post ...'
175
- end
176
- # verify the required parameter 'feature_key' is set
177
- if @api_client.config.client_side_validation && feature_key.nil?
178
- fail ArgumentError, "Missing the required parameter 'feature_key' when calling DefaultApi.sdk_v1_features_feature_key_evaluate_post"
179
- end
180
- # verify the required parameter 'request_body' is set
181
- if @api_client.config.client_side_validation && request_body.nil?
182
- fail ArgumentError, "Missing the required parameter 'request_body' when calling DefaultApi.sdk_v1_features_feature_key_evaluate_post"
183
- end
184
- # resource path
185
- local_var_path = '/sdk/v1/features/{feature_key}/evaluate'.sub('{' + 'feature_key' + '}', CGI.escape(feature_key.to_s))
186
-
187
- # query parameters
188
- query_params = opts[:query_params] || {}
189
-
190
- # header parameters
191
- header_params = opts[:header_params] || {}
192
- # HTTP header 'Accept' (if needed)
193
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
194
- # HTTP header 'Content-Type'
195
- content_type = @api_client.select_header_content_type(['application/json'])
196
- if !content_type.nil?
197
- header_params['Content-Type'] = content_type
198
- end
199
-
200
- # form parameters
201
- form_params = opts[:form_params] || {}
202
-
203
- # http body (model)
204
- post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)
205
-
206
- # return_type
207
- return_type = opts[:debug_return_type] || 'EvaluateResponse'
208
-
209
- # auth_names
210
- auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
211
-
212
- new_options = opts.merge(
213
- :operation => :"DefaultApi.sdk_v1_features_feature_key_evaluate_post",
214
- :header_params => header_params,
215
- :query_params => query_params,
216
- :form_params => form_params,
217
- :body => post_body,
218
- :auth_names => auth_names,
219
- :return_type => return_type
220
- )
221
-
222
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
223
- if @api_client.config.debugging
224
- @api_client.config.logger.debug "API called: DefaultApi#sdk_v1_features_feature_key_evaluate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
225
- end
226
- return data, status_code, headers
227
- end
228
-
229
- # Health check for SDK server
230
- # @param [Hash] opts the optional parameters
231
- # @return [HealthResponse]
232
- def sdk_v1_health_get(opts = {})
233
- data, _status_code, _headers = sdk_v1_health_get_with_http_info(opts)
234
- data
235
- end
236
-
237
- # Health check for SDK server
238
- # @param [Hash] opts the optional parameters
239
- # @return [Array<(HealthResponse, Integer, Hash)>] HealthResponse data, response status code and response headers
240
- def sdk_v1_health_get_with_http_info(opts = {})
241
- if @api_client.config.debugging
242
- @api_client.config.logger.debug 'Calling API: DefaultApi.sdk_v1_health_get ...'
243
- end
244
- # resource path
245
- local_var_path = '/sdk/v1/health'
246
-
247
- # query parameters
248
- query_params = opts[:query_params] || {}
249
-
250
- # header parameters
251
- header_params = opts[:header_params] || {}
252
- # HTTP header 'Accept' (if needed)
253
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
254
-
255
- # form parameters
256
- form_params = opts[:form_params] || {}
257
-
258
- # http body (model)
259
- post_body = opts[:debug_body]
260
-
261
- # return_type
262
- return_type = opts[:debug_return_type] || 'HealthResponse'
263
-
264
- # auth_names
265
- auth_names = opts[:debug_auth_names] || []
266
-
267
- new_options = opts.merge(
268
- :operation => :"DefaultApi.sdk_v1_health_get",
269
- :header_params => header_params,
270
- :query_params => query_params,
271
- :form_params => form_params,
272
- :body => post_body,
273
- :auth_names => auth_names,
274
- :return_type => return_type
275
- )
276
-
277
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
278
- if @api_client.config.debugging
279
- @api_client.config.logger.debug "API called: DefaultApi#sdk_v1_health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
280
- end
281
- return data, status_code, headers
282
- end
283
- end
284
- end