Documentation ¶
Index ¶
- type Account
- type AccountLink
- type AccountLinkRequest
- type AccountList
- type AccountMembership
- type AccountMembershipsResponse
- type AddMemberToAgencyAccountEvent
- type AddMemberToBusinessAccountInput
- type AddMemberToCelebrityAccountInput
- type AddMemberToEnterpriseAccountEvent
- type AddMemberToEnterpriseAccountInput
- type AddMemberToGovernmentAccountInput
- type AddSanctionedCountryInput
- type Agency
- type AssignPermissionToRoleEvent
- type AssignPermissionToRoleInput
- type AssignRoleData
- type AssignRoleInput
- type Business
- type Celebrity
- type CheckPasswordHashData
- type CheckUserAuthorizationError
- type Client
- func (c *Client) AddMemberToAgencyAccount(e AddMemberToAgencyAccountEvent) error
- func (c *Client) AddMemberToBusinessAccount(input AddMemberToBusinessAccountInput) error
- func (c *Client) AddMemberToCelebrityAccount(input AddMemberToCelebrityAccountInput) error
- func (c *Client) AddMemberToEnterpriseAccount(input AddMemberToEnterpriseAccountInput) error
- func (c *Client) AddMemberToGovernmentAccount(input AddMemberToGovernmentAccountInput) error
- func (c *Client) AddRoleToUser(userID, roleID uuid.UUID) error
- func (c *Client) AddSanctionedCountry(input AddSanctionedCountryInput) error
- func (c *Client) AssignPermissionToRole(input AssignPermissionToRoleInput) error
- func (c *Client) AssignRoleToServiceAccount(input AssignRoleInput) error
- func (c *Client) AssignRoleToUser(data *AssignRoleData) error
- func (c *Client) CheckPasswordHash(data *CheckPasswordHashData) (bool, error)
- func (c *Client) CheckUserAuthorization(ctx context.Context, token, permission string) (bool, error)
- func (c *Client) CreateAccount(input CreateAccountInput) (*Account, error)
- func (c *Client) CreateAccountLink(alr AccountLinkRequest) (*AccountLink, error)
- func (c *Client) CreateAccountMembership(accountMembership *AccountMembership) (*AccountMembership, error)
- func (c *Client) CreateAgencyAccount(input CreateAgencyAccountInput) (*Agency, error)
- func (c *Client) CreateBusinessAccount(input CreateBusinessAccountInput) (*Business, error)
- func (c *Client) CreateCelebrityAccount(input CreateCelebrityAccountInput) (*Celebrity, error)
- func (c *Client) CreateEnterpriseAccount(input CreateEnterpriseAccountInput) (*Enterprise, error)
- func (c *Client) CreateGovernmentAccount(input CreateGovernmentAccountInput) (*Government, error)
- func (c *Client) CreateMetadataKey(input CreateMetadataKeyInput) (*MetadataKey, error)
- func (c *Client) CreatePermission(input CreatePermissionInput) (*Permission, error)
- func (c *Client) CreateRole(input *CreateRoleInput) (*Role, error)
- func (c *Client) CreateToken(input CreateTokenInput) (*Token, error)
- func (c *Client) CreateUser(data *User) error
- func (c *Client) CreateUserMetadata(metadata *UserMetadata) error
- func (c *Client) DeleteAccount(accountID uuid.UUID) error
- func (c *Client) DeleteAccountLink(accountLinkRequest *AccountLinkRequest) error
- func (c *Client) DeleteAccountMembership(accountID uuid.UUID, userID uuid.UUID) error
- func (c *Client) DeleteAgencyAccount(agencyID uuid.UUID) error
- func (c *Client) DeleteBusinessAccount(businessID uuid.UUID) error
- func (c *Client) DeleteCelebrityAccount(userID uuid.UUID, celebrityID uuid.UUID) error
- func (c *Client) DeleteEnterpriseAccount(enterpriseID uuid.UUID) error
- func (c *Client) DeleteExpiredTokens() error
- func (c *Client) DeleteGovernmentAccount(accountID uuid.UUID) error
- func (c *Client) DeleteMetadataKey(input DeleteMetadataKeyInput) error
- func (c *Client) DeletePermission(input DeletePermissionInput) error
- func (c *Client) DeleteRole(input *DeleteRoleInput) error
- func (c *Client) DeleteServiceAccount(serviceAccountID uuid.UUID) error
- func (c *Client) DeleteToken(input DeleteTokenInput) error
- func (c *Client) DeleteTokensByUserID(input DeleteTokensByUserIDInput) error
- func (c *Client) DeleteUser(userID uuid.UUID) error
- func (c *Client) DeleteUserMetadataByID(id uuid.UUID) error
- func (c *Client) DeleteUserMetadataByKey(userID uuid.UUID, key string) error
- func (c *Client) DeleteUserMetadataByUserID(userID uuid.UUID) error
- func (c *Client) DisableTwoFactorAuthentication(data DisableTwoFactorAuthenticationInput) error
- func (c *Client) DoesPermissionExist(input *DoesPermissionExistInput) (bool, error)
- func (c *Client) DoesRoleExist(input DoesRoleExistInput) (bool, error)
- func (c *Client) EnableTwoFactorAuthentication(data EnableTwoFactorAuthenticationInput) error
- func (ac *Client) GetAccount()
- func (c *Client) GetAccountByField(fieldName string, fieldValue uuid.UUID) (*Account, error)
- func (c *Client) GetAccountLink(userID uuid.UUID, accountID uuid.UUID) (*AccountLink, error)
- func (c *Client) GetAccountLinksByAccountID(accountID uuid.UUID) ([]AccountLink, error)
- func (c *Client) GetAccountLinksByAccountType(accountType string) ([]AccountLink, error)
- func (c *Client) GetAccountLinksByUserID(userID uuid.UUID) ([]AccountLink, error)
- func (c *Client) GetAccountMembershipByID(id uuid.UUID) (*AccountMembership, error)
- func (c *Client) GetAccountMembershipsByAccountID(accountID uuid.UUID) (*AccountMembershipsResponse, error)
- func (c *Client) GetAccountMembershipsByAccountType(accountType string) ([]AccountMembership, error)
- func (c *Client) GetAccountMembershipsByUserID(userID uuid.UUID) ([]AccountMembership, error)
- func (ac *Client) GetAccountType()
- func (c *Client) GetAgencyAccountByID(agencyID uuid.UUID) (*Agency, error)
- func (c *Client) GetAgencyAccountsByUserID(userID uuid.UUID) ([]Agency, error)
- func (c *Client) GetBusinessAccountByID(businessID uuid.UUID) (*Business, error)
- func (c *Client) GetBusinessAccountsByUserID(userID uuid.UUID) ([]Business, error)
- func (c *Client) GetCelebrityAccountByID(celebrityID uuid.UUID) (*Celebrity, error)
- func (c *Client) GetCelebrityAccountsByUserID(userID uuid.UUID) ([]Celebrity, error)
- func (c *Client) GetEnterpriseAccountByID(enterpriseID uuid.UUID) (*Enterprise, error)
- func (c *Client) GetEnterpriseAccountsByUserID(userID uuid.UUID) ([]Enterprise, error)
- func (c *Client) GetGovernmentAccountByID(governmentID uuid.UUID) (*Government, error)
- func (c *Client) GetGovernmentAccountsByUserID(userID uuid.UUID) ([]Government, error)
- func (c *Client) GetLinkedAccountsForUser(userID uuid.UUID) ([]AccountLink, error)
- func (c *Client) GetMembersOfAccount(accountID uuid.UUID) ([]uuid.UUID, error)
- func (c *Client) GetMembersOfAgencyAccount(agencyID uuid.UUID) ([]AccountMembership, error)
- func (c *Client) GetMembersOfBusinessAccount(businessId uuid.UUID) ([]AccountMembership, error)
- func (c *Client) GetMembersOfCelebrityAccount(celebrityID uuid.UUID) ([]AccountMembership, error)
- func (c *Client) GetMembersOfEnterpriseAccount(enterpriseID uuid.UUID) (*EnterpriseMembers, error)
- func (c *Client) GetMembersOfGovernmentAccount(input GetMembersOfGovernmentAccountInput) ([]AccountMembership, error)
- func (c *Client) GetMetadataKeyByID(input GetMetadataKeyByIDInput) (*UserMetadata, error)
- func (c *Client) GetMetadataKeyByKeyName(input GetMetadataKeyByKeyNameInput) (*MetadataKey, error)
- func (c *Client) GetPermissionByID(input GetPermissionByIDInput) (*Permission, error)
- func (c *Client) GetPermissionByName(input GetPermissionByNameInput) (*Permission, error)
- func (c *Client) GetPermissionsByRoleID(input *GetPermissionsByRoleIDInput) ([]Permission, error)
- func (c *Client) GetPermissionsByUserID(input *GetPermissionsByUserIDInput) ([]Permission, error)
- func (c *Client) GetRoleByID(roleID uuid.UUID) (*Role, error)
- func (c *Client) GetRoleByName(roleName string) (*Role, error)
- func (c *Client) GetRolesByPermissionID(input GetRolesByPermissionIDInput) ([]Role, error)
- func (c *Client) GetRolesByServiceAccountID(input GetRolesInput) ([]Role, error)
- func (c *Client) GetRolesByUserID(input GetRolesByUserIDInput) ([]Role, error)
- func (c *Client) GetRolesForUser(userID uuid.UUID) ([]Role, error)
- func (c *Client) GetRolesForUserInAccount(userID uuid.UUID, accountID uuid.UUID) ([]Role, error)
- func (c *Client) GetServiceAccountByID(id uuid.UUID) (*ServiceAccount, error)
- func (c *Client) GetServiceAccountByName(serviceName string) (*ServiceAccount, error)
- func (c *Client) GetServiceAccountsByRoleID(input GetServiceAccountsInput) ([]ServiceAccount, error)
- func (c *Client) GetTokenByPlaintext(input GetTokenByPlaintextInput) (*Token, error)
- func (c *Client) GetTokensByScope(input GetTokensByScopeInput) ([]Token, error)
- func (c *Client) GetTokensByUserID(input GetTokensByUserIDInput) ([]Token, error)
- func (c *Client) GetUserByEmail(email string) (*User, error)
- func (c *Client) GetUserByID(id uuid.UUID) (*User, error)
- func (c *Client) GetUserMetadataByID(metadataID uuid.UUID) (*UserMetadata, error)
- func (c *Client) GetUserMetadataByKey(userID, key string) (*UserMetadata, error)
- func (c *Client) GetUserMetadataByUserID(userID uuid.UUID) (*[]UserMetadata, error)
- func (c *Client) IsCountrySanctioned(input IsCountrySanctionedInput) (bool, error)
- func (c *Client) IsPermissionAssignedToRole(input IsPermissionAssignedToRoleInput) (bool, error)
- func (c *Client) IsRoleAssignedToServiceAccount(input RoleAssignmentInput) (bool, error)
- func (c *Client) IsUserAMemberOfAccount(userID uuid.UUID, accountID uuid.UUID) (bool, error)
- func (c *Client) IsUserInRole(data *UserInRoleCheckData) (bool, error)
- func (c *Client) IsUserLinkedToAccount(userID uuid.UUID, accountID uuid.UUID) (bool, error)
- func (c *Client) ListAccountLinks(userID uuid.UUID) ([]AccountLink, error)
- func (c *Client) ListAccountMemberships(userID uuid.UUID) ([]AccountMembership, error)
- func (c *Client) ListAccounts() ([]Account, error)
- func (c *Client) ListAgencyAccounts(userID uuid.UUID) ([]Agency, error)
- func (c *Client) ListAllMetadataKeys() ([]MetadataKey, error)
- func (c *Client) ListAllUsers() ([]User, error)
- func (c *Client) ListBusinessAccounts() ([]Business, error)
- func (c *Client) ListCelebrityAccounts() ([]Celebrity, error)
- func (c *Client) ListEnterpriseAccounts() ([]*Enterprise, error)
- func (c *Client) ListGovernmentAccounts() ([]Government, error)
- func (c *Client) ListPermissions() (*ListPermissionsResponse, error)
- func (c *Client) ListRoles() ([]Role, error)
- func (c *Client) ListServiceAccounts() ([]ServiceAccount, error)
- func (c *Client) MetadataKeyExists(keyName string) (bool, error)
- func (c *Client) RegisterServiceAccount(ctx context.Context, input RegisterServiceAccountInput) (*ServiceAccount, error)
- func (c *Client) RegisterUser(data *UserRegistrationData) error
- func (c *Client) RemoveMemberFromAgencyAccount(userID uuid.UUID, agencyID uuid.UUID) error
- func (c *Client) RemoveMemberFromBusinessAccount(businessID, memberID uuid.UUID) error
- func (c *Client) RemoveMemberFromCelebrityAccount(celebrityID uuid.UUID, userID uuid.UUID) error
- func (c *Client) RemoveMemberFromEnterpriseAccount(enterpriseID, userID uuid.UUID) error
- func (c *Client) RemoveMemberFromGovernmentAccount(input RemoveMemberFromGovernmentAccountInput) error
- func (c *Client) RemovePermissionFromRole(input RemovePermissionFromRoleInput) error
- func (c *Client) RemoveRoleFromServiceAccount(input RemoveRoleInput) error
- func (c *Client) RemoveRoleFromUser(userID uuid.UUID, roleID uuid.UUID) error
- func (c *Client) RemoveSanctionedCountry(input RemoveSanctionedCountryInput) error
- func (c *Client) SearchAccounts(input SearchAccountInput) ([]*Account, error)
- func (c *Client) SetUserActiveStatus(event *SetUserActiveStatusEvent) error
- func (c *Client) UnassignRoleFromUser(input *UserUnassignRoleInput) error
- func (c *Client) UpdateAccount(accountID uuid.UUID, input UpdateAccountInput) (*Account, error)
- func (c *Client) UpdateAccountLink(userID uuid.UUID, accountType string, accountID uuid.UUID) error
- func (c *Client) UpdateAccountMembership(accountMembershipID uuid.UUID, event UpdateAccountMembershipEvent) (AccountMembership, error)
- func (c *Client) UpdateAgencyAccount(input UpdateAgencyAccountInput) error
- func (c *Client) UpdateBusinessAccount(input UpdateBusinessAccountInput) error
- func (c *Client) UpdateCelebrityAccount(event *UpdateCelebrityAccountEvent) (*Celebrity, error)
- func (c *Client) UpdateEnterpriseAccount(input UpdateEnterpriseAccountInput) error
- func (c *Client) UpdateGovernmentAccount(userID uuid.UUID, governmentID uuid.UUID, newName string) error
- func (c *Client) UpdateMemberRoleInAgencyAccount(input UpdateMemberRoleInAgencyAccountInput) error
- func (c *Client) UpdateMemberRoleInBusinessAccount(input UpdateMemberRoleInBusinessAccountInput) error
- func (c *Client) UpdateMemberRoleInCelebrityAccount(e *UpdateMemberRoleInCelebrityAccountEvent) error
- func (c *Client) UpdateMemberRoleInEnterpriseAccount(req UpdateMemberRoleInEnterpriseAccountRequest) error
- func (c *Client) UpdateMemberRoleInGovernmentAccount(event UpdateMemberRoleInGovernmentAccountEvent) error
- func (c *Client) UpdateMetadataKey(input UpdateMetadataKeyInput) (*MetadataKey, error)
- func (c *Client) UpdatePermission(input UpdatePermissionInput) error
- func (c *Client) UpdateRole(input *UpdateRoleInput) error
- func (c *Client) UpdateServiceAccount(input UpdateServiceAccountInput) error
- func (c *Client) UpdateUser(userID uuid.UUID, payload *UpdateUserPayload) error
- func (c *Client) UpdateUserMetadata(userMetadata *UserMetadataUpdate) error
- func (c *Client) Validate() error
- func (c *Client) VerifyAccount(input VerifyAccountInput) (*Account, error)
- func (c *Client) VerifyEmail(event *VerifyEmailEvent) error
- func (c *Client) VerifyPhoneNumber(user *User) error
- func (c *Client) VerifyToken(token string) (*Token, error)
- type CreateAccountInput
- type CreateAgencyAccountInput
- type CreateBusinessAccountInput
- type CreateCelebrityAccountInput
- type CreateCelebrityAccountResponse
- type CreateEnterpriseAccountInput
- type CreateGovernmentAccountInput
- type CreateMetadataKeyInput
- type CreatePermissionInput
- type CreateRoleInput
- type CreateTokenInput
- type DeleteGovernmentAccountInput
- type DeleteMetadataKeyInput
- type DeletePermissionInput
- type DeleteRoleInput
- type DeleteTokenInput
- type DeleteTokensByUserIDInput
- type DisableTwoFactorAuthenticationInput
- type DoesPermissionExistInput
- type DoesRoleExistInput
- type EnableTwoFactorAuthenticationInput
- type Enterprise
- type EnterpriseAccountsResponse
- type EnterpriseMembers
- type GetGovernmentAccountByIDInput
- type GetGovernmentAccountsByUserIDInput
- type GetMembersOfGovernmentAccountInput
- type GetMetadataKeyByIDInput
- type GetMetadataKeyByKeyNameInput
- type GetPermissionByIDInput
- type GetPermissionByNameInput
- type GetPermissionsByRoleIDInput
- type GetPermissionsByUserIDInput
- type GetRolesByPermissionIDInput
- type GetRolesByUserIDInput
- type GetRolesInput
- type GetServiceAccountsInput
- type GetTokenByPlaintextInput
- type GetTokensByScopeInput
- type GetTokensByUserIDInput
- type Government
- type IsCountrySanctionedInput
- type IsPermissionAssignedToRoleInput
- type ListPermissionsResponse
- type MetadataKey
- type MetadataKeyExistsInput
- type Permission
- type PermissionRequest
- type PermissionResponse
- type RegisterServiceAccountInput
- type RemoveMemberFromGovernmentAccountInput
- type RemovePermissionFromRoleEvent
- type RemovePermissionFromRoleInput
- type RemoveRoleInput
- type RemoveSanctionedCountryInput
- type Role
- type RoleAssignmentInput
- type RoleData
- type RolesForUserResponse
- type SanctionedCountry
- type SearchAccountInput
- type ServiceAccount
- type SetUserActiveStatusEvent
- type Token
- type UpdateAccountInput
- type UpdateAccountMembershipEvent
- type UpdateAgencyAccountInput
- type UpdateBusinessAccountInput
- type UpdateCelebrityAccountEvent
- type UpdateEnterpriseAccountInput
- type UpdateGovernmentAccountEvent
- type UpdateGovernmentAccountInput
- type UpdateMemberRoleInAgencyAccountInput
- type UpdateMemberRoleInBusinessAccountInput
- type UpdateMemberRoleInCelebrityAccountEvent
- type UpdateMemberRoleInEnterpriseAccountRequest
- type UpdateMemberRoleInGovernmentAccountEvent
- type UpdateMetadataKeyInput
- type UpdatePermissionInput
- type UpdateRoleInput
- type UpdateServiceAccountInput
- type UpdateUserPayload
- type User
- type UserInRoleCheckData
- type UserMetadata
- type UserMetadataUpdate
- type UserRegistrationData
- type UserRemoveRoleEvent
- type UserRoleData
- type UserUnassignRoleInput
- type VerifyAccountInput
- type VerifyEmailEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID uuid.UUID `json:"id"` UserID *uuid.UUID `json:"user_id"` AgencyID *uuid.UUID `json:"agencyId,omitempty"` CelebrityID *uuid.UUID `json:"celebrityId,omitempty"` BusinessID *uuid.UUID `json:"businessId,omitempty"` EnterpriseID *uuid.UUID `json:"enterpriseId,omitempty"` GovernmentID *uuid.UUID `json:"governmentId,omitempty"` }
type AccountLink ¶
type AccountLink struct { UserID uuid.UUID `json:"user_id"` AccountType string `json:"account_type"` AccountID uuid.UUID `json:"account_id"` CreatedAt time.Time `json:"created_at"` }
AccountLink represents the structure of an account link.
type AccountLinkRequest ¶
type AccountLinkRequest struct { UserID uuid.UUID `json:"user_id"` AccountType string `json:"account_type"` AccountID uuid.UUID `json:"account_id"` }
AccountLinkRequest represents the structure of an account link request.
type AccountList ¶
type AccountList struct {
Accounts []Account `json:"accounts"`
}
type AccountMembership ¶
type AccountMembership struct { ID uuid.UUID `json:"id"` AccountType string `json:"account_type"` AccountID uuid.UUID `json:"account_id"` UserID uuid.UUID `json:"user_id"` Role string `json:"role"` JoinedAt time.Time `json:"joined_at"` }
AccountMembership represents the structure of an account membership.
type AccountMembershipsResponse ¶
type AccountMembershipsResponse struct {
AccountMemberships []AccountMembership `json:"account_memberships"`
}
AccountMembershipsResponse represents a list of account memberships returned from the server.
type AddMemberToBusinessAccountInput ¶
type AddMemberToBusinessAccountInput struct { UserID uuid.UUID `json:"user_id"` BusinessID uuid.UUID `json:"business_id"` RoleID uuid.UUID `json:"role_id"` }
func (*AddMemberToBusinessAccountInput) Validate ¶
func (input *AddMemberToBusinessAccountInput) Validate() error
Define the validation for AddMemberToBusinessAccountInput
type AddMemberToEnterpriseAccountInput ¶
type AddMemberToEnterpriseAccountInput struct { EnterpriseID uuid.UUID `json:"enterprise_id"` UserID uuid.UUID `json:"user_id"` RoleID uuid.UUID `json:"role_id"` }
AddMemberToEnterpriseAccountInput is the data structure for the request to add a member to an enterprise account.
type AddMemberToGovernmentAccountInput ¶
type AddMemberToGovernmentAccountInput struct { UserID uuid.UUID `json:"userId"` RoleID uuid.UUID `json:"roleId"` GovernmentID uuid.UUID `json:"governmentId"` }
func (*AddMemberToGovernmentAccountInput) Validate ¶
func (input *AddMemberToGovernmentAccountInput) Validate() error
Validate checks if the UpdateGovernmentAccountEvent is valid
type Agency ¶
type Agency struct { ID uuid.UUID `json:"id"` UserAccountID uuid.UUID `json:"user_account_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Agency represents the structure of an agency.
type AssignPermissionToRoleInput ¶
func (*AssignPermissionToRoleInput) Validate ¶
func (input *AssignPermissionToRoleInput) Validate() error
You would also need to define the Validate method for AssignPermissionToRoleEvent
type AssignRoleData ¶
AssignRoleData represents the input data to assign a role to a user.
func (*AssignRoleData) Validate ¶
func (d *AssignRoleData) Validate() error
Validate checks if the AssignRoleData structure is valid.
type AssignRoleInput ¶
type AssignRoleInput struct { ServiceAccountID uuid.UUID `json:"service_account_id"` RoleID uuid.UUID `json:"role_id"` }
AssignRoleInput represents the input data for assigning a role to a service account.
type Business ¶
type Business struct { ID uuid.UUID `json:"id"` UserAccountID uuid.UUID `json:"user_account_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Business represents the structure of a business.
type Celebrity ¶
type Celebrity struct { ID uuid.UUID `json:"id"` UserAccountID uuid.UUID `json:"user_account_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Celebrity represents the structure of an artist, band, sports personality, or other public figure.
type CheckPasswordHashData ¶
type CheckPasswordHashData struct { UserID uuid.UUID `json:"userId"` Password string `json:"password"` }
func (*CheckPasswordHashData) Validate ¶
func (d *CheckPasswordHashData) Validate() error
type CheckUserAuthorizationError ¶
This is a custom error type
func (*CheckUserAuthorizationError) Error ¶
func (e *CheckUserAuthorizationError) Error() string
type Client ¶
Client represents an HTTP client that can be used to send requests to the skills server.
func (*Client) AddMemberToAgencyAccount ¶
func (c *Client) AddMemberToAgencyAccount(e AddMemberToAgencyAccountEvent) error
func (*Client) AddMemberToBusinessAccount ¶
func (c *Client) AddMemberToBusinessAccount(input AddMemberToBusinessAccountInput) error
Update the AddMemberToBusinessAccount function
func (*Client) AddMemberToCelebrityAccount ¶
func (c *Client) AddMemberToCelebrityAccount(input AddMemberToCelebrityAccountInput) error
AddMemberToCelebrityAccount adds a new member to a celebrity account.
func (*Client) AddMemberToEnterpriseAccount ¶
func (c *Client) AddMemberToEnterpriseAccount(input AddMemberToEnterpriseAccountInput) error
func (*Client) AddMemberToGovernmentAccount ¶
func (c *Client) AddMemberToGovernmentAccount(input AddMemberToGovernmentAccountInput) error
func (*Client) AddRoleToUser ¶
AddRoleToUser adds a role to a user.
func (*Client) AddSanctionedCountry ¶
func (c *Client) AddSanctionedCountry(input AddSanctionedCountryInput) error
func (*Client) AssignPermissionToRole ¶
func (c *Client) AssignPermissionToRole(input AssignPermissionToRoleInput) error
func (*Client) AssignRoleToServiceAccount ¶
func (c *Client) AssignRoleToServiceAccount(input AssignRoleInput) error
func (*Client) AssignRoleToUser ¶
func (c *Client) AssignRoleToUser(data *AssignRoleData) error
AssignRoleToUser assigns a role to a user
func (*Client) CheckPasswordHash ¶
func (c *Client) CheckPasswordHash(data *CheckPasswordHashData) (bool, error)
func (*Client) CheckUserAuthorization ¶
func (c *Client) CheckUserAuthorization(ctx context.Context, token, permission string) (bool, error)
CheckUserAuthorization verifies a user's authorization to perform a certain action.
func (*Client) CreateAccount ¶
func (c *Client) CreateAccount(input CreateAccountInput) (*Account, error)
CreateAccount makes a POST request to create an account
func (*Client) CreateAccountLink ¶
func (c *Client) CreateAccountLink(alr AccountLinkRequest) (*AccountLink, error)
func (*Client) CreateAccountMembership ¶
func (c *Client) CreateAccountMembership(accountMembership *AccountMembership) (*AccountMembership, error)
CreateAccountMembership sends a POST request to create a new account membership.
func (*Client) CreateAgencyAccount ¶
func (c *Client) CreateAgencyAccount(input CreateAgencyAccountInput) (*Agency, error)
func (*Client) CreateBusinessAccount ¶
func (c *Client) CreateBusinessAccount(input CreateBusinessAccountInput) (*Business, error)
CreateBusinessAccount creates a new business account for a given user.
func (*Client) CreateCelebrityAccount ¶
func (c *Client) CreateCelebrityAccount(input CreateCelebrityAccountInput) (*Celebrity, error)
CreateCelebrityAccount creates a new celebrity account.
func (*Client) CreateEnterpriseAccount ¶
func (c *Client) CreateEnterpriseAccount(input CreateEnterpriseAccountInput) (*Enterprise, error)
func (*Client) CreateGovernmentAccount ¶
func (c *Client) CreateGovernmentAccount(input CreateGovernmentAccountInput) (*Government, error)
CreateGovernmentAccount makes a POST request to create a government account
func (*Client) CreateMetadataKey ¶
func (c *Client) CreateMetadataKey(input CreateMetadataKeyInput) (*MetadataKey, error)
func (*Client) CreatePermission ¶
func (c *Client) CreatePermission(input CreatePermissionInput) (*Permission, error)
func (*Client) CreateRole ¶
func (c *Client) CreateRole(input *CreateRoleInput) (*Role, error)
func (*Client) CreateToken ¶
func (c *Client) CreateToken(input CreateTokenInput) (*Token, error)
CreateToken creates a new token for a user and returns it.
func (*Client) CreateUser ¶
func (*Client) CreateUserMetadata ¶
func (c *Client) CreateUserMetadata(metadata *UserMetadata) error
func (*Client) DeleteAccount ¶
DeleteAccount makes a DELETE request to delete an account
func (*Client) DeleteAccountLink ¶
func (c *Client) DeleteAccountLink(accountLinkRequest *AccountLinkRequest) error
func (*Client) DeleteAccountMembership ¶
func (*Client) DeleteBusinessAccount ¶
func (*Client) DeleteCelebrityAccount ¶
func (*Client) DeleteEnterpriseAccount ¶
func (*Client) DeleteExpiredTokens ¶
func (*Client) DeleteGovernmentAccount ¶
func (*Client) DeleteMetadataKey ¶
func (c *Client) DeleteMetadataKey(input DeleteMetadataKeyInput) error
DeleteMetadataKey deletes a metadata key by its id.
func (*Client) DeletePermission ¶
func (c *Client) DeletePermission(input DeletePermissionInput) error
func (*Client) DeleteRole ¶
func (c *Client) DeleteRole(input *DeleteRoleInput) error
DeleteRole deletes a role using the API.
func (*Client) DeleteServiceAccount ¶
DeleteServiceAccount deletes a service account by its ID
func (*Client) DeleteToken ¶
func (c *Client) DeleteToken(input DeleteTokenInput) error
DeleteToken deletes a token associated with a user.
func (*Client) DeleteTokensByUserID ¶
func (c *Client) DeleteTokensByUserID(input DeleteTokensByUserIDInput) error
DeleteTokensByUserID sends a request to the server to delete all tokens for the given user ID.
func (*Client) DeleteUserMetadataByID ¶
DeleteUserMetadataByID deletes user metadata by its ID.
func (*Client) DeleteUserMetadataByKey ¶
func (*Client) DeleteUserMetadataByUserID ¶
func (*Client) DisableTwoFactorAuthentication ¶
func (c *Client) DisableTwoFactorAuthentication(data DisableTwoFactorAuthenticationInput) error
func (*Client) DoesPermissionExist ¶
func (c *Client) DoesPermissionExist(input *DoesPermissionExistInput) (bool, error)
func (*Client) DoesRoleExist ¶
func (c *Client) DoesRoleExist(input DoesRoleExistInput) (bool, error)
func (*Client) EnableTwoFactorAuthentication ¶
func (c *Client) EnableTwoFactorAuthentication(data EnableTwoFactorAuthenticationInput) error
func (*Client) GetAccount ¶
func (ac *Client) GetAccount()
GetAccount retrieves an existing account.
func (*Client) GetAccountByField ¶
GetAccountByField retrieves an account based on a field.
func (*Client) GetAccountLink ¶
GetAccountLink retrieves an account link by user ID, account type, and account ID
func (*Client) GetAccountLinksByAccountID ¶
func (c *Client) GetAccountLinksByAccountID(accountID uuid.UUID) ([]AccountLink, error)
GetAccountLinksByAccountID fetches account links by account ID from the remote server.
func (*Client) GetAccountLinksByAccountType ¶
func (c *Client) GetAccountLinksByAccountType(accountType string) ([]AccountLink, error)
func (*Client) GetAccountLinksByUserID ¶
func (c *Client) GetAccountLinksByUserID(userID uuid.UUID) ([]AccountLink, error)
func (*Client) GetAccountMembershipByID ¶
func (c *Client) GetAccountMembershipByID(id uuid.UUID) (*AccountMembership, error)
GetAccountMembershipByID retrieves an AccountMembership by ID.
func (*Client) GetAccountMembershipsByAccountID ¶
func (c *Client) GetAccountMembershipsByAccountID(accountID uuid.UUID) (*AccountMembershipsResponse, error)
GetAccountMembershipsByAccountID sends a request to the server to retrieve account memberships by account ID.
func (*Client) GetAccountMembershipsByAccountType ¶
func (c *Client) GetAccountMembershipsByAccountType(accountType string) ([]AccountMembership, error)
func (*Client) GetAccountMembershipsByUserID ¶
func (c *Client) GetAccountMembershipsByUserID(userID uuid.UUID) ([]AccountMembership, error)
func (*Client) GetAccountType ¶
func (ac *Client) GetAccountType()
GetAccountType retrieves the type of an existing account.
func (*Client) GetAgencyAccountByID ¶
func (*Client) GetAgencyAccountsByUserID ¶
func (*Client) GetBusinessAccountByID ¶
func (*Client) GetBusinessAccountsByUserID ¶
func (*Client) GetCelebrityAccountByID ¶
GetCelebrityAccountByID fetches celebrity account data by ID from the API.
func (*Client) GetCelebrityAccountsByUserID ¶
GetCelebrityAccountsByUserID sends a GET request to the server to retrieve celebrity accounts by user ID.
func (*Client) GetEnterpriseAccountByID ¶
func (c *Client) GetEnterpriseAccountByID(enterpriseID uuid.UUID) (*Enterprise, error)
func (*Client) GetEnterpriseAccountsByUserID ¶
func (c *Client) GetEnterpriseAccountsByUserID(userID uuid.UUID) ([]Enterprise, error)
func (*Client) GetGovernmentAccountByID ¶
func (c *Client) GetGovernmentAccountByID(governmentID uuid.UUID) (*Government, error)
GetGovernmentAccountByID fetches a government account by its ID.
func (*Client) GetGovernmentAccountsByUserID ¶
func (c *Client) GetGovernmentAccountsByUserID(userID uuid.UUID) ([]Government, error)
func (*Client) GetLinkedAccountsForUser ¶
func (c *Client) GetLinkedAccountsForUser(userID uuid.UUID) ([]AccountLink, error)
GetLinkedAccountsForUser fetches all the linked accounts for a specific user.
func (*Client) GetMembersOfAccount ¶
func (*Client) GetMembersOfAgencyAccount ¶
func (c *Client) GetMembersOfAgencyAccount(agencyID uuid.UUID) ([]AccountMembership, error)
func (*Client) GetMembersOfBusinessAccount ¶
func (c *Client) GetMembersOfBusinessAccount(businessId uuid.UUID) ([]AccountMembership, error)
func (*Client) GetMembersOfCelebrityAccount ¶
func (c *Client) GetMembersOfCelebrityAccount(celebrityID uuid.UUID) ([]AccountMembership, error)
func (*Client) GetMembersOfEnterpriseAccount ¶
func (c *Client) GetMembersOfEnterpriseAccount(enterpriseID uuid.UUID) (*EnterpriseMembers, error)
GetMembersOfEnterpriseAccount makes a request to the server to get the members of a given enterprise account.
func (*Client) GetMembersOfGovernmentAccount ¶
func (c *Client) GetMembersOfGovernmentAccount(input GetMembersOfGovernmentAccountInput) ([]AccountMembership, error)
func (*Client) GetMetadataKeyByID ¶
func (c *Client) GetMetadataKeyByID(input GetMetadataKeyByIDInput) (*UserMetadata, error)
func (*Client) GetMetadataKeyByKeyName ¶
func (c *Client) GetMetadataKeyByKeyName(input GetMetadataKeyByKeyNameInput) (*MetadataKey, error)
GetMetadataKeyByKeyName sends a GET request to the /metadata-keys/{keyName} endpoint of the account service to retrieve the metadata key by its key name.
func (*Client) GetPermissionByID ¶
func (c *Client) GetPermissionByID(input GetPermissionByIDInput) (*Permission, error)
func (*Client) GetPermissionByName ¶
func (c *Client) GetPermissionByName(input GetPermissionByNameInput) (*Permission, error)
func (*Client) GetPermissionsByRoleID ¶
func (c *Client) GetPermissionsByRoleID(input *GetPermissionsByRoleIDInput) ([]Permission, error)
GetPermissionsByRoleID fetches the permissions associated with the provided role ID.
func (*Client) GetPermissionsByUserID ¶
func (c *Client) GetPermissionsByUserID(input *GetPermissionsByUserIDInput) ([]Permission, error)
func (*Client) GetRolesByPermissionID ¶
func (c *Client) GetRolesByPermissionID(input GetRolesByPermissionIDInput) ([]Role, error)
GetRolesByPermissionID retrieves all roles associated with a permission identified by its ID.
func (*Client) GetRolesByServiceAccountID ¶
func (c *Client) GetRolesByServiceAccountID(input GetRolesInput) ([]Role, error)
GetRolesByServiceAccountID retrieves roles associated with a specific service account ID
func (*Client) GetRolesByUserID ¶
func (c *Client) GetRolesByUserID(input GetRolesByUserIDInput) ([]Role, error)
func (*Client) GetRolesForUserInAccount ¶
GetRolesForUserInAccount retrieves roles for the given user in the provided account.
func (*Client) GetServiceAccountByID ¶
func (c *Client) GetServiceAccountByID(id uuid.UUID) (*ServiceAccount, error)
GetServiceAccountByID sends a GET request to the server to retrieve a service account by its ID
func (*Client) GetServiceAccountByName ¶
func (c *Client) GetServiceAccountByName(serviceName string) (*ServiceAccount, error)
func (*Client) GetServiceAccountsByRoleID ¶
func (c *Client) GetServiceAccountsByRoleID(input GetServiceAccountsInput) ([]ServiceAccount, error)
func (*Client) GetTokenByPlaintext ¶
func (c *Client) GetTokenByPlaintext(input GetTokenByPlaintextInput) (*Token, error)
func (*Client) GetTokensByScope ¶
func (c *Client) GetTokensByScope(input GetTokensByScopeInput) ([]Token, error)
GetTokensByScope gets all tokens associated with a scope.
func (*Client) GetTokensByUserID ¶
func (c *Client) GetTokensByUserID(input GetTokensByUserIDInput) ([]Token, error)
GetTokensByUserID gets all tokens associated with a user ID.
func (*Client) GetUserByID ¶
GetUserByID fetches a user using the user's ID
func (*Client) GetUserMetadataByID ¶
func (c *Client) GetUserMetadataByID(metadataID uuid.UUID) (*UserMetadata, error)
GetUserMetadataByID retrieves user metadata by ID
func (*Client) GetUserMetadataByKey ¶
func (c *Client) GetUserMetadataByKey(userID, key string) (*UserMetadata, error)
func (*Client) GetUserMetadataByUserID ¶
func (c *Client) GetUserMetadataByUserID(userID uuid.UUID) (*[]UserMetadata, error)
GetUserMetadataByUserID fetches a user's metadata from the server.
func (*Client) IsCountrySanctioned ¶
func (c *Client) IsCountrySanctioned(input IsCountrySanctionedInput) (bool, error)
func (*Client) IsPermissionAssignedToRole ¶
func (c *Client) IsPermissionAssignedToRole(input IsPermissionAssignedToRoleInput) (bool, error)
IsPermissionAssignedToRole checks if a permission is assigned to a role.
func (*Client) IsRoleAssignedToServiceAccount ¶
func (c *Client) IsRoleAssignedToServiceAccount(input RoleAssignmentInput) (bool, error)
func (*Client) IsUserAMemberOfAccount ¶
func (*Client) IsUserInRole ¶
func (c *Client) IsUserInRole(data *UserInRoleCheckData) (bool, error)
func (*Client) IsUserLinkedToAccount ¶
func (*Client) ListAccountLinks ¶
func (c *Client) ListAccountLinks(userID uuid.UUID) ([]AccountLink, error)
func (*Client) ListAccountMemberships ¶
func (c *Client) ListAccountMemberships(userID uuid.UUID) ([]AccountMembership, error)
func (*Client) ListAccounts ¶
ListAccounts lists all accounts.
func (*Client) ListAgencyAccounts ¶
func (*Client) ListAllMetadataKeys ¶
func (c *Client) ListAllMetadataKeys() ([]MetadataKey, error)
ListAllMetadataKeys retrieves all metadata keys.
func (*Client) ListAllUsers ¶
ListAllUsers sends a GET request to the accounts server to get a list of all users.
func (*Client) ListBusinessAccounts ¶
func (*Client) ListCelebrityAccounts ¶
func (*Client) ListEnterpriseAccounts ¶
func (c *Client) ListEnterpriseAccounts() ([]*Enterprise, error)
func (*Client) ListGovernmentAccounts ¶
func (c *Client) ListGovernmentAccounts() ([]Government, error)
func (*Client) ListPermissions ¶
func (c *Client) ListPermissions() (*ListPermissionsResponse, error)
func (*Client) ListServiceAccounts ¶
func (c *Client) ListServiceAccounts() ([]ServiceAccount, error)
func (*Client) MetadataKeyExists ¶
MetadataKeyExists sends a GET request to the service to determine if a metadata key exists. It returns true if it exists, false if not, and any error that occurred.
func (*Client) RegisterServiceAccount ¶
func (c *Client) RegisterServiceAccount(ctx context.Context, input RegisterServiceAccountInput) (*ServiceAccount, error)
RegisterServiceAccount registers a new service account with the provided name and roles.
func (*Client) RegisterUser ¶
func (c *Client) RegisterUser(data *UserRegistrationData) error
func (*Client) RemoveMemberFromAgencyAccount ¶
func (*Client) RemoveMemberFromBusinessAccount ¶
func (*Client) RemoveMemberFromCelebrityAccount ¶
func (*Client) RemoveMemberFromEnterpriseAccount ¶
func (*Client) RemoveMemberFromGovernmentAccount ¶
func (c *Client) RemoveMemberFromGovernmentAccount(input RemoveMemberFromGovernmentAccountInput) error
func (*Client) RemovePermissionFromRole ¶
func (c *Client) RemovePermissionFromRole(input RemovePermissionFromRoleInput) error
func (*Client) RemoveRoleFromServiceAccount ¶
func (c *Client) RemoveRoleFromServiceAccount(input RemoveRoleInput) error
RemoveRoleFromServiceAccount removes a role from a service account.
func (*Client) RemoveRoleFromUser ¶
func (*Client) RemoveSanctionedCountry ¶
func (c *Client) RemoveSanctionedCountry(input RemoveSanctionedCountryInput) error
func (*Client) SearchAccounts ¶
func (c *Client) SearchAccounts(input SearchAccountInput) ([]*Account, error)
SearchAccounts makes a GET request to search for accounts based on a query.
func (*Client) SetUserActiveStatus ¶
func (c *Client) SetUserActiveStatus(event *SetUserActiveStatusEvent) error
func (*Client) UnassignRoleFromUser ¶
func (c *Client) UnassignRoleFromUser(input *UserUnassignRoleInput) error
UnassignRoleFromUser removes a role from a user.
func (*Client) UpdateAccount ¶
UpdateAccount makes a PUT request to update an account
func (*Client) UpdateAccountLink ¶
func (*Client) UpdateAccountMembership ¶
func (c *Client) UpdateAccountMembership(accountMembershipID uuid.UUID, event UpdateAccountMembershipEvent) (AccountMembership, error)
func (*Client) UpdateAgencyAccount ¶
func (c *Client) UpdateAgencyAccount(input UpdateAgencyAccountInput) error
func (*Client) UpdateBusinessAccount ¶
func (c *Client) UpdateBusinessAccount(input UpdateBusinessAccountInput) error
func (*Client) UpdateCelebrityAccount ¶
func (c *Client) UpdateCelebrityAccount(event *UpdateCelebrityAccountEvent) (*Celebrity, error)
func (*Client) UpdateEnterpriseAccount ¶
func (c *Client) UpdateEnterpriseAccount(input UpdateEnterpriseAccountInput) error
func (*Client) UpdateGovernmentAccount ¶
func (*Client) UpdateMemberRoleInAgencyAccount ¶
func (c *Client) UpdateMemberRoleInAgencyAccount(input UpdateMemberRoleInAgencyAccountInput) error
func (*Client) UpdateMemberRoleInBusinessAccount ¶
func (c *Client) UpdateMemberRoleInBusinessAccount(input UpdateMemberRoleInBusinessAccountInput) error
UpdateMemberRoleInBusinessAccount sends a request to the REST API endpoint to update a member's role in a business account.
func (*Client) UpdateMemberRoleInCelebrityAccount ¶
func (c *Client) UpdateMemberRoleInCelebrityAccount(e *UpdateMemberRoleInCelebrityAccountEvent) error
func (*Client) UpdateMemberRoleInEnterpriseAccount ¶
func (c *Client) UpdateMemberRoleInEnterpriseAccount(req UpdateMemberRoleInEnterpriseAccountRequest) error
func (*Client) UpdateMemberRoleInGovernmentAccount ¶
func (c *Client) UpdateMemberRoleInGovernmentAccount(event UpdateMemberRoleInGovernmentAccountEvent) error
func (*Client) UpdateMetadataKey ¶
func (c *Client) UpdateMetadataKey(input UpdateMetadataKeyInput) (*MetadataKey, error)
func (*Client) UpdatePermission ¶
func (c *Client) UpdatePermission(input UpdatePermissionInput) error
func (*Client) UpdateRole ¶
func (c *Client) UpdateRole(input *UpdateRoleInput) error
func (*Client) UpdateServiceAccount ¶
func (c *Client) UpdateServiceAccount(input UpdateServiceAccountInput) error
UpdateServiceAccount sends a request to update a service account.
func (*Client) UpdateUser ¶
func (c *Client) UpdateUser(userID uuid.UUID, payload *UpdateUserPayload) error
func (*Client) UpdateUserMetadata ¶
func (c *Client) UpdateUserMetadata(userMetadata *UserMetadataUpdate) error
UpdateUserMetadata sends an HTTP request to update user metadata.
func (*Client) VerifyAccount ¶
func (c *Client) VerifyAccount(input VerifyAccountInput) (*Account, error)
VerifyAccount makes a GET request to verify an account
func (*Client) VerifyEmail ¶
func (c *Client) VerifyEmail(event *VerifyEmailEvent) error
func (*Client) VerifyPhoneNumber ¶
type CreateAccountInput ¶
type CreateAccountInput struct { UserID *uuid.UUID `json:"user_id"` AgencyID *uuid.UUID `json:"agencyId,omitempty"` CelebrityID *uuid.UUID `json:"celebrityId,omitempty"` BusinessID *uuid.UUID `json:"businessId,omitempty"` EnterpriseID *uuid.UUID `json:"enterpriseId,omitempty"` GovernmentID *uuid.UUID `json:"governmentId,omitempty"` }
func (*CreateAccountInput) GetAccountType ¶
func (input *CreateAccountInput) GetAccountType() string
Adding this method to CreateAccountInput struct
type CreateCelebrityAccountInput ¶
type CreateCelebrityAccountInput struct { UserID uuid.UUID `json:"user_id"` CelebrityName string `json:"celebrity_name"` }
CreateCelebrityAccountInput represents the information needed to create a celebrity account.
type CreateCelebrityAccountResponse ¶
type CreateCelebrityAccountResponse struct { CelebrityID uuid.UUID `json:"celebrity_id"` Status string `json:"status"` Message string `json:"message,omitempty"` }
CreateCelebrityAccountResponse represents the response from creating a celebrity account.
type CreateMetadataKeyInput ¶
type CreateMetadataKeyInput struct {
KeyName string `json:"key_name"`
}
type CreatePermissionInput ¶
type CreateRoleInput ¶
type CreateRoleInput struct { Name string Description string CompanyDomainOnly bool IsInternal bool UserID uuid.UUID }
func (*CreateRoleInput) Validate ¶
func (input *CreateRoleInput) Validate() error
type CreateTokenInput ¶
CreateTokenInput represents the input data for creating a new token.
type DeleteMetadataKeyInput ¶
type DeletePermissionInput ¶
type DeleteTokenInput ¶
type DeleteTokenInput struct { UserID uuid.UUID `json:"userId"` TokenID uuid.UUID `json:"tokenId"` }
DeleteTokenInput represents the input data for deleting a token.
type DeleteTokensByUserIDInput ¶
DeleteTokensByUserIDInput represents the input for deleting all tokens of a user.
type DoesRoleExistInput ¶
type Enterprise ¶
type Enterprise struct { ID uuid.UUID `json:"id"` UserAccountID uuid.UUID `json:"user_account_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Enterprise represents the structure of an enterprise.
type EnterpriseAccountsResponse ¶
type EnterpriseAccountsResponse struct {
EnterpriseAccounts []*Enterprise `json:"enterprise_accounts"`
}
EnterpriseAccountsResponse represents the structure of the response for the ListEnterpriseAccounts function.
type EnterpriseMembers ¶
type EnterpriseMembers struct {
Members []AccountMembership `json:"members"`
}
type GetMetadataKeyByIDInput ¶
type GetMetadataKeyByKeyNameInput ¶
type GetMetadataKeyByKeyNameInput struct {
KeyName string `json:"key_name"`
}
type GetPermissionByIDInput ¶
type GetPermissionByNameInput ¶
type GetPermissionByNameInput struct {
PermissionName string
}
type GetRolesByUserIDInput ¶
type GetRolesInput ¶
GetRolesInput represents the input data for retrieving roles of a service account.
type GetServiceAccountsInput ¶
GetServiceAccountsInput represents the input data for retrieving service accounts by a role ID.
type GetTokenByPlaintextInput ¶
type GetTokenByPlaintextInput struct {
Plaintext string `json:"plaintext"`
}
GetTokenByPlaintextInput represents the input data for retrieving a token by plaintext.
type GetTokensByScopeInput ¶
type GetTokensByScopeInput struct {
Scope string `json:"scope"`
}
GetTokensByScopeInput represents the input data for retrieving a token by scope.
type GetTokensByUserIDInput ¶
GetTokensByUserIDInput represents the input data for retrieving a token by user ID.
type Government ¶
type Government struct { ID uuid.UUID `json:"id"` UserAccountID uuid.UUID `json:"user_account_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Government represents the structure of a government agency.
type IsCountrySanctionedInput ¶
type IsCountrySanctionedInput struct {
CountryCode string
}
type ListPermissionsResponse ¶
type ListPermissionsResponse struct {
Permissions []Permission `json:"permissions"`
}
type MetadataKey ¶
MetadataKey represents a metadata key record in the database
type MetadataKeyExistsInput ¶
type MetadataKeyExistsInput struct {
KeyName string
}
type Permission ¶
type Permission struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Description string `json:"description"` }
Permission represents the structure of a permission.
type PermissionRequest ¶
type PermissionRequest struct { Token string `json:"token"` Permissions string `json:"permissions"` }
PermissionRequest represents the JSON request body sent to the authentication server to check a service account's permissions.
type PermissionResponse ¶
type PermissionResponse struct {
HasPermission bool `json:"has_permission"`
}
PermissionResponse represents the JSON response returned from the authentication server when checking a service account's permissions.
type RemovePermissionFromRoleInput ¶
func (*RemovePermissionFromRoleInput) Validate ¶
func (input *RemovePermissionFromRoleInput) Validate() error
type RemoveRoleInput ¶
type RemoveRoleInput struct { ServiceAccountID uuid.UUID `json:"service_account_id"` RoleID uuid.UUID `json:"role_id"` }
RemoveRoleInput represents the input data for removing a role from a service account.
type RemoveSanctionedCountryInput ¶
type RemoveSanctionedCountryInput struct {
CountryCode string
}
type Role ¶
type Role struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Description string `json:"description"` CompanyDomainOnly bool `json:"company_domain_only"` IsInternal bool `json:"is_internal"` }
Role represents the structure of a role.
type RoleAssignmentInput ¶
type RoleAssignmentInput struct { ServiceAccountID uuid.UUID `json:"service_account_id"` RoleID uuid.UUID `json:"role_id"` }
RoleAssignmentInput represents the input data for checking a role assignment.
type RoleData ¶
type RoleData struct { Name string `json:"name"` Description string `json:"description"` CompanyDomainOnly bool `json:"company_domain_only"` IsInternal bool `json:"is_internal"` }
RoleData represents the input data for a new role.
type RolesForUserResponse ¶
type RolesForUserResponse struct {
Roles []Role `json:"roles"`
}
type SanctionedCountry ¶
type SanctionedCountry struct { ID uuid.UUID `json:"id"` CountryCode string `json:"country_code"` CountryName string `json:"country_name"` AddedAt time.Time `json:"added_at"` }
SanctionedCountry represents the structure of a sanctioned country.
type SearchAccountInput ¶
type SearchAccountInput struct { UserID *uuid.UUID `json:"user_id"` AgencyID *uuid.UUID `json:"agencyId,omitempty"` CelebrityID *uuid.UUID `json:"celebrityId,omitempty"` BusinessID *uuid.UUID `json:"businessId,omitempty"` EnterpriseID *uuid.UUID `json:"enterpriseId,omitempty"` GovernmentID *uuid.UUID `json:"governmentId,omitempty"` }
func (*SearchAccountInput) GetAccountType ¶
func (input *SearchAccountInput) GetAccountType() string
Add this method to your SearchAccountInput struct
type ServiceAccount ¶
type ServiceAccount struct { ID uuid.UUID `db:"id" json:"id"` Secret string `db:"secret" json:"secret"` ServiceName string `db:"service_name" json:"service_name"` Roles []string `json:"roles"` CreatedAt time.Time `db:"created_at" json:"created_at"` ExpiresAt *time.Time `db:"expires_at" json:"expires_at,omitempty"` }
ServiceAccount represents the structure of a service account.
type SetUserActiveStatusEvent ¶
type SetUserActiveStatusEvent struct { UserID string `json:"user_id"` IsActive bool `json:"is_active"` }
SetUserActiveStatusEvent represents the event of a user's active status change.
func (*SetUserActiveStatusEvent) Validate ¶
func (e *SetUserActiveStatusEvent) Validate() error
Validate validates the SetUserActiveStatusEvent data.
type Token ¶
type Token struct { Plaintext string Hash []byte UserID uuid.UUID Expiry time.Time Scope string Error error }
Token represents the structure of a token.
type UpdateAccountInput ¶
type UpdateAccountInput struct { UserID *uuid.UUID `json:"user_id"` AgencyID *uuid.UUID `json:"agencyId,omitempty"` CelebrityID *uuid.UUID `json:"celebrityId,omitempty"` BusinessID *uuid.UUID `json:"businessId,omitempty"` EnterpriseID *uuid.UUID `json:"enterpriseId,omitempty"` GovernmentID *uuid.UUID `json:"governmentId,omitempty"` }
UpdateAccount updates an existing account.
func (*UpdateAccountInput) GetAccountType ¶
func (input *UpdateAccountInput) GetAccountType() string
Adding this method to UpdateAccountInput struct
type UpdateAccountMembershipEvent ¶
type UpdateAccountMembershipEvent struct { AccountType string `json:"account_type,omitempty"` AccountID uuid.UUID `json:"account_id,omitempty"` UserID uuid.UUID `json:"user_id,omitempty"` Role string `json:"role,omitempty"` }
UpdateAccountMembershipEvent represents the structure of an update account membership event.
type UpdateBusinessAccountInput ¶
type UpdateBusinessAccountInput struct { UserID uuid.UUID `json:"user_id"` BusinessName string `json:"business_name"` NewBusinessName string `json:"new_business_name"` BusinessID uuid.UUID `json:"business_id"` }
func (*UpdateBusinessAccountInput) Validate ¶
func (u *UpdateBusinessAccountInput) Validate() error
type UpdateCelebrityAccountEvent ¶
type UpdateCelebrityAccountEvent struct { CelebrityID uuid.UUID `json:"celebrity_id"` UserID uuid.UUID `json:"user_id,omitempty"` NewName string `json:"new_name,omitempty"` }
func (*UpdateCelebrityAccountEvent) Validate ¶
func (e *UpdateCelebrityAccountEvent) Validate() error
type UpdateEnterpriseAccountInput ¶
type UpdateEnterpriseAccountInput struct { UserID uuid.UUID `json:"user_id"` EnterpriseID uuid.UUID `json:"enterprise_id"` UpdatedUserAccountID uuid.UUID `json:"updated_user_account_id"` }
UpdateEnterpriseAccountInput is the data structure for the request to update an enterprise account.
type UpdateGovernmentAccountEvent ¶
type UpdateGovernmentAccountEvent struct { UserID uuid.UUID `json:"user_id"` GovernmentName string `json:"government_name"` GovernmentID uuid.UUID `json:"government_id"` }
func (*UpdateGovernmentAccountEvent) Validate ¶
func (e *UpdateGovernmentAccountEvent) Validate() error
Validate checks if the UpdateGovernmentAccountEvent is valid
type UpdateMemberRoleInBusinessAccountInput ¶
type UpdateMemberRoleInBusinessAccountInput struct { BusinessID uuid.UUID `json:"business_id"` MemberUserID uuid.UUID `json:"member_user_id"` NewRoleID uuid.UUID `json:"new_role_id"` }
func (*UpdateMemberRoleInBusinessAccountInput) Validate ¶
func (input *UpdateMemberRoleInBusinessAccountInput) Validate() error
Validate validates input data for UpdateMemberRoleInBusinessAccountInput
type UpdateMemberRoleInCelebrityAccountEvent ¶
type UpdateMemberRoleInCelebrityAccountEvent struct { CelebrityID uuid.UUID `json:"celebrity_id,omitempty"` UserID uuid.UUID `json:"user_id,omitempty"` NewRole string `json:"new_role,omitempty"` }
UpdateMemberRoleInCelebrityAccountEvent represents the structure of an update member role in celebrity account event.
type UpdateMemberRoleInEnterpriseAccountRequest ¶
type UpdateMemberRoleInEnterpriseAccountRequest struct { UserID uuid.UUID `json:"user_id"` EnterpriseID uuid.UUID `json:"enterprise_id"` NewRoleID uuid.UUID `json:"new_role_id"` }
UpdateMemberRoleRequest represents the request payload to update the role of the member in an enterprise account.
type UpdateMemberRoleInGovernmentAccountEvent ¶
type UpdateMemberRoleInGovernmentAccountEvent struct { UserID uuid.UUID `json:"user_id"` GovernmentID uuid.UUID `json:"government_id"` NewRoleID uuid.UUID `json:"new_role_id"` }
func (*UpdateMemberRoleInGovernmentAccountEvent) Validate ¶
func (event *UpdateMemberRoleInGovernmentAccountEvent) Validate() error
type UpdateMetadataKeyInput ¶
type UpdatePermissionInput ¶
type UpdatePermissionInput struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Description string `json:"description"` }
func (*UpdatePermissionInput) Validate ¶
func (input *UpdatePermissionInput) Validate() error
type UpdateRoleInput ¶
type UpdateServiceAccountInput ¶
type UpdateServiceAccountInput struct { ID uuid.UUID `json:"id"` ServiceName string `json:"service_name"` Roles []string `json:"roles"` ExpiresAt *time.Time `json:"expires_at,omitempty"` }
UpdateServiceAccountInput represents the input data for updating a service account.
type UpdateUserPayload ¶
type UpdateUserPayload struct { Email *string `json:"email,omitempty"` Username *string `json:"username,omitempty"` FirstName *string `json:"first_name,omitempty"` LastName *string `json:"last_name,omitempty"` DisplayName *string `json:"display_name,omitempty"` IsActive *bool `json:"is_active,omitempty"` IsEmailVerified *bool `json:"is_email_verified,omitempty"` IsPhoneVerified *bool `json:"is_phone_verified,omitempty"` TwoFactorEnabled *bool `json:"two_factor_enabled,omitempty"` }
func (*UpdateUserPayload) Validate ¶
func (u *UpdateUserPayload) Validate() error
type User ¶
type User struct { ID uuid.UUID `json:"id"` Email string `json:"email"` Username string `json:"username,omitempty"` PasswordHash []byte `json:"-"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` DisplayName string `json:"display_name,omitempty"` AvatarURL string `json:"avatar_url,omitempty"` PhoneNumber string `json:"phone_number,omitempty"` IsActive bool `json:"is_active"` IsEmailVerified bool `json:"is_email_verified"` IsPhoneVerified bool `json:"is_phone_verified"` TwoFactorEnabled bool `json:"two_factor_enabled"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
User represents the structure of a user.
type UserInRoleCheckData ¶
type UserInRoleCheckData struct { UserID uuid.UUID `json:"user_id"` RoleID uuid.UUID `json:"role_id"` }
UserInRoleCheckData represents the input data for a user role check.
type UserMetadata ¶
type UserMetadata struct { ID uuid.UUID `json:"id"` UserID uuid.UUID `json:"user_id"` KeyID uuid.UUID `json:"key"` Value string `json:"value"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
UserMetadata represents the structure of a user metadata.
func (*UserMetadata) Validate ¶
func (u *UserMetadata) Validate() error
type UserMetadataUpdate ¶
type UserMetadataUpdate struct { ID uuid.UUID `json:"id"` UserID uuid.UUID `json:"user_id"` Key string `json:"key"` Value string `json:"value"` }
UserMetadataUpdate represents the input data for updating user metadata.
func (*UserMetadataUpdate) Validate ¶
func (u *UserMetadataUpdate) Validate() error
Validate validates the UserMetadataUpdate fields.
type UserRegistrationData ¶
UserRegistrationData represents the input data for a new user registration.
func (*UserRegistrationData) Validate ¶
func (d *UserRegistrationData) Validate() error
Validate validates the UserRegistrationData fields.
type UserRemoveRoleEvent ¶
type UserRemoveRoleEvent struct { UserID uuid.UUID `json:"user_id"` RoleID uuid.UUID `json:"role_id"` }
UserRemoveRoleEvent represents the payload structure for the RemoveRoleFromUser event.
func (*UserRemoveRoleEvent) Validate ¶
func (e *UserRemoveRoleEvent) Validate() error
Validate checks if the UserRemoveRoleEvent structure is valid.
type UserRoleData ¶
type UserUnassignRoleInput ¶
type VerifyAccountInput ¶
type VerifyAccountInput struct { AccountID uuid.UUID `json:"account_id"` AccountType string `json:"account_type"` }
VerifyAccountInput contains input parameters for VerifyAccount
type VerifyEmailEvent ¶
func (*VerifyEmailEvent) Validate ¶
func (e *VerifyEmailEvent) Validate() error