Documentation ¶
Overview ¶
Package login - This file is auto-generated from the update_all.sh script. Do not modify anything here. Any changes to this EndPoint should be made in the data.go file. The only exception is the AppService.login package.
Index ¶
- Constants
- type EndPoint
- func (e *EndPoint) AppKey() string
- func (e EndPoint) CacheFilename() string
- func (e EndPoint) Call() api.EndPoint
- func (e *EndPoint) CreateDate() string
- func (e *EndPoint) Email() string
- func (e EndPoint) GetArea() api.AreaName
- func (e EndPoint) GetCacheTimeout() time.Duration
- func (e *EndPoint) GetData() api.DataMap
- func (e EndPoint) GetEndPointData() api.DataMap
- func (e EndPoint) GetEndPointDataTables() output.Tables
- func (e EndPoint) GetEndPointResultTable() output.Table
- func (e EndPoint) GetError() error
- func (e EndPoint) GetJsonData(raw bool) output.Json
- func (e EndPoint) GetName() api.EndPointName
- func (e EndPoint) GetRequest() Request
- func (e EndPoint) GetRequestArgNames() map[string]string
- func (e EndPoint) GetRequestJson() output.Json
- func (e EndPoint) GetResponse() Response
- func (e EndPoint) GetResponseJson() output.Json
- func (e EndPoint) GetUrl() api.EndPointUrl
- func (e *EndPoint) HasTokenChanged() bool
- func (e EndPoint) Help() string
- func (e *EndPoint) HoursFromLastLogin() float64
- func (e EndPoint) Init(apiRoot api.Web) *EndPoint
- func (e EndPoint) IsDebug() bool
- func (e EndPoint) IsDisabled() bool
- func (e EndPoint) IsError() bool
- func (e *EndPoint) IsOnline() bool
- func (e EndPoint) IsRequestValid() error
- func (e EndPoint) IsResponseValid() error
- func (e *EndPoint) IsTokenInvalid() bool
- func (e *EndPoint) IsTokenValid() bool
- func (e *EndPoint) LastLogin() time.Time
- func (e *EndPoint) Login(auth *SunGrowAuth) error
- func (e *EndPoint) LoginLastDate() string
- func (e *EndPoint) LoginLastIP() string
- func (e *EndPoint) LoginState() string
- func (e EndPoint) MarshalJSON() ([]byte, error)
- func (e *EndPoint) Print()
- func (e EndPoint) ReadDataFile() error
- func (e *EndPoint) RemoveToken() error
- func (e EndPoint) RequestFingerprint() string
- func (e EndPoint) RequestRef() interface{}
- func (e EndPoint) RequestString() string
- func (e EndPoint) ResponseRef() interface{}
- func (e EndPoint) ResponseString() string
- func (e EndPoint) ResultDataRef() ResultData
- func (e EndPoint) SetCacheTimeout(duration time.Duration) api.EndPoint
- func (e EndPoint) SetError(format string, a ...interface{}) api.EndPoint
- func (e EndPoint) SetFilenamePrefix(format string, args ...interface{}) string
- func (e EndPoint) SetRequest(ref interface{}) api.EndPoint
- func (e EndPoint) SetRequestByJson(j output.Json) api.EndPoint
- func (e EndPoint) SetResponse(ref []byte) api.EndPoint
- func (e *EndPoint) SetTokenInvalid()
- func (e EndPoint) String() string
- func (e *EndPoint) Token() string
- func (e *EndPoint) UserAccount() string
- func (e *EndPoint) UserId() string
- func (e *EndPoint) UserName() string
- func (e EndPoint) WriteDataFile() error
- type Request
- type RequestData
- type Response
- type ResultData
- type SunGrowAuth
Constants ¶
const ( DateTimeFormat = "2006-01-02T15:04:05" DefaultAuthTokenFile = "AuthToken.json" TokenValidHours = 24 LastLoginDateFormat = "2006-01-02 15:04:05" )
const Disabled = false
const EndPointName = "AppService.login"
const Url = "/v1/userService/login"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndPoint ¶
type EndPoint struct { api.EndPointStruct Request Request Response Response Auth *SunGrowAuth }
EndPoint - Holds the request, response and web method structures.
func Assert ¶
Assert - Used to obtain locally scoped EndPoint methods, (not visible from api.EndPoint).
func (EndPoint) CacheFilename ¶
CacheFilename - Check if a cache file exists for this EndPoint.
func (EndPoint) Call ¶
Call - Once RequestData is populated, this will access the iSolarCloud API and populate ResultData.
func (*EndPoint) CreateDate ¶
func (EndPoint) GetCacheTimeout ¶
GetCacheTimeout - Return the cache timeout for this EndPoint.
func (EndPoint) GetEndPointData ¶
func (EndPoint) GetEndPointDataTables ¶
func (EndPoint) GetEndPointResultTable ¶
func (EndPoint) GetJsonData ¶
GetJsonData - Get the JSON representation of ResultData, either as condensed or "pretty".
func (EndPoint) GetName ¶
func (e EndPoint) GetName() api.EndPointName
GetName - Returns the API EndPoint name.
func (EndPoint) GetRequest ¶
GetRequest - Get the Request structure as scoped by this endpoint.
func (EndPoint) GetRequestArgNames ¶
GetRequestArgNames -
func (EndPoint) GetRequestJson ¶
GetRequestJson - Return the Request structure as a JSON string.
func (EndPoint) GetResponse ¶
GetResponse - Get the Response structure as scoped by this endpoint.
func (EndPoint) GetResponseJson ¶
GetResponseJson - Return the Response structure as a JSON string.
func (EndPoint) GetUrl ¶
func (e EndPoint) GetUrl() api.EndPointUrl
GetUrl - Returns the API EndPoint url.
func (*EndPoint) HasTokenChanged ¶
func (EndPoint) Help ¶
Help - Return help information on the JSON structure used to populate RequestData.
func (*EndPoint) HoursFromLastLogin ¶
func (EndPoint) IsDisabled ¶
IsDisabled - Is this endpoint disabled? See data.go Disabled constant.
func (EndPoint) IsRequestValid ¶
IsRequestValid - Is api.RequestCommon and RequestData valid?
func (EndPoint) IsResponseValid ¶
IsResponseValid - Is api.ResponseCommon and ResultData valid?
func (*EndPoint) IsTokenInvalid ¶
func (*EndPoint) IsTokenValid ¶
func (*EndPoint) Login ¶
func (e *EndPoint) Login(auth *SunGrowAuth) error
func (*EndPoint) LoginLastDate ¶
func (*EndPoint) LoginLastIP ¶
func (*EndPoint) LoginState ¶
func (EndPoint) MarshalJSON ¶
MarshalJSON - Marshall the EndPoint.
func (EndPoint) ReadDataFile ¶
ReadDataFile - Read a JSON file and populate the ResultData structure. (File names will default to AREA-ENDPOINT.json )
func (*EndPoint) RemoveToken ¶
RemoveToken - Removes a token from a file path.
func (EndPoint) RequestFingerprint ¶
RequestFingerprint - Check if a cache file exists for this EndPoint.
func (EndPoint) RequestRef ¶
func (e EndPoint) RequestRef() interface{}
RequestRef - Return the locally scoped Request structure.
func (EndPoint) RequestString ¶
RequestString - Return the Request structure as a human-readable string.
func (EndPoint) ResponseRef ¶
func (e EndPoint) ResponseRef() interface{}
ResponseRef - Return the locally scoped Response structure.
func (EndPoint) ResponseString ¶
ResponseString - Return the Response structure as a human-readable string.
func (EndPoint) ResultDataRef ¶
func (e EndPoint) ResultDataRef() ResultData
ResultDataRef - Return the locally scoped ResultData structure.
func (EndPoint) SetCacheTimeout ¶
SetCacheTimeout - Set the cache timeout for this EndPoint. (Defaults to 1 hour.)
func (EndPoint) SetFilenamePrefix ¶
SetFilenamePrefix - Produce filename based on area and endpoint name.
func (EndPoint) SetRequest ¶
SetRequest - Save an interface reference as either api.RequestCommon or RequestData.
func (EndPoint) SetRequestByJson ¶
SetRequestByJson - Save RequestData from a JSON string.
func (EndPoint) SetResponse ¶
SetResponse - Save a JSON string to the Response structure. (Used by the web call method.)
func (*EndPoint) SetTokenInvalid ¶
func (e *EndPoint) SetTokenInvalid()
func (*EndPoint) UserAccount ¶
func (EndPoint) WriteDataFile ¶
WriteDataFile - Write to a file, the contents of ResultData as JSON. (File names will default to AREA-ENDPOINT.json )
type Request ¶
type Request struct { api.RequestCommon RequestData }
Request - Holds the api.RequestCommon and user RequestData structures. See data.go for request fields.
type RequestData ¶
type RequestData struct { UserAccount valueTypes.String `json:"user_account" required:"true"` UserPassword valueTypes.String `json:"user_password" required:"true"` }
func (RequestData) Help ¶
func (rd RequestData) Help() string
func (RequestData) IsValid ¶
func (rd RequestData) IsValid() error
type Response ¶
type Response struct { api.ResponseCommon ResultData ResultData `json:"result_data" PointIdReplace:"true"` }
Response - Holds the api.ResponseCommon and endpoint specific ResultData structures. See data.go for response fields.
type ResultData ¶
type ResultData struct { ErrTimes valueTypes.String `json:"err_times"` LoginState valueTypes.String `json:"login_state"` Msg valueTypes.String `json:"msg"` RemainTimes valueTypes.String `json:"remain_times"` AcceptOrderNum valueTypes.Integer `json:"accept_order_num"` BackgroundColor valueTypes.Integer `json:"background_color"` CountryId valueTypes.String `json:"countryid"` CreateDate valueTypes.String `json:"createdate"` CreateUserId valueTypes.String `json:"createuserid"` CurrentOrderNum valueTypes.Integer `json:"current_order_num"` DisableTime valueTypes.String `json:"disable_time"` Email valueTypes.String `json:"email"` EnglishName interface{} `json:"englishname"` GcjLatitude valueTypes.Float `json:"gcj_latitude"` GcjLongitude valueTypes.Float `json:"gcj_longitude"` ImToken interface{} `json:"im_token"` IsDST valueTypes.Bool `json:"isDST"` IsAfsFlag valueTypes.Bool `json:"is_afs_flag"` IsAgreeGdpr valueTypes.Bool `json:"is_agree_gdpr"` IsAu valueTypes.Bool `json:"is_au"` IsCanModifyUserAccount valueTypes.Bool `json:"is_can_modify_user_account"` IsDisableMap valueTypes.Bool `json:"is_disable_map"` IsGdpr valueTypes.Bool `json:"is_gdpr"` IsHaveIm valueTypes.Bool `json:"is_have_im"` IsNewVersion valueTypes.Bool `json:"is_new_version"` IsOnline valueTypes.Bool `json:"is_online"` IsOpenProtocol valueTypes.Bool `json:"is_open_protocol"` IsReceiveNotice valueTypes.Bool `json:"is_receive_notice"` IsUploadLocation valueTypes.Bool `json:"is_upload_location"` IsUseSungrowBrand valueTypes.Bool `json:"is_use_sungrow_brand"` IsValidMobileEmail valueTypes.Bool `json:"is_valid_mobile_email"` Isdst valueTypes.Bool `json:"isdst"` Jobs interface{} `json:"jobs"` Language valueTypes.String `json:"language"` LoginFirstDate valueTypes.DateTime `json:"loginFirstDate" PointNameDateFormat:"DateTimeLayout"` LoginFirstDate2 valueTypes.DateTime `json:"loginFristDate" PointNameDateFormat:"DateTimeLayout"` LoginLastDate valueTypes.DateTime `json:"loginLastDate" PointNameDateFormat:"DateTimeLayout"` LoginLastIP valueTypes.String `json:"loginLastIp"` LoginTimes valueTypes.Integer `json:"loginTimes"` Logo interface{} `json:"logo"` LogoHTTPSURL interface{} `json:"logo_https_url"` MapType valueTypes.String `json:"map_type"` MinDate valueTypes.DateTime `json:"min_date" PointNameDateFormat:"DateTimeLayout"` MobileTel interface{} `json:"mobile_tel"` OrgId valueTypes.Integer `json:"org_id"` OrgName valueTypes.String `json:"org_name"` OrgTimezone valueTypes.String `json:"org_timezone"` PasswordIsSimple valueTypes.Integer `json:"password_is_simple"` PhotoId interface{} `json:"photo_id"` PhotoURL interface{} `json:"photo_url"` Privileges []struct { FatherId valueTypes.Integer `json:"father_id"` IconURL interface{} `json:"icon_url"` IsOpen valueTypes.Bool `json:"is_open"` IsThirdPlatform valueTypes.Bool `json:"is_third_platform"` MenuCode valueTypes.String `json:"menu_code"` MenuLevel valueTypes.Integer `json:"menu_level"` MenuName valueTypes.String `json:"menu_name"` MenuOrder interface{} `json:"menu_order"` MenuType valueTypes.String `json:"menu_type"` MenuURL valueTypes.String `json:"menu_url"` PrivilegeId valueTypes.Integer `json:"privilege_id"` RoleId valueTypes.Integer `json:"role_id"` URLTarget valueTypes.String `json:"url_target"` VueIcon interface{} `json:"vue_icon"` VuePath interface{} `json:"vue_path"` } `json:"privileges" DataTable:"true"` RoleId valueTypes.String `json:"role_id"` SecondaryOrgIds []interface{} `json:"secondaryOrgIds"` ServerTel valueTypes.String `json:"server_tel"` ServiceVersion valueTypes.String `json:"service_version"` Sex valueTypes.String `json:"sex"` Stylename valueTypes.String `json:"stylename"` TimeZone valueTypes.String `json:"timeZone"` Timezone valueTypes.String `json:"timezone"` Timezoneid valueTypes.String `json:"timezoneid"` Toggleflag valueTypes.String `json:"toggleflag"` Token valueTypes.String `json:"token"` UnlockLaveMinute valueTypes.Integer `json:"unlock_lave_minute"` UploadTime interface{} `json:"upload_time"` UserAccount valueTypes.String `json:"user_account"` UserAccountModifyCount valueTypes.Integer `json:"user_account_modify_count"` UserAccountModifyRemainTimes valueTypes.Integer `json:"user_account_modify_remain_times"` UserDealerOrgCode interface{} `json:"user_dealer_org_code"` UserId valueTypes.String `json:"user_id"` UserLevel valueTypes.String `json:"user_level"` UserMasterOrgId valueTypes.Integer `json:"user_master_org_id"` UserMasterOrgName valueTypes.String `json:"user_master_org_name"` UserMasterOrgTimeZoneId valueTypes.String `json:"user_master_org_time_zone_id"` UserMasterOrgTimeZoneName valueTypes.String `json:"user_master_org_time_zone_name"` UserName valueTypes.String `json:"user_name"` UserRoleIdList []string `json:"user_role_id_list" DataTable:"true"` UserTelNationCode interface{} `json:"user_tel_nation_code"` Userdesc interface{} `json:"userdesc"` Userpassword valueTypes.String `json:"userpassword"` Validflag valueTypes.String `json:"validflag"` Voice valueTypes.String `json:"voice"` Welcometext valueTypes.String `json:"welcometext"` Wgs84Latitude valueTypes.Float `json:"wgs84_latitude"` Wgs84Longitude valueTypes.Float `json:"wgs84_longitude"` WorkTel interface{} `json:"work_tel"` }
func AssertResultData ¶
func AssertResultData(e api.EndPoint) ResultData
AssertResultData - Used to obtain locally scoped ResultData methods, (not visible from api.EndPoint).
func (*ResultData) IsValid ¶
func (e *ResultData) IsValid() error