api

package
v0.0.0-...-f60b9ba Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenapiFileServer

func OpenapiFileServer() http.Handler

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

type ApiKey

type ApiKey struct {
	APIKey string
}

func (*ApiKey) GetAPIKey

func (s *ApiKey) GetAPIKey() string

GetAPIKey returns the value of APIKey.

func (*ApiKey) SetAPIKey

func (s *ApiKey) SetAPIKey(val string)

SetAPIKey sets the value of APIKey.

type Client

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

Client implements OAS client.

func NewClient

func NewClient(serverURL string, sec SecuritySource, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) AddOrganization

func (c *Client) AddOrganization(ctx context.Context, request *Organization) (*Organization, error)

AddOrganization invokes AddOrganization operation.

Insert/update a single organization record.

POST /add-organization

func (*Client) AddPerson

func (c *Client) AddPerson(ctx context.Context, request *Person) (*Person, error)

AddPerson invokes AddPerson operation.

Insert/update a single person record.

POST /add-person

func (*Client) GetOrganization

func (c *Client) GetOrganization(ctx context.Context, request *GetOrganizationRequest) (*Organization, error)

GetOrganization invokes GetOrganization operation.

Get single organization record.

POST /get-organization

func (*Client) GetOrganizations

func (c *Client) GetOrganizations(ctx context.Context, request *GetOrganizationsRequest) (*OrganizationListResponse, error)

GetOrganizations invokes GetOrganizations operation.

Get all organization records.

POST /get-organizations

func (*Client) GetOrganizationsById

func (c *Client) GetOrganizationsById(ctx context.Context, request *GetOrganizationsByIdRequest) (*OrganizationListResponse, error)

GetOrganizationsById invokes GetOrganizationsById operation.

Get organization records by one of the extra identifiers.

POST /get-organizations-by-id

func (*Client) GetPeople

func (c *Client) GetPeople(ctx context.Context, request *GetPeopleRequest) (*PersonListResponse, error)

GetPeople invokes GetPeople operation.

Get all person records.

POST /get-people

func (*Client) GetPeopleById

func (c *Client) GetPeopleById(ctx context.Context, request *GetPeopleByIdRequest) (*PersonListResponse, error)

GetPeopleById invokes GetPeopleById operation.

Retrieve person records by one of the extra identifiers.

POST /get-people-by-id

func (*Client) GetPerson

func (c *Client) GetPerson(ctx context.Context, request *GetPersonRequest) (*Person, error)

GetPerson invokes GetPerson operation.

Retrieve a single person record.

POST /get-person

func (*Client) SetPersonOrcid

func (c *Client) SetPersonOrcid(ctx context.Context, request *SetPersonOrcidRequest) (*Person, error)

SetPersonOrcid invokes SetPersonOrcid operation.

Update person ORCID.

POST /set-person-orcid

func (*Client) SetPersonOrcidToken

func (c *Client) SetPersonOrcidToken(ctx context.Context, request *SetPersonOrcidTokenRequest) (*Person, error)

SetPersonOrcidToken invokes SetPersonOrcidToken operation.

Update person ORCID token.

POST /set-person-orcid-token

func (*Client) SetPersonRole

func (c *Client) SetPersonRole(ctx context.Context, request *SetPersonRoleRequest) (*Person, error)

SetPersonRole invokes SetPersonRole operation.

Update person role.

POST /set-person-role

func (*Client) SetPersonSettings

func (c *Client) SetPersonSettings(ctx context.Context, request *SetPersonSettingsRequest) (*Person, error)

SetPersonSettings invokes SetPersonSettings operation.

Update person settings.

POST /set-person-settings

func (*Client) SuggestOrganizations

func (c *Client) SuggestOrganizations(ctx context.Context, request *SuggestOrganizationsRequest) (*OrganizationListResponse, error)

SuggestOrganizations invokes SuggestOrganizations operation.

Search on organization records.

POST /suggest-organizations

func (*Client) SuggestPeople

func (c *Client) SuggestPeople(ctx context.Context, request *SuggestPeopleRequest) (*PersonListResponse, error)

SuggestPeople invokes SuggestPeople operation.

Search on person records.

POST /suggest-people

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type Error

type Error struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

Ref: #/components/schemas/Error

func (*Error) Decode

func (s *Error) Decode(d *jx.Decoder) error

Decode decodes Error from json.

func (*Error) Encode

func (s *Error) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Error) GetCode

func (s *Error) GetCode() int64

GetCode returns the value of Code.

func (*Error) GetMessage

func (s *Error) GetMessage() string

GetMessage returns the value of Message.

func (*Error) MarshalJSON

func (s *Error) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Error) SetCode

func (s *Error) SetCode(val int64)

SetCode sets the value of Code.

func (*Error) SetMessage

func (s *Error) SetMessage(val string)

SetMessage sets the value of Message.

func (*Error) UnmarshalJSON

func (s *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type ErrorStatusCode

type ErrorStatusCode struct {
	StatusCode int
	Response   Error
}

ErrorStatusCode wraps Error with StatusCode.

func (*ErrorStatusCode) Error

func (s *ErrorStatusCode) Error() string

func (*ErrorStatusCode) GetResponse

func (s *ErrorStatusCode) GetResponse() Error

GetResponse returns the value of Response.

func (*ErrorStatusCode) GetStatusCode

func (s *ErrorStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*ErrorStatusCode) SetResponse

func (s *ErrorStatusCode) SetResponse(val Error)

SetResponse sets the value of Response.

func (*ErrorStatusCode) SetStatusCode

func (s *ErrorStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

type GetOrganizationRequest

type GetOrganizationRequest struct {
	ID string `json:"id"`
}

Ref: #/components/schemas/GetOrganizationRequest

func (*GetOrganizationRequest) Decode

func (s *GetOrganizationRequest) Decode(d *jx.Decoder) error

Decode decodes GetOrganizationRequest from json.

func (*GetOrganizationRequest) Encode

func (s *GetOrganizationRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*GetOrganizationRequest) GetID

func (s *GetOrganizationRequest) GetID() string

GetID returns the value of ID.

func (*GetOrganizationRequest) MarshalJSON

func (s *GetOrganizationRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetOrganizationRequest) SetID

func (s *GetOrganizationRequest) SetID(val string)

SetID sets the value of ID.

func (*GetOrganizationRequest) UnmarshalJSON

func (s *GetOrganizationRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*GetOrganizationRequest) Validate

func (s *GetOrganizationRequest) Validate() error

type GetOrganizationsByIdRequest

type GetOrganizationsByIdRequest struct {
	ID []string `json:"id"`
}

Ref: #/components/schemas/GetOrganizationsByIdRequest

func (*GetOrganizationsByIdRequest) Decode

Decode decodes GetOrganizationsByIdRequest from json.

func (*GetOrganizationsByIdRequest) Encode

func (s *GetOrganizationsByIdRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*GetOrganizationsByIdRequest) GetID

func (s *GetOrganizationsByIdRequest) GetID() []string

GetID returns the value of ID.

func (*GetOrganizationsByIdRequest) MarshalJSON

func (s *GetOrganizationsByIdRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetOrganizationsByIdRequest) SetID

func (s *GetOrganizationsByIdRequest) SetID(val []string)

SetID sets the value of ID.

func (*GetOrganizationsByIdRequest) UnmarshalJSON

func (s *GetOrganizationsByIdRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*GetOrganizationsByIdRequest) Validate

func (s *GetOrganizationsByIdRequest) Validate() error

type GetOrganizationsRequest

type GetOrganizationsRequest struct {
	Cursor string `json:"cursor"`
}

Ref: #/components/schemas/GetOrganizationsRequest

func (*GetOrganizationsRequest) Decode

func (s *GetOrganizationsRequest) Decode(d *jx.Decoder) error

Decode decodes GetOrganizationsRequest from json.

func (*GetOrganizationsRequest) Encode

func (s *GetOrganizationsRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*GetOrganizationsRequest) GetCursor

func (s *GetOrganizationsRequest) GetCursor() string

GetCursor returns the value of Cursor.

func (*GetOrganizationsRequest) MarshalJSON

func (s *GetOrganizationsRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetOrganizationsRequest) SetCursor

func (s *GetOrganizationsRequest) SetCursor(val string)

SetCursor sets the value of Cursor.

func (*GetOrganizationsRequest) UnmarshalJSON

func (s *GetOrganizationsRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetPeopleByIdRequest

type GetPeopleByIdRequest struct {
	ID []string `json:"id"`
}

Ref: #/components/schemas/GetPeopleByIdRequest

func (*GetPeopleByIdRequest) Decode

func (s *GetPeopleByIdRequest) Decode(d *jx.Decoder) error

Decode decodes GetPeopleByIdRequest from json.

func (*GetPeopleByIdRequest) Encode

func (s *GetPeopleByIdRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*GetPeopleByIdRequest) GetID

func (s *GetPeopleByIdRequest) GetID() []string

GetID returns the value of ID.

func (*GetPeopleByIdRequest) MarshalJSON

func (s *GetPeopleByIdRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetPeopleByIdRequest) SetID

func (s *GetPeopleByIdRequest) SetID(val []string)

SetID sets the value of ID.

func (*GetPeopleByIdRequest) UnmarshalJSON

func (s *GetPeopleByIdRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*GetPeopleByIdRequest) Validate

func (s *GetPeopleByIdRequest) Validate() error

type GetPeopleRequest

type GetPeopleRequest struct {
	Cursor string `json:"cursor"`
}

Ref: #/components/schemas/GetPeopleRequest

func (*GetPeopleRequest) Decode

func (s *GetPeopleRequest) Decode(d *jx.Decoder) error

Decode decodes GetPeopleRequest from json.

func (*GetPeopleRequest) Encode

func (s *GetPeopleRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*GetPeopleRequest) GetCursor

func (s *GetPeopleRequest) GetCursor() string

GetCursor returns the value of Cursor.

func (*GetPeopleRequest) MarshalJSON

func (s *GetPeopleRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetPeopleRequest) SetCursor

func (s *GetPeopleRequest) SetCursor(val string)

SetCursor sets the value of Cursor.

func (*GetPeopleRequest) UnmarshalJSON

func (s *GetPeopleRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetPersonRequest

type GetPersonRequest struct {
	ID string `json:"id"`
}

Ref: #/components/schemas/GetPersonRequest

func (*GetPersonRequest) Decode

func (s *GetPersonRequest) Decode(d *jx.Decoder) error

Decode decodes GetPersonRequest from json.

func (*GetPersonRequest) Encode

func (s *GetPersonRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*GetPersonRequest) GetID

func (s *GetPersonRequest) GetID() string

GetID returns the value of ID.

func (*GetPersonRequest) MarshalJSON

func (s *GetPersonRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetPersonRequest) SetID

func (s *GetPersonRequest) SetID(val string)

SetID sets the value of ID.

func (*GetPersonRequest) UnmarshalJSON

func (s *GetPersonRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*GetPersonRequest) Validate

func (s *GetPersonRequest) Validate() error

type Handler

type Handler interface {
	// AddOrganization implements AddOrganization operation.
	//
	// Insert/update a single organization record.
	//
	// POST /add-organization
	AddOrganization(ctx context.Context, req *Organization) (*Organization, error)
	// AddPerson implements AddPerson operation.
	//
	// Insert/update a single person record.
	//
	// POST /add-person
	AddPerson(ctx context.Context, req *Person) (*Person, error)
	// GetOrganization implements GetOrganization operation.
	//
	// Get single organization record.
	//
	// POST /get-organization
	GetOrganization(ctx context.Context, req *GetOrganizationRequest) (*Organization, error)
	// GetOrganizations implements GetOrganizations operation.
	//
	// Get all organization records.
	//
	// POST /get-organizations
	GetOrganizations(ctx context.Context, req *GetOrganizationsRequest) (*OrganizationListResponse, error)
	// GetOrganizationsById implements GetOrganizationsById operation.
	//
	// Get organization records by one of the extra identifiers.
	//
	// POST /get-organizations-by-id
	GetOrganizationsById(ctx context.Context, req *GetOrganizationsByIdRequest) (*OrganizationListResponse, error)
	// GetPeople implements GetPeople operation.
	//
	// Get all person records.
	//
	// POST /get-people
	GetPeople(ctx context.Context, req *GetPeopleRequest) (*PersonListResponse, error)
	// GetPeopleById implements GetPeopleById operation.
	//
	// Retrieve person records by one of the extra identifiers.
	//
	// POST /get-people-by-id
	GetPeopleById(ctx context.Context, req *GetPeopleByIdRequest) (*PersonListResponse, error)
	// GetPerson implements GetPerson operation.
	//
	// Retrieve a single person record.
	//
	// POST /get-person
	GetPerson(ctx context.Context, req *GetPersonRequest) (*Person, error)
	// SetPersonOrcid implements SetPersonOrcid operation.
	//
	// Update person ORCID.
	//
	// POST /set-person-orcid
	SetPersonOrcid(ctx context.Context, req *SetPersonOrcidRequest) (*Person, error)
	// SetPersonOrcidToken implements SetPersonOrcidToken operation.
	//
	// Update person ORCID token.
	//
	// POST /set-person-orcid-token
	SetPersonOrcidToken(ctx context.Context, req *SetPersonOrcidTokenRequest) (*Person, error)
	// SetPersonRole implements SetPersonRole operation.
	//
	// Update person role.
	//
	// POST /set-person-role
	SetPersonRole(ctx context.Context, req *SetPersonRoleRequest) (*Person, error)
	// SetPersonSettings implements SetPersonSettings operation.
	//
	// Update person settings.
	//
	// POST /set-person-settings
	SetPersonSettings(ctx context.Context, req *SetPersonSettingsRequest) (*Person, error)
	// SuggestOrganizations implements SuggestOrganizations operation.
	//
	// Search on organization records.
	//
	// POST /suggest-organizations
	SuggestOrganizations(ctx context.Context, req *SuggestOrganizationsRequest) (*OrganizationListResponse, error)
	// SuggestPeople implements SuggestPeople operation.
	//
	// Search on person records.
	//
	// POST /suggest-people
	SuggestPeople(ctx context.Context, req *SuggestPeopleRequest) (*PersonListResponse, error)
	// NewError creates *ErrorStatusCode from error returned by handler.
	//
	// Used for common default response.
	NewError(ctx context.Context, err error) *ErrorStatusCode
}

Handler handles operations described by OpenAPI v3 specification.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OptBool

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (*OptBool) Decode

func (o *OptBool) Decode(d *jx.Decoder) error

Decode decodes bool from json.

func (OptBool) Encode

func (o OptBool) Encode(e *jx.Encoder)

Encode encodes bool as json.

func (OptBool) Get

func (o OptBool) Get() (v bool, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBool) IsSet

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptBool) Or

func (o OptBool) Or(d bool) bool

Or returns value if set, or given parameter if does not.

func (*OptBool) Reset

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

func (*OptBool) UnmarshalJSON

func (s *OptBool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptDateTime

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDateTime) Get

func (o OptDateTime) Get() (v time.Time, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptDateTime) IsSet

func (o OptDateTime) IsSet() bool

IsSet returns true if OptDateTime was set.

func (OptDateTime) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptDateTime) Or

func (o OptDateTime) Or(d time.Time) time.Time

Or returns value if set, or given parameter if does not.

func (*OptDateTime) Reset

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetTo

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDateTime) UnmarshalJSON

func (s *OptDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptPersonSettings

type OptPersonSettings struct {
	Value PersonSettings
	Set   bool
}

OptPersonSettings is optional PersonSettings.

func NewOptPersonSettings

func NewOptPersonSettings(v PersonSettings) OptPersonSettings

NewOptPersonSettings returns new OptPersonSettings with value set to v.

func (*OptPersonSettings) Decode

func (o *OptPersonSettings) Decode(d *jx.Decoder) error

Decode decodes PersonSettings from json.

func (OptPersonSettings) Encode

func (o OptPersonSettings) Encode(e *jx.Encoder)

Encode encodes PersonSettings as json.

func (OptPersonSettings) Get

func (o OptPersonSettings) Get() (v PersonSettings, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptPersonSettings) IsSet

func (o OptPersonSettings) IsSet() bool

IsSet returns true if OptPersonSettings was set.

func (OptPersonSettings) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptPersonSettings) Or

Or returns value if set, or given parameter if does not.

func (*OptPersonSettings) Reset

func (o *OptPersonSettings) Reset()

Reset unsets value.

func (*OptPersonSettings) SetTo

func (o *OptPersonSettings) SetTo(v PersonSettings)

SetTo sets value to v.

func (*OptPersonSettings) UnmarshalJSON

func (s *OptPersonSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type Organization

type Organization struct {
	ID          OptString            `json:"id"`
	DateCreated OptDateTime          `json:"date_created"`
	DateUpdated OptDateTime          `json:"date_updated"`
	Type        OptString            `json:"type"`
	Acronym     OptString            `json:"acronym"`
	NameDut     OptString            `json:"name_dut"`
	NameEng     OptString            `json:"name_eng"`
	Parent      []OrganizationParent `json:"parent"`
	Identifier  []PropertyValue      `json:"identifier"`
}

Ref: #/components/schemas/Organization

func (*Organization) Decode

func (s *Organization) Decode(d *jx.Decoder) error

Decode decodes Organization from json.

func (*Organization) Encode

func (s *Organization) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Organization) GetAcronym

func (s *Organization) GetAcronym() OptString

GetAcronym returns the value of Acronym.

func (*Organization) GetDateCreated

func (s *Organization) GetDateCreated() OptDateTime

GetDateCreated returns the value of DateCreated.

func (*Organization) GetDateUpdated

func (s *Organization) GetDateUpdated() OptDateTime

GetDateUpdated returns the value of DateUpdated.

func (*Organization) GetID

func (s *Organization) GetID() OptString

GetID returns the value of ID.

func (*Organization) GetIdentifier

func (s *Organization) GetIdentifier() []PropertyValue

GetIdentifier returns the value of Identifier.

func (*Organization) GetNameDut

func (s *Organization) GetNameDut() OptString

GetNameDut returns the value of NameDut.

func (*Organization) GetNameEng

func (s *Organization) GetNameEng() OptString

GetNameEng returns the value of NameEng.

func (*Organization) GetParent

func (s *Organization) GetParent() []OrganizationParent

GetParent returns the value of Parent.

func (*Organization) GetType

func (s *Organization) GetType() OptString

GetType returns the value of Type.

func (*Organization) MarshalJSON

func (s *Organization) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Organization) SetAcronym

func (s *Organization) SetAcronym(val OptString)

SetAcronym sets the value of Acronym.

func (*Organization) SetDateCreated

func (s *Organization) SetDateCreated(val OptDateTime)

SetDateCreated sets the value of DateCreated.

func (*Organization) SetDateUpdated

func (s *Organization) SetDateUpdated(val OptDateTime)

SetDateUpdated sets the value of DateUpdated.

func (*Organization) SetID

func (s *Organization) SetID(val OptString)

SetID sets the value of ID.

func (*Organization) SetIdentifier

func (s *Organization) SetIdentifier(val []PropertyValue)

SetIdentifier sets the value of Identifier.

func (*Organization) SetNameDut

func (s *Organization) SetNameDut(val OptString)

SetNameDut sets the value of NameDut.

func (*Organization) SetNameEng

func (s *Organization) SetNameEng(val OptString)

SetNameEng sets the value of NameEng.

func (*Organization) SetParent

func (s *Organization) SetParent(val []OrganizationParent)

SetParent sets the value of Parent.

func (*Organization) SetType

func (s *Organization) SetType(val OptString)

SetType sets the value of Type.

func (*Organization) UnmarshalJSON

func (s *Organization) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OrganizationListResponse

type OrganizationListResponse struct {
	Cursor OptString      `json:"cursor"`
	Data   []Organization `json:"data"`
}

Ref: #/components/schemas/OrganizationListResponse

func (*OrganizationListResponse) Decode

func (s *OrganizationListResponse) Decode(d *jx.Decoder) error

Decode decodes OrganizationListResponse from json.

func (*OrganizationListResponse) Encode

func (s *OrganizationListResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*OrganizationListResponse) GetCursor

func (s *OrganizationListResponse) GetCursor() OptString

GetCursor returns the value of Cursor.

func (*OrganizationListResponse) GetData

func (s *OrganizationListResponse) GetData() []Organization

GetData returns the value of Data.

func (*OrganizationListResponse) MarshalJSON

func (s *OrganizationListResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*OrganizationListResponse) SetCursor

func (s *OrganizationListResponse) SetCursor(val OptString)

SetCursor sets the value of Cursor.

func (*OrganizationListResponse) SetData

func (s *OrganizationListResponse) SetData(val []Organization)

SetData sets the value of Data.

func (*OrganizationListResponse) UnmarshalJSON

func (s *OrganizationListResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*OrganizationListResponse) Validate

func (s *OrganizationListResponse) Validate() error

type OrganizationMember

type OrganizationMember struct {
	ID          string      `json:"id"`
	DateCreated OptDateTime `json:"date_created"`
	DateUpdated OptDateTime `json:"date_updated"`
	From        time.Time   `json:"from"`
	Until       OptDateTime `json:"until"`
}

Ref: #/components/schemas/OrganizationMember

func (*OrganizationMember) Decode

func (s *OrganizationMember) Decode(d *jx.Decoder) error

Decode decodes OrganizationMember from json.

func (*OrganizationMember) Encode

func (s *OrganizationMember) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*OrganizationMember) GetDateCreated

func (s *OrganizationMember) GetDateCreated() OptDateTime

GetDateCreated returns the value of DateCreated.

func (*OrganizationMember) GetDateUpdated

func (s *OrganizationMember) GetDateUpdated() OptDateTime

GetDateUpdated returns the value of DateUpdated.

func (*OrganizationMember) GetFrom

func (s *OrganizationMember) GetFrom() time.Time

GetFrom returns the value of From.

func (*OrganizationMember) GetID

func (s *OrganizationMember) GetID() string

GetID returns the value of ID.

func (*OrganizationMember) GetUntil

func (s *OrganizationMember) GetUntil() OptDateTime

GetUntil returns the value of Until.

func (*OrganizationMember) MarshalJSON

func (s *OrganizationMember) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*OrganizationMember) SetDateCreated

func (s *OrganizationMember) SetDateCreated(val OptDateTime)

SetDateCreated sets the value of DateCreated.

func (*OrganizationMember) SetDateUpdated

func (s *OrganizationMember) SetDateUpdated(val OptDateTime)

SetDateUpdated sets the value of DateUpdated.

func (*OrganizationMember) SetFrom

func (s *OrganizationMember) SetFrom(val time.Time)

SetFrom sets the value of From.

func (*OrganizationMember) SetID

func (s *OrganizationMember) SetID(val string)

SetID sets the value of ID.

func (*OrganizationMember) SetUntil

func (s *OrganizationMember) SetUntil(val OptDateTime)

SetUntil sets the value of Until.

func (*OrganizationMember) UnmarshalJSON

func (s *OrganizationMember) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OrganizationParent

type OrganizationParent struct {
	ID          string      `json:"id"`
	DateCreated OptDateTime `json:"date_created"`
	DateUpdated OptDateTime `json:"date_updated"`
	From        time.Time   `json:"from"`
	Until       OptDateTime `json:"until"`
}

Ref: #/components/schemas/OrganizationParent

func (*OrganizationParent) Decode

func (s *OrganizationParent) Decode(d *jx.Decoder) error

Decode decodes OrganizationParent from json.

func (*OrganizationParent) Encode

func (s *OrganizationParent) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*OrganizationParent) GetDateCreated

func (s *OrganizationParent) GetDateCreated() OptDateTime

GetDateCreated returns the value of DateCreated.

func (*OrganizationParent) GetDateUpdated

func (s *OrganizationParent) GetDateUpdated() OptDateTime

GetDateUpdated returns the value of DateUpdated.

func (*OrganizationParent) GetFrom

func (s *OrganizationParent) GetFrom() time.Time

GetFrom returns the value of From.

func (*OrganizationParent) GetID

func (s *OrganizationParent) GetID() string

GetID returns the value of ID.

func (*OrganizationParent) GetUntil

func (s *OrganizationParent) GetUntil() OptDateTime

GetUntil returns the value of Until.

func (*OrganizationParent) MarshalJSON

func (s *OrganizationParent) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*OrganizationParent) SetDateCreated

func (s *OrganizationParent) SetDateCreated(val OptDateTime)

SetDateCreated sets the value of DateCreated.

func (*OrganizationParent) SetDateUpdated

func (s *OrganizationParent) SetDateUpdated(val OptDateTime)

SetDateUpdated sets the value of DateUpdated.

func (*OrganizationParent) SetFrom

func (s *OrganizationParent) SetFrom(val time.Time)

SetFrom sets the value of From.

func (*OrganizationParent) SetID

func (s *OrganizationParent) SetID(val string)

SetID sets the value of ID.

func (*OrganizationParent) SetUntil

func (s *OrganizationParent) SetUntil(val OptDateTime)

SetUntil sets the value of Until.

func (*OrganizationParent) UnmarshalJSON

func (s *OrganizationParent) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Person

type Person struct {
	ID                  OptString            `json:"id"`
	Active              OptBool              `json:"active"`
	DateCreated         OptDateTime          `json:"date_created"`
	DateUpdated         OptDateTime          `json:"date_updated"`
	Name                OptString            `json:"name"`
	GivenName           OptString            `json:"given_name"`
	FamilyName          OptString            `json:"family_name"`
	Email               OptString            `json:"email"`
	Token               []PropertyValue      `json:"token"`
	PreferredGivenName  OptString            `json:"preferred_given_name"`
	PreferredFamilyName OptString            `json:"preferred_family_name"`
	BirthDate           OptString            `json:"birth_date"`
	HonorificPrefix     OptString            `json:"honorific_prefix"`
	Identifier          []PropertyValue      `json:"identifier"`
	Organization        []OrganizationMember `json:"organization"`
	JobCategory         []string             `json:"job_category"`
	Role                []string             `json:"role"`
	Settings            OptPersonSettings    `json:"settings"`
	ObjectClass         []string             `json:"object_class"`
	ExpirationDate      OptString            `json:"expiration_date"`
}

Ref: #/components/schemas/Person

func (*Person) Decode

func (s *Person) Decode(d *jx.Decoder) error

Decode decodes Person from json.

func (*Person) Encode

func (s *Person) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Person) GetActive

func (s *Person) GetActive() OptBool

GetActive returns the value of Active.

func (*Person) GetBirthDate

func (s *Person) GetBirthDate() OptString

GetBirthDate returns the value of BirthDate.

func (*Person) GetDateCreated

func (s *Person) GetDateCreated() OptDateTime

GetDateCreated returns the value of DateCreated.

func (*Person) GetDateUpdated

func (s *Person) GetDateUpdated() OptDateTime

GetDateUpdated returns the value of DateUpdated.

func (*Person) GetEmail

func (s *Person) GetEmail() OptString

GetEmail returns the value of Email.

func (*Person) GetExpirationDate

func (s *Person) GetExpirationDate() OptString

GetExpirationDate returns the value of ExpirationDate.

func (*Person) GetFamilyName

func (s *Person) GetFamilyName() OptString

GetFamilyName returns the value of FamilyName.

func (*Person) GetGivenName

func (s *Person) GetGivenName() OptString

GetGivenName returns the value of GivenName.

func (*Person) GetHonorificPrefix

func (s *Person) GetHonorificPrefix() OptString

GetHonorificPrefix returns the value of HonorificPrefix.

func (*Person) GetID

func (s *Person) GetID() OptString

GetID returns the value of ID.

func (*Person) GetIdentifier

func (s *Person) GetIdentifier() []PropertyValue

GetIdentifier returns the value of Identifier.

func (*Person) GetJobCategory

func (s *Person) GetJobCategory() []string

GetJobCategory returns the value of JobCategory.

func (*Person) GetName

func (s *Person) GetName() OptString

GetName returns the value of Name.

func (*Person) GetObjectClass

func (s *Person) GetObjectClass() []string

GetObjectClass returns the value of ObjectClass.

func (*Person) GetOrganization

func (s *Person) GetOrganization() []OrganizationMember

GetOrganization returns the value of Organization.

func (*Person) GetPreferredFamilyName

func (s *Person) GetPreferredFamilyName() OptString

GetPreferredFamilyName returns the value of PreferredFamilyName.

func (*Person) GetPreferredGivenName

func (s *Person) GetPreferredGivenName() OptString

GetPreferredGivenName returns the value of PreferredGivenName.

func (*Person) GetRole

func (s *Person) GetRole() []string

GetRole returns the value of Role.

func (*Person) GetSettings

func (s *Person) GetSettings() OptPersonSettings

GetSettings returns the value of Settings.

func (*Person) GetToken

func (s *Person) GetToken() []PropertyValue

GetToken returns the value of Token.

func (*Person) MarshalJSON

func (s *Person) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Person) SetActive

func (s *Person) SetActive(val OptBool)

SetActive sets the value of Active.

func (*Person) SetBirthDate

func (s *Person) SetBirthDate(val OptString)

SetBirthDate sets the value of BirthDate.

func (*Person) SetDateCreated

func (s *Person) SetDateCreated(val OptDateTime)

SetDateCreated sets the value of DateCreated.

func (*Person) SetDateUpdated

func (s *Person) SetDateUpdated(val OptDateTime)

SetDateUpdated sets the value of DateUpdated.

func (*Person) SetEmail

func (s *Person) SetEmail(val OptString)

SetEmail sets the value of Email.

func (*Person) SetExpirationDate

func (s *Person) SetExpirationDate(val OptString)

SetExpirationDate sets the value of ExpirationDate.

func (*Person) SetFamilyName

func (s *Person) SetFamilyName(val OptString)

SetFamilyName sets the value of FamilyName.

func (*Person) SetGivenName

func (s *Person) SetGivenName(val OptString)

SetGivenName sets the value of GivenName.

func (*Person) SetHonorificPrefix

func (s *Person) SetHonorificPrefix(val OptString)

SetHonorificPrefix sets the value of HonorificPrefix.

func (*Person) SetID

func (s *Person) SetID(val OptString)

SetID sets the value of ID.

func (*Person) SetIdentifier

func (s *Person) SetIdentifier(val []PropertyValue)

SetIdentifier sets the value of Identifier.

func (*Person) SetJobCategory

func (s *Person) SetJobCategory(val []string)

SetJobCategory sets the value of JobCategory.

func (*Person) SetName

func (s *Person) SetName(val OptString)

SetName sets the value of Name.

func (*Person) SetObjectClass

func (s *Person) SetObjectClass(val []string)

SetObjectClass sets the value of ObjectClass.

func (*Person) SetOrganization

func (s *Person) SetOrganization(val []OrganizationMember)

SetOrganization sets the value of Organization.

func (*Person) SetPreferredFamilyName

func (s *Person) SetPreferredFamilyName(val OptString)

SetPreferredFamilyName sets the value of PreferredFamilyName.

func (*Person) SetPreferredGivenName

func (s *Person) SetPreferredGivenName(val OptString)

SetPreferredGivenName sets the value of PreferredGivenName.

func (*Person) SetRole

func (s *Person) SetRole(val []string)

SetRole sets the value of Role.

func (*Person) SetSettings

func (s *Person) SetSettings(val OptPersonSettings)

SetSettings sets the value of Settings.

func (*Person) SetToken

func (s *Person) SetToken(val []PropertyValue)

SetToken sets the value of Token.

func (*Person) UnmarshalJSON

func (s *Person) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PersonListResponse

type PersonListResponse struct {
	Cursor OptString `json:"cursor"`
	Data   []Person  `json:"data"`
}

Ref: #/components/schemas/PersonListResponse

func (*PersonListResponse) Decode

func (s *PersonListResponse) Decode(d *jx.Decoder) error

Decode decodes PersonListResponse from json.

func (*PersonListResponse) Encode

func (s *PersonListResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PersonListResponse) GetCursor

func (s *PersonListResponse) GetCursor() OptString

GetCursor returns the value of Cursor.

func (*PersonListResponse) GetData

func (s *PersonListResponse) GetData() []Person

GetData returns the value of Data.

func (*PersonListResponse) MarshalJSON

func (s *PersonListResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PersonListResponse) SetCursor

func (s *PersonListResponse) SetCursor(val OptString)

SetCursor sets the value of Cursor.

func (*PersonListResponse) SetData

func (s *PersonListResponse) SetData(val []Person)

SetData sets the value of Data.

func (*PersonListResponse) UnmarshalJSON

func (s *PersonListResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PersonListResponse) Validate

func (s *PersonListResponse) Validate() error

type PersonSettings

type PersonSettings map[string]string

func (*PersonSettings) Decode

func (s *PersonSettings) Decode(d *jx.Decoder) error

Decode decodes PersonSettings from json.

func (PersonSettings) Encode

func (s PersonSettings) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (PersonSettings) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PersonSettings) UnmarshalJSON

func (s *PersonSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PropertyValue

type PropertyValue struct {
	Type       string `json:"type"`
	PropertyID string `json:"property_id"`
	Value      string `json:"value"`
}

Ref: #/components/schemas/PropertyValue

func (*PropertyValue) Decode

func (s *PropertyValue) Decode(d *jx.Decoder) error

Decode decodes PropertyValue from json.

func (*PropertyValue) Encode

func (s *PropertyValue) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PropertyValue) GetPropertyID

func (s *PropertyValue) GetPropertyID() string

GetPropertyID returns the value of PropertyID.

func (*PropertyValue) GetType

func (s *PropertyValue) GetType() string

GetType returns the value of Type.

func (*PropertyValue) GetValue

func (s *PropertyValue) GetValue() string

GetValue returns the value of Value.

func (*PropertyValue) MarshalJSON

func (s *PropertyValue) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PropertyValue) SetPropertyID

func (s *PropertyValue) SetPropertyID(val string)

SetPropertyID sets the value of PropertyID.

func (*PropertyValue) SetType

func (s *PropertyValue) SetType(val string)

SetType sets the value of Type.

func (*PropertyValue) SetValue

func (s *PropertyValue) SetValue(val string)

SetValue sets the value of Value.

func (*PropertyValue) UnmarshalJSON

func (s *PropertyValue) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Route

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

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

type SecurityHandler

type SecurityHandler interface {
	// HandleApiKey handles apiKey security.
	HandleApiKey(ctx context.Context, operationName string, t ApiKey) (context.Context, error)
}

SecurityHandler is handler for security parameters.

type SecuritySource

type SecuritySource interface {
	// ApiKey provides apiKey security value.
	ApiKey(ctx context.Context, operationName string) (ApiKey, error)
}

SecuritySource is provider of security values (tokens, passwords, etc.).

type Server

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

Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.

func NewServer

func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

ServerOption is server config option.

func WithErrorHandler

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type Service

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

func NewService

func NewService(repository models.Repository) *Service

func (*Service) AddOrganization

func (s *Service) AddOrganization(ctx context.Context, o *Organization) (*Organization, error)

func (*Service) AddPerson

func (s *Service) AddPerson(ctx context.Context, p *Person) (*Person, error)

func (*Service) GetOrganization

func (s *Service) GetOrganization(ctx context.Context, req *GetOrganizationRequest) (*Organization, error)

func (*Service) GetOrganizations

func (s *Service) GetOrganizations(ctx context.Context, req *GetOrganizationsRequest) (*OrganizationListResponse, error)

func (*Service) GetOrganizationsById

func (s *Service) GetOrganizationsById(ctx context.Context, req *GetOrganizationsByIdRequest) (*OrganizationListResponse, error)

func (*Service) GetPeople

func (s *Service) GetPeople(ctx context.Context, req *GetPeopleRequest) (*PersonListResponse, error)

func (*Service) GetPeopleById

func (s *Service) GetPeopleById(ctx context.Context, req *GetPeopleByIdRequest) (*PersonListResponse, error)

func (*Service) GetPerson

func (s *Service) GetPerson(ctx context.Context, req *GetPersonRequest) (*Person, error)

func (*Service) NewError

func (s *Service) NewError(ctx context.Context, err error) *ErrorStatusCode

func (*Service) SetPersonOrcid

func (s *Service) SetPersonOrcid(ctx context.Context, req *SetPersonOrcidRequest) (*Person, error)

func (*Service) SetPersonOrcidToken

func (s *Service) SetPersonOrcidToken(ctx context.Context, req *SetPersonOrcidTokenRequest) (*Person, error)

func (*Service) SetPersonRole

func (s *Service) SetPersonRole(ctx context.Context, req *SetPersonRoleRequest) (*Person, error)

func (*Service) SetPersonSettings

func (s *Service) SetPersonSettings(ctx context.Context, req *SetPersonSettingsRequest) (*Person, error)

func (*Service) SuggestOrganizations

func (s *Service) SuggestOrganizations(ctx context.Context, req *SuggestOrganizationsRequest) (*OrganizationListResponse, error)

func (*Service) SuggestPeople

func (s *Service) SuggestPeople(ctx context.Context, req *SuggestPeopleRequest) (*PersonListResponse, error)

type SetPersonOrcidRequest

type SetPersonOrcidRequest struct {
	ID    string `json:"id"`
	Orcid string `json:"orcid"`
}

Ref: #/components/schemas/SetPersonOrcidRequest

func (*SetPersonOrcidRequest) Decode

func (s *SetPersonOrcidRequest) Decode(d *jx.Decoder) error

Decode decodes SetPersonOrcidRequest from json.

func (*SetPersonOrcidRequest) Encode

func (s *SetPersonOrcidRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SetPersonOrcidRequest) GetID

func (s *SetPersonOrcidRequest) GetID() string

GetID returns the value of ID.

func (*SetPersonOrcidRequest) GetOrcid

func (s *SetPersonOrcidRequest) GetOrcid() string

GetOrcid returns the value of Orcid.

func (*SetPersonOrcidRequest) MarshalJSON

func (s *SetPersonOrcidRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SetPersonOrcidRequest) SetID

func (s *SetPersonOrcidRequest) SetID(val string)

SetID sets the value of ID.

func (*SetPersonOrcidRequest) SetOrcid

func (s *SetPersonOrcidRequest) SetOrcid(val string)

SetOrcid sets the value of Orcid.

func (*SetPersonOrcidRequest) UnmarshalJSON

func (s *SetPersonOrcidRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SetPersonOrcidRequest) Validate

func (s *SetPersonOrcidRequest) Validate() error

type SetPersonOrcidTokenRequest

type SetPersonOrcidTokenRequest struct {
	ID         string `json:"id"`
	OrcidToken string `json:"orcid_token"`
}

Ref: #/components/schemas/SetPersonOrcidTokenRequest

func (*SetPersonOrcidTokenRequest) Decode

Decode decodes SetPersonOrcidTokenRequest from json.

func (*SetPersonOrcidTokenRequest) Encode

func (s *SetPersonOrcidTokenRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SetPersonOrcidTokenRequest) GetID

GetID returns the value of ID.

func (*SetPersonOrcidTokenRequest) GetOrcidToken

func (s *SetPersonOrcidTokenRequest) GetOrcidToken() string

GetOrcidToken returns the value of OrcidToken.

func (*SetPersonOrcidTokenRequest) MarshalJSON

func (s *SetPersonOrcidTokenRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SetPersonOrcidTokenRequest) SetID

func (s *SetPersonOrcidTokenRequest) SetID(val string)

SetID sets the value of ID.

func (*SetPersonOrcidTokenRequest) SetOrcidToken

func (s *SetPersonOrcidTokenRequest) SetOrcidToken(val string)

SetOrcidToken sets the value of OrcidToken.

func (*SetPersonOrcidTokenRequest) UnmarshalJSON

func (s *SetPersonOrcidTokenRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SetPersonOrcidTokenRequest) Validate

func (s *SetPersonOrcidTokenRequest) Validate() error

type SetPersonRoleRequest

type SetPersonRoleRequest struct {
	ID   string   `json:"id"`
	Role []string `json:"role"`
}

Ref: #/components/schemas/SetPersonRoleRequest

func (*SetPersonRoleRequest) Decode

func (s *SetPersonRoleRequest) Decode(d *jx.Decoder) error

Decode decodes SetPersonRoleRequest from json.

func (*SetPersonRoleRequest) Encode

func (s *SetPersonRoleRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SetPersonRoleRequest) GetID

func (s *SetPersonRoleRequest) GetID() string

GetID returns the value of ID.

func (*SetPersonRoleRequest) GetRole

func (s *SetPersonRoleRequest) GetRole() []string

GetRole returns the value of Role.

func (*SetPersonRoleRequest) MarshalJSON

func (s *SetPersonRoleRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SetPersonRoleRequest) SetID

func (s *SetPersonRoleRequest) SetID(val string)

SetID sets the value of ID.

func (*SetPersonRoleRequest) SetRole

func (s *SetPersonRoleRequest) SetRole(val []string)

SetRole sets the value of Role.

func (*SetPersonRoleRequest) UnmarshalJSON

func (s *SetPersonRoleRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SetPersonRoleRequest) Validate

func (s *SetPersonRoleRequest) Validate() error

type SetPersonSettingsRequest

type SetPersonSettingsRequest struct {
	ID       string                           `json:"id"`
	Settings SetPersonSettingsRequestSettings `json:"settings"`
}

Ref: #/components/schemas/SetPersonSettingsRequest

func (*SetPersonSettingsRequest) Decode

func (s *SetPersonSettingsRequest) Decode(d *jx.Decoder) error

Decode decodes SetPersonSettingsRequest from json.

func (*SetPersonSettingsRequest) Encode

func (s *SetPersonSettingsRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SetPersonSettingsRequest) GetID

func (s *SetPersonSettingsRequest) GetID() string

GetID returns the value of ID.

func (*SetPersonSettingsRequest) GetSettings

GetSettings returns the value of Settings.

func (*SetPersonSettingsRequest) MarshalJSON

func (s *SetPersonSettingsRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SetPersonSettingsRequest) SetID

func (s *SetPersonSettingsRequest) SetID(val string)

SetID sets the value of ID.

func (*SetPersonSettingsRequest) SetSettings

SetSettings sets the value of Settings.

func (*SetPersonSettingsRequest) UnmarshalJSON

func (s *SetPersonSettingsRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SetPersonSettingsRequest) Validate

func (s *SetPersonSettingsRequest) Validate() error

type SetPersonSettingsRequestSettings

type SetPersonSettingsRequestSettings map[string]string

func (*SetPersonSettingsRequestSettings) Decode

Decode decodes SetPersonSettingsRequestSettings from json.

func (SetPersonSettingsRequestSettings) Encode

Encode implements json.Marshaler.

func (SetPersonSettingsRequestSettings) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*SetPersonSettingsRequestSettings) UnmarshalJSON

func (s *SetPersonSettingsRequestSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type SuggestOrganizationsRequest

type SuggestOrganizationsRequest struct {
	Query string `json:"query"`
}

Ref: #/components/schemas/SuggestOrganizationsRequest

func (*SuggestOrganizationsRequest) Decode

Decode decodes SuggestOrganizationsRequest from json.

func (*SuggestOrganizationsRequest) Encode

func (s *SuggestOrganizationsRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SuggestOrganizationsRequest) GetQuery

func (s *SuggestOrganizationsRequest) GetQuery() string

GetQuery returns the value of Query.

func (*SuggestOrganizationsRequest) MarshalJSON

func (s *SuggestOrganizationsRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SuggestOrganizationsRequest) SetQuery

func (s *SuggestOrganizationsRequest) SetQuery(val string)

SetQuery sets the value of Query.

func (*SuggestOrganizationsRequest) UnmarshalJSON

func (s *SuggestOrganizationsRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SuggestOrganizationsRequest) Validate

func (s *SuggestOrganizationsRequest) Validate() error

type SuggestPeopleRequest

type SuggestPeopleRequest struct {
	Query string `json:"query"`
}

Ref: #/components/schemas/SuggestPeopleRequest

func (*SuggestPeopleRequest) Decode

func (s *SuggestPeopleRequest) Decode(d *jx.Decoder) error

Decode decodes SuggestPeopleRequest from json.

func (*SuggestPeopleRequest) Encode

func (s *SuggestPeopleRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SuggestPeopleRequest) GetQuery

func (s *SuggestPeopleRequest) GetQuery() string

GetQuery returns the value of Query.

func (*SuggestPeopleRequest) MarshalJSON

func (s *SuggestPeopleRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SuggestPeopleRequest) SetQuery

func (s *SuggestPeopleRequest) SetQuery(val string)

SetQuery sets the value of Query.

func (*SuggestPeopleRequest) UnmarshalJSON

func (s *SuggestPeopleRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SuggestPeopleRequest) Validate

func (s *SuggestPeopleRequest) Validate() error

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) AddOrganization

func (UnimplementedHandler) AddOrganization(ctx context.Context, req *Organization) (r *Organization, _ error)

AddOrganization implements AddOrganization operation.

Insert/update a single organization record.

POST /add-organization

func (UnimplementedHandler) AddPerson

func (UnimplementedHandler) AddPerson(ctx context.Context, req *Person) (r *Person, _ error)

AddPerson implements AddPerson operation.

Insert/update a single person record.

POST /add-person

func (UnimplementedHandler) GetOrganization

func (UnimplementedHandler) GetOrganization(ctx context.Context, req *GetOrganizationRequest) (r *Organization, _ error)

GetOrganization implements GetOrganization operation.

Get single organization record.

POST /get-organization

func (UnimplementedHandler) GetOrganizations

GetOrganizations implements GetOrganizations operation.

Get all organization records.

POST /get-organizations

func (UnimplementedHandler) GetOrganizationsById

GetOrganizationsById implements GetOrganizationsById operation.

Get organization records by one of the extra identifiers.

POST /get-organizations-by-id

func (UnimplementedHandler) GetPeople

GetPeople implements GetPeople operation.

Get all person records.

POST /get-people

func (UnimplementedHandler) GetPeopleById

GetPeopleById implements GetPeopleById operation.

Retrieve person records by one of the extra identifiers.

POST /get-people-by-id

func (UnimplementedHandler) GetPerson

func (UnimplementedHandler) GetPerson(ctx context.Context, req *GetPersonRequest) (r *Person, _ error)

GetPerson implements GetPerson operation.

Retrieve a single person record.

POST /get-person

func (UnimplementedHandler) NewError

func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)

NewError creates *ErrorStatusCode from error returned by handler.

Used for common default response.

func (UnimplementedHandler) SetPersonOrcid

func (UnimplementedHandler) SetPersonOrcid(ctx context.Context, req *SetPersonOrcidRequest) (r *Person, _ error)

SetPersonOrcid implements SetPersonOrcid operation.

Update person ORCID.

POST /set-person-orcid

func (UnimplementedHandler) SetPersonOrcidToken

func (UnimplementedHandler) SetPersonOrcidToken(ctx context.Context, req *SetPersonOrcidTokenRequest) (r *Person, _ error)

SetPersonOrcidToken implements SetPersonOrcidToken operation.

Update person ORCID token.

POST /set-person-orcid-token

func (UnimplementedHandler) SetPersonRole

func (UnimplementedHandler) SetPersonRole(ctx context.Context, req *SetPersonRoleRequest) (r *Person, _ error)

SetPersonRole implements SetPersonRole operation.

Update person role.

POST /set-person-role

func (UnimplementedHandler) SetPersonSettings

func (UnimplementedHandler) SetPersonSettings(ctx context.Context, req *SetPersonSettingsRequest) (r *Person, _ error)

SetPersonSettings implements SetPersonSettings operation.

Update person settings.

POST /set-person-settings

func (UnimplementedHandler) SuggestOrganizations

SuggestOrganizations implements SuggestOrganizations operation.

Search on organization records.

POST /suggest-organizations

func (UnimplementedHandler) SuggestPeople

SuggestPeople implements SuggestPeople operation.

Search on person records.

POST /suggest-people

Jump to

Keyboard shortcuts

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