Documentation ¶
Index ¶
- type CountryRestriction
- type RequestedDocumentFilter
- type RequestedDocumentRestriction
- type RequestedDocumentRestrictionBuilder
- func (b *RequestedDocumentRestrictionBuilder) Build() (*RequestedDocumentRestriction, error)
- func (b *RequestedDocumentRestrictionBuilder) WithCountryCodes(countryCodes []string) *RequestedDocumentRestrictionBuilder
- func (b *RequestedDocumentRestrictionBuilder) WithDocumentTypes(documentTypes []string) *RequestedDocumentRestrictionBuilder
- type RequestedDocumentRestrictionsFilter
- type RequestedDocumentRestrictionsFilterBuilder
- func (b *RequestedDocumentRestrictionsFilterBuilder) Build() (*RequestedDocumentRestrictionsFilter, error)
- func (b *RequestedDocumentRestrictionsFilterBuilder) ForExcludeList() *RequestedDocumentRestrictionsFilterBuilder
- func (b *RequestedDocumentRestrictionsFilterBuilder) ForIncludeList() *RequestedDocumentRestrictionsFilterBuilder
- func (b *RequestedDocumentRestrictionsFilterBuilder) WithAllowNonLatinDocuments(allowNonLatinDocuments bool) *RequestedDocumentRestrictionsFilterBuilder
- func (b *RequestedDocumentRestrictionsFilterBuilder) WithDocumentRestriction(docRestriction *RequestedDocumentRestriction) *RequestedDocumentRestrictionsFilterBuilder
- func (b *RequestedDocumentRestrictionsFilterBuilder) WithExpiredDocuments(allowExpiredDocuments bool) *RequestedDocumentRestrictionsFilterBuilder
- type RequestedOrthogonalRestrictionsFilter
- type RequestedOrthogonalRestrictionsFilterBuilder
- func (b *RequestedOrthogonalRestrictionsFilterBuilder) Build() (*RequestedOrthogonalRestrictionsFilter, error)
- func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithExcludedCountries(countryCodes []string) *RequestedOrthogonalRestrictionsFilterBuilder
- func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithExcludedDocumentTypes(documentTypes []string) *RequestedOrthogonalRestrictionsFilterBuilder
- func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithExpiredDocuments(allowExpiredDocuments bool) *RequestedOrthogonalRestrictionsFilterBuilder
- func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithIncludedCountries(countryCodes []string) *RequestedOrthogonalRestrictionsFilterBuilder
- func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithIncludedDocumentTypes(documentTypes []string) *RequestedOrthogonalRestrictionsFilterBuilder
- func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithNonLatinDocuments(allowNonLatinDocuments bool) *RequestedOrthogonalRestrictionsFilterBuilder
- type RequiredDocument
- type RequiredIDDocument
- type RequiredIDDocumentBuilder
- type RequiredSupplementaryDocument
- type RequiredSupplementaryDocumentBuilder
- func (r *RequiredSupplementaryDocumentBuilder) Build() (*RequiredSupplementaryDocument, error)
- func (r *RequiredSupplementaryDocumentBuilder) WithCountryCodes(countryCodes []string) *RequiredSupplementaryDocumentBuilder
- func (r *RequiredSupplementaryDocumentBuilder) WithDocumentTypes(documentTypes []string) *RequiredSupplementaryDocumentBuilder
- func (r *RequiredSupplementaryDocumentBuilder) WithFilter(filter RequestedDocumentFilter) *RequiredSupplementaryDocumentBuilder
- func (r *RequiredSupplementaryDocumentBuilder) WithObjective(objective objective.Objective) *RequiredSupplementaryDocumentBuilder
- type TypeRestriction
Examples ¶
- RequestedDocumentRestriction
- RequestedDocumentRestrictionBuilder.WithCountryCodes
- RequestedDocumentRestrictionBuilder.WithDocumentTypes
- RequestedDocumentRestrictionsFilterBuilder (WithAllowNonLatinDocuments)
- RequestedDocumentRestrictionsFilterBuilder (WithDenyExpiredDocuments)
- RequestedDocumentRestrictionsFilterBuilder (WithDenyNonLatinDocuments)
- RequestedDocumentRestrictionsFilterBuilder (WithExpiredDocuments)
- RequestedDocumentRestrictionsFilterBuilder.ForExcludeList
- RequestedDocumentRestrictionsFilterBuilder.ForIncludeList
- RequestedOrthogonalRestrictionsFilterBuilder (WithDenyExpiredDocuments)
- RequestedOrthogonalRestrictionsFilterBuilder (WithDenyNonLatinDocuments)
- RequestedOrthogonalRestrictionsFilterBuilder (WithExpiredDocuments)
- RequestedOrthogonalRestrictionsFilterBuilder (WithNonLatinDocuments)
- RequestedOrthogonalRestrictionsFilterBuilder.WithExcludedCountries
- RequestedOrthogonalRestrictionsFilterBuilder.WithExcludedDocumentTypes
- RequestedOrthogonalRestrictionsFilterBuilder.WithIncludedCountries
- RequestedOrthogonalRestrictionsFilterBuilder.WithIncludedDocumentTypes
- RequiredIDDocument.MarshalJSON
- RequiredSupplementaryDocument
- RequiredSupplementaryDocumentBuilder.WithCountryCodes
- RequiredSupplementaryDocumentBuilder.WithCountryCodes (Empty)
- RequiredSupplementaryDocumentBuilder.WithDocumentTypes
- RequiredSupplementaryDocumentBuilder.WithDocumentTypes (Empty)
- RequiredSupplementaryDocumentBuilder.WithFilter
- RequiredSupplementaryDocumentBuilder.WithObjective
- RequiredSupplementaryDocumentBuilder.WithObjective (ProofOfAddress)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountryRestriction ¶
type CountryRestriction struct { Inclusion string `json:"inclusion"` CountryCodes []string `json:"country_codes"` }
CountryRestriction is a restriction of the country in which a document pertains to
type RequestedDocumentFilter ¶
type RequestedDocumentFilter interface {
Type() string
}
RequestedDocumentFilter filters for a required document, allowing specification of restrictive parameters
type RequestedDocumentRestriction ¶
type RequestedDocumentRestriction struct { DocumentTypes []string `json:"document_types,omitempty"` CountryCodes []string `json:"country_codes,omitempty"` }
RequestedDocumentRestriction represents a document filter for checks and tasks
Example ¶
docRestriction, err := NewRequestedDocumentRestrictionBuilder(). WithDocumentTypes([]string{"PASSPORT"}). WithCountryCodes([]string{"GBR"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(docRestriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"document_types":["PASSPORT"],"country_codes":["GBR"]}
type RequestedDocumentRestrictionBuilder ¶
type RequestedDocumentRestrictionBuilder struct {
// contains filtered or unexported fields
}
RequestedDocumentRestrictionBuilder builds a RequestedDocumentRestriction
func NewRequestedDocumentRestrictionBuilder ¶
func NewRequestedDocumentRestrictionBuilder() *RequestedDocumentRestrictionBuilder
NewRequestedDocumentRestrictionBuilder creates a new RequestedDocumentRestrictionBuilder
func (*RequestedDocumentRestrictionBuilder) Build ¶
func (b *RequestedDocumentRestrictionBuilder) Build() (*RequestedDocumentRestriction, error)
Build creates a new RequestedDocumentRestriction
func (*RequestedDocumentRestrictionBuilder) WithCountryCodes ¶
func (b *RequestedDocumentRestrictionBuilder) WithCountryCodes(countryCodes []string) *RequestedDocumentRestrictionBuilder
WithCountryCodes sets the country codes of the filter
Example ¶
docRestriction, err := NewRequestedDocumentRestrictionBuilder(). WithCountryCodes([]string{"GBR"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(docRestriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"country_codes":["GBR"]}
func (*RequestedDocumentRestrictionBuilder) WithDocumentTypes ¶
func (b *RequestedDocumentRestrictionBuilder) WithDocumentTypes(documentTypes []string) *RequestedDocumentRestrictionBuilder
WithDocumentTypes sets the document types of the filter
Example ¶
docRestriction, err := NewRequestedDocumentRestrictionBuilder(). WithDocumentTypes([]string{"PASSPORT"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(docRestriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"document_types":["PASSPORT"]}
type RequestedDocumentRestrictionsFilter ¶
type RequestedDocumentRestrictionsFilter struct {
// contains filtered or unexported fields
}
RequestedDocumentRestrictionsFilter filters for a required document, allowing specification of restrictive parameters
func (*RequestedDocumentRestrictionsFilter) MarshalJSON ¶
func (r *RequestedDocumentRestrictionsFilter) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding
func (RequestedDocumentRestrictionsFilter) Type ¶
func (r RequestedDocumentRestrictionsFilter) Type() string
Type is the type of the document restriction filter
type RequestedDocumentRestrictionsFilterBuilder ¶
type RequestedDocumentRestrictionsFilterBuilder struct {
// contains filtered or unexported fields
}
RequestedDocumentRestrictionsFilterBuilder builds a RequestedDocumentRestrictionsFilter
Example (WithAllowNonLatinDocuments) ¶
restriction, err := NewRequestedDocumentRestrictionsFilterBuilder(). WithAllowNonLatinDocuments(true). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"DOCUMENT_RESTRICTIONS","inclusion":"","documents":[],"allow_non_latin_documents":true}
Example (WithDenyExpiredDocuments) ¶
restriction, err := NewRequestedDocumentRestrictionsFilterBuilder(). WithExpiredDocuments(false). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"DOCUMENT_RESTRICTIONS","inclusion":"","documents":[],"allow_expired_documents":false}
Example (WithDenyNonLatinDocuments) ¶
restriction, err := NewRequestedDocumentRestrictionsFilterBuilder(). WithAllowNonLatinDocuments(false). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"DOCUMENT_RESTRICTIONS","inclusion":"","documents":[],"allow_non_latin_documents":false}
Example (WithExpiredDocuments) ¶
restriction, err := NewRequestedDocumentRestrictionsFilterBuilder(). WithExpiredDocuments(true). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"DOCUMENT_RESTRICTIONS","inclusion":"","documents":[],"allow_expired_documents":true}
func NewRequestedDocumentRestrictionsFilterBuilder ¶
func NewRequestedDocumentRestrictionsFilterBuilder() *RequestedDocumentRestrictionsFilterBuilder
NewRequestedDocumentRestrictionsFilterBuilder creates a new RequestedDocumentRestrictionsFilterBuilder
func (*RequestedDocumentRestrictionsFilterBuilder) Build ¶
func (b *RequestedDocumentRestrictionsFilterBuilder) Build() (*RequestedDocumentRestrictionsFilter, error)
Build creates a new RequestedDocumentRestrictionsFilter
func (*RequestedDocumentRestrictionsFilterBuilder) ForExcludeList ¶
func (b *RequestedDocumentRestrictionsFilterBuilder) ForExcludeList() *RequestedDocumentRestrictionsFilterBuilder
ForExcludeList sets the type restriction to EXCLUDE the document restrictions
Example ¶
docRestriction, err := NewRequestedDocumentRestrictionBuilder(). WithDocumentTypes([]string{"PASSPORT"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } var docFilter *RequestedDocumentRestrictionsFilter docFilter, err = NewRequestedDocumentRestrictionsFilterBuilder(). ForExcludeList(). WithDocumentRestriction(docRestriction). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(docFilter) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"DOCUMENT_RESTRICTIONS","inclusion":"BLACKLIST","documents":[{"document_types":["PASSPORT"]}]}
func (*RequestedDocumentRestrictionsFilterBuilder) ForIncludeList ¶
func (b *RequestedDocumentRestrictionsFilterBuilder) ForIncludeList() *RequestedDocumentRestrictionsFilterBuilder
ForIncludeList sets the type restriction to INCLUDE the document restrictions
Example ¶
docRestriction, err := NewRequestedDocumentRestrictionBuilder(). WithDocumentTypes([]string{"PASSPORT"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } var docFilter *RequestedDocumentRestrictionsFilter docFilter, err = NewRequestedDocumentRestrictionsFilterBuilder(). ForIncludeList(). WithDocumentRestriction(docRestriction). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(docFilter) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"DOCUMENT_RESTRICTIONS","inclusion":"WHITELIST","documents":[{"document_types":["PASSPORT"]}]}
func (*RequestedDocumentRestrictionsFilterBuilder) WithAllowNonLatinDocuments ¶ added in v3.10.0
func (b *RequestedDocumentRestrictionsFilterBuilder) WithAllowNonLatinDocuments(allowNonLatinDocuments bool) *RequestedDocumentRestrictionsFilterBuilder
WithExpiredDocuments sets a bool value to allowExpiredDocuments on filter
func (*RequestedDocumentRestrictionsFilterBuilder) WithDocumentRestriction ¶
func (b *RequestedDocumentRestrictionsFilterBuilder) WithDocumentRestriction(docRestriction *RequestedDocumentRestriction) *RequestedDocumentRestrictionsFilterBuilder
WithDocumentRestriction adds a document restriction to the filter
func (*RequestedDocumentRestrictionsFilterBuilder) WithExpiredDocuments ¶ added in v3.10.0
func (b *RequestedDocumentRestrictionsFilterBuilder) WithExpiredDocuments(allowExpiredDocuments bool) *RequestedDocumentRestrictionsFilterBuilder
WithExpiredDocuments sets a bool value to allowExpiredDocuments on filter
type RequestedOrthogonalRestrictionsFilter ¶
type RequestedOrthogonalRestrictionsFilter struct {
// contains filtered or unexported fields
}
RequestedOrthogonalRestrictionsFilter filters for a required document, allowing specification of restrictive parameters
func (RequestedOrthogonalRestrictionsFilter) MarshalJSON ¶
func (r RequestedOrthogonalRestrictionsFilter) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding
func (RequestedOrthogonalRestrictionsFilter) Type ¶
func (r RequestedOrthogonalRestrictionsFilter) Type() string
Type returns the type of the RequestedOrthogonalRestrictionsFilter
type RequestedOrthogonalRestrictionsFilterBuilder ¶
type RequestedOrthogonalRestrictionsFilterBuilder struct {
// contains filtered or unexported fields
}
RequestedOrthogonalRestrictionsFilterBuilder builds a RequestedOrthogonalRestrictionsFilter
Example (WithDenyExpiredDocuments) ¶
restriction, err := NewRequestedOrthogonalRestrictionsFilterBuilder(). WithExpiredDocuments(false). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"ORTHOGONAL_RESTRICTIONS","allow_expired_documents":false}
Example (WithDenyNonLatinDocuments) ¶
restriction, err := NewRequestedOrthogonalRestrictionsFilterBuilder(). WithNonLatinDocuments(false). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"ORTHOGONAL_RESTRICTIONS","allow_non_latin_documents":false}
Example (WithExpiredDocuments) ¶
restriction, err := NewRequestedOrthogonalRestrictionsFilterBuilder(). WithExpiredDocuments(true). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"ORTHOGONAL_RESTRICTIONS","allow_expired_documents":true}
Example (WithNonLatinDocuments) ¶
restriction, err := NewRequestedOrthogonalRestrictionsFilterBuilder(). WithNonLatinDocuments(true). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"ORTHOGONAL_RESTRICTIONS","allow_non_latin_documents":true}
func NewRequestedOrthogonalRestrictionsFilterBuilder ¶
func NewRequestedOrthogonalRestrictionsFilterBuilder() *RequestedOrthogonalRestrictionsFilterBuilder
NewRequestedOrthogonalRestrictionsFilterBuilder creates a new RequestedOrthogonalRestrictionsFilterBuilder
func (*RequestedOrthogonalRestrictionsFilterBuilder) Build ¶
func (b *RequestedOrthogonalRestrictionsFilterBuilder) Build() (*RequestedOrthogonalRestrictionsFilter, error)
Build creates a new RequestedOrthogonalRestrictionsFilter
func (*RequestedOrthogonalRestrictionsFilterBuilder) WithExcludedCountries ¶
func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithExcludedCountries(countryCodes []string) *RequestedOrthogonalRestrictionsFilterBuilder
WithExcludedCountries sets an "EXCLUDE" slice of country codes on the filter
Example ¶
restriction, err := NewRequestedOrthogonalRestrictionsFilterBuilder(). WithExcludedCountries([]string{"CAN", "FJI"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"ORTHOGONAL_RESTRICTIONS","country_restriction":{"inclusion":"BLACKLIST","country_codes":["CAN","FJI"]}}
func (*RequestedOrthogonalRestrictionsFilterBuilder) WithExcludedDocumentTypes ¶
func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithExcludedDocumentTypes(documentTypes []string) *RequestedOrthogonalRestrictionsFilterBuilder
WithExcludedDocumentTypes sets an "EXCLUDE" slice of document types on the filter
Example ¶
restriction, err := NewRequestedOrthogonalRestrictionsFilterBuilder(). WithExcludedDocumentTypes([]string{"NATIONAL_ID", "PASS_CARD"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"ORTHOGONAL_RESTRICTIONS","type_restriction":{"inclusion":"BLACKLIST","document_types":["NATIONAL_ID","PASS_CARD"]}}
func (*RequestedOrthogonalRestrictionsFilterBuilder) WithExpiredDocuments ¶ added in v3.9.0
func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithExpiredDocuments(allowExpiredDocuments bool) *RequestedOrthogonalRestrictionsFilterBuilder
WithExpiredDocuments sets a bool value to allowExpiredDocuments on filter
func (*RequestedOrthogonalRestrictionsFilterBuilder) WithIncludedCountries ¶
func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithIncludedCountries(countryCodes []string) *RequestedOrthogonalRestrictionsFilterBuilder
WithIncludedCountries sets an "INCLUDE" slice of country codes on the filter
Example ¶
restriction, err := NewRequestedOrthogonalRestrictionsFilterBuilder(). WithIncludedCountries([]string{"KEN", "CIV"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"ORTHOGONAL_RESTRICTIONS","country_restriction":{"inclusion":"WHITELIST","country_codes":["KEN","CIV"]}}
func (*RequestedOrthogonalRestrictionsFilterBuilder) WithIncludedDocumentTypes ¶
func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithIncludedDocumentTypes(documentTypes []string) *RequestedOrthogonalRestrictionsFilterBuilder
WithIncludedDocumentTypes sets an "INCLUDE" slice of document types on the filter
Example ¶
restriction, err := NewRequestedOrthogonalRestrictionsFilterBuilder(). WithIncludedDocumentTypes([]string{"PASSPORT", "DRIVING_LICENCE"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(restriction) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"ORTHOGONAL_RESTRICTIONS","type_restriction":{"inclusion":"WHITELIST","document_types":["PASSPORT","DRIVING_LICENCE"]}}
func (*RequestedOrthogonalRestrictionsFilterBuilder) WithNonLatinDocuments ¶ added in v3.9.0
func (b *RequestedOrthogonalRestrictionsFilterBuilder) WithNonLatinDocuments(allowNonLatinDocuments bool) *RequestedOrthogonalRestrictionsFilterBuilder
WithNonLatinDocuments sets a bool value to allowNonLatinDocuments on filter
type RequiredDocument ¶
RequiredDocument is a document to be required for the session
type RequiredIDDocument ¶
type RequiredIDDocument struct {
Filter RequestedDocumentFilter
}
RequiredIDDocument details a required identity document
func (*RequiredIDDocument) MarshalJSON ¶
func (i *RequiredIDDocument) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding
Example ¶
docRestriction, err := NewRequestedDocumentRestrictionBuilder(). WithDocumentTypes([]string{"PASSPORT"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } var docFilter *RequestedDocumentRestrictionsFilter docFilter, err = NewRequestedDocumentRestrictionsFilterBuilder(). ForIncludeList(). WithDocumentRestriction(docRestriction). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } var requiredIDDocument *RequiredIDDocument requiredIDDocument, err = NewRequiredIDDocumentBuilder(). WithFilter(docFilter). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(requiredIDDocument) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"ID_DOCUMENT","filter":{"type":"DOCUMENT_RESTRICTIONS","inclusion":"WHITELIST","documents":[{"document_types":["PASSPORT"]}]}}
func (*RequiredIDDocument) Type ¶
func (i *RequiredIDDocument) Type() string
Type returns the type of the identity document
type RequiredIDDocumentBuilder ¶
type RequiredIDDocumentBuilder struct {
// contains filtered or unexported fields
}
RequiredIDDocumentBuilder builds a RequiredIDDocument
func NewRequiredIDDocumentBuilder ¶
func NewRequiredIDDocumentBuilder() *RequiredIDDocumentBuilder
NewRequiredIDDocumentBuilder creates a new RequiredIDDocumentBuilder
func (RequiredIDDocumentBuilder) Build ¶
func (r RequiredIDDocumentBuilder) Build() (*RequiredIDDocument, error)
Build builds the RequiredIDDocument struct
func (RequiredIDDocumentBuilder) WithFilter ¶
func (r RequiredIDDocumentBuilder) WithFilter(filter RequestedDocumentFilter) RequiredIDDocumentBuilder
WithFilter sets the filter on the required ID document
type RequiredSupplementaryDocument ¶ added in v3.3.0
type RequiredSupplementaryDocument struct { Filter RequestedDocumentFilter DocumentTypes []string CountryCodes []string Objective objective.Objective }
RequiredSupplementaryDocument details a required supplementary document
Example ¶
var requiredSupplementaryDocument *RequiredSupplementaryDocument requiredSupplementaryDocument, err := NewRequiredSupplementaryDocumentBuilder(). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(requiredSupplementaryDocument) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"SUPPLEMENTARY_DOCUMENT"}
func (*RequiredSupplementaryDocument) MarshalJSON ¶ added in v3.3.0
func (r *RequiredSupplementaryDocument) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding
func (*RequiredSupplementaryDocument) Type ¶ added in v3.3.0
func (r *RequiredSupplementaryDocument) Type() string
Type returns the type of the supplementary document
type RequiredSupplementaryDocumentBuilder ¶ added in v3.3.0
type RequiredSupplementaryDocumentBuilder struct {
// contains filtered or unexported fields
}
RequiredSupplementaryDocumentBuilder builds a RequiredSupplementaryDocument
func NewRequiredSupplementaryDocumentBuilder ¶ added in v3.3.0
func NewRequiredSupplementaryDocumentBuilder() *RequiredSupplementaryDocumentBuilder
NewRequiredSupplementaryDocumentBuilder creates a new RequiredSupplementaryDocumentBuilder
func (*RequiredSupplementaryDocumentBuilder) Build ¶ added in v3.3.0
func (r *RequiredSupplementaryDocumentBuilder) Build() (*RequiredSupplementaryDocument, error)
Build builds the RequiredSupplementaryDocument struct
func (*RequiredSupplementaryDocumentBuilder) WithCountryCodes ¶ added in v3.3.0
func (r *RequiredSupplementaryDocumentBuilder) WithCountryCodes(countryCodes []string) *RequiredSupplementaryDocumentBuilder
WithCountryCodes sets the country codes on the required supplementary document
Example ¶
var requiredSupplementaryDocument *RequiredSupplementaryDocument requiredSupplementaryDocument, err := NewRequiredSupplementaryDocumentBuilder(). WithCountryCodes([]string{"SOME_COUNTRY"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(requiredSupplementaryDocument) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"SUPPLEMENTARY_DOCUMENT","country_codes":["SOME_COUNTRY"]}
Example (Empty) ¶
var requiredSupplementaryDocument *RequiredSupplementaryDocument requiredSupplementaryDocument, err := NewRequiredSupplementaryDocumentBuilder(). WithCountryCodes([]string{}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(requiredSupplementaryDocument) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"SUPPLEMENTARY_DOCUMENT"}
func (*RequiredSupplementaryDocumentBuilder) WithDocumentTypes ¶ added in v3.3.0
func (r *RequiredSupplementaryDocumentBuilder) WithDocumentTypes(documentTypes []string) *RequiredSupplementaryDocumentBuilder
WithDocumentTypes sets the document types on the required supplementary document
Example ¶
var requiredSupplementaryDocument *RequiredSupplementaryDocument requiredSupplementaryDocument, err := NewRequiredSupplementaryDocumentBuilder(). WithDocumentTypes([]string{"SOME_DOCUMENT_TYPE"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(requiredSupplementaryDocument) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"SUPPLEMENTARY_DOCUMENT","document_types":["SOME_DOCUMENT_TYPE"]}
Example (Empty) ¶
var requiredSupplementaryDocument *RequiredSupplementaryDocument requiredSupplementaryDocument, err := NewRequiredSupplementaryDocumentBuilder(). WithDocumentTypes([]string{}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(requiredSupplementaryDocument) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"SUPPLEMENTARY_DOCUMENT"}
func (*RequiredSupplementaryDocumentBuilder) WithFilter ¶ added in v3.3.0
func (r *RequiredSupplementaryDocumentBuilder) WithFilter(filter RequestedDocumentFilter) *RequiredSupplementaryDocumentBuilder
WithFilter sets the filter on the required supplementary document
Example ¶
docRestriction, err := NewRequestedDocumentRestrictionBuilder(). WithDocumentTypes([]string{"UTILITY_BILL"}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } var docFilter *RequestedDocumentRestrictionsFilter docFilter, err = NewRequestedDocumentRestrictionsFilterBuilder(). ForIncludeList(). WithDocumentRestriction(docRestriction). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } var requiredSupplementaryDocument *RequiredSupplementaryDocument requiredSupplementaryDocument, err = NewRequiredSupplementaryDocumentBuilder(). WithFilter(docFilter). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(requiredSupplementaryDocument) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"SUPPLEMENTARY_DOCUMENT","filter":{"type":"DOCUMENT_RESTRICTIONS","inclusion":"WHITELIST","documents":[{"document_types":["UTILITY_BILL"]}]}}
func (*RequiredSupplementaryDocumentBuilder) WithObjective ¶ added in v3.3.0
func (r *RequiredSupplementaryDocumentBuilder) WithObjective(objective objective.Objective) *RequiredSupplementaryDocumentBuilder
WithObjective sets the objective for the required supplementary document
Example ¶
var requiredSupplementaryDocument *RequiredSupplementaryDocument requiredSupplementaryDocument, err := NewRequiredSupplementaryDocumentBuilder(). WithObjective(&mockObjective{}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(requiredSupplementaryDocument) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"SUPPLEMENTARY_DOCUMENT","objective":{"type":"SOME_OBJECTIVE"}}
Example (ProofOfAddress) ¶
var proofOfAddress objective.Objective proofOfAddress, err := objective.NewProofOfAddressObjectiveBuilder().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } var requiredSupplementaryDocument *RequiredSupplementaryDocument requiredSupplementaryDocument, err = NewRequiredSupplementaryDocumentBuilder(). WithObjective(proofOfAddress). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := json.Marshal(requiredSupplementaryDocument) if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"type":"SUPPLEMENTARY_DOCUMENT","objective":{"type":"PROOF_OF_ADDRESS"}}
type TypeRestriction ¶
type TypeRestriction struct { Inclusion string `json:"inclusion"` DocumentTypes []string `json:"document_types"` }
TypeRestriction is a restriction of the type of document required