Documentation
¶
Index ¶
- func UnsetProperties(propertyNames ...string) updater.Profile
- func WithAnonymousId(anonymousId string) updater.Profile
- func WithEmail(email string) updater.Profile
- func WithExternalId(externalId string) updater.Profile
- func WithFirstName(firstName string) updater.Profile
- func WithImage(image string) updater.Profile
- func WithLastName(lastName string) updater.Profile
- func WithLocation(updaters ...updater.Location) updater.Profile
- func WithOrganization(organization string) updater.Profile
- func WithPhoneNumber(phoneNumber string) updater.Profile
- func WithProperties(updaters ...updater.Properties) updater.Profile
- func WithTitle(title string) updater.Profile
- type ExistingAttributes
- type ExistingProfile
- type Location
- type NewAttributes
- type NewProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnsetProperties ¶ added in v0.0.4
UnsetProperties removes a key or keys (and their values) completely from properties.
func WithAnonymousId ¶
WithAnonymousId sets the anonymous ID for the profile.
func WithExternalId ¶
WithExternalId sets the external ID for the profile.
func WithFirstName ¶
WithFirstName sets the first name for the profile.
func WithLastName ¶
WithLastName sets the last name for the profile.
func WithLocation ¶
WithLocation sets the location for the profile.
func WithOrganization ¶
WithOrganization sets the organization for the profile.
func WithPhoneNumber ¶
WithPhoneNumber sets the phone number for the profile.
func WithProperties ¶
func WithProperties(updaters ...updater.Properties) updater.Profile
WithProperties sets the properties for the profile.
It accepts a variable number of updaters that each set a specific property. Each updater is responsible for setting a specific key-value pair within the properties map.
Types ¶
type ExistingAttributes ¶
type ExistingAttributes struct {
NewAttributes
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
LastEventDate *time.Time `json:"last_event_date"`
}
ExistingAttributes contains attributes for a profile that is already created, including timestamps.
type ExistingProfile ¶
type ExistingProfile struct {
Id string `json:"id"`
Attributes ExistingAttributes `json:"attributes"`
}
ExistingProfile represents the data structure for a profile that is already created.
type Location ¶
type Location struct {
Address1 *string `json:"address1"`
Address2 *string `json:"address2"`
City *string `json:"city"`
Country *string `json:"country"`
Latitude *float64 `json:"latitude"`
Longitude *float64 `json:"longitude"`
Region *string `json:"region"`
Zip *string `json:"zip"`
Timezone *string `json:"timezone"`
}
Location represents the geographical location details for a profile.
type NewAttributes ¶
type NewAttributes struct {
Email string `json:"email"`
PhoneNumber *string `json:"phone_number"`
ExternalId *string `json:"external_id"`
AnonymousId *string `json:"anonymous_id"`
FirstName *string `json:"first_name"`
LastName *string `json:"last_name"`
Organization *string `json:"organization"`
Title *string `json:"title"`
Image *string `json:"image"`
Location Location `json:"location"`
Properties map[string]interface{} `json:"properties"`
}
NewAttributes contains common attributes for a profile.
type NewProfile ¶
type NewProfile struct {
Attributes NewAttributes `json:"attributes"`
}
NewProfile represents the data structure for a profile that is not yet created.
func (*NewProfile) ToUpdaters ¶
func (p *NewProfile) ToUpdaters() []updater.Profile
ToUpdaters takes a NewProfile and transforms it into a slice of updater.Profile. This function facilitates the conversion of a profile's fields into a series of updaters, which can be used to modify a profile in a more granular manner. Importantly, it creates updaters only for the non-nil fields of the profile, ensuring that only specified fields are updated. It handles all the fields of the profile, including nested fields like Location and Properties.