diff --git a/examples/groups/create_group.py b/examples/groups/create_group.py new file mode 100644 index 0000000..8669597 --- /dev/null +++ b/examples/groups/create_group.py @@ -0,0 +1,17 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +# The name of the group you're creating +group_name = + +# Create a Stax groups +teams = StaxClient("teams") +response = teams.CreateGroup( + Name=group_name +) +print(response) diff --git a/examples/groups/delete_group.py b/examples/groups/delete_group.py new file mode 100644 index 0000000..85b69f3 --- /dev/null +++ b/examples/groups/delete_group.py @@ -0,0 +1,17 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +# Id of the group to delete +group_id = + +# Create a Stax groups +teams = StaxClient("teams") +response = teams.DeleteGroup( + group_id=group_id +) +print(response) diff --git a/examples/groups/update_group.py b/examples/groups/update_group.py new file mode 100644 index 0000000..aa9fce7 --- /dev/null +++ b/examples/groups/update_group.py @@ -0,0 +1,21 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +# Id of the group to update +group_id = + +# Name to rename the group +group_name = + +# Create a Stax groups +teams = StaxClient("teams") +response = teams.UpdateGroup( + group_id=group_id, + Name=group_name +) +print(response) diff --git a/examples/groups/update_group_members.py b/examples/groups/update_group_members.py new file mode 100644 index 0000000..d2a7b83 --- /dev/null +++ b/examples/groups/update_group_members.py @@ -0,0 +1,22 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +# An array of user memberships dicts to enableor an empty array +# Properties: GroupId(string), UserId(string) +user_membership_to_add = + +# An array of user memberships dicts to disable or an empty arry +user_membership_to_remove = + +# Create a Stax groups +teams = StaxClient("teams") +response = teams.UpdateGroupMembers( + AddMembers = user_membership_to_add, + RemoveMembers = user_membership_to_remove +) +print(response) diff --git a/examples/policy/create_policy.py b/examples/policy/create_policy.py new file mode 100644 index 0000000..dcd43fd --- /dev/null +++ b/examples/policy/create_policy.py @@ -0,0 +1,22 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +policy_name = + +policy_description = + +policy = + +# Create a policy +organisations = StaxClient("organisations") +response = organisations.CreatePolicy( + Name=policy_name, + Description=policy_description, + Policy=policy +) +print(response) diff --git a/examples/policy/delete_policy.py b/examples/policy/delete_policy.py new file mode 100644 index 0000000..1ef0283 --- /dev/null +++ b/examples/policy/delete_policy.py @@ -0,0 +1,16 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +policy_id = + +# Delete a policy +organisations = StaxClient("organisations") +response = organisations.DeletePolicy( + policy_id = policy_id, +) +print(response) diff --git a/examples/policy/update_policy.py b/examples/policy/update_policy.py new file mode 100644 index 0000000..2eba270 --- /dev/null +++ b/examples/policy/update_policy.py @@ -0,0 +1,23 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +# The policy to be updated +policy_id = + +policy_description = + +policy = + +# Update a policy +organisations = StaxClient("organisations") +response = organisations.UpdatePolicy( + policy_id = policy_id, + Description=policy_description, + Policy=policy, +) +print(response) diff --git a/examples/users/create_user.py b/examples/users/create_user.py new file mode 100644 index 0000000..a26bb17 --- /dev/null +++ b/examples/users/create_user.py @@ -0,0 +1,25 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +# The user's first name +first_name = + +# The user's second name +last_name = + +# The email for the user +user_email = + +# Create a Stax User +teams = StaxClient("teams") +response = teams.CreateUser( + FirstName = first_name, + LastName = last_name, + Email = user_email +) +print(response) diff --git a/examples/users/reset_password.py b/examples/users/reset_password.py new file mode 100644 index 0000000..51a3a22 --- /dev/null +++ b/examples/users/reset_password.py @@ -0,0 +1,16 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +# The user id that needs a reset +user_id = + +teams = StaxClient("teams") +response = teams.UpdateUserPassword( + user_id=user_id +) +print(response) \ No newline at end of file diff --git a/examples/users/update_user.py b/examples/users/update_user.py new file mode 100644 index 0000000..4818467 --- /dev/null +++ b/examples/users/update_user.py @@ -0,0 +1,24 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +# The user id to resend invite +user_id = + +# Not required just show how properties are changed +user_role = +user_status = + + +# Update a Stax User +teams = StaxClient("teams") +response = teams.UpdateUser( + user_id = user_id, + Role = user_role, + Status = user_status +) +print(response) \ No newline at end of file diff --git a/examples/users/update_user_invite.py b/examples/users/update_user_invite.py new file mode 100644 index 0000000..f984475 --- /dev/null +++ b/examples/users/update_user_invite.py @@ -0,0 +1,16 @@ +import os + +from staxapp.config import Config +from staxapp.openapi import StaxClient + +Config.access_key = os.getenv("STAX_ACCESS_KEY") +Config.secret_key = os.getenv("STAX_SECRET_KEY") + +# The user id to resend invite +user_id = + +teams = StaxClient("teams") +response = teams.UpdateUserInvite( + user_id= user_id +) +print(response) \ No newline at end of file