rbflagr 0.1.2

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 (112) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/Makefile +9 -0
  4. data/README.md +143 -0
  5. data/Rakefile +8 -0
  6. data/docs/Constraint.md +11 -0
  7. data/docs/ConstraintApi.md +211 -0
  8. data/docs/CreateConstraintRequest.md +10 -0
  9. data/docs/CreateFlagRequest.md +8 -0
  10. data/docs/CreateSegmentRequest.md +9 -0
  11. data/docs/CreateVariantRequest.md +9 -0
  12. data/docs/Distribution.md +12 -0
  13. data/docs/DistributionApi.md +109 -0
  14. data/docs/Error.md +8 -0
  15. data/docs/EvalContext.md +12 -0
  16. data/docs/EvalDebugLog.md +9 -0
  17. data/docs/EvalResult.md +16 -0
  18. data/docs/EvaluationApi.md +98 -0
  19. data/docs/EvaluationBatchRequest.md +10 -0
  20. data/docs/EvaluationBatchResponse.md +8 -0
  21. data/docs/EvaluationEntity.md +10 -0
  22. data/docs/Flag.md +13 -0
  23. data/docs/FlagApi.md +337 -0
  24. data/docs/FlagSnapshot.md +11 -0
  25. data/docs/HealthApi.md +46 -0
  26. data/docs/PutDistributionsRequest.md +8 -0
  27. data/docs/PutFlagRequest.md +9 -0
  28. data/docs/PutSegmentReorderRequest.md +8 -0
  29. data/docs/PutSegmentRequest.md +9 -0
  30. data/docs/PutVariantRequest.md +9 -0
  31. data/docs/Segment.md +13 -0
  32. data/docs/SegmentApi.md +246 -0
  33. data/docs/SegmentDebugLog.md +9 -0
  34. data/docs/SetFlagEnabledRequest.md +8 -0
  35. data/docs/Variant.md +10 -0
  36. data/docs/VariantApi.md +199 -0
  37. data/git_push.sh +55 -0
  38. data/lib/rbflagr.rb +70 -0
  39. data/lib/rbflagr/api/constraint_api.rb +310 -0
  40. data/lib/rbflagr/api/distribution_api.rb +159 -0
  41. data/lib/rbflagr/api/evaluation_api.rb +123 -0
  42. data/lib/rbflagr/api/flag_api.rb +413 -0
  43. data/lib/rbflagr/api/health_api.rb +66 -0
  44. data/lib/rbflagr/api/segment_api.rb +329 -0
  45. data/lib/rbflagr/api/variant_api.rb +270 -0
  46. data/lib/rbflagr/api_client.rb +388 -0
  47. data/lib/rbflagr/api_error.rb +38 -0
  48. data/lib/rbflagr/configuration.rb +202 -0
  49. data/lib/rbflagr/models/constraint.rb +317 -0
  50. data/lib/rbflagr/models/create_constraint_request.rb +273 -0
  51. data/lib/rbflagr/models/create_flag_request.rb +207 -0
  52. data/lib/rbflagr/models/create_segment_request.rb +249 -0
  53. data/lib/rbflagr/models/create_variant_request.rb +216 -0
  54. data/lib/rbflagr/models/distribution.rb +330 -0
  55. data/lib/rbflagr/models/error.rb +207 -0
  56. data/lib/rbflagr/models/eval_context.rb +268 -0
  57. data/lib/rbflagr/models/eval_debug_log.rb +194 -0
  58. data/lib/rbflagr/models/eval_result.rb +385 -0
  59. data/lib/rbflagr/models/evaluation_batch_request.rb +215 -0
  60. data/lib/rbflagr/models/evaluation_batch_response.rb +190 -0
  61. data/lib/rbflagr/models/evaluation_entity.rb +225 -0
  62. data/lib/rbflagr/models/flag.rb +282 -0
  63. data/lib/rbflagr/models/flag_snapshot.rb +263 -0
  64. data/lib/rbflagr/models/put_distributions_request.rb +190 -0
  65. data/lib/rbflagr/models/put_flag_request.rb +217 -0
  66. data/lib/rbflagr/models/put_segment_reorder_request.rb +190 -0
  67. data/lib/rbflagr/models/put_segment_request.rb +249 -0
  68. data/lib/rbflagr/models/put_variant_request.rb +221 -0
  69. data/lib/rbflagr/models/segment.rb +328 -0
  70. data/lib/rbflagr/models/segment_debug_log.rb +207 -0
  71. data/lib/rbflagr/models/set_flag_enabled_request.rb +188 -0
  72. data/lib/rbflagr/models/variant.rb +240 -0
  73. data/lib/rbflagr/version.rb +15 -0
  74. data/rbflagr.gemspec +45 -0
  75. data/spec/api/constraint_api_spec.rb +91 -0
  76. data/spec/api/distribution_api_spec.rb +62 -0
  77. data/spec/api/evaluation_api_spec.rb +47 -0
  78. data/spec/api/flag_api_spec.rb +108 -0
  79. data/spec/api/health_api_spec.rb +44 -0
  80. data/spec/api/segment_api_spec.rb +87 -0
  81. data/spec/api/variant_api_spec.rb +87 -0
  82. data/spec/api_client_spec.rb +226 -0
  83. data/spec/configuration_spec.rb +42 -0
  84. data/spec/models/constraint_spec.rb +64 -0
  85. data/spec/models/create_constraint_request_spec.rb +54 -0
  86. data/spec/models/create_flag_request_spec.rb +42 -0
  87. data/spec/models/create_segment_request_spec.rb +48 -0
  88. data/spec/models/create_variant_request_spec.rb +48 -0
  89. data/spec/models/distribution_spec.rb +66 -0
  90. data/spec/models/error_spec.rb +42 -0
  91. data/spec/models/eval_context_spec.rb +66 -0
  92. data/spec/models/eval_debug_log_spec.rb +48 -0
  93. data/spec/models/eval_result_spec.rb +78 -0
  94. data/spec/models/evaluation_batch_request_spec.rb +54 -0
  95. data/spec/models/evaluation_batch_response_spec.rb +42 -0
  96. data/spec/models/evaluation_entity_spec.rb +54 -0
  97. data/spec/models/flag_snapshot_spec.rb +60 -0
  98. data/spec/models/flag_spec.rb +66 -0
  99. data/spec/models/put_distributions_request_spec.rb +42 -0
  100. data/spec/models/put_flag_request_spec.rb +42 -0
  101. data/spec/models/put_segment_reorder_request_spec.rb +42 -0
  102. data/spec/models/put_segment_request_spec.rb +48 -0
  103. data/spec/models/put_variant_request_spec.rb +48 -0
  104. data/spec/models/segment_debug_log_spec.rb +48 -0
  105. data/spec/models/segment_spec.rb +72 -0
  106. data/spec/models/set_flag_enabled_request_spec.rb +42 -0
  107. data/spec/models/variant_spec.rb +54 -0
  108. data/spec/spec_helper.rb +111 -0
  109. data/swagger.yaml +1135 -0
  110. data/swagger_ruby.json +6 -0
  111. data/tags +618 -0
  112. metadata +362 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6d581712bb92f0f0bc0dcf1bd36fae8f9ed8e5511147bde6ed674f018ef8402b
4
+ data.tar.gz: 35f793dab20335bd32c8b8602b178cfd580ddaa5eb20a21759821f21be2eb6a6
5
+ SHA512:
6
+ metadata.gz: 41dd88e56157dd2ca3df30e5bf40b4bd487c3c93634da94d0d331f0827274045426f4ef75c1d73426e4a5cb48fac7ccd351a091239ed4545aaa512b74dad1002
7
+ data.tar.gz: c3b140e97a2c4921df97ccd8d89669de4eeb65d378549d317a1419e5457a063fc7dab72e90f028b523059ca57a9281347cbedc499d2cdfb9f50c5f3a2596f162
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 12.0.0'
7
+ end
@@ -0,0 +1,9 @@
1
+ # make sure swagger.yaml and swagger_ruby.json is update-to-date
2
+ gen:
3
+ docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
4
+ -i /local/swagger.yaml \
5
+ -l ruby \
6
+ -o /local/ -c /local/swagger_ruby.json
7
+ find ./rbflagr.gemspec -type f -exec sed -i "" "s/'json', '~> 2.1', '>= 2.1.0'/'json'/g" {} +
8
+ find ./.gitignore -type f -exec sed -i "" "s/# Gemfile.lock/Gemfile.lock/g" {} +
9
+ echo "\n## Use Makefile\n\`make gen\`\n" >> ./README.md
@@ -0,0 +1,143 @@
1
+ # rbflagr
2
+
3
+ Flagr - the Ruby gem for the Flagr
4
+
5
+ Flagr is a feature flagging, A/B testing and dynamic configuration microservice
6
+
7
+ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
+
9
+ - API version: 1.0.8
10
+ - Package version: 0.1.2
11
+ - Build package: io.swagger.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 rbflagr.gemspec
21
+ ```
22
+
23
+ Then either install the gem locally:
24
+
25
+ ```shell
26
+ gem install ./rbflagr-0.1.2.gem
27
+ ```
28
+ (for development, run `gem install --dev ./rbflagr-0.1.2.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 'rbflagr', '~> 0.1.2'
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 'rbflagr', :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 'rbflagr'
56
+
57
+ api_instance = Flagr::ConstraintApi.new
58
+
59
+ flag_id = 789 # Integer | numeric ID of the flag
60
+
61
+ segment_id = 789 # Integer | numeric ID of the segment
62
+
63
+ body = Flagr::CreateConstraintRequest.new # CreateConstraintRequest | create a constraint
64
+
65
+
66
+ begin
67
+ result = api_instance.create_constraint(flag_id, segment_id, body)
68
+ p result
69
+ rescue Flagr::ApiError => e
70
+ puts "Exception when calling ConstraintApi->create_constraint: #{e}"
71
+ end
72
+
73
+ ```
74
+
75
+ ## Documentation for API Endpoints
76
+
77
+ All URIs are relative to *http://localhost/api/v1*
78
+
79
+ Class | Method | HTTP request | Description
80
+ ------------ | ------------- | ------------- | -------------
81
+ *Flagr::ConstraintApi* | [**create_constraint**](docs/ConstraintApi.md#create_constraint) | **POST** /flags/{flagID}/segments/{segmentID}/constraints |
82
+ *Flagr::ConstraintApi* | [**delete_constraint**](docs/ConstraintApi.md#delete_constraint) | **DELETE** /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} |
83
+ *Flagr::ConstraintApi* | [**find_constraints**](docs/ConstraintApi.md#find_constraints) | **GET** /flags/{flagID}/segments/{segmentID}/constraints |
84
+ *Flagr::ConstraintApi* | [**put_constraint**](docs/ConstraintApi.md#put_constraint) | **PUT** /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} |
85
+ *Flagr::DistributionApi* | [**find_distributions**](docs/DistributionApi.md#find_distributions) | **GET** /flags/{flagID}/segments/{segmentID}/distributions |
86
+ *Flagr::DistributionApi* | [**put_distributions**](docs/DistributionApi.md#put_distributions) | **PUT** /flags/{flagID}/segments/{segmentID}/distributions |
87
+ *Flagr::EvaluationApi* | [**post_evaluation**](docs/EvaluationApi.md#post_evaluation) | **POST** /evaluation |
88
+ *Flagr::EvaluationApi* | [**post_evaluation_batch**](docs/EvaluationApi.md#post_evaluation_batch) | **POST** /evaluation/batch |
89
+ *Flagr::FlagApi* | [**create_flag**](docs/FlagApi.md#create_flag) | **POST** /flags |
90
+ *Flagr::FlagApi* | [**delete_flag**](docs/FlagApi.md#delete_flag) | **DELETE** /flags/{flagID} |
91
+ *Flagr::FlagApi* | [**find_flags**](docs/FlagApi.md#find_flags) | **GET** /flags |
92
+ *Flagr::FlagApi* | [**get_flag**](docs/FlagApi.md#get_flag) | **GET** /flags/{flagID} |
93
+ *Flagr::FlagApi* | [**get_flag_snapshots**](docs/FlagApi.md#get_flag_snapshots) | **GET** /flags/{flagID}/snapshots |
94
+ *Flagr::FlagApi* | [**put_flag**](docs/FlagApi.md#put_flag) | **PUT** /flags/{flagID} |
95
+ *Flagr::FlagApi* | [**set_flag_enabled**](docs/FlagApi.md#set_flag_enabled) | **PUT** /flags/{flagID}/enabled |
96
+ *Flagr::HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health |
97
+ *Flagr::SegmentApi* | [**create_segment**](docs/SegmentApi.md#create_segment) | **POST** /flags/{flagID}/segments |
98
+ *Flagr::SegmentApi* | [**delete_segment**](docs/SegmentApi.md#delete_segment) | **DELETE** /flags/{flagID}/segments/{segmentID} |
99
+ *Flagr::SegmentApi* | [**find_segments**](docs/SegmentApi.md#find_segments) | **GET** /flags/{flagID}/segments |
100
+ *Flagr::SegmentApi* | [**put_segment**](docs/SegmentApi.md#put_segment) | **PUT** /flags/{flagID}/segments/{segmentID} |
101
+ *Flagr::SegmentApi* | [**put_segments_reorder**](docs/SegmentApi.md#put_segments_reorder) | **PUT** /flags/{flagID}/segments/reorder |
102
+ *Flagr::VariantApi* | [**create_variant**](docs/VariantApi.md#create_variant) | **POST** /flags/{flagID}/variants |
103
+ *Flagr::VariantApi* | [**delete_variant**](docs/VariantApi.md#delete_variant) | **DELETE** /flags/{flagID}/variants/{variantID} |
104
+ *Flagr::VariantApi* | [**find_variants**](docs/VariantApi.md#find_variants) | **GET** /flags/{flagID}/variants |
105
+ *Flagr::VariantApi* | [**put_variant**](docs/VariantApi.md#put_variant) | **PUT** /flags/{flagID}/variants/{variantID} |
106
+
107
+
108
+ ## Documentation for Models
109
+
110
+ - [Flagr::Constraint](docs/Constraint.md)
111
+ - [Flagr::CreateConstraintRequest](docs/CreateConstraintRequest.md)
112
+ - [Flagr::CreateFlagRequest](docs/CreateFlagRequest.md)
113
+ - [Flagr::CreateSegmentRequest](docs/CreateSegmentRequest.md)
114
+ - [Flagr::CreateVariantRequest](docs/CreateVariantRequest.md)
115
+ - [Flagr::Distribution](docs/Distribution.md)
116
+ - [Flagr::Error](docs/Error.md)
117
+ - [Flagr::EvalContext](docs/EvalContext.md)
118
+ - [Flagr::EvalDebugLog](docs/EvalDebugLog.md)
119
+ - [Flagr::EvalResult](docs/EvalResult.md)
120
+ - [Flagr::EvaluationBatchRequest](docs/EvaluationBatchRequest.md)
121
+ - [Flagr::EvaluationBatchResponse](docs/EvaluationBatchResponse.md)
122
+ - [Flagr::EvaluationEntity](docs/EvaluationEntity.md)
123
+ - [Flagr::Flag](docs/Flag.md)
124
+ - [Flagr::FlagSnapshot](docs/FlagSnapshot.md)
125
+ - [Flagr::PutDistributionsRequest](docs/PutDistributionsRequest.md)
126
+ - [Flagr::PutFlagRequest](docs/PutFlagRequest.md)
127
+ - [Flagr::PutSegmentReorderRequest](docs/PutSegmentReorderRequest.md)
128
+ - [Flagr::PutSegmentRequest](docs/PutSegmentRequest.md)
129
+ - [Flagr::PutVariantRequest](docs/PutVariantRequest.md)
130
+ - [Flagr::Segment](docs/Segment.md)
131
+ - [Flagr::SegmentDebugLog](docs/SegmentDebugLog.md)
132
+ - [Flagr::SetFlagEnabledRequest](docs/SetFlagEnabledRequest.md)
133
+ - [Flagr::Variant](docs/Variant.md)
134
+
135
+
136
+ ## Documentation for Authorization
137
+
138
+ All endpoints do not require authorization.
139
+
140
+
141
+ ## Use Makefile
142
+ `make gen`
143
+
@@ -0,0 +1,8 @@
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
6
+ rescue LoadError
7
+ # no rspec available
8
+ end
@@ -0,0 +1,11 @@
1
+ # Flagr::Constraint
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | | [optional]
7
+ **property** | **String** | |
8
+ **operator** | **String** | |
9
+ **value** | **String** | |
10
+
11
+
@@ -0,0 +1,211 @@
1
+ # Flagr::ConstraintApi
2
+
3
+ All URIs are relative to *http://localhost/api/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**create_constraint**](ConstraintApi.md#create_constraint) | **POST** /flags/{flagID}/segments/{segmentID}/constraints |
8
+ [**delete_constraint**](ConstraintApi.md#delete_constraint) | **DELETE** /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} |
9
+ [**find_constraints**](ConstraintApi.md#find_constraints) | **GET** /flags/{flagID}/segments/{segmentID}/constraints |
10
+ [**put_constraint**](ConstraintApi.md#put_constraint) | **PUT** /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} |
11
+
12
+
13
+ # **create_constraint**
14
+ > Constraint create_constraint(flag_id, segment_id, body)
15
+
16
+
17
+
18
+ ### Example
19
+ ```ruby
20
+ # load the gem
21
+ require 'rbflagr'
22
+
23
+ api_instance = Flagr::ConstraintApi.new
24
+
25
+ flag_id = 789 # Integer | numeric ID of the flag
26
+
27
+ segment_id = 789 # Integer | numeric ID of the segment
28
+
29
+ body = Flagr::CreateConstraintRequest.new # CreateConstraintRequest | create a constraint
30
+
31
+
32
+ begin
33
+ result = api_instance.create_constraint(flag_id, segment_id, body)
34
+ p result
35
+ rescue Flagr::ApiError => e
36
+ puts "Exception when calling ConstraintApi->create_constraint: #{e}"
37
+ end
38
+ ```
39
+
40
+ ### Parameters
41
+
42
+ Name | Type | Description | Notes
43
+ ------------- | ------------- | ------------- | -------------
44
+ **flag_id** | **Integer**| numeric ID of the flag |
45
+ **segment_id** | **Integer**| numeric ID of the segment |
46
+ **body** | [**CreateConstraintRequest**](CreateConstraintRequest.md)| create a constraint |
47
+
48
+ ### Return type
49
+
50
+ [**Constraint**](Constraint.md)
51
+
52
+ ### Authorization
53
+
54
+ No authorization required
55
+
56
+ ### HTTP request headers
57
+
58
+ - **Content-Type**: application/json
59
+ - **Accept**: application/json
60
+
61
+
62
+
63
+ # **delete_constraint**
64
+ > delete_constraint(flag_id, segment_id, constraint_id)
65
+
66
+
67
+
68
+ ### Example
69
+ ```ruby
70
+ # load the gem
71
+ require 'rbflagr'
72
+
73
+ api_instance = Flagr::ConstraintApi.new
74
+
75
+ flag_id = 789 # Integer | numeric ID of the flag
76
+
77
+ segment_id = 789 # Integer | numeric ID of the segment
78
+
79
+ constraint_id = 789 # Integer | numeric ID of the constraint
80
+
81
+
82
+ begin
83
+ api_instance.delete_constraint(flag_id, segment_id, constraint_id)
84
+ rescue Flagr::ApiError => e
85
+ puts "Exception when calling ConstraintApi->delete_constraint: #{e}"
86
+ end
87
+ ```
88
+
89
+ ### Parameters
90
+
91
+ Name | Type | Description | Notes
92
+ ------------- | ------------- | ------------- | -------------
93
+ **flag_id** | **Integer**| numeric ID of the flag |
94
+ **segment_id** | **Integer**| numeric ID of the segment |
95
+ **constraint_id** | **Integer**| numeric ID of the constraint |
96
+
97
+ ### Return type
98
+
99
+ nil (empty response body)
100
+
101
+ ### Authorization
102
+
103
+ No authorization required
104
+
105
+ ### HTTP request headers
106
+
107
+ - **Content-Type**: application/json
108
+ - **Accept**: application/json
109
+
110
+
111
+
112
+ # **find_constraints**
113
+ > Array<Constraint> find_constraints(flag_id, segment_id)
114
+
115
+
116
+
117
+ ### Example
118
+ ```ruby
119
+ # load the gem
120
+ require 'rbflagr'
121
+
122
+ api_instance = Flagr::ConstraintApi.new
123
+
124
+ flag_id = 789 # Integer | numeric ID of the flag
125
+
126
+ segment_id = 789 # Integer | numeric ID of the segment
127
+
128
+
129
+ begin
130
+ result = api_instance.find_constraints(flag_id, segment_id)
131
+ p result
132
+ rescue Flagr::ApiError => e
133
+ puts "Exception when calling ConstraintApi->find_constraints: #{e}"
134
+ end
135
+ ```
136
+
137
+ ### Parameters
138
+
139
+ Name | Type | Description | Notes
140
+ ------------- | ------------- | ------------- | -------------
141
+ **flag_id** | **Integer**| numeric ID of the flag |
142
+ **segment_id** | **Integer**| numeric ID of the segment |
143
+
144
+ ### Return type
145
+
146
+ [**Array<Constraint>**](Constraint.md)
147
+
148
+ ### Authorization
149
+
150
+ No authorization required
151
+
152
+ ### HTTP request headers
153
+
154
+ - **Content-Type**: application/json
155
+ - **Accept**: application/json
156
+
157
+
158
+
159
+ # **put_constraint**
160
+ > Constraint put_constraint(flag_id, segment_id, constraint_id, body)
161
+
162
+
163
+
164
+ ### Example
165
+ ```ruby
166
+ # load the gem
167
+ require 'rbflagr'
168
+
169
+ api_instance = Flagr::ConstraintApi.new
170
+
171
+ flag_id = 789 # Integer | numeric ID of the flag
172
+
173
+ segment_id = 789 # Integer | numeric ID of the segment
174
+
175
+ constraint_id = 789 # Integer | numeric ID of the constraint
176
+
177
+ body = Flagr::CreateConstraintRequest.new # CreateConstraintRequest | create a constraint
178
+
179
+
180
+ begin
181
+ result = api_instance.put_constraint(flag_id, segment_id, constraint_id, body)
182
+ p result
183
+ rescue Flagr::ApiError => e
184
+ puts "Exception when calling ConstraintApi->put_constraint: #{e}"
185
+ end
186
+ ```
187
+
188
+ ### Parameters
189
+
190
+ Name | Type | Description | Notes
191
+ ------------- | ------------- | ------------- | -------------
192
+ **flag_id** | **Integer**| numeric ID of the flag |
193
+ **segment_id** | **Integer**| numeric ID of the segment |
194
+ **constraint_id** | **Integer**| numeric ID of the constraint |
195
+ **body** | [**CreateConstraintRequest**](CreateConstraintRequest.md)| create a constraint |
196
+
197
+ ### Return type
198
+
199
+ [**Constraint**](Constraint.md)
200
+
201
+ ### Authorization
202
+
203
+ No authorization required
204
+
205
+ ### HTTP request headers
206
+
207
+ - **Content-Type**: application/json
208
+ - **Accept**: application/json
209
+
210
+
211
+
@@ -0,0 +1,10 @@
1
+ # Flagr::CreateConstraintRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **property** | **String** | |
7
+ **operator** | **String** | |
8
+ **value** | **String** | |
9
+
10
+
@@ -0,0 +1,8 @@
1
+ # Flagr::CreateFlagRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **description** | **String** | |
7
+
8
+
@@ -0,0 +1,9 @@
1
+ # Flagr::CreateSegmentRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **description** | **String** | |
7
+ **rollout_percent** | **Integer** | |
8
+
9
+
@@ -0,0 +1,9 @@
1
+ # Flagr::CreateVariantRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **key** | **String** | |
7
+ **attachment** | **Object** | | [optional]
8
+
9
+