Documentation ¶
Index ¶
- Constants
- type ApplicationContent
- type ApplicationProfile
- func (p ApplicationProfile) ApplicationLogo() *attribute.ImageAttribute
- func (p ApplicationProfile) ApplicationName() *attribute.StringAttribute
- func (p ApplicationProfile) ApplicationReceiptBgColor() *attribute.StringAttribute
- func (p ApplicationProfile) ApplicationURL() *attribute.StringAttribute
- func (p ApplicationProfile) GetAttribute(attributeName string) *attribute.GenericAttribute
- func (p ApplicationProfile) GetAttributeByID(attributeID string) *attribute.GenericAttribute
- func (p ApplicationProfile) GetAttributes(attributeName string) []*attribute.GenericAttribute
- func (p ApplicationProfile) GetImageAttribute(attributeName string) *attribute.ImageAttribute
- func (p ApplicationProfile) GetJSONAttribute(attributeName string) (*attribute.JSONAttribute, error)
- func (p ApplicationProfile) GetStringAttribute(attributeName string) *attribute.StringAttribute
- type Content
- type Policy
- type PolicyBuilder
- func (b *PolicyBuilder) Build() (Policy, error)
- func (b *PolicyBuilder) WithAdvancedIdentityProfileRequirements(advancedIdentityProfile json.RawMessage) *PolicyBuilder
- func (b *PolicyBuilder) WithAgeDerivedAttribute(derivation string, options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithAgeOver(age int, options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithAgeUnder(age int, options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithDateOfBirth(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithDocumentDetails(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithDocumentImages(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithEmail(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithFamilyName(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithFullName(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithGender(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithGivenNames(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithIdentityProfileRequirements(identityProfile json.RawMessage) *PolicyBuilder
- func (b *PolicyBuilder) WithNationality(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithPhoneNumber(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithPinAuth() *PolicyBuilder
- func (b *PolicyBuilder) WithPostalAddress(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithSelfie(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithSelfieAuth() *PolicyBuilder
- func (b *PolicyBuilder) WithStructuredPostalAddress(options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithWantedAttribute(attribute WantedAttribute) *PolicyBuilder
- func (b *PolicyBuilder) WithWantedAttributeByName(name string, options ...interface{}) *PolicyBuilder
- func (b *PolicyBuilder) WithWantedAuthType(wantedAuthType int) *PolicyBuilder
- func (b *PolicyBuilder) WithWantedRememberMe() *PolicyBuilder
- type QrCode
- type ReceiptItemKeyResponse
- type ReceiptResponse
- type ShareSession
- type ShareSessionCreated
- type ShareSessionFetchedQrCode
- type ShareSessionNotification
- type ShareSessionNotificationBuilder
- func (b *ShareSessionNotificationBuilder) Build() (ShareSessionNotification, error)
- func (b *ShareSessionNotificationBuilder) WithHeaders(headers map[string][]string) *ShareSessionNotificationBuilder
- func (b *ShareSessionNotificationBuilder) WithMethod(method string) *ShareSessionNotificationBuilder
- func (b *ShareSessionNotificationBuilder) WithUrl(url string) *ShareSessionNotificationBuilder
- func (b *ShareSessionNotificationBuilder) WithVerifyTls(verifyTls bool) *ShareSessionNotificationBuilder
- type ShareSessionQrCode
- type ShareSessionRequest
- type ShareSessionRequestBuilder
- func (builder *ShareSessionRequestBuilder) Build() (ShareSessionRequest, error)
- func (builder *ShareSessionRequestBuilder) WithExtension(extension interface{}) *ShareSessionRequestBuilder
- func (builder *ShareSessionRequestBuilder) WithNotification(notification *ShareSessionNotification) *ShareSessionRequestBuilder
- func (builder *ShareSessionRequestBuilder) WithPolicy(policy Policy) *ShareSessionRequestBuilder
- func (builder *ShareSessionRequestBuilder) WithRedirectUri(redirectUri string) *ShareSessionRequestBuilder
- func (builder *ShareSessionRequestBuilder) WithSubject(subject json.RawMessage) *ShareSessionRequestBuilder
- type SharedReceiptResponse
- type SourceConstraint
- type SourceConstraintBuilder
- func (b *SourceConstraintBuilder) Build() (SourceConstraint, error)
- func (b *SourceConstraintBuilder) WithAnchor(anchor WantedAnchor) *SourceConstraintBuilder
- func (b *SourceConstraintBuilder) WithAnchorByValue(value, subtype string) *SourceConstraintBuilder
- func (b *SourceConstraintBuilder) WithDrivingLicence(subtype string) *SourceConstraintBuilder
- func (b *SourceConstraintBuilder) WithNationalID(subtype string) *SourceConstraintBuilder
- func (b *SourceConstraintBuilder) WithPasscard(subtype string) *SourceConstraintBuilder
- func (b *SourceConstraintBuilder) WithPassport(subtype string) *SourceConstraintBuilder
- func (b *SourceConstraintBuilder) WithSoftPreference(soft bool) *SourceConstraintBuilder
- type UserContent
- type UserProfile
- func (p UserProfile) Address() *attribute.StringAttribute
- func (p UserProfile) AgeVerifications() (out []attribute.AgeVerification, err error)
- func (p UserProfile) DateOfBirth() (*attribute.DateAttribute, error)
- func (p UserProfile) DocumentDetails() (*attribute.DocumentDetailsAttribute, error)
- func (p UserProfile) DocumentImages() (*attribute.ImageSliceAttribute, error)
- func (p UserProfile) EmailAddress() *attribute.StringAttribute
- func (p UserProfile) FamilyName() *attribute.StringAttribute
- func (p UserProfile) FullName() *attribute.StringAttribute
- func (p UserProfile) Gender() *attribute.StringAttribute
- func (p UserProfile) GetAttribute(attributeName string) *attribute.GenericAttribute
- func (p UserProfile) GetAttributeByID(attributeID string) *attribute.GenericAttribute
- func (p UserProfile) GetAttributes(attributeName string) []*attribute.GenericAttribute
- func (p UserProfile) GetDocumentImagesAttributeByID(attributeID string) (*attribute.ImageSliceAttribute, error)
- func (p UserProfile) GetImageAttribute(attributeName string) *attribute.ImageAttribute
- func (p UserProfile) GetJSONAttribute(attributeName string) (*attribute.JSONAttribute, error)
- func (p UserProfile) GetSelfieAttributeByID(attributeID string) (*attribute.ImageAttribute, error)
- func (p UserProfile) GetStringAttribute(attributeName string) *attribute.StringAttribute
- func (p UserProfile) GivenNames() *attribute.StringAttribute
- func (p UserProfile) IdentityProfileReport() (*attribute.JSONAttribute, error)
- func (p UserProfile) MobileNumber() *attribute.StringAttribute
- func (p UserProfile) Nationality() *attribute.StringAttribute
- func (p UserProfile) Selfie() *attribute.ImageAttribute
- func (p UserProfile) StructuredPostalAddress() (*attribute.JSONAttribute, error)
- type WantedAnchor
- type WantedAnchorBuilder
- type WantedAttribute
- type WantedAttributeBuilder
- func (builder *WantedAttributeBuilder) Build() (WantedAttribute, error)
- func (builder *WantedAttributeBuilder) WithAcceptSelfAsserted(accept bool) *WantedAttributeBuilder
- func (builder *WantedAttributeBuilder) WithConstraint(constraint constraintInterface) *WantedAttributeBuilder
- func (builder *WantedAttributeBuilder) WithDerivation(derivation string) *WantedAttributeBuilder
- func (builder *WantedAttributeBuilder) WithName(name string) *WantedAttributeBuilder
Examples ¶
- CreateShareSession
- PolicyBuilder
- PolicyBuilder.WithAdvancedIdentityProfileRequirements
- PolicyBuilder.WithAgeOver
- PolicyBuilder.WithAgeUnder
- PolicyBuilder.WithDateOfBirth
- PolicyBuilder.WithDocumentDetails
- PolicyBuilder.WithDocumentImages
- PolicyBuilder.WithFamilyName
- PolicyBuilder.WithFullName
- PolicyBuilder.WithGender
- PolicyBuilder.WithGivenNames
- PolicyBuilder.WithNationality
- PolicyBuilder.WithPhoneNumber
- PolicyBuilder.WithPostalAddress
- PolicyBuilder.WithSelfie
- PolicyBuilder.WithSelfieAuth
- PolicyBuilder.WithStructuredPostalAddress
- PolicyBuilder.WithWantedRememberMe
- ShareSessionNotificationBuilder
- ShareSessionNotificationBuilder.WithHeaders
- ShareSessionNotificationBuilder.WithMethod
- ShareSessionNotificationBuilder.WithUrl
- ShareSessionNotificationBuilder.WithVerifyTls
- ShareSessionRequestBuilder
- ShareSessionRequestBuilder.WithExtension
- ShareSessionRequestBuilder.WithPolicy
- ShareSessionRequestBuilder.WithSubject
- UserProfile.GetAttributeByID
- UserProfile.GetDocumentImagesAttributeByID
- UserProfile.GetSelfieAttributeByID
- WantedAnchorBuilder
- WantedAttributeBuilder (Optional_true)
- WantedAttributeBuilder.WithAcceptSelfAsserted
- WantedAttributeBuilder.WithAcceptSelfAsserted (False)
- WantedAttributeBuilder.WithConstraint
- WantedAttributeBuilder.WithDerivation
- WantedAttributeBuilder.WithName
Constants ¶
const ( AttrConstApplicationName = "application_name" AttrConstApplicationURL = "application_url" AttrConstApplicationLogo = "application_logo" AttrConstApplicationReceiptBGColor = "application_receipt_bgcolor" )
Attribute names for application attributes
const ( AnchorDrivingLicenceConst = "DRIVING_LICENCE" AnchorPassportConst = "PASSPORT" AnchorNationalIDConst = "NATIONAL_ID" AnchorPassCardConst = "PASS_CARD" )
Anchor name constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationContent ¶
type ApplicationContent struct { ApplicationProfile ApplicationProfile ExtraData *extra.Data }
type ApplicationProfile ¶
type ApplicationProfile struct {
// contains filtered or unexported fields
}
ApplicationProfile is the profile of an application with convenience methods to access well-known attributes.
func (ApplicationProfile) ApplicationLogo ¶
func (p ApplicationProfile) ApplicationLogo() *attribute.ImageAttribute
ApplicationLogo is the logo of the application that will be displayed to those users that perform a share with it.
func (ApplicationProfile) ApplicationName ¶
func (p ApplicationProfile) ApplicationName() *attribute.StringAttribute
ApplicationName is the name of the application
func (ApplicationProfile) ApplicationReceiptBgColor ¶
func (p ApplicationProfile) ApplicationReceiptBgColor() *attribute.StringAttribute
ApplicationReceiptBgColor is the background colour that will be displayed on each receipt the user gets as a result of a share with the application.
func (ApplicationProfile) ApplicationURL ¶
func (p ApplicationProfile) ApplicationURL() *attribute.StringAttribute
ApplicationURL is the URL where the application is available at
func (ApplicationProfile) GetAttribute ¶
func (p ApplicationProfile) GetAttribute(attributeName string) *attribute.GenericAttribute
GetAttribute retrieve an attribute by name on the Yoti profile. Will return nil if attribute is not present.
func (ApplicationProfile) GetAttributeByID ¶
func (p ApplicationProfile) GetAttributeByID(attributeID string) *attribute.GenericAttribute
GetAttributeByID retrieve an attribute by ID on the Yoti profile. Will return nil if attribute is not present.
func (ApplicationProfile) GetAttributes ¶
func (p ApplicationProfile) GetAttributes(attributeName string) []*attribute.GenericAttribute
GetAttributes retrieve a list of attributes by name on the Yoti profile. Will return an empty list of attribute is not present.
func (ApplicationProfile) GetImageAttribute ¶
func (p ApplicationProfile) GetImageAttribute(attributeName string) *attribute.ImageAttribute
GetImageAttribute retrieves an image attribute by name. Will return nil if attribute is not present.
func (ApplicationProfile) GetJSONAttribute ¶
func (p ApplicationProfile) GetJSONAttribute(attributeName string) (*attribute.JSONAttribute, error)
GetJSONAttribute retrieves a JSON attribute by name. Will return nil if attribute is not present.
func (ApplicationProfile) GetStringAttribute ¶
func (p ApplicationProfile) GetStringAttribute(attributeName string) *attribute.StringAttribute
GetStringAttribute retrieves a string attribute by name. Will return nil if attribute is not present.
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
Policy represents a dynamic policy for a share
func (*Policy) MarshalJSON ¶
MarshalJSON returns the JSON encoding
type PolicyBuilder ¶
type PolicyBuilder struct {
// contains filtered or unexported fields
}
PolicyBuilder constructs a json payload specifying the dynamic policy for a dynamic scenario
Example ¶
policy, err := (&PolicyBuilder{}).WithFullName(). WithPinAuth().WithWantedRememberMe().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[{"name":"full_name","accept_self_asserted":false}],"wanted_auth_types":[2],"wanted_remember_me":true}
func (*PolicyBuilder) Build ¶
func (b *PolicyBuilder) Build() (Policy, error)
Build constructs a dynamic policy object
func (*PolicyBuilder) WithAdvancedIdentityProfileRequirements ¶
func (b *PolicyBuilder) WithAdvancedIdentityProfileRequirements(advancedIdentityProfile json.RawMessage) *PolicyBuilder
WithAdvancedIdentityProfileRequirements adds Advanced Identity Profile Requirements to the policy. Must be valid JSON.
Example ¶
advancedIdentityProfile := []byte(`{ "profiles": [ { "trust_framework": "UK_TFIDA", "schemes": [ { "label": "LB912", "type": "RTW" }, { "label": "LB777", "type": "DBS", "objective": "BASIC" } ] }, { "trust_framework": "YOTI_GLOBAL", "schemes": [ { "label": "LB321", "type": "IDENTITY", "objective": "AL_L1", "config": {} } ] } ] }`) policy, err := (&PolicyBuilder{}).WithAdvancedIdentityProfileRequirements(advancedIdentityProfile).Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[],"wanted_auth_types":[],"wanted_remember_me":false,"advanced_identity_profile_requirements":{"profiles":[{"trust_framework":"UK_TFIDA","schemes":[{"label":"LB912","type":"RTW"},{"label":"LB777","type":"DBS","objective":"BASIC"}]},{"trust_framework":"YOTI_GLOBAL","schemes":[{"label":"LB321","type":"IDENTITY","objective":"AL_L1","config":{}}]}]}}
func (*PolicyBuilder) WithAgeDerivedAttribute ¶
func (b *PolicyBuilder) WithAgeDerivedAttribute(derivation string, options ...interface{}) *PolicyBuilder
WithAgeDerivedAttribute is a helper method for setting age based derivations Prefer to use WithAgeOver and WithAgeUnder instead of using this directly. "options" allows one or more options to be specified e.g. SourceConstraint
func (*PolicyBuilder) WithAgeOver ¶
func (b *PolicyBuilder) WithAgeOver(age int, options ...interface{}) *PolicyBuilder
WithAgeOver sets this dynamic policy as requesting whether the user is older than a certain age. "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
constraint, err := (&SourceConstraintBuilder{}).WithDrivingLicence("").Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } policy, err := (&PolicyBuilder{}).WithAgeOver(18, constraint).Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.attributes[0].MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"name":"date_of_birth","derivation":"age_over:18","constraints":[{"type":"SOURCE","preferred_sources":{"anchors":[{"name":"DRIVING_LICENCE","sub_type":""}],"soft_preference":false}}],"accept_self_asserted":false}
func (*PolicyBuilder) WithAgeUnder ¶
func (b *PolicyBuilder) WithAgeUnder(age int, options ...interface{}) *PolicyBuilder
WithAgeUnder sets this dynamic policy as requesting whether the user is younger than a certain age, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithAgeUnder(18).Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[{"name":"date_of_birth","derivation":"age_under:18","accept_self_asserted":false}],"wanted_auth_types":[],"wanted_remember_me":false}
func (*PolicyBuilder) WithDateOfBirth ¶
func (b *PolicyBuilder) WithDateOfBirth(options ...interface{}) *PolicyBuilder
WithDateOfBirth adds the date of birth attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithDateOfBirth().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[{"name":"date_of_birth","accept_self_asserted":false}],"wanted_auth_types":[],"wanted_remember_me":false}
func (*PolicyBuilder) WithDocumentDetails ¶
func (b *PolicyBuilder) WithDocumentDetails(options ...interface{}) *PolicyBuilder
WithDocumentDetails adds the document details attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithDocumentDetails().Build() if err != nil { return } data, err := policy.attributes[0].MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"name":"document_details","accept_self_asserted":false}
func (*PolicyBuilder) WithDocumentImages ¶
func (b *PolicyBuilder) WithDocumentImages(options ...interface{}) *PolicyBuilder
WithDocumentImages adds the document images attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithDocumentImages().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.attributes[0].MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"name":"document_images","accept_self_asserted":false}
func (*PolicyBuilder) WithEmail ¶
func (b *PolicyBuilder) WithEmail(options ...interface{}) *PolicyBuilder
WithEmail adds the email address attribute, "options" allows one or more options to be specified e.g. SourceConstraint
func (*PolicyBuilder) WithFamilyName ¶
func (b *PolicyBuilder) WithFamilyName(options ...interface{}) *PolicyBuilder
WithFamilyName adds the family name attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithFamilyName().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.attributes[0].MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"name":"family_name","accept_self_asserted":false}
func (*PolicyBuilder) WithFullName ¶
func (b *PolicyBuilder) WithFullName(options ...interface{}) *PolicyBuilder
WithFullName adds the full name attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
constraint, err := (&SourceConstraintBuilder{}).WithPassport("").Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } policy, err := (&PolicyBuilder{}).WithFullName(&constraint).Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } marshalledJSON, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(marshalledJSON))
Output: {"wanted":[{"name":"full_name","constraints":[{"type":"SOURCE","preferred_sources":{"anchors":[{"name":"PASSPORT","sub_type":""}],"soft_preference":false}}],"accept_self_asserted":false}],"wanted_auth_types":[],"wanted_remember_me":false}
func (*PolicyBuilder) WithGender ¶
func (b *PolicyBuilder) WithGender(options ...interface{}) *PolicyBuilder
WithGender adds the gender attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithGender().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[{"name":"gender","accept_self_asserted":false}],"wanted_auth_types":[],"wanted_remember_me":false}
func (*PolicyBuilder) WithGivenNames ¶
func (b *PolicyBuilder) WithGivenNames(options ...interface{}) *PolicyBuilder
WithGivenNames adds the given names attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithGivenNames().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[{"name":"given_names","accept_self_asserted":false}],"wanted_auth_types":[],"wanted_remember_me":false}
func (*PolicyBuilder) WithIdentityProfileRequirements ¶
func (b *PolicyBuilder) WithIdentityProfileRequirements(identityProfile json.RawMessage) *PolicyBuilder
WithIdentityProfileRequirements adds Identity Profile Requirements to the policy. Must be valid JSON.
func (*PolicyBuilder) WithNationality ¶
func (b *PolicyBuilder) WithNationality(options ...interface{}) *PolicyBuilder
WithNationality adds the nationality attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithNationality().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[{"name":"nationality","accept_self_asserted":false}],"wanted_auth_types":[],"wanted_remember_me":false}
func (*PolicyBuilder) WithPhoneNumber ¶
func (b *PolicyBuilder) WithPhoneNumber(options ...interface{}) *PolicyBuilder
WithPhoneNumber adds the phone number attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithPhoneNumber().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[{"name":"phone_number","accept_self_asserted":false}],"wanted_auth_types":[],"wanted_remember_me":false}
func (*PolicyBuilder) WithPinAuth ¶
func (b *PolicyBuilder) WithPinAuth() *PolicyBuilder
WithPinAuth sets this dynamic policy as requiring PIN authentication
func (*PolicyBuilder) WithPostalAddress ¶
func (b *PolicyBuilder) WithPostalAddress(options ...interface{}) *PolicyBuilder
WithPostalAddress adds the postal address attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithPostalAddress().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[{"name":"postal_address","accept_self_asserted":false}],"wanted_auth_types":[],"wanted_remember_me":false}
func (*PolicyBuilder) WithSelfie ¶
func (b *PolicyBuilder) WithSelfie(options ...interface{}) *PolicyBuilder
WithSelfie adds the selfie attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithSelfie().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.attributes[0].MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"name":"selfie","accept_self_asserted":false}
func (*PolicyBuilder) WithSelfieAuth ¶
func (b *PolicyBuilder) WithSelfieAuth() *PolicyBuilder
WithSelfieAuth sets this dynamic policy as requiring Selfie-based authentication
Example ¶
policy, err := (&PolicyBuilder{}).WithSelfieAuth().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[],"wanted_auth_types":[1],"wanted_remember_me":false}
func (*PolicyBuilder) WithStructuredPostalAddress ¶
func (b *PolicyBuilder) WithStructuredPostalAddress(options ...interface{}) *PolicyBuilder
WithStructuredPostalAddress adds the structured postal address attribute, "options" allows one or more options to be specified e.g. SourceConstraint
Example ¶
policy, err := (&PolicyBuilder{}).WithStructuredPostalAddress().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[{"name":"structured_postal_address","accept_self_asserted":false}],"wanted_auth_types":[],"wanted_remember_me":false}
func (*PolicyBuilder) WithWantedAttribute ¶
func (b *PolicyBuilder) WithWantedAttribute(attribute WantedAttribute) *PolicyBuilder
WithWantedAttribute adds an attribute from WantedAttributeBuilder to the policy
func (*PolicyBuilder) WithWantedAttributeByName ¶
func (b *PolicyBuilder) WithWantedAttributeByName(name string, options ...interface{}) *PolicyBuilder
WithWantedAttributeByName adds an attribute by its name. This is not the preferred way of adding an attribute - instead use the other methods below. Options allows one or more options to be specified e.g. SourceConstraint
func (*PolicyBuilder) WithWantedAuthType ¶
func (b *PolicyBuilder) WithWantedAuthType(wantedAuthType int) *PolicyBuilder
WithWantedAuthType sets this dynamic policy as requiring a specific authentication type
func (*PolicyBuilder) WithWantedRememberMe ¶
func (b *PolicyBuilder) WithWantedRememberMe() *PolicyBuilder
WithWantedRememberMe sets the Policy as requiring a "Remember Me ID"
Example ¶
policy, err := (&PolicyBuilder{}).WithWantedRememberMe().Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } data, err := policy.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(data))
Output: {"wanted":[],"wanted_auth_types":[],"wanted_remember_me":true}
type QrCode ¶
func CreateShareQrCode ¶
func CreateShareQrCode(httpClient requests.HttpClient, sessionID string, clientSdkId, apiUrl string, key *rsa.PrivateKey) (*QrCode, error)
CreateShareQrCode generates a sharing qr code using the supplied sessionID parameter
type ReceiptItemKeyResponse ¶
type ReceiptResponse ¶
type ReceiptResponse struct { ID string `json:"id"` SessionID string `json:"sessionId"` Timestamp string `json:"timestamp"` RememberMeID string `json:"rememberMeId,omitempty"` ParentRememberMeID string `json:"parentRememberMeId,omitempty"` Content *Content `json:"content,omitempty"` OtherPartyContent *Content `json:"otherPartyContent,omitempty"` WrappedItemKeyId string `json:"wrappedItemKeyId"` WrappedKey []byte `json:"wrappedKey"` Error string `json:"error"` }
type ShareSession ¶
type ShareSession struct {}
ShareSession contains information about the session.
func CreateShareSession ¶
func CreateShareSession(httpClient requests.HttpClient, shareSessionRequest *ShareSessionRequest, clientSdkId, apiUrl string, key *rsa.PrivateKey) (*ShareSession, error)
CreateShareSession creates session using the supplied session specification
func GetShareSession ¶
func GetShareSession(httpClient requests.HttpClient, sessionID string, clientSdkId, apiUrl string, key *rsa.PrivateKey) (*ShareSession, error)
GetShareSession get session info using the supplied sessionID parameter
type ShareSessionCreated ¶
type ShareSessionCreated struct {}
ShareSessionCreated Share Session QR Result
type ShareSessionFetchedQrCode ¶
type ShareSessionFetchedQrCode struct {}
type ShareSessionNotification ¶
type ShareSessionNotification struct {
// contains filtered or unexported fields
}
ShareSessionNotification specifies the session notification configuration.
func (*ShareSessionNotification) MarshalJSON ¶
func (a *ShareSessionNotification) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding
type ShareSessionNotificationBuilder ¶
type ShareSessionNotificationBuilder struct {
// contains filtered or unexported fields
}
ShareSessionNotificationBuilder builds Share Session Notification
func (*ShareSessionNotificationBuilder) Build ¶
func (b *ShareSessionNotificationBuilder) Build() (ShareSessionNotification, error)
Build constructs the Share Session Notification Builder
func (*ShareSessionNotificationBuilder) WithHeaders ¶
func (b *ShareSessionNotificationBuilder) WithHeaders(headers map[string][]string) *ShareSessionNotificationBuilder
WithHeaders set headers to Share Session Notification
func (*ShareSessionNotificationBuilder) WithMethod ¶
func (b *ShareSessionNotificationBuilder) WithMethod(method string) *ShareSessionNotificationBuilder
WithMethod set method to Share Session Notification
func (*ShareSessionNotificationBuilder) WithUrl ¶
func (b *ShareSessionNotificationBuilder) WithUrl(url string) *ShareSessionNotificationBuilder
WithUrl setsUrl to Share Session Notification
func (*ShareSessionNotificationBuilder) WithVerifyTls ¶
func (b *ShareSessionNotificationBuilder) WithVerifyTls(verifyTls bool) *ShareSessionNotificationBuilder
WithVerifyTLS sets whether TLS should be verified for notifications.
type ShareSessionQrCode ¶
type ShareSessionQrCode struct { string `json:"id"` Status string `json:"status"` Expiry string `json:"expiry"` } `json:"session"` }ID
func GetShareSessionQrCode ¶
func GetShareSessionQrCode(httpClient requests.HttpClient, qrCodeId string, clientSdkId, apiUrl string, key *rsa.PrivateKey) (fetchedQrCode ShareSessionQrCode, err error)
GetShareSessionQrCode is used to fetch the qr code by id.
type ShareSessionRequest ¶
type ShareSessionRequest struct {
// contains filtered or unexported fields
}
ShareSessionRequest represents a sharesession
func (ShareSessionRequest) MarshalJSON ¶
func (shareSesssion ShareSessionRequest) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding
type ShareSessionRequestBuilder ¶
type ShareSessionRequestBuilder struct {
// contains filtered or unexported fields
}
ShareSessionRequestBuilder builds a session
func (*ShareSessionRequestBuilder) Build ¶
func (builder *ShareSessionRequestBuilder) Build() (ShareSessionRequest, error)
Build constructs the ShareSession
func (*ShareSessionRequestBuilder) WithExtension ¶
func (builder *ShareSessionRequestBuilder) WithExtension(extension interface{}) *ShareSessionRequestBuilder
WithExtension adds an extension to the ShareSession
func (*ShareSessionRequestBuilder) WithNotification ¶
func (builder *ShareSessionRequestBuilder) WithNotification(notification *ShareSessionNotification) *ShareSessionRequestBuilder
WithNotification sets the callback URL
func (*ShareSessionRequestBuilder) WithPolicy ¶
func (builder *ShareSessionRequestBuilder) WithPolicy(policy Policy) *ShareSessionRequestBuilder
WithPolicy attaches a Policy to the ShareSession
func (*ShareSessionRequestBuilder) WithRedirectUri ¶
func (builder *ShareSessionRequestBuilder) WithRedirectUri(redirectUri string) *ShareSessionRequestBuilder
WithRedirectUri sets redirectUri to the ShareSession
func (*ShareSessionRequestBuilder) WithSubject ¶
func (builder *ShareSessionRequestBuilder) WithSubject(subject json.RawMessage) *ShareSessionRequestBuilder
WithSubject adds a subject to the ShareSession. Must be valid JSON.
type SharedReceiptResponse ¶
type SharedReceiptResponse struct {}
func GetShareReceipt ¶
func GetShareReceipt(httpClient requests.HttpClient, receiptId string, clientSdkId, apiUrl string, key *rsa.PrivateKey) (receipt SharedReceiptResponse, err error)
type SourceConstraint ¶
type SourceConstraint struct {
// contains filtered or unexported fields
}
SourceConstraint describes a requirement or preference for a particular set of anchors
func (*SourceConstraint) MarshalJSON ¶
func (constraint *SourceConstraint) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding
type SourceConstraintBuilder ¶
type SourceConstraintBuilder struct {
// contains filtered or unexported fields
}
SourceConstraintBuilder builds a source constraint
func (*SourceConstraintBuilder) Build ¶
func (b *SourceConstraintBuilder) Build() (SourceConstraint, error)
Build builds a SourceConstraint
func (*SourceConstraintBuilder) WithAnchor ¶
func (b *SourceConstraintBuilder) WithAnchor(anchor WantedAnchor) *SourceConstraintBuilder
WithAnchor adds an anchor to the preference list
func (*SourceConstraintBuilder) WithAnchorByValue ¶
func (b *SourceConstraintBuilder) WithAnchorByValue(value, subtype string) *SourceConstraintBuilder
WithAnchorByValue is a helper method which builds an anchor and adds it to the source constraint
func (*SourceConstraintBuilder) WithDrivingLicence ¶
func (b *SourceConstraintBuilder) WithDrivingLicence(subtype string) *SourceConstraintBuilder
WithDrivingLicence adds a Driving Licence anchor
func (*SourceConstraintBuilder) WithNationalID ¶
func (b *SourceConstraintBuilder) WithNationalID(subtype string) *SourceConstraintBuilder
WithNationalID adds a national ID anchor
func (*SourceConstraintBuilder) WithPasscard ¶
func (b *SourceConstraintBuilder) WithPasscard(subtype string) *SourceConstraintBuilder
WithPasscard adds a passcard anchor
func (*SourceConstraintBuilder) WithPassport ¶
func (b *SourceConstraintBuilder) WithPassport(subtype string) *SourceConstraintBuilder
WithPassport adds a passport anchor
func (*SourceConstraintBuilder) WithSoftPreference ¶
func (b *SourceConstraintBuilder) WithSoftPreference(soft bool) *SourceConstraintBuilder
WithSoftPreference sets this constraint as a 'soft requirement' if the parameter is true, and a hard requirement if it is false.
type UserContent ¶
type UserContent struct { UserProfile UserProfile ExtraData *extra.Data }
type UserProfile ¶
type UserProfile struct {
// contains filtered or unexported fields
}
UserProfile represents the details retrieved for a particular user. Consists of Yoti attributes: a small piece of information about a Yoti user such as a photo of the user or the user's date of birth.
func (UserProfile) Address ¶
func (p UserProfile) Address() *attribute.StringAttribute
Address represents the user's address. Will be nil if not provided by Yoti.
func (UserProfile) AgeVerifications ¶
func (p UserProfile) AgeVerifications() (out []attribute.AgeVerification, err error)
AgeVerifications returns a slice of age verifications for the user. Will be an empty slice if not provided by Yoti.
func (UserProfile) DateOfBirth ¶
func (p UserProfile) DateOfBirth() (*attribute.DateAttribute, error)
DateOfBirth represents the user's date of birth. Will be nil if not provided by Yoti. Has an err value which will be filled if there is an error parsing the date.
func (UserProfile) DocumentDetails ¶
func (p UserProfile) DocumentDetails() (*attribute.DocumentDetailsAttribute, error)
DocumentDetails represents information extracted from a document provided by the user. Will be nil if not provided by Yoti.
func (UserProfile) DocumentImages ¶
func (p UserProfile) DocumentImages() (*attribute.ImageSliceAttribute, error)
DocumentImages returns a slice of document images cropped from the image in the capture page. There can be multiple images as per the number of regions in the capture in this attribute. Will be nil if not provided by Yoti.
func (UserProfile) EmailAddress ¶
func (p UserProfile) EmailAddress() *attribute.StringAttribute
EmailAddress represents the user's verified email address. Will be nil if not provided by Yoti.
func (UserProfile) FamilyName ¶
func (p UserProfile) FamilyName() *attribute.StringAttribute
FamilyName corresponds to primary name in passport, and surname in English. Will be nil if not provided by Yoti.
func (UserProfile) FullName ¶
func (p UserProfile) FullName() *attribute.StringAttribute
FullName represents the user's full name. If family_name/given_names are present, the value will be equal to the string 'given_names + " " family_name'. Will be nil if not provided by Yoti.
func (UserProfile) Gender ¶
func (p UserProfile) Gender() *attribute.StringAttribute
Gender corresponds to the gender in the registered document; the value will be one of the strings "MALE", "FEMALE", "TRANSGENDER" or "OTHER". Will be nil if not provided by Yoti.
func (UserProfile) GetAttribute ¶
func (p UserProfile) GetAttribute(attributeName string) *attribute.GenericAttribute
GetAttribute retrieve an attribute by name on the Yoti profile. Will return nil if attribute is not present.
func (UserProfile) GetAttributeByID ¶
func (p UserProfile) GetAttributeByID(attributeID string) *attribute.GenericAttribute
GetAttributeByID retrieve an attribute by ID on the Yoti profile. Will return nil if attribute is not present.
Example ¶
userProfile := getUserProfile() fullNameAttribute := userProfile.GetAttributeByID("full-name-id-123") value := fullNameAttribute.Value().(string) fmt.Println(value)
Output: John Smith
func (UserProfile) GetAttributes ¶
func (p UserProfile) GetAttributes(attributeName string) []*attribute.GenericAttribute
GetAttributes retrieve a list of attributes by name on the Yoti profile. Will return an empty list of attribute is not present.
func (UserProfile) GetDocumentImagesAttributeByID ¶
func (p UserProfile) GetDocumentImagesAttributeByID(attributeID string) (*attribute.ImageSliceAttribute, error)
GetDocumentImagesAttributeByID retrieve a Document Images attribute by ID on the Yoti profile. This attribute consists of a slice of document images cropped from the image in the capture page. There can be multiple images as per the number of regions in the capture in this attribute. Will return nil if attribute is not present.
Example ¶
userProfile := getUserProfile() documentImagesAttribute, err := userProfile.GetDocumentImagesAttributeByID("document-images-attribute-id-123") if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(*documentImagesAttribute.ID())
Output: document-images-attribute-id-123
func (UserProfile) GetImageAttribute ¶
func (p UserProfile) GetImageAttribute(attributeName string) *attribute.ImageAttribute
GetImageAttribute retrieves an image attribute by name. Will return nil if attribute is not present.
func (UserProfile) GetJSONAttribute ¶
func (p UserProfile) GetJSONAttribute(attributeName string) (*attribute.JSONAttribute, error)
GetJSONAttribute retrieves a JSON attribute by name. Will return nil if attribute is not present.
func (UserProfile) GetSelfieAttributeByID ¶
func (p UserProfile) GetSelfieAttributeByID(attributeID string) (*attribute.ImageAttribute, error)
GetSelfieAttributeByID retrieve a Selfie attribute by ID on the Yoti profile. This attribute is a photograph of the user. Will return nil if attribute is not present.
Example ¶
userProfile := getUserProfile() selfieAttribute, err := userProfile.GetSelfieAttributeByID("selfie-attribute-id-123") if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(*selfieAttribute.ID())
Output: selfie-attribute-id-123
func (UserProfile) GetStringAttribute ¶
func (p UserProfile) GetStringAttribute(attributeName string) *attribute.StringAttribute
GetStringAttribute retrieves a string attribute by name. Will return nil if attribute is not present.
func (UserProfile) GivenNames ¶
func (p UserProfile) GivenNames() *attribute.StringAttribute
GivenNames corresponds to secondary names in passport, and first/middle names in English. Will be nil if not provided by Yoti.
func (UserProfile) IdentityProfileReport ¶
func (p UserProfile) IdentityProfileReport() (*attribute.JSONAttribute, error)
IdentityProfileReport represents the JSON object containing identity assertion and the verification report. Will be nil if not provided by Yoti.
func (UserProfile) MobileNumber ¶
func (p UserProfile) MobileNumber() *attribute.StringAttribute
MobileNumber represents the user's mobile phone number, as verified at registration time. The value will be a number in E.164 format (i.e. '+' for international prefix and no spaces, e.g. "+447777123456"). Will be nil if not provided by Yoti.
func (UserProfile) Nationality ¶
func (p UserProfile) Nationality() *attribute.StringAttribute
Nationality corresponds to the nationality in the passport. The value is an ISO-3166-1 alpha-3 code with ICAO9303 (passport) extensions. Will be nil if not provided by Yoti.
func (UserProfile) Selfie ¶
func (p UserProfile) Selfie() *attribute.ImageAttribute
Selfie is a photograph of the user. Will be nil if not provided by Yoti.
func (UserProfile) StructuredPostalAddress ¶
func (p UserProfile) StructuredPostalAddress() (*attribute.JSONAttribute, error)
StructuredPostalAddress represents the user's address in a JSON format. Will be nil if not provided by Yoti. This can be accessed as a map[string]string{} using a type assertion, e.g.: structuredPostalAddress := structuredPostalAddressAttribute.Value().(map[string]string{})
type WantedAnchor ¶
type WantedAnchor struct {
// contains filtered or unexported fields
}
WantedAnchor specifies a preferred anchor for a user's details
func (*WantedAnchor) MarshalJSON ¶
func (a *WantedAnchor) MarshalJSON() ([]byte, error)
MarshalJSON ...
type WantedAnchorBuilder ¶
type WantedAnchorBuilder struct {
// contains filtered or unexported fields
}
WantedAnchorBuilder describes a desired anchor for user profile data
Example ¶
aadhaarAnchor, err := (&WantedAnchorBuilder{}). WithValue("NATIONAL_ID"). WithSubType("AADHAAR"). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } aadhaarJSON, err := aadhaarAnchor.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println("Aadhaar:", string(aadhaarJSON))
Output: Aadhaar: {"name":"NATIONAL_ID","sub_type":"AADHAAR"}
func (*WantedAnchorBuilder) Build ¶
func (b *WantedAnchorBuilder) Build() (WantedAnchor, error)
Build constructs the anchor from the builder's specification
func (*WantedAnchorBuilder) WithSubType ¶
func (b *WantedAnchorBuilder) WithSubType(subType string) *WantedAnchorBuilder
WithSubType sets the anchors subtype
func (*WantedAnchorBuilder) WithValue ¶
func (b *WantedAnchorBuilder) WithValue(name string) *WantedAnchorBuilder
WithValue sets the anchor's name
type WantedAttribute ¶
type WantedAttribute struct { Optional bool // contains filtered or unexported fields }
WantedAttribute represents a wanted attribute in a dynamic sharing policy
func (*WantedAttribute) MarshalJSON ¶
func (attr *WantedAttribute) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding
type WantedAttributeBuilder ¶
type WantedAttributeBuilder struct {
// contains filtered or unexported fields
}
WantedAttributeBuilder generates the payload for specifying a single wanted attribute as part of a dynamic scenario
Example (Optional_true) ¶
attribute, err := (&WantedAttributeBuilder{}). WithName("TEST NAME"). WithAcceptSelfAsserted(false). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } attribute.Optional = true marshalledJSON, err := attribute.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(marshalledJSON))
Output: {"name":"TEST NAME","accept_self_asserted":false,"optional":true}
func (*WantedAttributeBuilder) Build ¶
func (builder *WantedAttributeBuilder) Build() (WantedAttribute, error)
Build generates the wanted attribute's specification
func (*WantedAttributeBuilder) WithAcceptSelfAsserted ¶
func (builder *WantedAttributeBuilder) WithAcceptSelfAsserted(accept bool) *WantedAttributeBuilder
WithAcceptSelfAsserted allows self-asserted user details, such as those from Aadhar
Example ¶
attribute, err := (&WantedAttributeBuilder{}). WithName("TEST NAME"). WithAcceptSelfAsserted(true). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } marshalledJSON, err := attribute.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(marshalledJSON))
Output: {"name":"TEST NAME","accept_self_asserted":true}
Example (False) ¶
attribute, err := (&WantedAttributeBuilder{}). WithName("TEST NAME"). WithAcceptSelfAsserted(false). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } marshalledJSON, err := attribute.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(marshalledJSON))
Output: {"name":"TEST NAME","accept_self_asserted":false}
func (*WantedAttributeBuilder) WithConstraint ¶
func (builder *WantedAttributeBuilder) WithConstraint(constraint constraintInterface) *WantedAttributeBuilder
WithConstraint adds a constraint to a wanted attribute
Example ¶
constraint, err := (&SourceConstraintBuilder{}). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } attribute, err := (&WantedAttributeBuilder{}). WithName("TEST NAME"). WithConstraint(&constraint). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } marshalledJSON, err := attribute.MarshalJSON() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(string(marshalledJSON))
Output: {"name":"TEST NAME","constraints":[{"type":"SOURCE","preferred_sources":{"anchors":[],"soft_preference":false}}],"accept_self_asserted":false}
func (*WantedAttributeBuilder) WithDerivation ¶
func (builder *WantedAttributeBuilder) WithDerivation(derivation string) *WantedAttributeBuilder
WithDerivation sets the derivation
Example ¶
attribute, err := (&WantedAttributeBuilder{}). WithDerivation("TEST DERIVATION"). WithName("TEST NAME"). Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(attribute.derivation)
Output: TEST DERIVATION
func (*WantedAttributeBuilder) WithName ¶
func (builder *WantedAttributeBuilder) WithName(name string) *WantedAttributeBuilder
WithName sets the name of the wanted attribute
Example ¶
builder := (&WantedAttributeBuilder{}).WithName("TEST NAME") attribute, err := builder.Build() if err != nil { fmt.Printf("error: %s", err.Error()) return } fmt.Println(attribute.name)
Output: TEST NAME
Source Files ¶
- address.go
- application_profile.go
- base_profile.go
- policy_builder.go
- qr_code.go
- receipt.go
- receipt_item_key.go
- service.go
- share_receipt.go
- share_retrieve_qr.go
- share_session.go
- share_session_builder.go
- share_session_created.go
- share_session_notification_builder.go
- share_session_qr_code.go
- source_constraint.go
- user_profile.go
- wanted_anchor_builder.go
- wanted_attribute_builder.go