|
| 1 | +{ |
| 2 | + "environment_document": { |
| 3 | + "api_key": "B62qaMZNwfiqT76p38ggrQ", |
| 4 | + "name": "Test environment", |
| 5 | + "project": { |
| 6 | + "name": "Test project", |
| 7 | + "organisation": { |
| 8 | + "feature_analytics": false, |
| 9 | + "name": "Test Org", |
| 10 | + "id": 1, |
| 11 | + "persist_trait_data": true, |
| 12 | + "stop_serving_flags": false |
| 13 | + }, |
| 14 | + "id": 1, |
| 15 | + "hide_disabled_flags": false, |
| 16 | + "segments": [ |
| 17 | + { |
| 18 | + "id": 1, |
| 19 | + "name": "Test segment", |
| 20 | + "rules": [ |
| 21 | + { |
| 22 | + "type": "ALL", |
| 23 | + "rules": [ |
| 24 | + { |
| 25 | + "type": "ALL", |
| 26 | + "rules": [], |
| 27 | + "conditions": [ |
| 28 | + { |
| 29 | + "operator": "EQUAL", |
| 30 | + "property_": "foo", |
| 31 | + "value": "bar" |
| 32 | + } |
| 33 | + ] |
| 34 | + } |
| 35 | + ] |
| 36 | + } |
| 37 | + ] |
| 38 | + } |
| 39 | + ] |
| 40 | + }, |
| 41 | + "segment_overrides": [], |
| 42 | + "id": 1, |
| 43 | + "feature_states": [ |
| 44 | + { |
| 45 | + "feature_state_value": "some-value", |
| 46 | + "id": 1, |
| 47 | + "featurestate_uuid": "00000000-0000-0000-0000-000000000000", |
| 48 | + "feature": { |
| 49 | + "name": "some_feature", |
| 50 | + "type": "STANDARD", |
| 51 | + "id": 1 |
| 52 | + }, |
| 53 | + "segment_id": null, |
| 54 | + "enabled": true, |
| 55 | + "multivariate_feature_state_values": [] |
| 56 | + }, |
| 57 | + { |
| 58 | + "feature_state_value": "default_value", |
| 59 | + "django_id": 2, |
| 60 | + "featurestate_uuid": "11111111-1111-1111-1111-111111111111", |
| 61 | + "feature": { |
| 62 | + "name": "mv_feature_with_ids", |
| 63 | + "type": "MULTIVARIATE", |
| 64 | + "id": 2 |
| 65 | + }, |
| 66 | + "segment_id": null, |
| 67 | + "enabled": true, |
| 68 | + "multivariate_feature_state_values": [ |
| 69 | + { |
| 70 | + "id": 100, |
| 71 | + "multivariate_feature_option": { |
| 72 | + "id": 10, |
| 73 | + "value": "variant_a" |
| 74 | + }, |
| 75 | + "mv_fs_value_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", |
| 76 | + "percentage_allocation": 30.0 |
| 77 | + }, |
| 78 | + { |
| 79 | + "id": 200, |
| 80 | + "multivariate_feature_option": { |
| 81 | + "id": 20, |
| 82 | + "value": "variant_b" |
| 83 | + }, |
| 84 | + "mv_fs_value_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", |
| 85 | + "percentage_allocation": 70.0 |
| 86 | + } |
| 87 | + ] |
| 88 | + }, |
| 89 | + { |
| 90 | + "feature_state_value": "fallback_value", |
| 91 | + "django_id": 3, |
| 92 | + "featurestate_uuid": "22222222-2222-2222-2222-222222222222", |
| 93 | + "feature": { |
| 94 | + "name": "mv_feature_without_ids", |
| 95 | + "type": "MULTIVARIATE", |
| 96 | + "id": 3 |
| 97 | + }, |
| 98 | + "segment_id": null, |
| 99 | + "enabled": false, |
| 100 | + "multivariate_feature_state_values": [ |
| 101 | + { |
| 102 | + "multivariate_feature_option": { |
| 103 | + "id": 40, |
| 104 | + "value": "option_y" |
| 105 | + }, |
| 106 | + "mv_fs_value_uuid": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy", |
| 107 | + "percentage_allocation": 50.0 |
| 108 | + }, |
| 109 | + { |
| 110 | + "multivariate_feature_option": { |
| 111 | + "id": 30, |
| 112 | + "value": "option_x" |
| 113 | + }, |
| 114 | + "mv_fs_value_uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", |
| 115 | + "percentage_allocation": 25.0 |
| 116 | + }, |
| 117 | + { |
| 118 | + "multivariate_feature_option": { |
| 119 | + "id": 50, |
| 120 | + "value": "option_z" |
| 121 | + }, |
| 122 | + "mv_fs_value_uuid": "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz", |
| 123 | + "percentage_allocation": 25.0 |
| 124 | + } |
| 125 | + ] |
| 126 | + } |
| 127 | + ], |
| 128 | + "identity_overrides": [ |
| 129 | + { |
| 130 | + "identifier": "overridden-id", |
| 131 | + "identity_uuid": "0f21cde8-63c5-4e50-baca-87897fa6cd01", |
| 132 | + "created_date": "2019-08-27T14:53:45.698555Z", |
| 133 | + "updated_at": "2023-07-14 16:12:00.000000", |
| 134 | + "environment_api_key": "B62qaMZNwfiqT76p38ggrQ", |
| 135 | + "identity_features": [ |
| 136 | + { |
| 137 | + "id": 1, |
| 138 | + "feature": { |
| 139 | + "id": 1, |
| 140 | + "name": "some_feature", |
| 141 | + "type": "STANDARD" |
| 142 | + }, |
| 143 | + "featurestate_uuid": "1bddb9a5-7e59-42c6-9be9-625fa369749f", |
| 144 | + "feature_state_value": "some-overridden-value", |
| 145 | + "enabled": false, |
| 146 | + "environment": 1, |
| 147 | + "identity": null, |
| 148 | + "feature_segment": null |
| 149 | + } |
| 150 | + ] |
| 151 | + } |
| 152 | + ] |
| 153 | + }, |
| 154 | + "expected_evaluation_context": { |
| 155 | + "environment": { |
| 156 | + "key": "B62qaMZNwfiqT76p38ggrQ", |
| 157 | + "name": "Test environment" |
| 158 | + }, |
| 159 | + "identity": null, |
| 160 | + "segments": { |
| 161 | + "0": { |
| 162 | + "key": "1", |
| 163 | + "name": "Test segment", |
| 164 | + "rules": [ |
| 165 | + { |
| 166 | + "type": "ALL", |
| 167 | + "conditions": [], |
| 168 | + "rules": [ |
| 169 | + { |
| 170 | + "type": "ALL", |
| 171 | + "conditions": [ |
| 172 | + { |
| 173 | + "property": "foo", |
| 174 | + "operator": "EQUAL", |
| 175 | + "value": "bar" |
| 176 | + } |
| 177 | + ], |
| 178 | + "rules": [] |
| 179 | + } |
| 180 | + ] |
| 181 | + } |
| 182 | + ], |
| 183 | + "overrides": [], |
| 184 | + "metadata": { |
| 185 | + "source": "api", |
| 186 | + "id": 1 |
| 187 | + } |
| 188 | + }, |
| 189 | + "1011e8db6ebc6fc7d7ad32c3c49e6b2b79ea110abfd8bb9eaa0a228e1b924a74": { |
| 190 | + "key": "", |
| 191 | + "name": "identity_overrides", |
| 192 | + "rules": [ |
| 193 | + { |
| 194 | + "type": "ALL", |
| 195 | + "conditions": [ |
| 196 | + { |
| 197 | + "property": "$.identity.identifier", |
| 198 | + "operator": "IN", |
| 199 | + "value": ["overridden-id"] |
| 200 | + } |
| 201 | + ], |
| 202 | + "rules": null |
| 203 | + } |
| 204 | + ], |
| 205 | + "overrides": [ |
| 206 | + { |
| 207 | + "key": "", |
| 208 | + "name": "some_feature", |
| 209 | + "enabled": false, |
| 210 | + "value": "some-overridden-value", |
| 211 | + "priority": "-INF", |
| 212 | + "variants": null, |
| 213 | + "metadata": { |
| 214 | + "id": 1 |
| 215 | + } |
| 216 | + } |
| 217 | + ], |
| 218 | + "metadata": { |
| 219 | + "source": "identity_override" |
| 220 | + } |
| 221 | + } |
| 222 | + }, |
| 223 | + "features": { |
| 224 | + "some_feature": { |
| 225 | + "key": "00000000-0000-0000-0000-000000000000", |
| 226 | + "name": "some_feature", |
| 227 | + "enabled": true, |
| 228 | + "value": "some-value", |
| 229 | + "priority": null, |
| 230 | + "variants": [], |
| 231 | + "metadata": { |
| 232 | + "id": 1 |
| 233 | + } |
| 234 | + }, |
| 235 | + "mv_feature_with_ids": { |
| 236 | + "key": "2", |
| 237 | + "name": "mv_feature_with_ids", |
| 238 | + "enabled": true, |
| 239 | + "value": "default_value", |
| 240 | + "priority": null, |
| 241 | + "variants": [ |
| 242 | + { |
| 243 | + "value": "variant_a", |
| 244 | + "weight": 30.0, |
| 245 | + "priority": 100 |
| 246 | + }, |
| 247 | + { |
| 248 | + "value": "variant_b", |
| 249 | + "weight": 70.0, |
| 250 | + "priority": 200 |
| 251 | + } |
| 252 | + ], |
| 253 | + "metadata": { |
| 254 | + "id": 2 |
| 255 | + } |
| 256 | + }, |
| 257 | + "mv_feature_without_ids": { |
| 258 | + "key": "3", |
| 259 | + "name": "mv_feature_without_ids", |
| 260 | + "enabled": false, |
| 261 | + "value": "fallback_value", |
| 262 | + "priority": null, |
| 263 | + "variants": [ |
| 264 | + { |
| 265 | + "value": "option_y", |
| 266 | + "weight": 50.0, |
| 267 | + "priority": 1 |
| 268 | + }, |
| 269 | + { |
| 270 | + "value": "option_x", |
| 271 | + "weight": 25.0, |
| 272 | + "priority": 0 |
| 273 | + }, |
| 274 | + { |
| 275 | + "value": "option_z", |
| 276 | + "weight": 25.0, |
| 277 | + "priority": 2 |
| 278 | + } |
| 279 | + ], |
| 280 | + "metadata": { |
| 281 | + "id": 3 |
| 282 | + } |
| 283 | + } |
| 284 | + } |
| 285 | + } |
| 286 | +} |
0 commit comments