Documentation
¶
Index ¶
- type Details
- type Flag
- type Flagger
- type Flags
- type Form
- type FormAttributes
- type FormListResponse
- type FormResponse
- type ImageData
- type Included
- func (c *Included) Add(includes ...Resource)
- func (c Included) MarshalJSON() ([]byte, error)
- func (c *Included) MustForm(key Key) *Form
- func (c *Included) MustSubmitForm(key Key) *SubmitForm
- func (c *Included) MustUploadImage(key Key) *UploadImage
- func (c *Included) MustUploadImageResponse(key Key) *UploadImageResponse
- func (c *Included) MustUploadImageResponseV2(key Key) *UploadImageResponseV2
- func (c *Included) MustUploadImageV2(key Key) *UploadImageV2
- func (c *Included) UnmarshalJSON(data []byte) error
- type Key
- type Links
- type Relation
- type RelationCollection
- type Resource
- type ResourceType
- type SubmitForm
- type SubmitFormAttributes
- type SubmitFormListRequest
- type SubmitFormRequest
- type UploadImage
- type UploadImageAttributes
- type UploadImageListRequest
- type UploadImageRequest
- type UploadImageResponse
- type UploadImageResponseAttributes
- type UploadImageResponseListResponse
- type UploadImageResponseResponse
- type UploadImageResponseV2
- type UploadImageResponseV2Attributes
- type UploadImageResponseV2ListResponse
- type UploadImageResponseV2Response
- type UploadImageV2
- type UploadImageV2Attributes
- type UploadImageV2ListRequest
- type UploadImageV2Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Details ¶
type Details json.RawMessage
func (Details) MarshalJSON ¶
MarshalJSON - casts Details to []byte
func (*Details) UnmarshalJSON ¶
UnmarshalJSON - casts data to Details
type Form ¶
type Form struct {
Key
Attributes FormAttributes `json:"attributes"`
}
type FormAttributes ¶
type FormAttributes struct {
Address string `json:"address"`
Birthday string `json:"birthday"`
Citizen string `json:"citizen"`
City string `json:"city"`
Country string `json:"country"`
// Form submission time. Unix time. Read-only.
CreatedAt *int64 `json:"created_at,omitempty"`
Email string `json:"email"`
IdNum string `json:"id_num"`
// base64 encoded image with max size 4 MB or URL for S3 storage with image up to 4 mb
Image string `json:"image"`
Name string `json:"name"`
// Time of the next possible form submission. Unix time. Read-only.
NextFormAt *int64 `json:"next_form_at,omitempty"`
// base64 encoded image with max size 4 MB or URL for S3 storage with image up to 4 mb
PassportImage *string `json:"passport_image,omitempty"`
Phone string `json:"phone"`
Postal string `json:"postal"`
// Form processing time. Absent if the status is accepted. Unix time. Read-only.
ProcessedAt *int64 `json:"processed_at,omitempty"`
Purpose string `json:"purpose"`
// Created - the empty form was created and now user can't use legacy submit Accepted - the data was saved by the service for further processing Processed - the data is processed and stored Read-only.
Status *string `json:"status,omitempty"`
Surname string `json:"surname"`
// Time until the next form submission in seconds. Read-only.
UntilNextForm *int64 `json:"until_next_form,omitempty"`
Visited string `json:"visited"`
}
type FormListResponse ¶
type FormListResponse struct {
Data []Form `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
Meta json.RawMessage `json:"meta,omitempty"`
}
func (*FormListResponse) GetMeta ¶
func (r *FormListResponse) GetMeta(out interface{}) error
func (*FormListResponse) PutMeta ¶
func (r *FormListResponse) PutMeta(v interface{}) (err error)
type FormResponse ¶
type Included ¶
type Included struct {
// contains filtered or unexported fields
}
Included - an array of Resource objects that are related to the primary data and/or each other (“included resources”).
func (Included) MarshalJSON ¶
MarshalJSON - marshals include collection as array of json objects
func (*Included) MustForm ¶
MustForm - returns Form from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustSubmitForm ¶
func (c *Included) MustSubmitForm(key Key) *SubmitForm
MustSubmitForm - returns SubmitForm from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustUploadImage ¶
func (c *Included) MustUploadImage(key Key) *UploadImage
MustUploadImage - returns UploadImage from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustUploadImageResponse ¶
func (c *Included) MustUploadImageResponse(key Key) *UploadImageResponse
MustUploadImageResponse - returns UploadImageResponse from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustUploadImageResponseV2 ¶
func (c *Included) MustUploadImageResponseV2(key Key) *UploadImageResponseV2
MustUploadImageResponseV2 - returns UploadImageResponseV2 from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustUploadImageV2 ¶
func (c *Included) MustUploadImageV2(key Key) *UploadImageV2
MustUploadImageV2 - returns UploadImageV2 from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) UnmarshalJSON ¶
UmarshalJSON - unmarshal array of json objects into include collection
type Key ¶
type Key struct {
ID string `json:"id"`
Type ResourceType `json:"type"`
}
func NewKeyInt64 ¶
func NewKeyInt64(id int64, resourceType ResourceType) Key
func (Key) AsRelation ¶
type RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type ResourceType ¶
type ResourceType string
const ( FORM ResourceType = "form" SUBMIT_FORM ResourceType = "submit_form" UPLOAD_IMAGE ResourceType = "upload_image" UPLOAD_IMAGE_RESPONSE ResourceType = "upload_image_response" )
List of ResourceType
type SubmitForm ¶
type SubmitForm struct {
Key
Attributes SubmitFormAttributes `json:"attributes"`
}
type SubmitFormAttributes ¶
type SubmitFormAttributes struct {
Address string `json:"address"`
// Date formated as DD/MM/YYYY
Birthday string `json:"birthday"`
Citizen string `json:"citizen"`
City string `json:"city"`
Country string `json:"country"`
Email string `json:"email"`
IdNum string `json:"id_num"`
// For default endpoint: base64 encoded image with max size 4 MB; For lightweight endpoint: link to the image in s3 storage;
Image string `json:"image"`
Name string `json:"name"`
Phone string `json:"phone"`
Postal string `json:"postal"`
Purpose string `json:"purpose"`
Surname string `json:"surname"`
// Date formated as DD/MM/YYYY
Visited string `json:"visited"`
}
type SubmitFormListRequest ¶
type SubmitFormListRequest struct {
Data []SubmitForm `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
Meta json.RawMessage `json:"meta,omitempty"`
}
func (*SubmitFormListRequest) GetMeta ¶
func (r *SubmitFormListRequest) GetMeta(out interface{}) error
func (*SubmitFormListRequest) PutMeta ¶
func (r *SubmitFormListRequest) PutMeta(v interface{}) (err error)
type SubmitFormRequest ¶
type SubmitFormRequest struct {
Data SubmitForm `json:"data"`
Included Included `json:"included"`
}
type UploadImage ¶
type UploadImage struct {
Key
Attributes UploadImageAttributes `json:"attributes"`
}
type UploadImageAttributes ¶
type UploadImageListRequest ¶
type UploadImageListRequest struct {
Data []UploadImage `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
Meta json.RawMessage `json:"meta,omitempty"`
}
func (*UploadImageListRequest) GetMeta ¶
func (r *UploadImageListRequest) GetMeta(out interface{}) error
func (*UploadImageListRequest) PutMeta ¶
func (r *UploadImageListRequest) PutMeta(v interface{}) (err error)
type UploadImageRequest ¶
type UploadImageRequest struct {
Data UploadImage `json:"data"`
Included Included `json:"included"`
}
type UploadImageResponse ¶
type UploadImageResponse struct {
Key
Attributes UploadImageResponseAttributes `json:"attributes"`
}
type UploadImageResponseAttributes ¶
type UploadImageResponseAttributes struct {
// Pre-signed URL to upload the file
Url string `json:"url"`
}
type UploadImageResponseListResponse ¶
type UploadImageResponseListResponse struct {
Data []UploadImageResponse `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
Meta json.RawMessage `json:"meta,omitempty"`
}
func (*UploadImageResponseListResponse) GetMeta ¶
func (r *UploadImageResponseListResponse) GetMeta(out interface{}) error
func (*UploadImageResponseListResponse) PutMeta ¶
func (r *UploadImageResponseListResponse) PutMeta(v interface{}) (err error)
type UploadImageResponseResponse ¶
type UploadImageResponseResponse struct {
Data UploadImageResponse `json:"data"`
Included Included `json:"included"`
}
type UploadImageResponseV2 ¶
type UploadImageResponseV2 struct {
Key
Attributes UploadImageResponseV2Attributes `json:"attributes"`
}
type UploadImageResponseV2ListResponse ¶
type UploadImageResponseV2ListResponse struct {
Data []UploadImageResponseV2 `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
Meta json.RawMessage `json:"meta,omitempty"`
}
func (*UploadImageResponseV2ListResponse) GetMeta ¶
func (r *UploadImageResponseV2ListResponse) GetMeta(out interface{}) error
func (*UploadImageResponseV2ListResponse) PutMeta ¶
func (r *UploadImageResponseV2ListResponse) PutMeta(v interface{}) (err error)
type UploadImageResponseV2Response ¶
type UploadImageResponseV2Response struct {
Data UploadImageResponseV2 `json:"data"`
Included Included `json:"included"`
}
type UploadImageV2 ¶
type UploadImageV2 struct {
Key
Attributes UploadImageV2Attributes `json:"attributes"`
}
type UploadImageV2Attributes ¶
type UploadImageV2ListRequest ¶
type UploadImageV2ListRequest struct {
Data []UploadImageV2 `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
Meta json.RawMessage `json:"meta,omitempty"`
}
func (*UploadImageV2ListRequest) GetMeta ¶
func (r *UploadImageV2ListRequest) GetMeta(out interface{}) error
func (*UploadImageV2ListRequest) PutMeta ¶
func (r *UploadImageV2ListRequest) PutMeta(v interface{}) (err error)
type UploadImageV2Request ¶
type UploadImageV2Request struct {
Data UploadImageV2 `json:"data"`
Included Included `json:"included"`
}
Source Files
¶
- db.go
- flag.go
- included.go
- links.go
- model_details.go
- model_form.go
- model_form_attributes.go
- model_image_data.go
- model_key.go
- model_relation.go
- model_relation_collection.go
- model_resource_type.go
- model_submit_form.go
- model_submit_form_attributes.go
- model_upload_image.go
- model_upload_image_attributes.go
- model_upload_image_response.go
- model_upload_image_response_attributes.go
- model_upload_image_response_v2.go
- model_upload_image_response_v2_attributes.go
- model_upload_image_v2.go
- model_upload_image_v2_attributes.go