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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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={})
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)