Skip to content

Commit 0962c8e

Browse files
committed
Initial Commit
0 parents  commit 0962c8e

File tree

110 files changed

+12371
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+12371
-0
lines changed

.gitignore

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
venv/
48+
.python-version
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
57+
# Sphinx documentation
58+
docs/_build/
59+
60+
# PyBuilder
61+
target/
62+
63+
#Ipython Notebook
64+
.ipynb_checkpoints

.swagger-codegen-ignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Swagger Codegen Ignore
2+
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

.swagger-codegen/VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.3.0-SNAPSHOT

.travis.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ref: https://docs.travis-ci.com/user/languages/python
2+
language: python
3+
python:
4+
- "2.7"
5+
- "3.2"
6+
- "3.3"
7+
- "3.4"
8+
- "3.5"
9+
#- "3.5-dev" # 3.5 development branch
10+
#- "nightly" # points to the latest development branch e.g. 3.6-dev
11+
# command to install dependencies
12+
install: "pip install -r requirements.txt"
13+
# command to run tests
14+
script: nosetests

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
gen:
2+
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
3+
-i /local/swagger.yaml \
4+
-l python \
5+
-o /local/ -c /local/swagger_py.json

README.md

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# flagr
2+
Flagr is a feature flagging, A/B testing and dynamic configuration microservice
3+
4+
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
5+
6+
- API version: 1.0.0
7+
- Package version: 0.1.0
8+
- Build package: io.swagger.codegen.languages.PythonClientCodegen
9+
10+
## Requirements.
11+
12+
Python 2.7 and 3.4+
13+
14+
## Installation & Usage
15+
### pip install
16+
17+
If the python package is hosted on Github, you can install directly from Github
18+
19+
```sh
20+
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
21+
```
22+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
23+
24+
Then import the package:
25+
```python
26+
import flagr
27+
```
28+
29+
### Setuptools
30+
31+
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
32+
33+
```sh
34+
python setup.py install --user
35+
```
36+
(or `sudo python setup.py install` to install the package for all users)
37+
38+
Then import the package:
39+
```python
40+
import flagr
41+
```
42+
43+
## Getting Started
44+
45+
Please follow the [installation procedure](#installation--usage) and then run the following:
46+
47+
```python
48+
from __future__ import print_function
49+
import time
50+
import flagr
51+
from flagr.rest import ApiException
52+
from pprint import pprint
53+
# create an instance of the API class
54+
api_instance = flagr.ConstraintApi()
55+
flag_id = 789 # int | numeric ID of the flag
56+
segment_id = 789 # int | numeric ID of the segment
57+
body = flagr.CreateConstraintRequest() # CreateConstraintRequest | create a constraint
58+
59+
try:
60+
api_response = api_instance.create_constraint(flag_id, segment_id, body)
61+
pprint(api_response)
62+
except ApiException as e:
63+
print("Exception when calling ConstraintApi->create_constraint: %s\n" % e)
64+
65+
```
66+
67+
## Documentation for API Endpoints
68+
69+
All URIs are relative to *http://localhost/api/v1*
70+
71+
Class | Method | HTTP request | Description
72+
------------ | ------------- | ------------- | -------------
73+
*ConstraintApi* | [**create_constraint**](docs/ConstraintApi.md#create_constraint) | **POST** /flags/{flagID}/segments/{segmentID}/constraints |
74+
*ConstraintApi* | [**delete_constraint**](docs/ConstraintApi.md#delete_constraint) | **DELETE** /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} |
75+
*ConstraintApi* | [**find_constraints**](docs/ConstraintApi.md#find_constraints) | **GET** /flags/{flagID}/segments/{segmentID}/constraints |
76+
*ConstraintApi* | [**put_constraint**](docs/ConstraintApi.md#put_constraint) | **PUT** /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} |
77+
*DistributionApi* | [**find_distributions**](docs/DistributionApi.md#find_distributions) | **GET** /flags/{flagID}/segments/{segmentID}/distributions |
78+
*DistributionApi* | [**put_distributions**](docs/DistributionApi.md#put_distributions) | **PUT** /flags/{flagID}/segments/{segmentID}/distributions |
79+
*EvaluationApi* | [**post_evaluation**](docs/EvaluationApi.md#post_evaluation) | **POST** /evaluation |
80+
*EvaluationApi* | [**post_evaluation_batch**](docs/EvaluationApi.md#post_evaluation_batch) | **POST** /evaluation/batch |
81+
*FlagApi* | [**create_flag**](docs/FlagApi.md#create_flag) | **POST** /flags |
82+
*FlagApi* | [**delete_flag**](docs/FlagApi.md#delete_flag) | **DELETE** /flags/{flagID} |
83+
*FlagApi* | [**find_flags**](docs/FlagApi.md#find_flags) | **GET** /flags |
84+
*FlagApi* | [**get_flag**](docs/FlagApi.md#get_flag) | **GET** /flags/{flagID} |
85+
*FlagApi* | [**get_flag_snapshots**](docs/FlagApi.md#get_flag_snapshots) | **GET** /flags/{flagID}/snapshots |
86+
*FlagApi* | [**put_flag**](docs/FlagApi.md#put_flag) | **PUT** /flags/{flagID} |
87+
*FlagApi* | [**set_flag_enabled**](docs/FlagApi.md#set_flag_enabled) | **PUT** /flags/{flagID}/enabled |
88+
*SegmentApi* | [**create_segment**](docs/SegmentApi.md#create_segment) | **POST** /flags/{flagID}/segments |
89+
*SegmentApi* | [**delete_segment**](docs/SegmentApi.md#delete_segment) | **DELETE** /flags/{flagID}/segments/{segmentID} |
90+
*SegmentApi* | [**find_segments**](docs/SegmentApi.md#find_segments) | **GET** /flags/{flagID}/segments |
91+
*SegmentApi* | [**put_segment**](docs/SegmentApi.md#put_segment) | **PUT** /flags/{flagID}/segments/{segmentID} |
92+
*SegmentApi* | [**put_segments_reorder**](docs/SegmentApi.md#put_segments_reorder) | **PUT** /flags/{flagID}/segments/reorder |
93+
*VariantApi* | [**create_variant**](docs/VariantApi.md#create_variant) | **POST** /flags/{flagID}/variants |
94+
*VariantApi* | [**delete_variant**](docs/VariantApi.md#delete_variant) | **DELETE** /flags/{flagID}/variants/{variantID} |
95+
*VariantApi* | [**find_variants**](docs/VariantApi.md#find_variants) | **GET** /flags/{flagID}/variants |
96+
*VariantApi* | [**put_variant**](docs/VariantApi.md#put_variant) | **PUT** /flags/{flagID}/variants/{variantID} |
97+
98+
99+
## Documentation For Models
100+
101+
- [Constraint](docs/Constraint.md)
102+
- [CreateConstraintRequest](docs/CreateConstraintRequest.md)
103+
- [CreateFlagRequest](docs/CreateFlagRequest.md)
104+
- [CreateSegmentRequest](docs/CreateSegmentRequest.md)
105+
- [CreateVariantRequest](docs/CreateVariantRequest.md)
106+
- [Distribution](docs/Distribution.md)
107+
- [Error](docs/Error.md)
108+
- [EvalContext](docs/EvalContext.md)
109+
- [EvalDebugLog](docs/EvalDebugLog.md)
110+
- [EvalResult](docs/EvalResult.md)
111+
- [EvaluationBatchRequest](docs/EvaluationBatchRequest.md)
112+
- [EvaluationBatchResponse](docs/EvaluationBatchResponse.md)
113+
- [EvaluationEntity](docs/EvaluationEntity.md)
114+
- [Flag](docs/Flag.md)
115+
- [FlagSnapshot](docs/FlagSnapshot.md)
116+
- [PutDistributionsRequest](docs/PutDistributionsRequest.md)
117+
- [PutFlagRequest](docs/PutFlagRequest.md)
118+
- [PutSegmentReorderRequest](docs/PutSegmentReorderRequest.md)
119+
- [PutSegmentRequest](docs/PutSegmentRequest.md)
120+
- [PutVariantRequest](docs/PutVariantRequest.md)
121+
- [Segment](docs/Segment.md)
122+
- [SegmentDebugLog](docs/SegmentDebugLog.md)
123+
- [SetFlagEnabledRequest](docs/SetFlagEnabledRequest.md)
124+
- [Variant](docs/Variant.md)
125+
126+
127+
## Documentation For Authorization
128+
129+
All endpoints do not require authorization.
130+
131+
132+
## Author
133+
134+
135+

docs/Constraint.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Constraint
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **int** | | [optional]
7+
**_property** | **str** | |
8+
**operator** | **str** | |
9+
**value** | **str** | |
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+

0 commit comments

Comments
 (0)