Documentation ¶
Index ¶
- Constants
- type AccountEmail
- type AccountEmailPivot
- type AccountMobile
- type AccountMobilePivot
- type AccountProfile
- type AuthenticationResult
- type Client
- func (c *Client) GetLoginUrl() string
- func (c *Client) GetProfile(tokenType string, accessToken string) (AccountProfile, error)
- func (c *Client) Login(username string, password string, profile bool) (AuthenticationResult, error)
- func (c *Client) LoginWithScope(username string, password string, profile bool, scope string) (AuthenticationResult, error)
- func (c *Client) RedirectToLoginUrl(w http.ResponseWriter, r *http.Request)
- func (c *Client) RefreshNewToken(refreshToken string) (AuthenticationResult, error)
- func (c *Client) VerifyAuthorizedCode(authCode string, profile bool) (AuthenticationResult, error)
- type Department
- type Employee
- type HeadDepartment
- type IdCredential
- type OrgApiResult
- type OrgClient
- type TeamMember
Constants ¶
View Source
const ( ProductionEndpoint = "https://one.th" MaxTimeOut = 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountEmail ¶
type AccountEmail struct { ID string `json:"id"` Email string `json:"email"` CreatedAt string `json:"created_at"` CreatedBy string `json:"created_by"` UpdatedAt string `json:"updated_at"` UpdatedBy string `json:"updated_by"` DeletedBy string `json:"deleted_at"` EmailPivot AccountEmailPivot `json:"pivot"` }
type AccountEmailPivot ¶
type AccountEmailPivot struct { AccountID string `json:"account_id"` EmailID string `json:"email_id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` StatusCD string `json:"status_cd"` PrimaryFlag string `json:"primary_flg"` ConfirmFlag string `json:"email_confirm_flg"` ConfirmDate string `json:"email_confirm_dt"` }
type AccountMobile ¶
type AccountMobile struct { ID string `json:"id"` MobileNumber string `json:"mobile_no"` CreatedAt string `json:"created_at"` CreatedBy string `json:"created_by"` UpdatedAt string `json:"updated_at"` UpdatedBy string `json:"updated_by"` DeletedAt string `json:"deleted_at"` MobilePivot AccountMobilePivot `json:"pivot"` }
type AccountMobilePivot ¶
type AccountMobilePivot struct { AccountID string `json:"account_id"` MobileID string `json:"mobile_id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` StatusCD string `json:"status_cd"` PrimaryFlag string `json:"primary_flg"` ConfirmFlag string `json:"mobile_confirm_flg"` ConfirmDate string `json:"mobile_confirm_dt"` }
type AccountProfile ¶
type AccountProfile struct { ID string `json:"id"` FirstNameTH string `json:"first_name_th"` LastNameTH string `json:"last_name_th"` FirstNameENG string `json:"first_name_eng"` LastNameENG string `json:"last_name_eng"` TitleTH string `json:"account_title_th"` TitleENG string `json:"account_title_eng"` IDCardType string `json:"id_card_type"` IDCardTypeNumber string `json:"id_card_num"` IDCardHashed string `json:"hash_id_card_num"` AccountCategory string `json:"account_category"` AccountSubCategory string `json:"account_sub_category"` ThaiEmail1 string `json:"thai_email"` ThaiEmail2 string `json:"thai_email2"` StatusCD string `json:"status_cd"` BirthDate string `json:"birth_date"` StatusDate string `json:"status_dt"` RegisterDate string `json:"register_dt"` AddressID string `json:"address_id"` CreatedAt string `json:"created_at"` CreatedBy string `json:"created_by"` UpdatedAt string `json:"updated_at"` UpdatedBy string `json:"updated_by"` Reason string `json:"reason"` TelephoneNumber string `json:"tel_no"` NameOnDocTH string `json:"name_on_document_th"` NameOnDocENG string `json:"name_on_document_eng"` Mobile []AccountMobile `json:"mobile"` Email []AccountEmail `json:"email"` Address interface{} `json:"address"` AccountAttr []string `json:"account_attribute"` Status string `json:"status"` LastUpdate string `json:"last_update"` Employee *Employee `json:"has_employee_detail"` }
Account profile model
type AuthenticationResult ¶
type AuthenticationResult struct { TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` AccountID string `json:"account_id"` Result string `json:"result"` Username string `json:"username"` Profile AccountProfile `json:"profile"` }
Authentication result model
type Client ¶
func NewIdentity ¶
func (*Client) GetLoginUrl ¶
func (*Client) GetProfile ¶
func (c *Client) GetProfile(tokenType string, accessToken string) (AccountProfile, error)
func (*Client) LoginWithScope ¶
func (*Client) RedirectToLoginUrl ¶
func (c *Client) RedirectToLoginUrl(w http.ResponseWriter, r *http.Request)
func (*Client) RefreshNewToken ¶
func (c *Client) RefreshNewToken(refreshToken string) (AuthenticationResult, error)
func (*Client) VerifyAuthorizedCode ¶
func (c *Client) VerifyAuthorizedCode(authCode string, profile bool) (AuthenticationResult, error)
type Department ¶
type Employee ¶
type Employee struct { Id uuid.UUID `json:"id"` AccountId string `json:"account_id"` BizId string `json:"biz_id"` Email string `json:"email"` EmployeeId string `json:"employee_id"` Account *AccountProfile `json:"account"` Employee *Employee `json:"employee"` Position string `json:"position"` PositionId uuid.UUID `json:"role_id"` }
type HeadDepartment ¶
type IdCredential ¶
type OrgApiResult ¶
Click to show internal directories.
Click to hide internal directories.