Skip to content

Commit 52309df

Browse files
committed
updated to version 3.1.12
1 parent a4b7542 commit 52309df

File tree

7 files changed

+39
-11
lines changed

7 files changed

+39
-11
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@
3333
- Added scope options for admin api
3434
3.1.11 (Dec 13, 2023)
3535
- Added ability to get individual flag definitions with the `get_definition` method of splitDefinition
36+
3.1.12 (Jan 13, 2024)
37+
- Added ability to retrieve API keys when creating an environment

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "splitapiclient"
7-
version = "3.1.11"
7+
version = "3.1.12"
88
description = "This Python Library provide full support for Split REST Admin API, allow creating, deleting and editing Environments, Splits, Split Definitions, Segments, Segment Keys, Users, Groups, API Keys, Change Requests, Attributes and Identities"
99
classifiers = [
1010
"Programming Language :: Python :: 3",
@@ -24,7 +24,11 @@ authors = [
2424
maintainers = [
2525
{name = "Josh Klein", email = "[email protected]"}
2626
]
27-
27+
dependencies = [
28+
'argparse >= 1.1',
29+
'requests >= 2.14.2',
30+
'six >= 1.10.0',
31+
]
2832

2933
[project.license]
3034
text = "Apache License 2.0"

splitapiclient/resources/environment.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,16 @@ class Environment(BaseResource):
2020
},
2121
"environmentType" : "string",
2222
"workspaceIds" : [ "string" ],
23+
2324
"name" : "string",
25+
"apiTokens" : [
26+
{
27+
"name" : "string",
28+
"type" : "string",
29+
"id" : "id",
30+
"apiKeyType" : "string"
31+
}
32+
],
2433
"changePermissions" : {
2534
"areApproversRestricted" : False,
2635
"allowKills" : False,
@@ -59,8 +68,13 @@ def __init__(self, data=None, workspace_id=None, client=None):
5968
self._type = data.get('type')
6069
self._orgId = data.get('orgId')
6170
self._changePermissions = data.get("changePermissions") if "changePermissions" in data else {}
71+
self._apiTokens = data.get("apiTokens") if "apiTokens" in data else {}
6272
self._client = client
6373

74+
@property
75+
def apiTokens(self):
76+
return self._apiTokens
77+
6478
@property
6579
def workspace_id(self):
6680
return self._workspace_id

splitapiclient/tests/microclients/environment_microclient_test.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def test_list(self, mocker):
2424
'changePermissions' : None,
2525
'type': None,
2626
'orgId' : None,
27-
'status' : None
27+
'status' : None,
28+
'apiTokens' : None
2829
}]
2930
SyncHttpClient.make_request.return_value = data
3031
result = emc.list('ws_id')
@@ -67,7 +68,8 @@ def test_update(self, mocker):
6768
'changePermissions' : None,
6869
'type': None,
6970
'orgId' : None,
70-
'status' : None
71+
'status' : None,
72+
'apiTokens' : None
7173
}
7274
SyncHttpClient.make_request.return_value = data
7375
result = emc.update('env_1', 'ws_1', 'name', 'env_new')
@@ -89,7 +91,8 @@ def test_update(self, mocker):
8991
'changePermissions' : None,
9092
'type': None,
9193
'orgId' : None,
92-
'status' : None
94+
'status' : None,
95+
'apiTokens' : None
9396
}
9497
assert response == result.to_dict()
9598

@@ -111,7 +114,8 @@ def test_add(self, mocker):
111114
'changePermissions' : None,
112115
'type': None,
113116
'orgId' : None,
114-
'status' : None
117+
'status' : None,
118+
'apiTokens' : None
115119
}
116120
SyncHttpClient.make_request.return_value = data
117121
result = emc.add(data, 'ws_1')
@@ -131,6 +135,7 @@ def test_add(self, mocker):
131135
'changePermissions' : None,
132136
'type': None,
133137
'orgId' : None,
134-
'status' : None
138+
'status' : None,
139+
'apiTokens' : None
135140
}
136141
assert response == result.to_dict()

splitapiclient/tests/resources/test_environment.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def test_update(self, mocker):
7676
'changePermissions' : None,
7777
'type': None,
7878
'orgId' : None,
79-
'status' : None
79+
'status' : None,
80+
'apiTokens' : None
8081
}
8182
http_client_mock.make_request.return_value = data
8283
env = Environment(
@@ -91,7 +92,8 @@ def test_update(self, mocker):
9192
'changePermissions' : None,
9293
'type': None,
9394
'orgId' : None,
94-
'status' : None
95+
'status' : None,
96+
'apiTokens' : None
9597
},
9698
'ws_id',
9799
http_client_mock

splitapiclient/tests/resources/test_workspace.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def test_add_environment(self, mocker):
5959
'changePermissions' : None,
6060
'type': None,
6161
'orgId' : None,
62-
'status' : None
62+
'status' : None,
63+
'apiTokens' : None
6364
}
6465
http_client_mock = mocker.Mock(spec=BaseHttpClient)
6566
http_client_mock.make_request.return_value = data

splitapiclient/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.1.11'
1+
__version__ = '3.1.12'

0 commit comments

Comments
 (0)