resources

package
v0.7.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim added in v0.3.0

type Claim struct {
	Key
	Attributes ClaimAttributes `json:"attributes"`
}

type ClaimAttributes added in v0.3.0

type ClaimAttributes struct {
	ClaimId   string    `json:"claim_id"`
	CreatedAt time.Time `json:"created_at"`
	RequestId string    `json:"request_id"`
	SchemaUrl string    `json:"schema_url"`
	Status    string    `json:"status"`
	UpdatedAt time.Time `json:"updated_at"`
}

type ClaimListResponse added in v0.3.0

type ClaimListResponse struct {
	Data     []Claim         `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*ClaimListResponse) GetMeta added in v0.3.0

func (r *ClaimListResponse) GetMeta(out interface{}) error

func (*ClaimListResponse) PutMeta added in v0.3.0

func (r *ClaimListResponse) PutMeta(v interface{}) (err error)

type ClaimOffer

type ClaimOffer struct {
	Key
	Attributes ClaimOfferAttributes `json:"attributes"`
}

type ClaimOfferAttributes added in v0.2.0

type ClaimOfferAttributes struct {
	Body     interface{} `json:"body"`
	From     string      `json:"from"`
	Id       string      `json:"id"`
	ThreadID string      `json:"threadID"`
	To       string      `json:"to"`
	Typ      string      `json:"typ"`
	Type     string      `json:"type"`
}

type ClaimOfferListResponse added in v0.2.0

type ClaimOfferListResponse struct {
	Data     []ClaimOffer    `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*ClaimOfferListResponse) GetMeta added in v0.2.0

func (r *ClaimOfferListResponse) GetMeta(out interface{}) error

func (*ClaimOfferListResponse) PutMeta added in v0.2.0

func (r *ClaimOfferListResponse) PutMeta(v interface{}) (err error)

type ClaimOfferResponse added in v0.2.0

type ClaimOfferResponse struct {
	Data     ClaimOffer `json:"data"`
	Included Included   `json:"included"`
}

type ClaimResponse added in v0.3.0

type ClaimResponse struct {
	Data     Claim    `json:"data"`
	Included Included `json:"included"`
}

type ClaimSchema

type ClaimSchema struct {
	Key
	Attributes ClaimSchemaAttributes `json:"attributes"`
}

type ClaimSchemaAttributes

type ClaimSchemaAttributes struct {
	ActionType string `json:"action_type"`
	SchemaType string `json:"schema_type"`
	SchemaUrl  string `json:"schema_url"`
}

type ClaimSchemaListResponse

type ClaimSchemaListResponse struct {
	Data     []ClaimSchema   `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*ClaimSchemaListResponse) GetMeta

func (r *ClaimSchemaListResponse) GetMeta(out interface{}) error

func (*ClaimSchemaListResponse) PutMeta

func (r *ClaimSchemaListResponse) PutMeta(v interface{}) (err error)

type ClaimSchemaResponse

type ClaimSchemaResponse struct {
	Data     ClaimSchema `json:"data"`
	Included Included    `json:"included"`
}

type CredentialRequest added in v0.2.0

type CredentialRequest struct {
	// The ID of the organization that the group belongs to
	CredentialSchema string `json:"credentialSchema"`
	// JSON object containing the data to create a claim based on
	CredentialSubject json.RawMessage `json:"credentialSubject"`
	// The timestamp when the claim expires
	Expiration *int64 `json:"expiration,omitempty"`
	// Flag to include Merkle Tree proof or not
	MtProof bool `json:"mtProof"`
	// Flag to include Signature proof or not
	SignatureProof bool `json:"signatureProof"`
	// The type of the claim
	Type string `json:"type"`
}

type Details

type Details json.RawMessage

func (Details) MarshalJSON

func (d Details) MarshalJSON() ([]byte, error)

MarshalJSON - casts Details to []byte

func (*Details) Scan

func (r *Details) Scan(src interface{}) error

Scan - implements db driver method for auto unmarshal

func (Details) String

func (d Details) String() string

func (*Details) UnmarshalJSON

func (d *Details) UnmarshalJSON(data []byte) error

UnmarshalJSON - casts data to Details

func (Details) Value

func (r Details) Value() (driver.Value, error)

Value - implements db driver method for auto marshal

type Flag

type Flag struct {
	Name  string `json:"name"`
	Value int32  `json:"value"`
}

type Flagger

type Flagger interface {
	IsFlag() bool
}

type Flags

type Flags struct {
	Mask   int32  `json:"mask"`
	Values []Flag `json:"flags"`
}

func FlagsFromMask

func FlagsFromMask(mask int32, allFlags map[int32]string) Flags

type GetUploadForm added in v0.6.0

type GetUploadForm struct {
	Key
	Attributes GetUploadFormAttributes `json:"attributes"`
}

type GetUploadFormAttributes added in v0.6.0

type GetUploadFormAttributes struct {
	// MIME type of the document
	ContentType string `json:"content_type"`
}

type GetUploadFormListRequest added in v0.6.0

type GetUploadFormListRequest struct {
	Data     []GetUploadForm `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*GetUploadFormListRequest) GetMeta added in v0.6.0

func (r *GetUploadFormListRequest) GetMeta(out interface{}) error

func (*GetUploadFormListRequest) PutMeta added in v0.6.0

func (r *GetUploadFormListRequest) PutMeta(v interface{}) (err error)

type GetUploadFormRequest added in v0.6.0

type GetUploadFormRequest struct {
	Data     GetUploadForm `json:"data"`
	Included Included      `json:"included"`
}

type Group

type Group struct {
	Key
	Attributes    GroupAttributes     `json:"attributes"`
	Relationships *GroupRelationships `json:"relationships,omitempty"`
}

type GroupAttributes

type GroupAttributes struct {
	// The time (UTC) that the group was created in RFC3339 format
	CreatedAt time.Time `json:"created_at"`
	// JSON object containing the metadata information of the group
	Metadata json.RawMessage `json:"metadata"`
	// The ID of the organization that the group belongs to
	OrgId string `json:"org_id"`
	// JSON object containing the rules of the group, which will be used to generate claims for the group members
	Rules json.RawMessage `json:"rules"`
}

type GroupCreate

type GroupCreate struct {
	Key
	Attributes GroupCreateAttributes `json:"attributes"`
}

type GroupCreateAttributes

type GroupCreateAttributes struct {
	// JSON object containing the metadata information of the group
	Metadata json.RawMessage `json:"metadata"`
	// JSON object containing the rules of the group, which will be used to generate claims for the group members
	Rules json.RawMessage `json:"rules"`
}

type GroupCreateListRequest

type GroupCreateListRequest struct {
	Data     []GroupCreate   `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*GroupCreateListRequest) GetMeta

func (r *GroupCreateListRequest) GetMeta(out interface{}) error

func (*GroupCreateListRequest) PutMeta

func (r *GroupCreateListRequest) PutMeta(v interface{}) (err error)

type GroupCreateRequest

type GroupCreateRequest struct {
	Data     GroupCreate `json:"data"`
	Included Included    `json:"included"`
}

type GroupListResponse

type GroupListResponse struct {
	Data     []Group         `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*GroupListResponse) GetMeta

func (r *GroupListResponse) GetMeta(out interface{}) error

func (*GroupListResponse) PutMeta

func (r *GroupListResponse) PutMeta(v interface{}) (err error)

type GroupRelationships

type GroupRelationships struct {
	GroupUsers RelationCollection `json:"group_users"`
}

type GroupResponse

type GroupResponse struct {
	Data     Group    `json:"data"`
	Included Included `json:"included"`
}

type GroupUser

type GroupUser struct {
	Key
	Attributes GroupUserAttributes `json:"attributes"`
}

type GroupUserAttributes

type GroupUserAttributes struct {
	// The time (UTC) that the group user was created in RFC3339 format
	CreatedAt time.Time `json:"created_at"`
	// The ID of the group that the user belongs to
	GroupId string `json:"group_id"`
	// The role of the group user. `undefined` (code 0) – The group user that was created but hasn't been verified yet by the organization  owner or group admin or superadmin. `employee` (code 1) – The group user that was verified by the organization owner or group admin or  superadmin by verifying verification request. `admin` (code 2) – The group user that was verified by the organization owner or group admin or superadmin as admin and has the ability to verify other group users. `superadmin` (code 3) – The group user that was verified by the organization owner or superadmin as  superadmin and has the the same permissions as organization owner.
	Role GroupUserRole `json:"role"`
	// The time (UTC) that the group user was updated in RFC3339 format
	UpdatedAt time.Time `json:"updated_at"`
	// The ID of the user that belongs to the group user
	UserId string `json:"user_id"`
}

type GroupUserListResponse

type GroupUserListResponse struct {
	Data     []GroupUser     `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*GroupUserListResponse) GetMeta

func (r *GroupUserListResponse) GetMeta(out interface{}) error

func (*GroupUserListResponse) PutMeta

func (r *GroupUserListResponse) PutMeta(v interface{}) (err error)

type GroupUserRelationships

type GroupUserRelationships struct {
	User Relation `json:"user"`
}

type GroupUserResponse

type GroupUserResponse struct {
	Data     GroupUser `json:"data"`
	Included Included  `json:"included"`
}

type GroupUserRole

type GroupUserRole int32
const (
	GroupUserRole_Undefined  GroupUserRole = 0
	GroupUserRole_Employee   GroupUserRole = 1
	GroupUserRole_Admin      GroupUserRole = 2
	GroupUserRole_Superadmin GroupUserRole = 3
)

func GroupUserRoleFromString

func GroupUserRoleFromString(s string) GroupUserRole

func (GroupUserRole) Int

func (r GroupUserRole) Int() int

func (GroupUserRole) Int16

func (r GroupUserRole) Int16() int16

func (GroupUserRole) MarshalJSON

func (r GroupUserRole) MarshalJSON() ([]byte, error)

func (GroupUserRole) String

func (r GroupUserRole) String() string

func (GroupUserRole) UInt32 added in v0.6.0

func (r GroupUserRole) UInt32() uint32

func (*GroupUserRole) UnmarshalJSON

func (r *GroupUserRole) UnmarshalJSON(b []byte) error

type Included

type Included struct {
	// contains filtered or unexported fields
}

Included - an array of Resource objects that are related to the primary data and/or each other (“included resources”).

func (*Included) Add

func (c *Included) Add(includes ...Resource)

Add - adds new include into collection. If one already present - skips it

func (Included) MarshalJSON

func (c Included) MarshalJSON() ([]byte, error)

MarshalJSON - marshals include collection as array of json objects

func (*Included) MustClaim added in v0.3.0

func (c *Included) MustClaim(key Key) *Claim

MustClaim - returns Claim from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustClaimOffer added in v0.2.0

func (c *Included) MustClaimOffer(key Key) *ClaimOffer

MustClaimOffer - returns ClaimOffer from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustClaimSchema

func (c *Included) MustClaimSchema(key Key) *ClaimSchema

MustClaimSchema - returns ClaimSchema from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustGetUploadForm added in v0.6.0

func (c *Included) MustGetUploadForm(key Key) *GetUploadForm

MustGetUploadForm - returns GetUploadForm from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustGroup

func (c *Included) MustGroup(key Key) *Group

MustGroup - returns Group from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustGroupCreate

func (c *Included) MustGroupCreate(key Key) *GroupCreate

MustGroupCreate - returns GroupCreate from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustGroupUser

func (c *Included) MustGroupUser(key Key) *GroupUser

MustGroupUser - returns GroupUser from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustInvitationAcceptEmail

func (c *Included) MustInvitationAcceptEmail(key Key) *InvitationAcceptEmail

MustInvitationAcceptEmail - returns InvitationAcceptEmail from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustInvitationCreateEmail

func (c *Included) MustInvitationCreateEmail(key Key) *InvitationCreateEmail

MustInvitationCreateEmail - returns InvitationCreateEmail from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustInvitationEmail

func (c *Included) MustInvitationEmail(key Key) *InvitationEmail

MustInvitationEmail - returns InvitationEmail from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustOrganization

func (c *Included) MustOrganization(key Key) *Organization

MustOrganization - returns Organization from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustOrganizationCreate

func (c *Included) MustOrganizationCreate(key Key) *OrganizationCreate

MustOrganizationCreate - returns OrganizationCreate from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustRequest

func (c *Included) MustRequest(key Key) *Request

MustRequest - returns Request from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustRequestFill

func (c *Included) MustRequestFill(key Key) *RequestFill

MustRequestFill - returns RequestFill from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustRequestVerify

func (c *Included) MustRequestVerify(key Key) *RequestVerify

MustRequestVerify - returns RequestVerify from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustUploadForm added in v0.6.0

func (c *Included) MustUploadForm(key Key) *UploadForm

MustUploadForm - returns UploadForm from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustUser

func (c *Included) MustUser(key Key) *User

MustUser - returns User from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustVerificationCode

func (c *Included) MustVerificationCode(key Key) *VerificationCode

MustVerificationCode - returns VerificationCode from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) UnmarshalJSON

func (c *Included) UnmarshalJSON(data []byte) error

UmarshalJSON - unmarshal array of json objects into include collection

type InvitationAcceptEmail

type InvitationAcceptEmail struct {
	Key
	Attributes InvitationAcceptEmailAttributes `json:"attributes"`
}

type InvitationAcceptEmailAttributes

type InvitationAcceptEmailAttributes struct {
	// The one-time password that the user must use to accept the invitation
	Otp string `json:"otp"`
	// The DID of the user that the request is associated with, can be empty if user hasn't accepted the invitation yet
	UserDid string `json:"user_did"`
}

type InvitationAcceptEmailListRequest

type InvitationAcceptEmailListRequest struct {
	Data     []InvitationAcceptEmail `json:"data"`
	Included Included                `json:"included"`
	Links    *Links                  `json:"links"`
	Meta     json.RawMessage         `json:"meta,omitempty"`
}

func (*InvitationAcceptEmailListRequest) GetMeta

func (r *InvitationAcceptEmailListRequest) GetMeta(out interface{}) error

func (*InvitationAcceptEmailListRequest) PutMeta

func (r *InvitationAcceptEmailListRequest) PutMeta(v interface{}) (err error)

type InvitationAcceptEmailRequest

type InvitationAcceptEmailRequest struct {
	Data     InvitationAcceptEmail `json:"data"`
	Included Included              `json:"included"`
}

type InvitationCreateEmail

type InvitationCreateEmail struct {
	Key
	Attributes InvitationCreateEmailAttributes `json:"attributes"`
}

type InvitationCreateEmailAttributes

type InvitationCreateEmailAttributes struct {
	// Credential requests to an issuer
	CredentialRequests *[]CredentialRequest `json:"credential_requests,omitempty"`
	// The email address of the user that the invitation email is sent to
	Email string `json:"email"`
}

type InvitationCreateEmailListRequest

type InvitationCreateEmailListRequest struct {
	Data     []InvitationCreateEmail `json:"data"`
	Included Included                `json:"included"`
	Links    *Links                  `json:"links"`
	Meta     json.RawMessage         `json:"meta,omitempty"`
}

func (*InvitationCreateEmailListRequest) GetMeta

func (r *InvitationCreateEmailListRequest) GetMeta(out interface{}) error

func (*InvitationCreateEmailListRequest) PutMeta

func (r *InvitationCreateEmailListRequest) PutMeta(v interface{}) (err error)

type InvitationCreateEmailRequest

type InvitationCreateEmailRequest struct {
	Data     InvitationCreateEmail `json:"data"`
	Included Included              `json:"included"`
}

type InvitationEmail

type InvitationEmail struct {
	Key
	Attributes    InvitationEmailAttributes     `json:"attributes"`
	Relationships *InvitationEmailRelationships `json:"relationships,omitempty"`
}

type InvitationEmailAttributes

type InvitationEmailAttributes struct {
	// Claim UUID
	ClaimId *string `json:"claim_id,omitempty"`
	// The time (UTC) that the email invitation was created in RFC3339 format
	CreatedAt time.Time `json:"created_at"`
	// The email address of the user that the invitation email is sent to
	Email string `json:"email"`
	// The ID of the group
	GroupId string `json:"group_id"`
	// The ID of the organization that the group belongs to
	OrgId string `json:"org_id"`
	// The ID of the request that the invitation email is associated with
	ReqId string `json:"req_id"`
}

type InvitationEmailListResponse

type InvitationEmailListResponse struct {
	Data     []InvitationEmail `json:"data"`
	Included Included          `json:"included"`
	Links    *Links            `json:"links"`
	Meta     json.RawMessage   `json:"meta,omitempty"`
}

func (*InvitationEmailListResponse) GetMeta

func (r *InvitationEmailListResponse) GetMeta(out interface{}) error

func (*InvitationEmailListResponse) PutMeta

func (r *InvitationEmailListResponse) PutMeta(v interface{}) (err error)

type InvitationEmailRelationships

type InvitationEmailRelationships struct {
	Request Relation `json:"request"`
}

type InvitationEmailResponse

type InvitationEmailResponse struct {
	Data     InvitationEmail `json:"data"`
	Included Included        `json:"included"`
}

type Key

type Key struct {
	ID   string       `json:"id"`
	Type ResourceType `json:"type"`
}

func NewKeyInt64

func NewKeyInt64(id int64, resourceType ResourceType) Key

func (Key) AsRelation

func (r Key) AsRelation() *Relation

func (*Key) GetKey

func (r *Key) GetKey() Key

func (Key) GetKeyP

func (r Key) GetKeyP() *Key
type Links struct {
	First string `json:"first,omitempty"`
	Last  string `json:"last,omitempty"`
	Next  string `json:"next,omitempty"`
	Prev  string `json:"prev,omitempty"`
	Self  string `json:"self,omitempty"`
}

type Organization

type Organization struct {
	Key
	Attributes    OrganizationAttributes     `json:"attributes"`
	Relationships *OrganizationRelationships `json:"relationships,omitempty"`
}

type OrganizationAttributes

type OrganizationAttributes struct {
	// The time (UTC) that the organization was created in RFC3339 format
	CreatedAt time.Time `json:"created_at"`
	// The DID of the organization, can be empty for the organizations with the status `unverified`
	Did *string `json:"did,omitempty"`
	// The domain of the organization
	Domain string `json:"domain"`
	// The number of claims issued by the organization
	IssuedClaimsCount string `json:"issued_claims_count"`
	// The number of members in the organization
	MembersCount string `json:"members_count"`
	// JSON object containing the metadata information of the organization
	Metadata json.RawMessage `json:"metadata"`
	// The status of the organization. `unverified` – The organization was created by the user and hasn't been verified yet. `verified` – The owner verified the organization's domain by adding code to the DNS record, verifying by the service, and creating the organization's DID issuer. As the result of the verification – the owner of the organization receives an \"owner role claim\".
	Status OrganizationStatus `json:"status"`
	// The time (UTC) that the organization was updated in RFC3339 format
	UpdatedAt time.Time `json:"updated_at"`
	// The base64 encoded verification code that was by service to verify the domain of the organization. Can be empty for the organizations with the status `unverified`
	VerificationCode *string `json:"verification_code,omitempty"`
}

type OrganizationCreate

type OrganizationCreate struct {
	Key
	Attributes OrganizationCreateAttributes `json:"attributes"`
}

type OrganizationCreateAttributes

type OrganizationCreateAttributes struct {
	// The domain of the organization
	Domain string `json:"domain"`
	// JSON object containing the metadata information of the organization
	Metadata json.RawMessage `json:"metadata"`
	// The DID of the owner of the organization
	OwnerDid string `json:"owner_did"`
}

type OrganizationCreateListRequest

type OrganizationCreateListRequest struct {
	Data     []OrganizationCreate `json:"data"`
	Included Included             `json:"included"`
	Links    *Links               `json:"links"`
	Meta     json.RawMessage      `json:"meta,omitempty"`
}

func (*OrganizationCreateListRequest) GetMeta

func (r *OrganizationCreateListRequest) GetMeta(out interface{}) error

func (*OrganizationCreateListRequest) PutMeta

func (r *OrganizationCreateListRequest) PutMeta(v interface{}) (err error)

type OrganizationCreateRequest

type OrganizationCreateRequest struct {
	Data     OrganizationCreate `json:"data"`
	Included Included           `json:"included"`
}

type OrganizationListResponse

type OrganizationListResponse struct {
	Data     []Organization  `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*OrganizationListResponse) GetMeta

func (r *OrganizationListResponse) GetMeta(out interface{}) error

func (*OrganizationListResponse) PutMeta

func (r *OrganizationListResponse) PutMeta(v interface{}) (err error)

type OrganizationRelationships

type OrganizationRelationships struct {
	Owner *Relation `json:"owner,omitempty"`
}

type OrganizationResponse

type OrganizationResponse struct {
	Data     Organization `json:"data"`
	Included Included     `json:"included"`
}

type OrganizationStatus

type OrganizationStatus int32
const (
	OrganizationStatus_Unverified OrganizationStatus = 0
	OrganizationStatus_Verified   OrganizationStatus = 1
)

func OrganizationStatusFromString

func OrganizationStatusFromString(s string) OrganizationStatus

func (OrganizationStatus) Int

func (s OrganizationStatus) Int() int

func (OrganizationStatus) Int16

func (s OrganizationStatus) Int16() int16

func (OrganizationStatus) Intp

func (s OrganizationStatus) Intp() *int

func (OrganizationStatus) MarshalJSON

func (s OrganizationStatus) MarshalJSON() ([]byte, error)

func (OrganizationStatus) String

func (s OrganizationStatus) String() string

func (*OrganizationStatus) UnmarshalJSON

func (s *OrganizationStatus) UnmarshalJSON(b []byte) error

type Relation

type Relation struct {
	Data  *Key   `json:"data,omitempty"`
	Links *Links `json:"links,omitempty"`
}

type RelationCollection

type RelationCollection struct {
	Data  []Key  `json:"data"`
	Links *Links `json:"links,omitempty"`
}

func (RelationCollection) MarshalJSON

func (r RelationCollection) MarshalJSON() ([]byte, error)

type Request

type Request struct {
	Key
	Attributes    RequestAttributes     `json:"attributes"`
	Relationships *RequestRelationships `json:"relationships,omitempty"`
}

type RequestAttributes

type RequestAttributes struct {
	// The time (UTC) that the group was created in RFC3339 format
	CreatedAt time.Time `json:"created_at"`
	// Credential requests to an issuer
	CredentialRequests []CredentialRequest `json:"credential_requests"`
	// The ID of the group
	GroupId string `json:"group_id"`
	// Object that represents request style and other data
	Metadata json.RawMessage `json:"metadata"`
	// The ID of the organization that the group belongs to
	OrgId string `json:"org_id"`
	// The request status. `created` – The request was created by the group admin or organization owner or superadmin and hasn't been filled yet by the user. `accepted` – The request was accepted by the user, user entity was created, request filled with `user_did` field. Email and `undefined` user role claims was issued for the user `filled` – The user filled the request but it hasn't been approved or rejected yet by the group admin or organization owner or superadmin. `approved` – The request was approved by the group admin or organization owner or superadmin. `rejected` – The request was rejected by the group admin or organization owner or superadmin. `submitted` – The request becomes submitted when claims were issues for the all fields in attributes and was submitted to the chain by the issuer service.
	Status RequestStatus `json:"status"`
	// The time (UTC) that the organization was updated in RFC3339 format
	UpdatedAt time.Time `json:"updated_at"`
	// The DID of the user that the request is associated with, can be empty if user hasn't accepted the invitation yet
	UserDid *string `json:"user_did,omitempty"`
}

type RequestFill

type RequestFill struct {
	Key
	Attributes RequestFillAttributes `json:"attributes"`
}

type RequestFillAttributes

type RequestFillAttributes struct {
	// Credential requests to an issuer
	CredentialRequests []CredentialRequest `json:"credential_requests"`
}

type RequestFillListRequest

type RequestFillListRequest struct {
	Data     []RequestFill   `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*RequestFillListRequest) GetMeta

func (r *RequestFillListRequest) GetMeta(out interface{}) error

func (*RequestFillListRequest) PutMeta

func (r *RequestFillListRequest) PutMeta(v interface{}) (err error)

type RequestFillRequest

type RequestFillRequest struct {
	Data     RequestFill `json:"data"`
	Included Included    `json:"included"`
}

type RequestListResponse

type RequestListResponse struct {
	Data     []Request       `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*RequestListResponse) GetMeta

func (r *RequestListResponse) GetMeta(out interface{}) error

func (*RequestListResponse) PutMeta

func (r *RequestListResponse) PutMeta(v interface{}) (err error)

type RequestRelationships

type RequestRelationships struct {
	Claims       *RelationCollection `json:"claims,omitempty"`
	Group        *Relation           `json:"group,omitempty"`
	Organization *Relation           `json:"organization,omitempty"`
}

type RequestResponse

type RequestResponse struct {
	Data     Request  `json:"data"`
	Included Included `json:"included"`
}

type RequestStatus

type RequestStatus int32
const (
	RequestStatus_Created   RequestStatus = 0
	RequestStatus_Accepted  RequestStatus = 1
	RequestStatus_Filled    RequestStatus = 2
	RequestStatus_Approved  RequestStatus = 3
	RequestStatus_Rejected  RequestStatus = 4
	RequestStatus_Submitted RequestStatus = 5
	RequestStatus_Claimed   RequestStatus = 6
)

func RequestStatusFromString

func RequestStatusFromString(s string) RequestStatus

func (RequestStatus) Int

func (s RequestStatus) Int() int

func (RequestStatus) Int16

func (s RequestStatus) Int16() int16

func (RequestStatus) IntP

func (s RequestStatus) IntP() *int

func (RequestStatus) MarshalJSON

func (s RequestStatus) MarshalJSON() ([]byte, error)

func (RequestStatus) String

func (s RequestStatus) String() string

func (*RequestStatus) UnmarshalJSON

func (s *RequestStatus) UnmarshalJSON(b []byte) error

type RequestVerify

type RequestVerify struct {
	Key
	Attributes RequestVerifyAttributes `json:"attributes"`
}

type RequestVerifyAttributes

type RequestVerifyAttributes struct {
	// The time (UTC) when claims will be issued
	ActivationDate time.Time `json:"activation_date"`
	// The approval status of the verification request. `true` – The verification request was approved. `false` – The verification request was rejected. In that case `metadata` and `role` fields could be empty.
	Approved bool `json:"approved"`
	// The time (UTC) when claims expire
	ExpirationDate time.Time `json:"expiration_date"`
	// JSON object containing the metadata (background, name, etc) information of the request
	Metadata json.RawMessage `json:"metadata"`
	// The role of the group user. 0 - `undefined` – The group user that was created but hasn't been verified yet by the organization owner or group admin or superadmin. 1 - `employee` – The group user that was verified by the organization owner or group admin or superadmin by verifying verification request. 2 - `admin` – The group user that was verified by the organization owner or group admin or superadmin as admin and has the ability to verify other group users. 3 - `superadmin` – The group user that was verified by the superadmin as superadmin and has the ability to verify other group users and has the highest permissions in the group.
	Role uint32 `json:"role"`
}

type RequestVerifyListRequest

type RequestVerifyListRequest struct {
	Data     []RequestVerify `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*RequestVerifyListRequest) GetMeta

func (r *RequestVerifyListRequest) GetMeta(out interface{}) error

func (*RequestVerifyListRequest) PutMeta

func (r *RequestVerifyListRequest) PutMeta(v interface{}) (err error)

type RequestVerifyRequest

type RequestVerifyRequest struct {
	Data     RequestVerify `json:"data"`
	Included Included      `json:"included"`
}

type Resource

type Resource interface {
	//GetKey - returns key of the Resource
	GetKey() Key
}

type ResourceType

type ResourceType string
const (
	CLAIMS                   ResourceType = "claims"
	GROUPS_CREATE            ResourceType = "groups-create"
	GROUPS                   ResourceType = "groups"
	GROUP_USERS              ResourceType = "group-users"
	INVITATIONS_ACCEPT_EMAIL ResourceType = "invitations-accept-email"
	INVITATIONS_CREATE_EMAIL ResourceType = "invitations-create-email"
	INVITATIONS_EMAIL        ResourceType = "invitations-email"
	ORGANIZATIONS_CREATE     ResourceType = "organizations-create"
	ORGANIZATIONS            ResourceType = "organizations"
	REQUESTS_FILL            ResourceType = "requests-fill"
	REQUESTS                 ResourceType = "requests"
	REQUESTS_VERIFY          ResourceType = "requests-verify"
	UPLOAD_FORM              ResourceType = "upload_form"
	USERS                    ResourceType = "users"
	VERIFICATION_CODES       ResourceType = "verification-codes"
)

List of ResourceType

type UploadForm added in v0.6.0

type UploadForm struct {
	Key
	Attributes UploadFormAttributes `json:"attributes"`
}

type UploadFormAttributes added in v0.6.0

type UploadFormAttributes struct {
	// Name of the bucket
	Bucket string `json:"bucket"`
	// Document identifier
	Key string `json:"key"`
	// Upload policy
	Policy string `json:"policy"`
	// URL to upload an object to
	Url            string `json:"url"`
	XAmzAlgorithm  string `json:"x-amz-algorithm"`
	XAmzCredential string `json:"x-amz-credential"`
	XAmzDate       string `json:"x-amz-date"`
	XAmzSignature  string `json:"x-amz-signature"`
}

type UploadFormListResponse added in v0.6.0

type UploadFormListResponse struct {
	Data     []UploadForm    `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*UploadFormListResponse) GetMeta added in v0.6.0

func (r *UploadFormListResponse) GetMeta(out interface{}) error

func (*UploadFormListResponse) PutMeta added in v0.6.0

func (r *UploadFormListResponse) PutMeta(v interface{}) (err error)

type UploadFormResponse added in v0.6.0

type UploadFormResponse struct {
	Data     UploadForm `json:"data"`
	Included Included   `json:"included"`
}

type User

type User struct {
	Key
	Attributes    UserAttributes     `json:"attributes"`
	Relationships *UserRelationships `json:"relationships,omitempty"`
}

type UserAttributes

type UserAttributes struct {
	// The time (UTC) that the user was created in RFC3339 format
	CreatedAt time.Time `json:"created_at"`
	// The DID of the user
	Did *string `json:"did,omitempty"`
	// The ID of the organization that the user belongs to
	OrgId string `json:"org_id"`
	// The global role of the user. `undefined` (code 100) – Basic user role. Any group role that does not corresponds to superadmin will be  mapped into this. `owner` (code 101) – The owner of some organization. `superadmin` (code 102) – The user with the same privileges as organization admin.
	Role UserRole `json:"role"`
	// The time (UTC) that the user was updated in RFC3339 format
	UpdatedAt time.Time `json:"updated_at"`
}

type UserListResponse

type UserListResponse struct {
	Data     []User          `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*UserListResponse) GetMeta

func (r *UserListResponse) GetMeta(out interface{}) error

func (*UserListResponse) PutMeta

func (r *UserListResponse) PutMeta(v interface{}) (err error)

type UserRelationships

type UserRelationships struct {
	Organization Relation `json:"organization"`
}

type UserResponse

type UserResponse struct {
	Data     User     `json:"data"`
	Included Included `json:"included"`
}

type UserRole

type UserRole int32
const (
	UserRole_Undefined  UserRole = 100
	UserRole_Owner      UserRole = 101
	UserRole_Superadmin UserRole = 102
)

func UserRoleFromString

func UserRoleFromString(s string) UserRole

func (UserRole) Int

func (r UserRole) Int() int

func (UserRole) Int16 added in v0.6.0

func (r UserRole) Int16() int16

func (UserRole) MarshalJSON

func (r UserRole) MarshalJSON() ([]byte, error)

func (UserRole) String

func (r UserRole) String() string

func (UserRole) UInt32 added in v0.6.0

func (r UserRole) UInt32() uint32

func (*UserRole) UnmarshalJSON

func (r *UserRole) UnmarshalJSON(b []byte) error

type VerificationCode

type VerificationCode struct {
	Key
	Attributes VerificationCodeAttributes `json:"attributes"`
}

type VerificationCodeAttributes

type VerificationCodeAttributes struct {
	// Verification code for particular organization that should be added to the TXT DNS record in the “rarimo.” subdomain of provided organization domain.
	Code string `json:"code"`
}

type VerificationCodeListResponse

type VerificationCodeListResponse struct {
	Data     []VerificationCode `json:"data"`
	Included Included           `json:"included"`
	Links    *Links             `json:"links"`
	Meta     json.RawMessage    `json:"meta,omitempty"`
}

func (*VerificationCodeListResponse) GetMeta

func (r *VerificationCodeListResponse) GetMeta(out interface{}) error

func (*VerificationCodeListResponse) PutMeta

func (r *VerificationCodeListResponse) PutMeta(v interface{}) (err error)

type VerificationCodeResponse

type VerificationCodeResponse struct {
	Data     VerificationCode `json:"data"`
	Included Included         `json:"included"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL