profile

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2017 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessHistories

type AccessHistories struct {
	UserAgent string `json:"userAgent,omitempty"`
	IPAddress string `json:"ipAddress,omitempty"`
	TimeStamp string `json:"timeStamp,omitempty"`
	AuthState string `json:"authState,omitempty"`
}

AccessHistories :

Response struct containing the access history detaisl for the user.

type KnowledgeBase

type KnowledgeBase struct {
	Kbq1       *KnowledgeBaseData `json:"kbq1,omitempty"`
	Kbq2       *KnowledgeBaseData `json:"kbq2,omitempty"`
	Kbq3       *KnowledgeBaseData `json:"kbq3,omitempty"`
	Kbq4       *KnowledgeBaseData `json:"kbq4,omitempty"`
	Kbq5       *KnowledgeBaseData `json:"kbq5,omitempty"`
	Kbq6       *KnowledgeBaseData `json:"kbq6,omitempty"`
	HelpDeskKb *KnowledgeBaseData `json:"helpDeskKb,omitempty"`
}

KnowledgeBase :

Request struct to build the scaffolding for the knowledge base questions and answers.

type KnowledgeBaseData

type KnowledgeBaseData struct {
	Question string `json:"question,omitempty"`
	Answer   string `json:"answer,omitempty"`
}

KnowledgeBaseData :

Request and Response struct containing the specific knowledge base question and answer set.

type PropertiesRequest

type PropertiesRequest struct {
	FirstName string `json:"firstName,omitempty"`
	LastName  string `json:"lastName,omitempty"`
	Phone1    string `json:"phone1,omitempty"`
	Phone2    string `json:"phone2,omitempty"`
	Phone3    string `json:"phone3,omitempty"`
	Phone4    string `json:"phone4,omitempty"`
	Email1    string `json:"email1,omitempty"`
	Email2    string `json:"email2,omitempty"`
	Email3    string `json:"email3,omitempty"`
	Email4    string `json:"email4,omitempty"`
	PinHash   string `json:"pinHash,omtempty"`
	AuxID1    string `json:"auxId1,omitempty"`
	AuxID2    string `json:"auxId2,omitempty"`
	AuxID3    string `json:"auxId3,omitempty"`
	AuxID4    string `json:"auxId4,omitempty"`
	AuxID5    string `json:"auxId5,omitempty"`
	AuxID6    string `json:"auxId6,omitempty"`
	AuxID7    string `json:"auxId7,omitempty"`
	AuxID8    string `json:"auxId8,omitempty"`
	AuxID9    string `json:"auxId9,omitempty"`
	AuxID10   string `json:"auxId10,omitempty"`
}

PropertiesRequest :

Request struct to build the property key/value pairs.

type PropertiesResponse

type PropertiesResponse struct {
	Value       string `json:"value,omitempty"`
	IsWritable  string `json:"isWritable,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
}

PropertiesResponse :

Response struct containing the attributes of a property.

type Request

type Request struct {
	UserID        string             `json:"userId,omitempty"`
	Password      string             `json:"password,omitempty"`
	Props         *PropertiesRequest `json:"properties,omitempty"`
	KnowledgeBase *KnowledgeBase     `json:"knowledgeBase,omitempty"`
}

Request :

Request struct to build the required post/put parameters.

Fields:

Props: Set of key/value properties that you wish to update, none are required, but do not pass empty string
if you want to leave the value as it is.
KnowledgeBase: Struct providing scaffolding to build knowledge base questions and answers.

func (*Request) CreateUser

func (r *Request) CreateUser(c *sa.Client) (*Response, error)

CreateUser :

Creates a new user using the users endpoint via post.

Parameters:

[Required] r: should have all the fields that are required for create user (UserId and Password at a minimum).
[Required] c: passing in the client containing authorization and host information.

Returns:

Response: Struct marshaled from the Json response from the API endpoints.
Error: If an error is encountered, response will be nil and the error must be handled.

func (*Request) Get

func (r *Request) Get(c *sa.Client, userID string) (*Response, error)

Get :

Executes a get request against the users endpoint.

Parameters:

[Required] r: empty struct used to make Get easy.
[Required] c: passing in the client containing authorization and host information.
[Required] userID: the username of the user to perform the get for.

Returns:

Response: Struct marshaled from the Json response from the API endpoints.
Error: If an error is encountered, response will be nil and the error must be handled.

func (*Request) Post

func (r *Request) Post(c *sa.Client, userID string) (*Response, error)

Post :

Executes a post to the users endpoint.

Parameters:

[Required] r: should have all required fields of the struct populated before using.
[Required] c: passing in the client containing authorization and host information.
[Required] userID: the username of the user to perform the post for.

Returns:

Response: Struct marshaled from the Json response from the API endpoints.
Error: If an error is encountered, response will be nil and the error must be handled.

func (*Request) Put

func (r *Request) Put(c *sa.Client, userID string) (*Response, error)

Put :

Executes a put to the users endpoint.

Parameters:

[Required] r: should have all the required fields for the put type.
[Required] c: passing in the client containing authorization and host information.
[Required] userID: the username of the user to perform the put for.

Returns:

Response: Struct marshaled from the Json response from the API endpoints.
Error: If an error is encountered, response will be nil and the error must be handled.

type Response

type Response struct {
	UserID          string                        `json:"userId,omitempty"`
	Props           map[string]PropertiesResponse `json:"properties,omitempty"`
	KnowledgeBase   map[string]KnowledgeBaseData  `json:"knowledgeBase,omitempty"`
	Groups          []string                      `json:"groups,omitempty"`
	AccessHistories []AccessHistories             `json:"accessHistories,omitempty"`
	Status          string                        `json:"status"`
	Message         string                        `json:"message"`
	RawJSON         string                        `json:"-"`
	HTTPResponse    *http.Response                `json:"-"`
}

Response :

Response struct that will be populated after the post request.

func (*Response) IsSignatureValid added in v1.1.0

func (r *Response) IsSignatureValid(c *sa.Client) (bool, error)

IsSignatureValid :

Helper function to validate the SecureAuth Response signature in X-SA-SIGNATURE

Parameters:

[Required] r: response struct with HTTPResponse
[Required] c: passing in the client with application id and key

Returns:

bool: if true, computed signature matches X-SA-SIGNATURE. if false, computed signature does not match.
error: If an error is encountered, bool will be false and the error must be handled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL