Exemplo n.º 1
0
 def DeleteUserDigitalWallet(self, label, username, query_params=None):
     """
     Delete a BankAccount
     It is method for DELETE /users/{username}/digitalwallet/{label}
     """
     uri = self.url + "users/" + username + "/digitalwallet/" + label
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
Exemplo n.º 2
0
 def GetOrganizationAPIKeyLabels(self, globalid, query_params=None):
     """
     Get the list of active api keys.
     It is method for GET /organizations/{globalid}/apikeys
     """
     uri = self.url + "/organizations/" + globalid + "/apikeys"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
Exemplo n.º 3
0
 def DeleteOrganizationAPIKey(self, label, globalid, query_params=None):
     """
     Removes an API key
     It is method for DELETE /organizations/{globalid}/apikeys/{label}
     """
     uri = self.url + "organizations/" + globalid + "/apikeys/" + label
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
Exemplo n.º 4
0
 def GetOrganizationContracts(self, globalid, query_params=None):
     """
     Get the contracts where the organization is 1 of the parties. Order descending by date.
     It is method for GET /organizations/{globalid}/contracts
     """
     uri = self.url + "/organizations/" + globalid + "/contracts"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
Exemplo n.º 5
0
 def GetPendingOrganizationInvitations(self, globalid, query_params=None):
     """
     Get the list of pending invitations for users to join this organization.
     It is method for GET /organizations/{globalid}/invitations
     """
     uri = self.url + "organizations/" + globalid + "/invitations"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
Exemplo n.º 6
0
 def RejectMembership(self, globalid, role, username, query_params=None):
     """
     Reject membership invitation in an organization.
     It is method for DELETE /users/{username}/organizations/{globalid}/roles/{role}
     """
     uri = self.url + "/users/" + username + "/organizations/" + globalid + "/roles/" + role
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
Exemplo n.º 7
0
 def AddOrganizationOwner(self, data, globalid, query_params=None):
     """
     Invite a user to become owner of an organization.
     It is method for POST /organizations/{globalid}/owners
     """
     uri = self.url + "organizations/" + globalid + "/owners"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
Exemplo n.º 8
0
 def VerifyPhoneNumber(self, data, label, username, query_params=None):
     """
     Verifies a phone number
     It is method for PUT /users/{username}/phonenumbers/{label}/validate
     """
     uri = self.url + "users/" + username + "/phonenumbers/" + label + "/validate"
     uri = uri + build_query_string(query_params)
     return self.session.put(uri, json=data)
Exemplo n.º 9
0
 def GetUserContracts(self, username, query_params=None):
     """
     Get the contracts where the user is 1 of the parties. Order descending by date.
     It is method for GET /users/{username}/contracts
     """
     uri = self.url + "users/" + username + "/contracts"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
Exemplo n.º 10
0
 def DeleteUserPublicKey(self, label, username, query_params=None):
     """
     Delete a BankAccount
     It is method for DELETE /users/{username}/publickeys/{label}
     """
     uri = self.url + "users/" + username + "/publickeys/" + label
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
Exemplo n.º 11
0
 def DeleteUserPhonenumber(self, label, username, query_params=None):
     """
     Removes a phonenumber
     It is method for DELETE /users/{username}/phonenumbers/{label}
     """
     uri = self.url + "users/" + username + "/phonenumbers/" + label
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
Exemplo n.º 12
0
 def UpdateUserPublicKey(self, data, label, username, query_params=None):
     """
     Update an existing bankaccount and label.
     It is method for PUT /users/{username}/publickeys/{label}
     """
     uri = self.url + "users/" + username + "/publickeys/" + label
     uri = uri + build_query_string(query_params)
     return self.session.put(uri, json=data)
Exemplo n.º 13
0
 def RegisterUserPublicKey(self, data, username, query_params=None):
     """
     Create new bank account
     It is method for POST /users/{username}/publickeys
     """
     uri = self.url + "users/" + username + "/publickeys"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
Exemplo n.º 14
0
 def AcceptMembership(self, globalid, role, username, query_params=None):
     """
     Accept membership in organization
     It is method for POST /users/{username}/organizations/{globalid}/roles/{role}
     """
     uri = self.url + "users/" + username + "/organizations/" + globalid + "/roles/" + role
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json={})
Exemplo n.º 15
0
 def DeleteOrganization(self, globalid, query_params=None):
     """
     Delete organization by globalid.
     It is method for DELETE /organizations/{globalid}
     """
     uri = self.url + "organizations/" + globalid
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
Exemplo n.º 16
0
 def CreateUserContract(self, data, username, query_params=None):
     """
     Create a new contract.
     It is method for POST /users/{username}/contracts
     """
     uri = self.url + "users/" + username + "/contracts"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
Exemplo n.º 17
0
 def GetOrganizationUsers(self, globalid, query_params=None):
     """
     Get organization info
     It is method for GET /organizations/{globalid}/users
     """
     uri = self.url + "organizations/" + globalid + "/users"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
Exemplo n.º 18
0
 def GetAllAuthorizations(self, username, query_params=None):
     """
     Get the list of authorizations.
     It is method for GET /users/{username}/authorizations
     """
     uri = self.url + "users/" + username + "/authorizations"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
Exemplo n.º 19
0
 def AddOrganizationOrgowner(self, data, globalid, query_params=None):
     """
     Assign a member to organization.
     It is method for POST /organizations/{globalid}/orgowners
     """
     uri = self.url + "organizations/" + globalid + "/orgowners"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
Exemplo n.º 20
0
 def GetAuthorization(self, grantedTo, username, query_params=None):
     """
     Get the authorization for a specific organization.
     It is method for GET /users/{username}/authorizations/{grantedTo}
     """
     uri = self.url + "/users/" + username + "/authorizations/" + grantedTo
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
Exemplo n.º 21
0
 def RemoveOrganizationOwner(self, username, globalid, query_params=None):
     """
     Remove an owner from organization
     It is method for DELETE /organizations/{globalid}/owners/{username}
     """
     uri = self.url + "organizations/" + globalid + "/owners/" + username
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
Exemplo n.º 22
0
 def DeleteAuthorization(self, grantedTo, username, query_params=None):
     """
     Remove the authorization for an organization, the granted organization will no longer have access the user's information.
     It is method for DELETE /users/{username}/authorizations/{grantedTo}
     """
     uri = self.url + "users/" + username + "/authorizations/" + grantedTo
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
Exemplo n.º 23
0
 def CreateOrganizationContracts(self, data, globalid, query_params=None):
     """
     Create a new contract.
     It is method for POST /organizations/{globalid}/contracts
     """
     uri = self.url + "organizations/" + globalid + "/contracts"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
Exemplo n.º 24
0
 def CreateNewOrganization(self, data, query_params=None):
     """
     Create a new organization. 1 user should be in the owners list. Validation is performed to check if the securityScheme allows management on this user.
     It is method for POST /organizations
     """
     uri = self.url + "organizations"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
Exemplo n.º 25
0
 def LeaveOrganization(self, globalid, username, query_params=None):
     """
     Removes the user from an organization.
     It is method for DELETE /users/{username}/organizations/{globalid}/leave
     """
     uri = self.url + "users/" + username + "/organizations/" + globalid + "/leave"
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
Exemplo n.º 26
0
 def CreateNewSubOrganization(self, data, globalid, query_params=None):
     """
     Create a new suborganization.
     It is method for POST /organizations/{globalid}
     """
     uri = self.url + "organizations/" + globalid
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
Exemplo n.º 27
0
 def CreateNewOrganizationAPIKey(self, data, globalid, query_params=None):
     """
     Create a new API Key, a secret itself should not be provided, it will be generated serverside.
     It is method for POST /organizations/{globalid}/apikeys
     """
     uri = self.url + "organizations/" + globalid + "/apikeys"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
Exemplo n.º 28
0
 def UpdateOrganization(self, data, globalid, query_params=None):
     """
     Update organization info
     It is method for PUT /organizations/{globalid}
     """
     uri = self.url + "organizations/" + globalid
     uri = uri + build_query_string(query_params)
     return self.session.put(uri, json=data)
Exemplo n.º 29
0
 def GetOrganizationRegistry(self, key, globalid, query_params=None):
     """
     Get the list of active registry.
     It is method for GET /organizations/{globalid}/registry
     """
     uri = self.url + "organizations/" + globalid + "/registry/" + key
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
Exemplo n.º 30
0
 def RegisterDigitalWallet(self, data, username, query_params=None):
     """
     Create new bank account
     It is method for POST /users/{username}/digitalwallet
     """
     uri = self.url + "users/" + username + "/digitalwallet"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)