stage-ruby 0.0.03 → 0.0.05
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/README.md +8 -6
- data/docs/ClientUserObjectForm.md +3 -1
- data/docs/StageApi.md +150 -12
- data/docs/StageUserObjectForm.md +7 -1
- data/lib/stage-ruby/api/stage_api.rb +179 -12
- data/lib/stage-ruby/configuration.rb +7 -0
- data/lib/stage-ruby/models/client_user_object_form.rb +24 -4
- data/lib/stage-ruby/models/stage_user_object_form.rb +58 -4
- data/lib/stage-ruby/version.rb +1 -1
- data/stage-ruby-0.0.03.gem +0 -0
- data/stage-ruby-0.0.04.gem +0 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8696610434e5ed41407d311b22d95116bdb456d3ae1d7209fa85e9be2f9dc018
|
4
|
+
data.tar.gz: 66b05c08547611bffa009dd052d966848e657d84afe1ac7f2cf626fc449984d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a698a429708f768e06b4fac865f0ac62108f6efd70b0fe2eb032f7a82775424cad8d7ad52677f496da1b9b248e343d6501eeeda595a5a0a9a13bf0facc1c0ae1
|
7
|
+
data.tar.gz: b585a11bdfd0412d4123efeea78922a7db86d0cd4e4a6a384dee3304a8afd1dfe1e29b90cb84df28dd39be378aefb7f9b7c0661d29aa1cf031a477418c351145
|
data/README.md
CHANGED
@@ -145,12 +145,14 @@ end
|
|
145
145
|
|
146
146
|
## 4. Documentation for API Endpoints
|
147
147
|
|
148
|
-
| Class | Method | HTTP request
|
149
|
-
|
150
|
-
| *Stage::StageApi* | [**create_user**](docs/StageApi.md#create_user) | **POST** /sdk-api/v1/users
|
151
|
-
| *Stage::StageApi* | [**get_plans**](docs/StageApi.md#get_plans) | **GET** /sdk-api/v1/plans
|
152
|
-
| *Stage::StageApi* | [**has_access**](docs/StageApi.md#has_access) | **GET** /sdk-api/v1/users/{userIdentifier}/features
|
153
|
-
| *Stage::StageApi* | [**
|
148
|
+
| Class | Method | HTTP request | Description |
|
149
|
+
|-------------------|-----------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------------------------------|
|
150
|
+
| *Stage::StageApi* | [**create_user**](docs/StageApi.md#create_user) | **POST** /sdk-api/v1/users | Creates a user and assigning it to a pre-defined role. |
|
151
|
+
| *Stage::StageApi* | [**get_plans**](docs/StageApi.md#get_plans) | **GET** /sdk-api/v1/plans | Gets all plans. |
|
152
|
+
| *Stage::StageApi* | [**has_access**](docs/StageApi.md#has_access) | **GET** /sdk-api/v1/users/{userIdentifier}/features | Checks if a user has access to the identified features. |
|
153
|
+
| *Stage::StageApi* | [**access**](docs/StageApi.md#access) | **POST** /sdk-api/v1/users/{userIdentifier}/features | If the user has access to the features, this marks those features as accessed. |
|
154
|
+
| *Stage::StageApi* | [**decrement_access_count_or_credit_usage**](docs/StageApi.md#decrement_access_count_or_credit_usage) | **DELETE** /sdk-api/v1/users/{userIdentifier}/features | Either decrements the access count or credits the one usage for each of the accessible features. |
|
155
|
+
| *Stage::StageApi* | [**update_user_plan**](docs/StageApi.md#update_user_plan) | **PUT** /sdk-api/v1/users/{userIdentifier}/plans | Updates a user's plan. |
|
154
156
|
|
155
157
|
## 5. Documentation for Models
|
156
158
|
|
@@ -5,10 +5,12 @@ Name | Type | Description | Notes
|
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
6
|
**arena_id** | **Integer** | The Arena ID of the client user. | [optional]
|
7
7
|
**created_at** | **DateTime** | The creation date. | [optional]
|
8
|
-
**created_by** | [**
|
8
|
+
**created_by** | [**StageUserObjectFormReq**](StageUserObjectFormReq.md) | | [optional]
|
9
9
|
**deleted** | **BOOLEAN** | A boolean value indicating whether the client user is deleted or not. | [optional]
|
10
10
|
**id** | **Integer** | The ID of the client user. | [optional]
|
11
11
|
**identifier** | **String** | A client user identifier. | [optional]
|
12
|
+
**organization_id** | **Integer** | The organization this user belongs to. | [optional]
|
12
13
|
**plan_id** | **Integer** | The plan to be assigned to the client user. | [optional]
|
13
14
|
**plan_identifier** | **String** | The plan to be assigned to the user. | [optional]
|
15
|
+
**plan_role_id** | **Integer** | The role within the organization's plan this user is assigned. | [optional]
|
14
16
|
|
data/docs/StageApi.md
CHANGED
@@ -4,11 +4,71 @@ All URIs are relative to *//localhost:8080/*
|
|
4
4
|
|
5
5
|
Method | HTTP request | Description
|
6
6
|
------------- | ------------- | -------------
|
7
|
+
[**access**](StageApi.md#access) | **POST** /sdk-api/v1/users/{userIdentifier}/features | If the user has access to the features, this marks those features as accessed.
|
7
8
|
[**create_user**](StageApi.md#create_user) | **POST** /sdk-api/v1/users | Creates a user and assigning it to a pre-defined role.
|
8
9
|
[**get_plans**](StageApi.md#get_plans) | **GET** /sdk-api/v1/plans | Gets all plans.
|
9
|
-
[**has_access**](StageApi.md#has_access) | **GET** /sdk-api/v1/users/{userIdentifier}/features | Checks if a user has access to the identified
|
10
|
+
[**has_access**](StageApi.md#has_access) | **GET** /sdk-api/v1/users/{userIdentifier}/features | Checks if a user has access to the identified features.
|
11
|
+
[**decrement_access_count_or_credit_usage**](StageApi.md#decrement_access_count_or_credit_usage) | **DELETE** /sdk-api/v1/users/{userIdentifier}/features | If the user has access to the features, this un-accesses those features.
|
10
12
|
[**update_user_plan**](StageApi.md#update_user_plan) | **PUT** /sdk-api/v1/users/{userIdentifier}/plans | Updates a user's plan.
|
11
13
|
|
14
|
+
# **access**
|
15
|
+
> AccessForm access(identifiers, user_identifier)
|
16
|
+
|
17
|
+
If the user has access to the features, this marks those features as accessed.
|
18
|
+
|
19
|
+
### Example
|
20
|
+
```ruby
|
21
|
+
# load the gem
|
22
|
+
require 'stage-ruby'
|
23
|
+
# setup authorization
|
24
|
+
Stage.configure do |config|
|
25
|
+
# Configure API key authorization: stage-api-token
|
26
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
27
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
28
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
29
|
+
|
30
|
+
# Configure API key authorization: stage-read-only-api-token
|
31
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
32
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
33
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
34
|
+
end
|
35
|
+
|
36
|
+
api_instance = Stage::StageApi.new
|
37
|
+
identifiers = ['identifiers_example'] # Array<String> | The identifiers of the features being accessed.
|
38
|
+
user_identifier = 'user_identifier_example' # String | The identifier of the user who is accessing the feature.
|
39
|
+
|
40
|
+
|
41
|
+
begin
|
42
|
+
#If the user has access to the features, this marks those features as accessed.
|
43
|
+
result = api_instance.access(identifiers, user_identifier)
|
44
|
+
p result
|
45
|
+
rescue Stage::ApiError => e
|
46
|
+
puts "Exception when calling StageApi->access: #{e}"
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
50
|
+
### Parameters
|
51
|
+
|
52
|
+
Name | Type | Description | Notes
|
53
|
+
------------- | ------------- | ------------- | -------------
|
54
|
+
**identifiers** | [**Array<String>**](String.md)| The identifiers of the features being accessed. |
|
55
|
+
**user_identifier** | **String**| The identifier of the user who is accessing the feature. |
|
56
|
+
|
57
|
+
### Return type
|
58
|
+
|
59
|
+
[**AccessForm**](AccessForm.md)
|
60
|
+
|
61
|
+
### Authorization
|
62
|
+
|
63
|
+
[stage-api-token](../README.md#stage-api-token), [stage-read-only-api-token](../README.md#stage-read-only-api-token)
|
64
|
+
|
65
|
+
### HTTP request headers
|
66
|
+
|
67
|
+
- **Content-Type**: Not defined
|
68
|
+
- **Accept**: application/json
|
69
|
+
|
70
|
+
|
71
|
+
|
12
72
|
# **create_user**
|
13
73
|
> ClientUserForm create_user(body)
|
14
74
|
|
@@ -24,6 +84,11 @@ Stage.configure do |config|
|
|
24
84
|
config.api_key['Authorization'] = 'YOUR API KEY'
|
25
85
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
26
86
|
#config.api_key_prefix['Authorization'] = 'Bearer'
|
87
|
+
|
88
|
+
# Configure API key authorization: stage-read-only-api-token
|
89
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
90
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
91
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
27
92
|
end
|
28
93
|
|
29
94
|
api_instance = Stage::StageApi.new
|
@@ -51,7 +116,7 @@ Name | Type | Description | Notes
|
|
51
116
|
|
52
117
|
### Authorization
|
53
118
|
|
54
|
-
[stage-api-token](../README.md#stage-api-token)
|
119
|
+
[stage-api-token](../README.md#stage-api-token), [stage-read-only-api-token](../README.md#stage-read-only-api-token)
|
55
120
|
|
56
121
|
### HTTP request headers
|
57
122
|
|
@@ -75,6 +140,11 @@ Stage.configure do |config|
|
|
75
140
|
config.api_key['Authorization'] = 'YOUR API KEY'
|
76
141
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
77
142
|
#config.api_key_prefix['Authorization'] = 'Bearer'
|
143
|
+
|
144
|
+
# Configure API key authorization: stage-read-only-api-token
|
145
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
146
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
147
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
78
148
|
end
|
79
149
|
|
80
150
|
api_instance = Stage::StageApi.new
|
@@ -97,7 +167,7 @@ This endpoint does not need any parameter.
|
|
97
167
|
|
98
168
|
### Authorization
|
99
169
|
|
100
|
-
[stage-api-token](../README.md#stage-api-token)
|
170
|
+
[stage-api-token](../README.md#stage-api-token), [stage-read-only-api-token](../README.md#stage-read-only-api-token)
|
101
171
|
|
102
172
|
### HTTP request headers
|
103
173
|
|
@@ -107,9 +177,9 @@ This endpoint does not need any parameter.
|
|
107
177
|
|
108
178
|
|
109
179
|
# **has_access**
|
110
|
-
> AccessForm has_access(identifiers, user_identifier
|
180
|
+
> AccessForm has_access(identifiers, user_identifier)
|
111
181
|
|
112
|
-
Checks if a user has access to the identified
|
182
|
+
Checks if a user has access to the identified features.
|
113
183
|
|
114
184
|
### Example
|
115
185
|
```ruby
|
@@ -121,17 +191,21 @@ Stage.configure do |config|
|
|
121
191
|
config.api_key['Authorization'] = 'YOUR API KEY'
|
122
192
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
123
193
|
#config.api_key_prefix['Authorization'] = 'Bearer'
|
194
|
+
|
195
|
+
# Configure API key authorization: stage-read-only-api-token
|
196
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
197
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
198
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
124
199
|
end
|
125
200
|
|
126
201
|
api_instance = Stage::StageApi.new
|
127
202
|
identifiers = ['identifiers_example'] # Array<String> | The identifiers of the features being accessed.
|
128
|
-
mark_accessed = true # BOOLEAN | Whether this has-access check should mark the features as having been accessed.
|
129
203
|
user_identifier = 'user_identifier_example' # String | The identifier of the user who is accessing the feature.
|
130
204
|
|
131
205
|
|
132
206
|
begin
|
133
|
-
#Checks if a user has access to the identified
|
134
|
-
result = api_instance.has_access(identifiers, user_identifier
|
207
|
+
#Checks if a user has access to the identified features.
|
208
|
+
result = api_instance.has_access(identifiers, user_identifier)
|
135
209
|
p result
|
136
210
|
rescue Stage::ApiError => e
|
137
211
|
puts "Exception when calling StageApi->has_access: #{e}"
|
@@ -143,7 +217,6 @@ end
|
|
143
217
|
Name | Type | Description | Notes
|
144
218
|
------------- | ------------- | ------------- | -------------
|
145
219
|
**identifiers** | [**Array<String>**](String.md)| The identifiers of the features being accessed. |
|
146
|
-
**mark_accessed** | **BOOLEAN**| Whether this has-access check should mark the features as having been accessed. |
|
147
220
|
**user_identifier** | **String**| The identifier of the user who is accessing the feature. |
|
148
221
|
|
149
222
|
### Return type
|
@@ -152,7 +225,67 @@ Name | Type | Description | Notes
|
|
152
225
|
|
153
226
|
### Authorization
|
154
227
|
|
155
|
-
[stage-api-token](../README.md#stage-api-token)
|
228
|
+
[stage-api-token](../README.md#stage-api-token), [stage-read-only-api-token](../README.md#stage-read-only-api-token)
|
229
|
+
|
230
|
+
### HTTP request headers
|
231
|
+
|
232
|
+
- **Content-Type**: Not defined
|
233
|
+
- **Accept**: application/json
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
# **decrement_access_count_or_credit_usage**
|
238
|
+
> AccessForm decrement_access_count_or_credit_usage(as_credit, identifiers, user_identifier)
|
239
|
+
|
240
|
+
If the user has access to the features, this un-accesses those features.
|
241
|
+
|
242
|
+
### Example
|
243
|
+
```ruby
|
244
|
+
# load the gem
|
245
|
+
require 'stage-ruby'
|
246
|
+
# setup authorization
|
247
|
+
Stage.configure do |config|
|
248
|
+
# Configure API key authorization: stage-api-token
|
249
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
250
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
251
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
252
|
+
|
253
|
+
# Configure API key authorization: stage-read-only-api-token
|
254
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
255
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
256
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
257
|
+
end
|
258
|
+
|
259
|
+
api_instance = Stage::StageApi.new
|
260
|
+
as_credit = true # BOOLEAN | When set to true, this un-accessing of a feature is treated as a credit instead of decrementing the access count.
|
261
|
+
identifiers = ['identifiers_example'] # Array<String> | The identifiers of the features being accessed.
|
262
|
+
user_identifier = 'user_identifier_example' # String | The identifier of the user who is accessing the feature.
|
263
|
+
|
264
|
+
|
265
|
+
begin
|
266
|
+
#If the user has access to the features, this un-accesses those features.
|
267
|
+
result = api_instance.decrement_access_count_or_credit_usage(as_credit, identifiers, user_identifier)
|
268
|
+
p result
|
269
|
+
rescue Stage::ApiError => e
|
270
|
+
puts "Exception when calling StageApi->decrement_access_count_or_credit_usage: #{e}"
|
271
|
+
end
|
272
|
+
```
|
273
|
+
|
274
|
+
### Parameters
|
275
|
+
|
276
|
+
Name | Type | Description | Notes
|
277
|
+
------------- | ------------- | ------------- | -------------
|
278
|
+
**as_credit** | **BOOLEAN**| When set to true, this un-accessing of a feature is treated as a credit instead of decrementing the access count. |
|
279
|
+
**identifiers** | [**Array<String>**](String.md)| The identifiers of the features being accessed. |
|
280
|
+
**user_identifier** | **String**| The identifier of the user who is accessing the feature. |
|
281
|
+
|
282
|
+
### Return type
|
283
|
+
|
284
|
+
[**AccessForm**](AccessForm.md)
|
285
|
+
|
286
|
+
### Authorization
|
287
|
+
|
288
|
+
[stage-api-token](../README.md#stage-api-token), [stage-read-only-api-token](../README.md#stage-read-only-api-token)
|
156
289
|
|
157
290
|
### HTTP request headers
|
158
291
|
|
@@ -176,6 +309,11 @@ Stage.configure do |config|
|
|
176
309
|
config.api_key['Authorization'] = 'YOUR API KEY'
|
177
310
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
178
311
|
#config.api_key_prefix['Authorization'] = 'Bearer'
|
312
|
+
|
313
|
+
# Configure API key authorization: stage-read-only-api-token
|
314
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
315
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
316
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
179
317
|
end
|
180
318
|
|
181
319
|
api_instance = Stage::StageApi.new
|
@@ -196,7 +334,7 @@ end
|
|
196
334
|
|
197
335
|
Name | Type | Description | Notes
|
198
336
|
------------- | ------------- | ------------- | -------------
|
199
|
-
**body** | [**ClientUserForm**](ClientUserForm.md)| The payload containing the information to update a user's plan. Only identifier and planIdentifier fields are required. |
|
337
|
+
**body** | [**ClientUserForm**](ClientUserForm.md)| The payload containing the information to update a user's plan. Only identifier and planIdentifier fields are required. |
|
200
338
|
**user_identifier** | **String**| The identifier of the user. |
|
201
339
|
|
202
340
|
### Return type
|
@@ -205,7 +343,7 @@ Name | Type | Description | Notes
|
|
205
343
|
|
206
344
|
### Authorization
|
207
345
|
|
208
|
-
[stage-api-token](../README.md#stage-api-token)
|
346
|
+
[stage-api-token](../README.md#stage-api-token), [stage-read-only-api-token](../README.md#stage-read-only-api-token)
|
209
347
|
|
210
348
|
### HTTP request headers
|
211
349
|
|
data/docs/StageUserObjectForm.md
CHANGED
@@ -4,8 +4,14 @@
|
|
4
4
|
Name | Type | Description | Notes
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
6
|
**arena_id** | **Integer** | | [optional]
|
7
|
+
**created_at** | **DateTime** | | [optional]
|
7
8
|
**deleted** | **BOOLEAN** | | [optional]
|
8
9
|
**email** | **String** | | [optional]
|
9
|
-
**
|
10
|
+
**existing_password** | **String** | | [optional]
|
11
|
+
**first_name** | **String** | | [optional]
|
12
|
+
**id** | **Integer** | | [optional]
|
13
|
+
**invite_accepted** | **BOOLEAN** | | [optional]
|
14
|
+
**last_name** | **String** | | [optional]
|
10
15
|
**password** | **String** | | [optional]
|
16
|
+
**updated_at** | **DateTime** | | [optional]
|
11
17
|
|
@@ -135,34 +135,32 @@ module Stage
|
|
135
135
|
# Checks if a user has access to the identified feature.
|
136
136
|
# @param user_identifier The identifier of the user who is accessing the feature.
|
137
137
|
# @param feature_identifiers identifiers
|
138
|
-
# @param mark_accessed Whether this has-access check should mark the features as having been accessed.
|
139
138
|
# @return [AccessForm]
|
140
|
-
def has_access_verbose(user_identifier, feature_identifiers
|
141
|
-
data, _status_code, _headers = has_access_with_http_info(user_identifier, feature_identifiers,
|
139
|
+
def has_access_verbose(user_identifier, feature_identifiers)
|
140
|
+
data, _status_code, _headers = has_access_with_http_info(user_identifier, feature_identifiers, {})
|
142
141
|
data
|
143
142
|
end
|
144
143
|
|
145
|
-
def has_access(user_identifier, feature_identifier
|
146
|
-
has_access_to_all(user_identifier, [feature_identifier]
|
144
|
+
def has_access(user_identifier, feature_identifier)
|
145
|
+
has_access_to_all(user_identifier, [feature_identifier])
|
147
146
|
end
|
148
147
|
|
149
|
-
def has_access_to_any(user_identifier, feature_identifiers
|
150
|
-
data, _status_code, _headers = has_access_with_http_info(user_identifier, feature_identifiers,
|
148
|
+
def has_access_to_any(user_identifier, feature_identifiers)
|
149
|
+
data, _status_code, _headers = has_access_with_http_info(user_identifier, feature_identifiers, {})
|
151
150
|
data.features.map { |feature| feature[:hasAccess] }.any?
|
152
151
|
end
|
153
152
|
|
154
|
-
def has_access_to_all(user_identifier, feature_identifiers
|
155
|
-
data, _status_code, _headers = has_access_with_http_info(user_identifier, feature_identifiers,
|
153
|
+
def has_access_to_all(user_identifier, feature_identifiers)
|
154
|
+
data, _status_code, _headers = has_access_with_http_info(user_identifier, feature_identifiers, {})
|
156
155
|
data.features.map { |feature| feature[:hasAccess] }.all?
|
157
156
|
end
|
158
157
|
|
159
158
|
# Checks if a user has access to the identified feature.
|
160
159
|
# @param user_identifier The identifier of the user who is accessing the feature.
|
161
160
|
# @param feature_identifiers identifiers
|
162
|
-
# @param mark_accessed Whether this has-access check should mark the features as having been accessed.
|
163
161
|
# @param [Hash] opts the optional parameters
|
164
162
|
# @return [Array<(AccessForm, Integer, Hash)>] AccessForm data, response status code and response headers
|
165
|
-
def has_access_with_http_info(user_identifier, feature_identifiers,
|
163
|
+
def has_access_with_http_info(user_identifier, feature_identifiers, opts = {})
|
166
164
|
if @api_client.config.debugging
|
167
165
|
@api_client.config.logger.debug 'Calling API: StageApi.has_access ...'
|
168
166
|
end
|
@@ -180,7 +178,6 @@ module Stage
|
|
180
178
|
# query parameters
|
181
179
|
query_params = opts[:query_params] || {}
|
182
180
|
query_params[:'identifiers'] = @api_client.build_collection_param(feature_identifiers, :csv)
|
183
|
-
query_params[:'markAccessed'] = mark_accessed
|
184
181
|
|
185
182
|
# header parameters
|
186
183
|
header_params = opts[:header_params] || {}
|
@@ -210,6 +207,176 @@ module Stage
|
|
210
207
|
return data, status_code, headers
|
211
208
|
end
|
212
209
|
|
210
|
+
# If the user has access to the feature, this marks that feature as accessed.
|
211
|
+
# @param user_identifier The identifier of the user who is accessing the feature.
|
212
|
+
# @param feature_identifier The feature_identifier of the feature being accessed.
|
213
|
+
# @param [Hash] opts the optional parameters
|
214
|
+
# @return [AccessForm]
|
215
|
+
def access(user_identifier, feature_identifier, opts = {})
|
216
|
+
data, _status_code, _headers = access_with_http_info(user_identifier, [feature_identifier], opts)
|
217
|
+
data
|
218
|
+
end
|
219
|
+
|
220
|
+
# If the user has access to the features, this marks those features as accessed.
|
221
|
+
# @param user_identifier The identifier of the user who is accessing the feature.
|
222
|
+
# @param feature_identifiers The feature_identifiers of the features being accessed.
|
223
|
+
# @param [Hash] opts the optional parameters
|
224
|
+
# @return [AccessForm]
|
225
|
+
def accessAll(user_identifier, feature_identifiers, opts = {})
|
226
|
+
data, _status_code, _headers = access_with_http_info(user_identifier, feature_identifiers, opts)
|
227
|
+
data
|
228
|
+
end
|
229
|
+
|
230
|
+
# If the user has access to the features, this marks those features as accessed.
|
231
|
+
# @param user_identifier The identifier of the user who is accessing the feature.
|
232
|
+
# @param feature_identifiers The identifiers of the features being accessed.
|
233
|
+
# @param [Hash] opts the optional parameters
|
234
|
+
# @return [Array<(AccessForm, Integer, Hash)>] AccessForm data, response status code and response headers
|
235
|
+
def access_with_http_info(user_identifier, feature_identifiers, opts = {})
|
236
|
+
if @api_client.config.debugging
|
237
|
+
@api_client.config.logger.debug 'Calling API: StageApi.access ...'
|
238
|
+
end
|
239
|
+
# verify the required parameter 'feature_identifiers' is set
|
240
|
+
if @api_client.config.client_side_validation && feature_identifiers.nil?
|
241
|
+
fail ArgumentError, "Missing the required parameter 'feature_identifiers' when calling StageApi.access"
|
242
|
+
end
|
243
|
+
# verify the required parameter 'user_identifier' is set
|
244
|
+
if @api_client.config.client_side_validation && user_identifier.nil?
|
245
|
+
fail ArgumentError, "Missing the required parameter 'user_identifier' when calling StageApi.access"
|
246
|
+
end
|
247
|
+
# resource path
|
248
|
+
local_var_path = '/sdk-api/v1/users/{userIdentifier}/features'.sub('{' + 'userIdentifier' + '}', user_identifier.to_s)
|
249
|
+
|
250
|
+
# query parameters
|
251
|
+
query_params = opts[:query_params] || {}
|
252
|
+
query_params[:'identifiers'] = @api_client.build_collection_param(feature_identifiers, :multi)
|
253
|
+
|
254
|
+
# header parameters
|
255
|
+
header_params = opts[:header_params] || {}
|
256
|
+
# HTTP header 'Accept' (if needed)
|
257
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
258
|
+
|
259
|
+
# form parameters
|
260
|
+
form_params = opts[:form_params] || {}
|
261
|
+
|
262
|
+
# http body (model)
|
263
|
+
post_body = opts[:body]
|
264
|
+
|
265
|
+
return_type = opts[:return_type] || 'AccessForm'
|
266
|
+
|
267
|
+
auth_names = opts[:auth_names] || ['stage-api-token', 'stage-read-only-api-token']
|
268
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
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
|
+
if @api_client.config.debugging
|
277
|
+
@api_client.config.logger.debug "API called: StageApi#access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
278
|
+
end
|
279
|
+
return data, status_code, headers
|
280
|
+
end
|
281
|
+
|
282
|
+
# If the user has access to a feature, this decrements the access count of that feature.
|
283
|
+
# @param user_identifier The identifier of the user who is accessing the feature.
|
284
|
+
# @param feature_identifier The identifier of the feature being accessed.
|
285
|
+
# @param [Hash] opts the optional parameters
|
286
|
+
# @return [AccessForm]
|
287
|
+
def decrement_access_count(user_identifier, feature_identifier, opts = {})
|
288
|
+
data, _status_code, _headers = un_access_with_http_info(user_identifier, [feature_identifier], false, opts)
|
289
|
+
data
|
290
|
+
end
|
291
|
+
|
292
|
+
# If the user has access to the features, this decrements the access counts of those features.
|
293
|
+
# @param user_identifier The identifier of the user who is accessing the feature.
|
294
|
+
# @param feature_identifiers The identifiers of the features being accessed.
|
295
|
+
# @param [Hash] opts the optional parameters
|
296
|
+
# @return [AccessForm]
|
297
|
+
def decrement_access_count_all(user_identifier, feature_identifiers, as_credit, opts = {})
|
298
|
+
data, _status_code, _headers = un_access_with_http_info(user_identifier, feature_identifiers, false, opts)
|
299
|
+
data
|
300
|
+
end
|
301
|
+
|
302
|
+
# If the user has access to a feature, this decrements the access count of that feature.
|
303
|
+
# @param user_identifier The identifier of the user who is accessing the feature.
|
304
|
+
# @param feature_identifier The identifier of the feature being accessed.
|
305
|
+
# @param [Hash] opts the optional parameters
|
306
|
+
# @return [AccessForm]
|
307
|
+
def credit(user_identifier, feature_identifier, as_credit, opts = {})
|
308
|
+
data, _status_code, _headers = un_access_with_http_info(user_identifier, [feature_identifier], true, opts)
|
309
|
+
data
|
310
|
+
end
|
311
|
+
|
312
|
+
# If the user has access to the features, this decrements the access counts of those features.
|
313
|
+
# @param user_identifier The identifier of the user who is accessing the feature.
|
314
|
+
# @param feature_identifiers The identifiers of the features being accessed.
|
315
|
+
# @param [Hash] opts the optional parameters
|
316
|
+
# @return [AccessForm]
|
317
|
+
def credit_all(user_identifier, feature_identifiers, as_credit, opts = {})
|
318
|
+
data, _status_code, _headers = un_access_with_http_info(user_identifier, feature_identifiers, true, opts)
|
319
|
+
data
|
320
|
+
end
|
321
|
+
|
322
|
+
# Either decrements the access count or credits the one usage for each of the accessible features.
|
323
|
+
# @param as_credit When set to true, this un-accessing of a feature is treated as a credit instead of decrementing the access count.
|
324
|
+
# @param feature_identifiers The identifiers of the features being accessed.
|
325
|
+
# @param user_identifier The identifier of the user who is accessing the feature.
|
326
|
+
# @param [Hash] opts the optional parameters
|
327
|
+
# @return [Array<(AccessForm, Integer, Hash)>] AccessForm data, response status code and response headers
|
328
|
+
def decrement_access_count_or_credit_usage_with_http_info(user_identifier, feature_identifiers, as_credit, opts = {})
|
329
|
+
if @api_client.config.debugging
|
330
|
+
@api_client.config.logger.debug 'Calling API: StageApi.un_access ...'
|
331
|
+
end
|
332
|
+
# verify the required parameter 'as_credit' is set
|
333
|
+
if @api_client.config.client_side_validation && as_credit.nil?
|
334
|
+
fail ArgumentError, "Missing the required parameter 'as_credit' when calling StageApi.un_access"
|
335
|
+
end
|
336
|
+
# verify the required parameter 'feature_identifiers' is set
|
337
|
+
if @api_client.config.client_side_validation && feature_identifiers.nil?
|
338
|
+
fail ArgumentError, "Missing the required parameter 'feature_identifiers' when calling StageApi.un_access"
|
339
|
+
end
|
340
|
+
# verify the required parameter 'user_identifier' is set
|
341
|
+
if @api_client.config.client_side_validation && user_identifier.nil?
|
342
|
+
fail ArgumentError, "Missing the required parameter 'user_identifier' when calling StageApi.un_access"
|
343
|
+
end
|
344
|
+
# resource path
|
345
|
+
local_var_path = '/sdk-api/v1/users/{userIdentifier}/features'.sub('{' + 'userIdentifier' + '}', user_identifier.to_s)
|
346
|
+
|
347
|
+
# query parameters
|
348
|
+
query_params = opts[:query_params] || {}
|
349
|
+
query_params[:'asCredit'] = as_credit
|
350
|
+
query_params[:'identifiers'] = @api_client.build_collection_param(feature_identifiers, :multi)
|
351
|
+
|
352
|
+
# header parameters
|
353
|
+
header_params = opts[:header_params] || {}
|
354
|
+
# HTTP header 'Accept' (if needed)
|
355
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
356
|
+
|
357
|
+
# form parameters
|
358
|
+
form_params = opts[:form_params] || {}
|
359
|
+
|
360
|
+
# http body (model)
|
361
|
+
post_body = opts[:body]
|
362
|
+
|
363
|
+
return_type = opts[:return_type] || 'AccessForm'
|
364
|
+
|
365
|
+
auth_names = opts[:auth_names] || ['stage-api-token', 'stage-read-only-api-token']
|
366
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
367
|
+
:header_params => header_params,
|
368
|
+
:query_params => query_params,
|
369
|
+
:form_params => form_params,
|
370
|
+
:body => post_body,
|
371
|
+
:auth_names => auth_names,
|
372
|
+
:return_type => return_type)
|
373
|
+
|
374
|
+
if @api_client.config.debugging
|
375
|
+
@api_client.config.logger.debug "API called: StageApi#un_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
376
|
+
end
|
377
|
+
return data, status_code, headers
|
378
|
+
end
|
379
|
+
|
213
380
|
# Updates a user's plan.
|
214
381
|
# @param user_identifier The identifier of the user.
|
215
382
|
# @param plan_identifier The plan identifier.
|
@@ -199,6 +199,13 @@ module Stage
|
|
199
199
|
key: 'Authorization',
|
200
200
|
value: api_key_with_prefix('Authorization')
|
201
201
|
},
|
202
|
+
'stage-read-only-api-token' =>
|
203
|
+
{
|
204
|
+
type: 'api_key',
|
205
|
+
in: 'header',
|
206
|
+
key: 'Authorization',
|
207
|
+
value: api_key_with_prefix('Authorization')
|
208
|
+
},
|
202
209
|
}
|
203
210
|
end
|
204
211
|
end
|
@@ -30,12 +30,18 @@ module Stage
|
|
30
30
|
# A client user identifier.
|
31
31
|
attr_accessor :identifier
|
32
32
|
|
33
|
+
# The organization this user belongs to.
|
34
|
+
attr_accessor :organization_id
|
35
|
+
|
33
36
|
# The plan to be assigned to the client user.
|
34
37
|
attr_accessor :plan_id
|
35
38
|
|
36
39
|
# The plan to be assigned to the user.
|
37
40
|
attr_accessor :plan_identifier
|
38
41
|
|
42
|
+
# The role within the organization's plan this user is assigned.
|
43
|
+
attr_accessor :plan_role_id
|
44
|
+
|
39
45
|
# Attribute mapping from ruby-style variable name to JSON key.
|
40
46
|
def self.attribute_map
|
41
47
|
{
|
@@ -45,8 +51,10 @@ module Stage
|
|
45
51
|
:'deleted' => :'deleted',
|
46
52
|
:'id' => :'id',
|
47
53
|
:'identifier' => :'identifier',
|
54
|
+
:'organization_id' => :'organizationId',
|
48
55
|
:'plan_id' => :'planId',
|
49
|
-
:'plan_identifier' => :'planIdentifier'
|
56
|
+
:'plan_identifier' => :'planIdentifier',
|
57
|
+
:'plan_role_id' => :'planRoleId'
|
50
58
|
}
|
51
59
|
end
|
52
60
|
|
@@ -59,8 +67,10 @@ module Stage
|
|
59
67
|
:'deleted' => :'Object',
|
60
68
|
:'id' => :'Object',
|
61
69
|
:'identifier' => :'Object',
|
70
|
+
:'organization_id' => :'Object',
|
62
71
|
:'plan_id' => :'Object',
|
63
|
-
:'plan_identifier' => :'Object'
|
72
|
+
:'plan_identifier' => :'Object',
|
73
|
+
:'plan_role_id' => :'Object'
|
64
74
|
}
|
65
75
|
end
|
66
76
|
|
@@ -109,6 +119,10 @@ module Stage
|
|
109
119
|
self.identifier = attributes[:'identifier']
|
110
120
|
end
|
111
121
|
|
122
|
+
if attributes.key?(:'organization_id')
|
123
|
+
self.organization_id = attributes[:'organization_id']
|
124
|
+
end
|
125
|
+
|
112
126
|
if attributes.key?(:'plan_id')
|
113
127
|
self.plan_id = attributes[:'plan_id']
|
114
128
|
end
|
@@ -116,6 +130,10 @@ module Stage
|
|
116
130
|
if attributes.key?(:'plan_identifier')
|
117
131
|
self.plan_identifier = attributes[:'plan_identifier']
|
118
132
|
end
|
133
|
+
|
134
|
+
if attributes.key?(:'plan_role_id')
|
135
|
+
self.plan_role_id = attributes[:'plan_role_id']
|
136
|
+
end
|
119
137
|
end
|
120
138
|
|
121
139
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -142,8 +160,10 @@ module Stage
|
|
142
160
|
deleted == o.deleted &&
|
143
161
|
id == o.id &&
|
144
162
|
identifier == o.identifier &&
|
163
|
+
organization_id == o.organization_id &&
|
145
164
|
plan_id == o.plan_id &&
|
146
|
-
plan_identifier == o.plan_identifier
|
165
|
+
plan_identifier == o.plan_identifier &&
|
166
|
+
plan_role_id == o.plan_role_id
|
147
167
|
end
|
148
168
|
|
149
169
|
# @see the `==` method
|
@@ -155,7 +175,7 @@ module Stage
|
|
155
175
|
# Calculates hash code according to all attributes.
|
156
176
|
# @return [Integer] Hash code
|
157
177
|
def hash
|
158
|
-
[arena_id, created_at, created_by, deleted, id, identifier, plan_id, plan_identifier].hash
|
178
|
+
[arena_id, created_at, created_by, deleted, id, identifier, organization_id, plan_id, plan_identifier, plan_role_id].hash
|
159
179
|
end
|
160
180
|
|
161
181
|
# Builds the object from hash
|
@@ -15,22 +15,40 @@ module Stage
|
|
15
15
|
class StageUserObjectForm
|
16
16
|
attr_accessor :arena_id
|
17
17
|
|
18
|
+
attr_accessor :created_at
|
19
|
+
|
18
20
|
attr_accessor :deleted
|
19
21
|
|
20
22
|
attr_accessor :email
|
21
23
|
|
24
|
+
attr_accessor :existing_password
|
25
|
+
|
26
|
+
attr_accessor :first_name
|
27
|
+
|
22
28
|
attr_accessor :id
|
23
29
|
|
30
|
+
attr_accessor :invite_accepted
|
31
|
+
|
32
|
+
attr_accessor :last_name
|
33
|
+
|
24
34
|
attr_accessor :password
|
25
35
|
|
36
|
+
attr_accessor :updated_at
|
37
|
+
|
26
38
|
# Attribute mapping from ruby-style variable name to JSON key.
|
27
39
|
def self.attribute_map
|
28
40
|
{
|
29
41
|
:'arena_id' => :'arenaId',
|
42
|
+
:'created_at' => :'createdAt',
|
30
43
|
:'deleted' => :'deleted',
|
31
44
|
:'email' => :'email',
|
45
|
+
:'existing_password' => :'existingPassword',
|
46
|
+
:'first_name' => :'firstName',
|
32
47
|
:'id' => :'id',
|
33
|
-
:'
|
48
|
+
:'invite_accepted' => :'inviteAccepted',
|
49
|
+
:'last_name' => :'lastName',
|
50
|
+
:'password' => :'password',
|
51
|
+
:'updated_at' => :'updatedAt'
|
34
52
|
}
|
35
53
|
end
|
36
54
|
|
@@ -38,10 +56,16 @@ module Stage
|
|
38
56
|
def self.openapi_types
|
39
57
|
{
|
40
58
|
:'arena_id' => :'Object',
|
59
|
+
:'created_at' => :'Object',
|
41
60
|
:'deleted' => :'Object',
|
42
61
|
:'email' => :'Object',
|
62
|
+
:'existing_password' => :'Object',
|
63
|
+
:'first_name' => :'Object',
|
43
64
|
:'id' => :'Object',
|
44
|
-
:'
|
65
|
+
:'invite_accepted' => :'Object',
|
66
|
+
:'last_name' => :'Object',
|
67
|
+
:'password' => :'Object',
|
68
|
+
:'updated_at' => :'Object'
|
45
69
|
}
|
46
70
|
end
|
47
71
|
|
@@ -70,6 +94,10 @@ module Stage
|
|
70
94
|
self.arena_id = attributes[:'arena_id']
|
71
95
|
end
|
72
96
|
|
97
|
+
if attributes.key?(:'created_at')
|
98
|
+
self.created_at = attributes[:'created_at']
|
99
|
+
end
|
100
|
+
|
73
101
|
if attributes.key?(:'deleted')
|
74
102
|
self.deleted = attributes[:'deleted']
|
75
103
|
end
|
@@ -78,13 +106,33 @@ module Stage
|
|
78
106
|
self.email = attributes[:'email']
|
79
107
|
end
|
80
108
|
|
109
|
+
if attributes.key?(:'existing_password')
|
110
|
+
self.existing_password = attributes[:'existing_password']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'first_name')
|
114
|
+
self.first_name = attributes[:'first_name']
|
115
|
+
end
|
116
|
+
|
81
117
|
if attributes.key?(:'id')
|
82
118
|
self.id = attributes[:'id']
|
83
119
|
end
|
84
120
|
|
121
|
+
if attributes.key?(:'invite_accepted')
|
122
|
+
self.invite_accepted = attributes[:'invite_accepted']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'last_name')
|
126
|
+
self.last_name = attributes[:'last_name']
|
127
|
+
end
|
128
|
+
|
85
129
|
if attributes.key?(:'password')
|
86
130
|
self.password = attributes[:'password']
|
87
131
|
end
|
132
|
+
|
133
|
+
if attributes.key?(:'updated_at')
|
134
|
+
self.updated_at = attributes[:'updated_at']
|
135
|
+
end
|
88
136
|
end
|
89
137
|
|
90
138
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -106,10 +154,16 @@ module Stage
|
|
106
154
|
return true if self.equal?(o)
|
107
155
|
self.class == o.class &&
|
108
156
|
arena_id == o.arena_id &&
|
157
|
+
created_at == o.created_at &&
|
109
158
|
deleted == o.deleted &&
|
110
159
|
email == o.email &&
|
160
|
+
existing_password == o.existing_password &&
|
161
|
+
first_name == o.first_name &&
|
111
162
|
id == o.id &&
|
112
|
-
|
163
|
+
invite_accepted == o.invite_accepted &&
|
164
|
+
last_name == o.last_name &&
|
165
|
+
password == o.password &&
|
166
|
+
updated_at == o.updated_at
|
113
167
|
end
|
114
168
|
|
115
169
|
# @see the `==` method
|
@@ -121,7 +175,7 @@ module Stage
|
|
121
175
|
# Calculates hash code according to all attributes.
|
122
176
|
# @return [Integer] Hash code
|
123
177
|
def hash
|
124
|
-
[arena_id, deleted, email, id, password].hash
|
178
|
+
[arena_id, created_at, deleted, email, existing_password, first_name, id, invite_accepted, last_name, password, updated_at].hash
|
125
179
|
end
|
126
180
|
|
127
181
|
# Builds the object from hash
|
data/lib/stage-ruby/version.rb
CHANGED
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stage-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.05
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stage Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -127,6 +127,8 @@ files:
|
|
127
127
|
- spec/models/stage_user_object_form_spec.rb
|
128
128
|
- spec/spec_helper.rb
|
129
129
|
- stage-ruby-0.0.02.gem
|
130
|
+
- stage-ruby-0.0.03.gem
|
131
|
+
- stage-ruby-0.0.04.gem
|
130
132
|
- stage-ruby.gemspec
|
131
133
|
homepage: https://github.com/swagger-api/swagger-codegen
|
132
134
|
licenses:
|