itsyouonline

package
v0.0.0-...-d3d53d6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MultipleOf

func MultipleOf(num interface{}, value string) error

Types

type Address

type Address struct {
	City       string `json:"city" validate:"max=30,nonzero"`
	Country    string `json:"country" validate:"max=40,nonzero"`
	Label      string `json:"label" validate:"nonzero"`
	Nr         string `json:"nr" validate:"max=10,nonzero"`
	Other      string `json:"other,omitempty" validate:"max=30"`
	Postalcode string `json:"postalcode" validate:"max=20,nonzero"`
	Street     string `json:"street" validate:"max=50,nonzero"`
}

func (Address) Validate

func (s Address) Validate() error

type Authorization

type Authorization struct {
	Addresses      string             `json:"addresses,omitempty"`
	Bankaccounts   string             `json:"bankaccounts,omitempty"`
	Emailaddresses string             `json:"emailaddresses,omitempty"`
	Facebook       bool               `json:"facebook,omitempty"`
	Github         bool               `json:"github,omitempty"`
	GrantedTo      string             `json:"grantedTo" validate:"nonzero"`
	Organizations  []string           `json:"organizations" validate:"nonzero"`
	Phonenumbers   string             `json:"phonenumbers,omitempty"`
	PublicKeys     []AuthorizationMap `json:"publicKeys,omitempty"`
	Username       string             `json:"username" validate:"nonzero"`
}

For an explanation about scopes and scopemapping, see https://github.com/itsyouonline/identityserver/blob/master/docs/oauth2/scopes.md

func (Authorization) Validate

func (s Authorization) Validate() error

type AuthorizationMap

type AuthorizationMap struct {
	Reallabel      Label `json:"reallabel" validate:"nonzero"`
	Requestedlabel Label `json:"requestedlabel" validate:"nonzero"`
}

Mapping between requested labels and real labels

func (AuthorizationMap) Validate

func (s AuthorizationMap) Validate() error

type BankAccount

type BankAccount struct {
	Bic     string `json:"bic" validate:"max=11,nonzero"`
	Country string `json:"country" validate:"max=40,nonzero"`
	Iban    string `json:"iban" validate:"max=30,nonzero"`
	Label   string `json:"label" validate:"nonzero"`
}

func (BankAccount) Validate

func (s BankAccount) Validate() error

type CompaniesService

type CompaniesService service

func (*CompaniesService) CompaniesGlobalIdValidateGet

func (s *CompaniesService) CompaniesGlobalIdValidateGet(globalId string, headers, queryParams map[string]interface{}) (*http.Response, error)

func (*CompaniesService) CreateCompany

func (s *CompaniesService) CreateCompany(company Company, headers, queryParams map[string]interface{}) (*http.Response, error)

Register a new company

func (*CompaniesService) CreateCompanyContract

func (s *CompaniesService) CreateCompanyContract(globalId string, contract Contract, headers, queryParams map[string]interface{}) (Contract, *http.Response, error)

Create a new contract.

func (*CompaniesService) GetCompany

func (s *CompaniesService) GetCompany(globalId string, headers, queryParams map[string]interface{}) (Company, *http.Response, error)

Get organization info

func (*CompaniesService) GetCompanyContracts

func (s *CompaniesService) GetCompanyContracts(globalId string, headers, queryParams map[string]interface{}) (*http.Response, error)

Get the contracts where the organization is 1 of the parties. Order descending by date.

func (*CompaniesService) GetCompanyInfo

func (s *CompaniesService) GetCompanyInfo(globalId string, headers, queryParams map[string]interface{}) (companyview, *http.Response, error)

func (*CompaniesService) GetCompanyList

func (s *CompaniesService) GetCompanyList(headers, queryParams map[string]interface{}) ([]Company, *http.Response, error)

Get companies. Authorization limits are applied to requesting user.

func (*CompaniesService) UpdateCompany

func (s *CompaniesService) UpdateCompany(globalId string, headers, queryParams map[string]interface{}) (Company, *http.Response, error)

Update existing company. Updating “globalId“ is not allowed.

type Company

type Company struct {
	Expire        DateTime `json:"expire,omitempty"`
	Globalid      string   `json:"globalid" validate:"min=3,max=150,regexp=^[a-z0-9]{3,150}$,nonzero"`
	Info          []string `json:"info,omitempty" validate:"max=20"`
	Organizations []string `json:"organizations,omitempty" validate:"max=100"`
	PublicKeys    []string `json:"publicKeys" validate:"max=20,nonzero"`
	Taxnr         string   `json:"taxnr,omitempty"`
}

func (Company) Validate

func (s Company) Validate() error

type Contract

type Contract struct {
	Content      string      `json:"content" validate:"nonzero"`
	ContractId   string      `json:"contractId" validate:"nonzero"`
	ContractType string      `json:"contractType" validate:"max=40,nonzero"`
	Expires      DateTime    `json:"expires" validate:"nonzero"`
	Extends      []string    `json:"extends,omitempty" validate:"max=10"`
	Invalidates  []string    `json:"invalidates,omitempty" validate:"max=10"`
	Parties      []Party     `json:"parties" validate:"min=2,max=20,nonzero"`
	Signatures   []Signature `json:"signatures" validate:"nonzero"`
}

func (Contract) Validate

func (s Contract) Validate() error

type ContractSigningRequest

type ContractSigningRequest struct {
	ContractId string `json:"contractId" validate:"nonzero"`
	Party      string `json:"party" validate:"nonzero"`
}

func (ContractSigningRequest) Validate

func (s ContractSigningRequest) Validate() error

type ContractsService

type ContractsService service

func (*ContractsService) GetContract

func (s *ContractsService) GetContract(contractId string, headers, queryParams map[string]interface{}) (Contract, *http.Response, error)

Get a contract

func (*ContractsService) SignContract

func (s *ContractsService) SignContract(contractId string, signature Signature, headers, queryParams map[string]interface{}) (*http.Response, error)

Sign a contract

type Date

type Date time.Time

Date represent RFC3399 date

func (*Date) MarshalJSON

func (t *Date) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*Date) MarshalText

func (t *Date) MarshalText() ([]byte, error)

MarshalText override marshalText

func (*Date) String

func (t *Date) String() string

func (*Date) UnmarshalJSON

func (t *Date) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

func (*Date) UnmarshalText

func (t *Date) UnmarshalText(b []byte) error

UnmarshalText override unmarshalText

type DateOnly

type DateOnly time.Time

DateOnly represent RAML date-only type The "full-date" notation of RFC3339, namely yyyy-mm-dd. Does not support time or time zone-offset notation.

func (*DateOnly) MarshalJSON

func (do *DateOnly) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*DateOnly) String

func (do *DateOnly) String() string

String returns string representation

func (*DateOnly) UnmarshalJSON

func (do *DateOnly) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

type DateTime

type DateTime time.Time

DateTime is timestamp in "date-time" format defined in RFC3339

func (*DateTime) MarshalJSON

func (dt *DateTime) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*DateTime) String

func (dt *DateTime) String() string

String returns it's string representation

func (*DateTime) UnmarshalJSON

func (dt *DateTime) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

type DateTimeRFC2616

type DateTimeRFC2616 time.Time

DateTimeRFC2616 is timestamp in RFC2616 format

func (*DateTimeRFC2616) MarshalJSON

func (dt *DateTimeRFC2616) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*DateTimeRFC2616) String

func (dt *DateTimeRFC2616) String() string

String returns it's string representation

func (*DateTimeRFC2616) UnmarshalJSON

func (dt *DateTimeRFC2616) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

type DatetimeOnly

type DatetimeOnly time.Time

DatetimeOnly represent RAML datetime-only type Combined date-only and time-only with a separator of "T", namely yyyy-mm-ddThh:mm:ss[.ff...]. Does not support a time zone offset.

func (*DatetimeOnly) MarshalJSON

func (dto *DatetimeOnly) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*DatetimeOnly) String

func (dto *DatetimeOnly) String() string

String returns string representation

func (*DatetimeOnly) UnmarshalJSON

func (dto *DatetimeOnly) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

type DigitalAssetAddress

type DigitalAssetAddress struct {
	Address        string   `json:"address" validate:"nonzero"`
	Currencysymbol string   `json:"currencysymbol" validate:"nonzero"`
	Expire         DateTime `json:"expire" validate:"nonzero"`
	Label          string   `json:"label" validate:"nonzero"`
	Noexpiration   bool     `json:"noexpiration,omitempty"`
}

func (DigitalAssetAddress) Validate

func (s DigitalAssetAddress) Validate() error

type DigitalWalletAuthorization

type DigitalWalletAuthorization struct {
	Currency       string `json:"currency" validate:"min=1,max=15,nonzero"`
	Reallabel      Label  `json:"reallabel" validate:"nonzero"`
	Requestedlabel Label  `json:"requestedlabel" validate:"nonzero"`
}

Mapping between requested labels and real label. Also has a 'currency' property

func (DigitalWalletAuthorization) Validate

func (s DigitalWalletAuthorization) Validate() error

type EmailAddress

type EmailAddress struct {
	Emailaddress string `json:"emailaddress" validate:"nonzero"`
	Label        string `json:"label" validate:"nonzero"`
}

func (EmailAddress) Validate

func (s EmailAddress) Validate() error

type Error

type Error struct {
	Error string `json:"error" validate:"nonzero"`
}

func (Error) Validate

func (s Error) Validate() error

type FacebookAccount

type FacebookAccount struct {
	Id      int    `json:"id" validate:"nonzero"`
	Link    string `json:"link" validate:"nonzero"`
	Name    string `json:"name" validate:"nonzero"`
	Picture string `json:"picture" validate:"nonzero"`
}

func (FacebookAccount) Validate

func (s FacebookAccount) Validate() error

type GithubAccount

type GithubAccount struct {
	Avatar_url string `json:"avatar_url" validate:"nonzero"`
	Html_url   string `json:"html_url" validate:"nonzero"`
	Id         int    `json:"id" validate:"nonzero"`
	Login      string `json:"login" validate:"nonzero"`
	Name       string `json:"name" validate:"nonzero"`
}

func (GithubAccount) Validate

func (s GithubAccount) Validate() error

type Itsyouonline

type Itsyouonline struct {
	AuthHeader string // Authorization header, will be sent on each request if not empty
	BaseURI    string

	Companies     *CompaniesService
	Contracts     *ContractsService
	Organizations *OrganizationsService
	Users         *UsersService
	// contains filtered or unexported fields
}

func NewItsyouonline

func NewItsyouonline() *Itsyouonline

func (*Itsyouonline) CreateJWTToken

func (c *Itsyouonline) CreateJWTToken(scopes, auds []string) (string, error)

CreateJWTToken creates JWT token with scope=scopes and audience=auds. To execute it, client need to be logged in.

func (*Itsyouonline) LoginWithClientCredentials

func (c *Itsyouonline) LoginWithClientCredentials(clientID, clientSecret string) (username, globalid, token string, err error)

LoginWithClientCredentials login to itsyouonline using the client ID and client secret. If succeed:

  • the authenticated user in the username or the globalid of the authenticated organization
  • returns the oauth2 access token
  • set AuthHeader to `token TOKEN_VALUE`.

type JoinOrganizationInvitation

type JoinOrganizationInvitation struct {
	Created      DateTime `json:"created,omitempty"`
	Organization string   `json:"organization" validate:"nonzero"`
	Role         string   `json:"role" validate:"nonzero"`
	User         string   `json:"user" validate:"nonzero"`
}

func (JoinOrganizationInvitation) Validate

func (s JoinOrganizationInvitation) Validate() error

type Label

type Label string

func (Label) Validate

func (s Label) Validate() error

type Member

type Member struct {
	Username string `json:"username" validate:"nonzero"`
}

func (Member) Validate

func (s Member) Validate() error

type Organization

type Organization struct {
	Dns        []string `json:"dns" validate:"max=100,nonzero"`
	Globalid   string   `json:"globalid" validate:"min=3,max=150,regexp=^[a-z0-9]{3,150}$,nonzero"`
	Includes   []string `json:"includes" validate:"max=100,nonzero"`
	Members    []string `json:"members" validate:"max=2000,nonzero"`
	Owners     []string `json:"owners" validate:"max=20,nonzero"`
	PublicKeys []string `json:"publicKeys" validate:"max=20,nonzero"`
}

func (Organization) Validate

func (s Organization) Validate() error

type OrganizationAPIKey

type OrganizationAPIKey struct {
	CallbackURL                string `json:"callbackURL,omitempty" validate:"min=5,max=250"`
	ClientCredentialsGrantType bool   `json:"clientCredentialsGrantType,omitempty"`
	Label                      Label  `json:"label" validate:"nonzero"`
	Secret                     string `json:"secret,omitempty" validate:"max=250"`
}

func (OrganizationAPIKey) Validate

func (s OrganizationAPIKey) Validate() error

type OrganizationTreeItem

type OrganizationTreeItem struct {
	Children []OrganizationTreeItem `json:"children" validate:"nonzero"`
	Globalid string                 `json:"globalid" validate:"nonzero"`
}

func (OrganizationTreeItem) Validate

func (s OrganizationTreeItem) Validate() error

type OrganizationsGlobalidApikeysLabelPutReqBody

type OrganizationsGlobalidApikeysLabelPutReqBody struct {
	Type OrganizationAPIKey `json:"type" validate:"nonzero"`
}

func (OrganizationsGlobalidApikeysLabelPutReqBody) Validate

type OrganizationsGlobalidDnsDnsnamePostReqBody

type OrganizationsGlobalidDnsDnsnamePostReqBody struct {
	Name string `json:"name" validate:"min=4,max=250,nonzero"`
}

func (OrganizationsGlobalidDnsDnsnamePostReqBody) Validate

type OrganizationsGlobalidDnsDnsnamePostRespBody

type OrganizationsGlobalidDnsDnsnamePostRespBody struct {
	Name string `json:"name" validate:"nonzero"`
}

func (OrganizationsGlobalidDnsDnsnamePostRespBody) Validate

type OrganizationsGlobalidDnsDnsnamePutReqBody

type OrganizationsGlobalidDnsDnsnamePutReqBody struct {
	Newname string `json:"newname" validate:"min=4,max=250,nonzero"`
	Oldname string `json:"oldname" validate:"min=4,max=250,nonzero"`
}

func (OrganizationsGlobalidDnsDnsnamePutReqBody) Validate

type OrganizationsGlobalidLogoPutReqBody

type OrganizationsGlobalidLogoPutReqBody struct {
}

func (OrganizationsGlobalidLogoPutReqBody) Validate

type OrganizationsGlobalidMembersPutReqBody

type OrganizationsGlobalidMembersPutReqBody struct {
	Role     string `json:"role" validate:"nonzero"`
	Username string `json:"username" validate:"nonzero"`
}

func (OrganizationsGlobalidMembersPutReqBody) Validate

type OrganizationsGlobalidOrgmembersPostReqBody

type OrganizationsGlobalidOrgmembersPostReqBody struct {
	Orgmember string `json:"orgmember" validate:"nonzero"`
}

func (OrganizationsGlobalidOrgmembersPostReqBody) Validate

type OrganizationsGlobalidOrgmembersPutReqBody

type OrganizationsGlobalidOrgmembersPutReqBody struct {
	Org  string `json:"org" validate:"nonzero"`
	Role string `json:"role" validate:"nonzero"`
}

func (OrganizationsGlobalidOrgmembersPutReqBody) Validate

type OrganizationsGlobalidOrgmembersPutRespBody

type OrganizationsGlobalidOrgmembersPutRespBody struct {
	Org Organization `json:"org" validate:"nonzero"`
}

func (OrganizationsGlobalidOrgmembersPutRespBody) Validate

type OrganizationsGlobalidOrgownersPostReqBody

type OrganizationsGlobalidOrgownersPostReqBody struct {
	Orgowner string `json:"orgowner" validate:"nonzero"`
}

func (OrganizationsGlobalidOrgownersPostReqBody) Validate

type OrganizationsService

type OrganizationsService service

func (*OrganizationsService) AddOrganizationMember

func (s *OrganizationsService) AddOrganizationMember(globalid string, member Member, headers, queryParams map[string]interface{}) (Member, *http.Response, error)

Assign a member to organization.

func (*OrganizationsService) AddOrganizationOwner

func (s *OrganizationsService) AddOrganizationOwner(globalid string, member Member, headers, queryParams map[string]interface{}) (Member, *http.Response, error)

Invite a user to become owner of an organization.

func (*OrganizationsService) AddOrganizationRegistryEntry

func (s *OrganizationsService) AddOrganizationRegistryEntry(globalid string, registryentry RegistryEntry, headers, queryParams map[string]interface{}) (RegistryEntry, *http.Response, error)

Adds a RegistryEntry to the organization's registry, if the key is already used, it is overwritten.

func (*OrganizationsService) CreateNewOrganization

func (s *OrganizationsService) CreateNewOrganization(organization Organization, headers, queryParams map[string]interface{}) (Organization, *http.Response, error)

Create a new organization. 1 user should be in the owners list. Validation is performed to check if the securityScheme allows management on this user.

func (*OrganizationsService) CreateNewOrganizationAPIKey

func (s *OrganizationsService) CreateNewOrganizationAPIKey(globalid string, organizationapikey OrganizationAPIKey, headers, queryParams map[string]interface{}) (OrganizationAPIKey, *http.Response, error)

Create a new API Key, a secret itself should not be provided, it will be generated serverside.

func (*OrganizationsService) CreateNewSubOrganization

func (s *OrganizationsService) CreateNewSubOrganization(globalid string, organization Organization, headers, queryParams map[string]interface{}) (Organization, *http.Response, error)

Create a new suborganization.

func (*OrganizationsService) CreateOrganizationContracty

func (s *OrganizationsService) CreateOrganizationContracty(globalid string, contract Contract, headers, queryParams map[string]interface{}) (Contract, *http.Response, error)

Create a new contract.

func (*OrganizationsService) CreateOrganizationDNS

func (s *OrganizationsService) CreateOrganizationDNS(dnsname, globalid string, organizationsglobaliddnsdnsnamepostreqbody OrganizationsGlobalidDnsDnsnamePostReqBody, headers, queryParams map[string]interface{}) (OrganizationsGlobalidDnsDnsnamePostRespBody, *http.Response, error)

Creates a new DNS name associated with an organization

func (*OrganizationsService) DeleteOrganizaitonDNS

func (s *OrganizationsService) DeleteOrganizaitonDNS(dnsname, globalid string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes a DNS name

func (*OrganizationsService) DeleteOrganization

func (s *OrganizationsService) DeleteOrganization(globalid string, headers, queryParams map[string]interface{}) (*http.Response, error)

Deletes an organization and all data linked to it (join-organization-invitations, oauth_access_tokens, oauth_clients, logo)

func (*OrganizationsService) DeleteOrganizationAPIKey

func (s *OrganizationsService) DeleteOrganizationAPIKey(label, globalid string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes an API key

func (s *OrganizationsService) DeleteOrganizationLogo(globalid string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes the Logo from an organization

func (*OrganizationsService) DeleteOrganizationRegistryEntry

func (s *OrganizationsService) DeleteOrganizationRegistryEntry(key, globalid string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes a RegistryEntry from the organization's registry

func (*OrganizationsService) Get2faValidityTime

func (s *OrganizationsService) Get2faValidityTime(globalid string, headers, queryParams map[string]interface{}) (int, *http.Response, error)

Get the 2FA validity time for the organization, in seconds

func (*OrganizationsService) GetOrganization

func (s *OrganizationsService) GetOrganization(globalid string, headers, queryParams map[string]interface{}) (Organization, *http.Response, error)

Get organization info

func (*OrganizationsService) GetOrganizationAPIKey

func (s *OrganizationsService) GetOrganizationAPIKey(label, globalid string, headers, queryParams map[string]interface{}) (OrganizationAPIKey, *http.Response, error)

func (*OrganizationsService) GetOrganizationAPIKeyLabels

func (s *OrganizationsService) GetOrganizationAPIKeyLabels(globalid string, headers, queryParams map[string]interface{}) ([]string, *http.Response, error)

Get the list of active api keys.

func (*OrganizationsService) GetOrganizationContracts

func (s *OrganizationsService) GetOrganizationContracts(globalid string, headers, queryParams map[string]interface{}) (*http.Response, error)

Get the contracts where the organization is 1 of the parties. Order descending by date.

func (s *OrganizationsService) GetOrganizationLogo(globalid string, headers, queryParams map[string]interface{}) (string, *http.Response, error)

Get the Logo from an organization

func (*OrganizationsService) GetOrganizationRegistryEntry

func (s *OrganizationsService) GetOrganizationRegistryEntry(key, globalid string, headers, queryParams map[string]interface{}) (RegistryEntry, *http.Response, error)

Get a RegistryEntry from the organization's registry.

func (*OrganizationsService) GetOrganizationTree

func (s *OrganizationsService) GetOrganizationTree(globalid string, headers, queryParams map[string]interface{}) ([]OrganizationTreeItem, *http.Response, error)

func (*OrganizationsService) GetPendingOrganizationInvitations

func (s *OrganizationsService) GetPendingOrganizationInvitations(globalid string, headers, queryParams map[string]interface{}) ([]JoinOrganizationInvitation, *http.Response, error)

Get the list of pending invitations for users to join this organization.

func (*OrganizationsService) ListOrganizationRegistry

func (s *OrganizationsService) ListOrganizationRegistry(globalid string, headers, queryParams map[string]interface{}) ([]RegistryEntry, *http.Response, error)

Lists the RegistryEntries in an organization's registry.

func (*OrganizationsService) RemoveOrganizationMember

func (s *OrganizationsService) RemoveOrganizationMember(username, globalid string, headers, queryParams map[string]interface{}) (*http.Response, error)

Remove a member from an organization.

func (*OrganizationsService) RemoveOrganizationOwner

func (s *OrganizationsService) RemoveOrganizationOwner(username, globalid string, headers, queryParams map[string]interface{}) (*http.Response, error)

Remove an owner from organization

func (*OrganizationsService) RemovePendingOrganizationInvitation

func (s *OrganizationsService) RemovePendingOrganizationInvitation(username, globalid string, headers, queryParams map[string]interface{}) (*http.Response, error)

Cancel a pending invitation.

func (*OrganizationsService) Set2faValidityTime

func (s *OrganizationsService) Set2faValidityTime(globalid string, int int, headers, queryParams map[string]interface{}) (*http.Response, error)

Update the 2FA validity time for the organization

func (s *OrganizationsService) SetOrganizationLogo(globalid string, organizationsglobalidlogoputreqbody OrganizationsGlobalidLogoPutReqBody, headers, queryParams map[string]interface{}) (string, *http.Response, error)

Set the organization Logo for the organization

func (*OrganizationsService) UpdateOrganization

func (s *OrganizationsService) UpdateOrganization(globalid string, organization Organization, headers, queryParams map[string]interface{}) (Organization, *http.Response, error)

Update organization info

func (*OrganizationsService) UpdateOrganizationAPIKey

func (s *OrganizationsService) UpdateOrganizationAPIKey(label, globalid string, organizationsglobalidapikeyslabelputreqbody OrganizationsGlobalidApikeysLabelPutReqBody, headers, queryParams map[string]interface{}) (*http.Response, error)

Updates the label or other properties of a key.

func (*OrganizationsService) UpdateOrganizationDNS

func (s *OrganizationsService) UpdateOrganizationDNS(dnsname, globalid string, organizationsglobaliddnsdnsnameputreqbody OrganizationsGlobalidDnsDnsnamePutReqBody, headers, queryParams map[string]interface{}) (*http.Response, error)

Updates an existing DNS name associated with an organization

func (*OrganizationsService) UpdateOrganizationMemberShip

func (s *OrganizationsService) UpdateOrganizationMemberShip(globalid string, organizationsglobalidmembersputreqbody OrganizationsGlobalidMembersPutReqBody, headers, queryParams map[string]interface{}) (Organization, *http.Response, error)

Update an organization membership

type Party

type Party struct {
	Name string `json:"name" validate:"nonzero"`
	Type string `json:"type" validate:"nonzero"`
}

func (Party) Validate

func (s Party) Validate() error

type Phonenumber

type Phonenumber struct {
	Label       string `json:"label" validate:"nonzero"`
	Phonenumber string `json:"phonenumber" validate:"regexp=^\+?[0-9]+$,nonzero"`
}

func (Phonenumber) Validate

func (s Phonenumber) Validate() error

type PublicKey

type PublicKey struct {
	Label     Label  `json:"label" validate:"nonzero"`
	Publickey string `json:"publickey" validate:"nonzero"`
}

PublicKey of a user

func (PublicKey) Validate

func (s PublicKey) Validate() error

type RegistryEntry

type RegistryEntry struct {
	Key   string `json:"Key" validate:"min=1,max=256,nonzero"`
	Value string `json:"Value" validate:"max=1024,nonzero"`
}

func (RegistryEntry) Validate

func (s RegistryEntry) Validate() error

type Signature

type Signature struct {
	Date      DateTime `json:"date" validate:"nonzero"`
	PublicKey string   `json:"publicKey" validate:"nonzero"`
	Signature string   `json:"signature" validate:"nonzero"`
	SignedBy  string   `json:"signedBy" validate:"nonzero"`
}

func (Signature) Validate

func (s Signature) Validate() error

type TimeOnly

type TimeOnly time.Time

TimeOnly represent RAML time-only type. The "partial-time" notation of RFC3339, namely hh:mm:ss[.ff...]. Does not support date or time zone-offset notation.

func (*TimeOnly) MarshalJSON

func (to *TimeOnly) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*TimeOnly) String

func (to *TimeOnly) String() string

String returns string representation

func (*TimeOnly) UnmarshalJSON

func (to *TimeOnly) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

type User

type User struct {
	Addresses      []Address             `json:"addresses" validate:"nonzero"`
	Bankaccounts   []BankAccount         `json:"bankaccounts" validate:"nonzero"`
	Digitalwallet  []DigitalAssetAddress `json:"digitalwallet" validate:"nonzero"`
	Emailaddresses []EmailAddress        `json:"emailaddresses" validate:"nonzero"`
	Expire         DateTime              `json:"expire,omitempty"`
	Facebook       FacebookAccount       `json:"facebook,omitempty"`
	Firstname      string                `json:"firstname" validate:"nonzero"`
	Github         GithubAccount         `json:"github,omitempty"`
	Lastname       string                `json:"lastname" validate:"nonzero"`
	Phonenumbers   []Phonenumber         `json:"phonenumbers" validate:"nonzero"`
	PublicKeys     []string              `json:"publicKeys" validate:"nonzero"`
	Username       string                `json:"username" validate:"min=2,max=30,regexp=^[a-z0-9]{2,30}$,nonzero"`
}

func (User) Validate

func (s User) Validate() error

type UserAPIKey

type UserAPIKey struct {
	Apikey        string   `json:"apikey" validate:"nonzero"`
	Applicationid string   `json:"applicationid" validate:"nonzero"`
	Label         Label    `json:"label" validate:"nonzero"`
	Scopes        []string `json:"scopes" validate:"nonzero"`
	Username      string   `json:"username" validate:"nonzero"`
}

User specific API key

func (UserAPIKey) Validate

func (s UserAPIKey) Validate() error

type UsersService

type UsersService service

func (*UsersService) AcceptMembership

func (s *UsersService) AcceptMembership(role, globalid, username string, joinorganizationinvitation JoinOrganizationInvitation, headers, queryParams map[string]interface{}) (JoinOrganizationInvitation, *http.Response, error)

Accept membership in organization

func (*UsersService) AddApiKey

func (s *UsersService) AddApiKey(username string, usersusernameapikeyspostreqbody UsersUsernameApikeysPostReqBody, headers, queryParams map[string]interface{}) (UserAPIKey, *http.Response, error)

Adds an APIKey to the user

func (*UsersService) AddUserRegistryEntry

func (s *UsersService) AddUserRegistryEntry(username string, registryentry RegistryEntry, headers, queryParams map[string]interface{}) (RegistryEntry, *http.Response, error)

Adds a RegistryEntry to the user's registry, if the key is already used, it is overwritten.

func (*UsersService) CreateUser

func (s *UsersService) CreateUser(user User, headers, queryParams map[string]interface{}) (*http.Response, error)

Create a new user

func (*UsersService) CreateUserBankAccount

func (s *UsersService) CreateUserBankAccount(username string, usersusernamebankspostreqbody UsersUsernameBanksPostReqBody, headers, queryParams map[string]interface{}) (UsersUsernameBanksPostRespBody, *http.Response, error)

Create new bank account

func (*UsersService) CreateUserContract

func (s *UsersService) CreateUserContract(username string, contract Contract, headers, queryParams map[string]interface{}) (Contract, *http.Response, error)

Create a new contract.

func (*UsersService) DeleteAPIkey

func (s *UsersService) DeleteAPIkey(label, username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes an API key

func (*UsersService) DeleteAuthorization

func (s *UsersService) DeleteAuthorization(grantedTo, username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Remove the authorization for an organization, the granted organization will no longer have access the user's information.

func (*UsersService) DeleteDigitalAssetAddress

func (s *UsersService) DeleteDigitalAssetAddress(label, username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes an address

func (*UsersService) DeleteEmailAddress

func (s *UsersService) DeleteEmailAddress(label, username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes an email address

func (*UsersService) DeleteFacebookAccount

func (s *UsersService) DeleteFacebookAccount(username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Delete the associated facebook account

func (*UsersService) DeleteGithubAccount

func (s *UsersService) DeleteGithubAccount(username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Unlink Github Account

func (*UsersService) DeleteUserAddress

func (s *UsersService) DeleteUserAddress(label, username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes an address

func (*UsersService) DeleteUserBankAccount

func (s *UsersService) DeleteUserBankAccount(username, label string, headers, queryParams map[string]interface{}) (*http.Response, error)

Delete a BankAccount

func (*UsersService) DeleteUserPhonenumber

func (s *UsersService) DeleteUserPhonenumber(label, username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes a phonenumber

func (*UsersService) DeleteUserRegistryEntry

func (s *UsersService) DeleteUserRegistryEntry(key, username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes a RegistryEntry from the user's registry

func (*UsersService) GetAPIkey

func (s *UsersService) GetAPIkey(label, username string, headers, queryParams map[string]interface{}) (UserAPIKey, *http.Response, error)

Get an API key by label

func (*UsersService) GetAllAuthorizations

func (s *UsersService) GetAllAuthorizations(username string, headers, queryParams map[string]interface{}) ([]Authorization, *http.Response, error)

Get the list of authorizations.

func (*UsersService) GetAuthorization

func (s *UsersService) GetAuthorization(grantedTo, username string, headers, queryParams map[string]interface{}) (Authorization, *http.Response, error)

Get the authorization for a specific organization.

func (*UsersService) GetDigitalAssetAddressByLabel

func (s *UsersService) GetDigitalAssetAddressByLabel(label, username string, headers, queryParams map[string]interface{}) (DigitalAssetAddress, *http.Response, error)

func (*UsersService) GetDigitalWallet

func (s *UsersService) GetDigitalWallet(username string, headers, queryParams map[string]interface{}) ([]DigitalAssetAddress, *http.Response, error)

func (*UsersService) GetEmailAddresses

func (s *UsersService) GetEmailAddresses(username string, headers, queryParams map[string]interface{}) ([]EmailAddress, *http.Response, error)

Get a list of the user his email addresses.

func (*UsersService) GetNotifications

func (s *UsersService) GetNotifications(username string, headers, queryParams map[string]interface{}) (UsersUsernameNotificationsGetRespBody, *http.Response, error)

Get the list of notifications, these are pending invitations or approvals

func (*UsersService) GetTOTPSecret

func (s *UsersService) GetTOTPSecret(username string, headers, queryParams map[string]interface{}) (UsersUsernameTotpGetRespBody, *http.Response, error)

func (*UsersService) GetTwoFAMethods

func (s *UsersService) GetTwoFAMethods(username string, headers, queryParams map[string]interface{}) (UsersUsernameTwofamethodsGetRespBody, *http.Response, error)

Get the possible two factor authentication methods

func (*UsersService) GetUser

func (s *UsersService) GetUser(username string, headers, queryParams map[string]interface{}) (User, *http.Response, error)

func (*UsersService) GetUserAddressByLabel

func (s *UsersService) GetUserAddressByLabel(label, username string, headers, queryParams map[string]interface{}) (Address, *http.Response, error)

func (*UsersService) GetUserAddresses

func (s *UsersService) GetUserAddresses(username string, headers, queryParams map[string]interface{}) ([]Address, *http.Response, error)

func (*UsersService) GetUserBankAccountByLabel

func (s *UsersService) GetUserBankAccountByLabel(username, label string, headers, queryParams map[string]interface{}) (BankAccount, *http.Response, error)

func (*UsersService) GetUserBankAccounts

func (s *UsersService) GetUserBankAccounts(username string, headers, queryParams map[string]interface{}) ([]BankAccount, *http.Response, error)

func (*UsersService) GetUserContracts

func (s *UsersService) GetUserContracts(username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Get the contracts where the user is 1 of the parties. Order descending by date.

func (*UsersService) GetUserInformation

func (s *UsersService) GetUserInformation(username string, headers, queryParams map[string]interface{}) (userview, *http.Response, error)

func (*UsersService) GetUserOrganizations

func (s *UsersService) GetUserOrganizations(username string, headers, queryParams map[string]interface{}) (UsersUsernameOrganizationsGetRespBody, *http.Response, error)

Get the list organizations a user is owner or member of

func (*UsersService) GetUserPhoneNumbers

func (s *UsersService) GetUserPhoneNumbers(username string, headers, queryParams map[string]interface{}) ([]Phonenumber, *http.Response, error)

func (*UsersService) GetUserPhonenumberByLabel

func (s *UsersService) GetUserPhonenumberByLabel(label, username string, headers, queryParams map[string]interface{}) (Phonenumber, *http.Response, error)

func (*UsersService) GetUserRegistryEntry

func (s *UsersService) GetUserRegistryEntry(key, username string, headers, queryParams map[string]interface{}) (RegistryEntry, *http.Response, error)

Get a RegistryEntry from the user's registry.

func (*UsersService) LeaveOrganization

func (s *UsersService) LeaveOrganization(globalid, username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Removes the user from an organization

func (*UsersService) ListAPIKeys

func (s *UsersService) ListAPIKeys(username string, headers, queryParams map[string]interface{}) ([]UserAPIKey, *http.Response, error)

Lists the API keys

func (*UsersService) ListUserRegistry

func (s *UsersService) ListUserRegistry(username string, headers, queryParams map[string]interface{}) ([]RegistryEntry, *http.Response, error)

Lists the Registry entries

func (*UsersService) RegisterNewDigitalAssetAddress

func (s *UsersService) RegisterNewDigitalAssetAddress(username string, digitalassetaddress DigitalAssetAddress, headers, queryParams map[string]interface{}) (DigitalAssetAddress, *http.Response, error)

Register a new digital asset address

func (*UsersService) RegisterNewEmailAddress

func (s *UsersService) RegisterNewEmailAddress(username string, usersusernameemailaddressespostreqbody UsersUsernameEmailaddressesPostReqBody, headers, queryParams map[string]interface{}) (UsersUsernameEmailaddressesPostRespBody, *http.Response, error)

Register a new email address

func (*UsersService) RegisterNewUserAddress

func (s *UsersService) RegisterNewUserAddress(username string, address Address, headers, queryParams map[string]interface{}) (Address, *http.Response, error)

Register a new address

func (*UsersService) RegisterNewUserPhonenumber

func (s *UsersService) RegisterNewUserPhonenumber(username string, phonenumber Phonenumber, headers, queryParams map[string]interface{}) (Phonenumber, *http.Response, error)

Register a new phonenumber

func (*UsersService) RemoveTOTP

func (s *UsersService) RemoveTOTP(username string, headers, queryParams map[string]interface{}) (*http.Response, error)

func (*UsersService) SetupTOTP

func (s *UsersService) SetupTOTP(username string, usersusernametotppostreqbody UsersUsernameTotpPostReqBody, headers, queryParams map[string]interface{}) (*http.Response, error)

func (*UsersService) UpdateAPIkey

func (s *UsersService) UpdateAPIkey(label, username string, usersusernameapikeyslabelputreqbody UsersUsernameApikeysLabelPutReqBody, headers, queryParams map[string]interface{}) (*http.Response, error)

Updates the label for the api key

func (*UsersService) UpdateAuthorization

func (s *UsersService) UpdateAuthorization(grantedTo, username string, authorization Authorization, headers, queryParams map[string]interface{}) (*http.Response, error)

Modify which information an organization is able to see.

func (*UsersService) UpdateDigitalAssetAddress

func (s *UsersService) UpdateDigitalAssetAddress(label, username string, digitalassetaddress DigitalAssetAddress, headers, queryParams map[string]interface{}) (*http.Response, error)

Update the label and/or value of an existing address.

func (*UsersService) UpdateEmailAddress

func (s *UsersService) UpdateEmailAddress(label, username string, usersusernameemailaddresseslabelputreqbody UsersUsernameEmailaddressesLabelPutReqBody, headers, queryParams map[string]interface{}) (*http.Response, error)

Updates the label and/or value of an email address

func (*UsersService) UpdatePassword

func (s *UsersService) UpdatePassword(username string, usersusernamepasswordputreqbody UsersUsernamePasswordPutReqBody, headers, queryParams map[string]interface{}) (*http.Response, error)

Update the user his password

func (*UsersService) UpdateUserAddress

func (s *UsersService) UpdateUserAddress(label, username string, address Address, headers, queryParams map[string]interface{}) (*http.Response, error)

Update the label and/or value of an existing address.

func (*UsersService) UpdateUserBankAccount

func (s *UsersService) UpdateUserBankAccount(username, label string, bankaccount BankAccount, headers, queryParams map[string]interface{}) (*http.Response, error)

Update an existing bankaccount and label.

func (*UsersService) UpdateUserName

func (s *UsersService) UpdateUserName(username string, usersusernamenameputreqbody UsersUsernameNamePutReqBody, headers, queryParams map[string]interface{}) (*http.Response, error)

Update the user his firstname and lastname

func (*UsersService) UpdateUserPhonenumber

func (s *UsersService) UpdateUserPhonenumber(label, username string, phonenumber Phonenumber, headers, queryParams map[string]interface{}) (*http.Response, error)

Update the label and/or value of an existing phonenumber.

func (*UsersService) UsersUsernameOrganizationsGlobalidRolesRoleDelete

func (s *UsersService) UsersUsernameOrganizationsGlobalidRolesRoleDelete(role, globalid, username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Reject membership invitation in an organization.

func (*UsersService) ValidateEmailAddress

func (s *UsersService) ValidateEmailAddress(label, username string, headers, queryParams map[string]interface{}) (*http.Response, error)

Sends validation email to email address

func (*UsersService) ValidatePhonenumber

func (s *UsersService) ValidatePhonenumber(label, username string, headers, queryParams map[string]interface{}) (UsersUsernamePhonenumbersLabelActivatePostRespBody, *http.Response, error)

Sends validation text to phone numbers

func (*UsersService) ValidateUsername

func (s *UsersService) ValidateUsername(username string, headers, queryParams map[string]interface{}) (*http.Response, error)

func (*UsersService) VerifyPhoneNumber

func (s *UsersService) VerifyPhoneNumber(label, username string, usersusernamephonenumberslabelactivateputreqbody UsersUsernamePhonenumbersLabelActivatePutReqBody, headers, queryParams map[string]interface{}) (*http.Response, error)

Verifies a phone number

type UsersUsernameApikeysLabelPutReqBody

type UsersUsernameApikeysLabelPutReqBody struct {
	Label Label `json:"label" validate:"nonzero"`
}

func (UsersUsernameApikeysLabelPutReqBody) Validate

type UsersUsernameApikeysPostReqBody

type UsersUsernameApikeysPostReqBody struct {
	Label Label `json:"label" validate:"nonzero"`
}

func (UsersUsernameApikeysPostReqBody) Validate

type UsersUsernameBanksPostReqBody

type UsersUsernameBanksPostReqBody struct {
	Type BankAccount `json:"type" validate:"nonzero"`
}

func (UsersUsernameBanksPostReqBody) Validate

func (s UsersUsernameBanksPostReqBody) Validate() error

type UsersUsernameBanksPostRespBody

type UsersUsernameBanksPostRespBody struct {
	Type BankAccount `json:"type" validate:"nonzero"`
}

func (UsersUsernameBanksPostRespBody) Validate

type UsersUsernameEmailaddressesLabelPutReqBody

type UsersUsernameEmailaddressesLabelPutReqBody struct {
	Emailaddress string `json:"emailaddress" validate:"nonzero"`
	Label        Label  `json:"label" validate:"nonzero"`
}

func (UsersUsernameEmailaddressesLabelPutReqBody) Validate

type UsersUsernameEmailaddressesPostReqBody

type UsersUsernameEmailaddressesPostReqBody struct {
	Emailaddress string `json:"emailaddress" validate:"nonzero"`
	Label        Label  `json:"label" validate:"nonzero"`
}

func (UsersUsernameEmailaddressesPostReqBody) Validate

type UsersUsernameEmailaddressesPostRespBody

type UsersUsernameEmailaddressesPostRespBody struct {
	Emailaddress string `json:"emailaddress" validate:"nonzero"`
	Label        Label  `json:"label" validate:"nonzero"`
}

func (UsersUsernameEmailaddressesPostRespBody) Validate

type UsersUsernameNamePutReqBody

type UsersUsernameNamePutReqBody struct {
	Firstname string `json:"firstname" validate:"nonzero"`
	Lastname  string `json:"lastname" validate:"nonzero"`
}

func (UsersUsernameNamePutReqBody) Validate

func (s UsersUsernameNamePutReqBody) Validate() error

type UsersUsernameNotificationsGetRespBody

type UsersUsernameNotificationsGetRespBody struct {
	Approvals        []JoinOrganizationInvitation `json:"approvals" validate:"nonzero"`
	ContractRequests []ContractSigningRequest     `json:"contractRequests" validate:"nonzero"`
	Invitations      []JoinOrganizationInvitation `json:"invitations" validate:"nonzero"`
}

func (UsersUsernameNotificationsGetRespBody) Validate

type UsersUsernameOrganizationsGetRespBody

type UsersUsernameOrganizationsGetRespBody struct {
	Member []string `json:"member" validate:"nonzero"`
	Owner  []string `json:"owner" validate:"nonzero"`
}

func (UsersUsernameOrganizationsGetRespBody) Validate

type UsersUsernamePasswordPutReqBody

type UsersUsernamePasswordPutReqBody struct {
	Currentpassword string `json:"currentpassword" validate:"nonzero"`
	Newpassword     string `json:"newpassword" validate:"nonzero"`
}

func (UsersUsernamePasswordPutReqBody) Validate

type UsersUsernamePhonenumbersLabelActivatePostRespBody

type UsersUsernamePhonenumbersLabelActivatePostRespBody struct {
	Validationkey string `json:"validationkey" validate:"nonzero"`
}

func (UsersUsernamePhonenumbersLabelActivatePostRespBody) Validate

type UsersUsernamePhonenumbersLabelActivatePutReqBody

type UsersUsernamePhonenumbersLabelActivatePutReqBody struct {
	Smscode       string `json:"smscode" validate:"nonzero"`
	Validationkey string `json:"validationkey" validate:"nonzero"`
}

func (UsersUsernamePhonenumbersLabelActivatePutReqBody) Validate

type UsersUsernameTotpGetRespBody

type UsersUsernameTotpGetRespBody struct {
	Totpsecret string `json:"totpsecret" validate:"nonzero"`
}

func (UsersUsernameTotpGetRespBody) Validate

func (s UsersUsernameTotpGetRespBody) Validate() error

type UsersUsernameTotpPostReqBody

type UsersUsernameTotpPostReqBody struct {
	Totpcode string `json:"totpcode" validate:"nonzero"`
}

func (UsersUsernameTotpPostReqBody) Validate

func (s UsersUsernameTotpPostReqBody) Validate() error

type UsersUsernameTwofamethodsGetRespBody

type UsersUsernameTwofamethodsGetRespBody struct {
	Sms  []Phonenumber `json:"sms" validate:"nonzero"`
	Totp bool          `json:"totp" validate:"nonzero"`
}

func (UsersUsernameTwofamethodsGetRespBody) Validate

Source Files

Jump to

Keyboard shortcuts

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