servicenow

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRequest

func DoRequest(method string, endpointUrl string, header http.Header, payload io.Reader, result interface{}) error

Types

type Config

type Config struct {
	InstanceURL  string
	BasicAuth    bool
	GrantType    string
	ClientID     string
	ClientSecret string
	Username     string
	Password     string
}

type Consumer

type Consumer struct {
	Active            string `json:"active"`
	BusinessPhone     string `json:"business_phone"`
	City              string `json:"city"`
	Country           string `json:"country"`
	DateFormat        string `json:"date_format"`
	Email             string `json:"email"`
	Fax               string `json:"fax"`
	FirstName         string `json:"first_name"`
	Gender            string `json:"gender"`
	HomePhone         string `json:"home_phone"`
	Household         string `json:"household"`
	LastName          string `json:"last_name"`
	MiddleName        string `json:"middle_name"`
	MobilePhone       string `json:"mobile_phone"`
	Name              string `json:"name"`
	Notes             string `json:"notes"`
	Notification      string `json:"notification"`
	Number            string `json:"number"`
	Photo             string `json:"photo"`
	PreferredLanguage string `json:"preferred_language"`
	Prefix            string `json:"prefix"`
	Primary           string `json:"primary"`
	State             string `json:"state"`
	Street            string `json:"street"`
	Suffix            string `json:"suffix"`
	SysCreatedBy      string `json:"sys_created_by"`
	SysCreatedOn      string `json:"sys_created_on"`
	SysDomain         string `json:"sys_domain"`
	SysID             string `json:"sys_id"`
	SysModCount       string `json:"sys_mod_count"`
	SysTags           string `json:"sys_tags"`
	SysUpdatedBy      string `json:"sys_updated_by"`
	SysUpdatedOn      string `json:"sys_updated_on"`
	TimeFormat        string `json:"time_format"`
	TimeZone          string `json:"time_zone"`
	Title             string `json:"title"`
	User              string `json:"user"`
	Zip               string `json:"zip"`
}

type ConsumerGetResponse

type ConsumerGetResponse struct {
	Result Consumer `json:"result"`
}

type ConsumerListResponse

type ConsumerListResponse struct {
	Result []Consumer `json:"result"`
}

type Contact

type Contact struct {
	Account                 string `json:"account"`
	Active                  string `json:"active"`
	AgentStatus             string `json:"agent_status"`
	Building                string `json:"building"`
	CalendarIntegration     string `json:"calendar_integration"`
	City                    string `json:"city"`
	Company                 string `json:"company"`
	CostCenter              string `json:"cost_center"`
	Country                 string `json:"country"`
	DateFormat              string `json:"date_format"`
	DefaultPerspective      string `json:"default_perspective"`
	Department              string `json:"department"`
	EduStatus               string `json:"edu_status"`
	Email                   string `json:"email"`
	EmployeeNumber          string `json:"employee_number"`
	EnableMultifactorAuthn  string `json:"enable_multifactor_authn"`
	FailedAttempts          string `json:"failed_attempts"`
	FirstName               string `json:"first_name"`
	Gender                  string `json:"gender"`
	GeolocationTracked      string `json:"geolocation_tracked"`
	HomePhone               string `json:"home_phone"`
	InternalIntegrationUser string `json:"internal_integration_user"`
	Introduction            string `json:"introduction"`
	LastLogin               string `json:"last_login"`
	LastLoginDevice         string `json:"last_login_device"`
	LastLoginTime           string `json:"last_login_time"`
	LastName                string `json:"last_name"`
	LastPositionUpdate      string `json:"last_position_update"`
	Latitude                string `json:"latitude"`
	LdapServer              string `json:"ldap_server"`
	Location                string `json:"location"`
	LockedOut               string `json:"locked_out"`
	Longitude               string `json:"longitude"`
	Manager                 string `json:"manager"`
	MiddleName              string `json:"middle_name"`
	MobilePhone             string `json:"mobile_phone"`
	Name                    string `json:"name"`
	Notification            string `json:"notification"`
	OnSchedule              string `json:"on_schedule"`
	Phone                   string `json:"phone"`
	Photo                   string `json:"photo"`
	PreferredLanguage       string `json:"preferred_language"`
	Roles                   string `json:"roles"`
	Schedule                string `json:"schedule"`
	Source                  string `json:"source"`
	State                   string `json:"state"`
	Street                  string `json:"street"`
	SysClassName            string `json:"sys_class_name"`
	SysCreatedBy            string `json:"sys_created_by"`
	SysCreatedOn            string `json:"sys_created_on"`
	SysDomain               string `json:"sys_domain"`
	SysDomainPath           string `json:"sys_domain_path"`
	SysID                   string `json:"sys_id"`
	SysModCount             string `json:"sys_mod_count"`
	SysTags                 string `json:"sys_tags"`
	SysUpdatedBy            string `json:"sys_updated_by"`
	SysUpdatedOn            string `json:"sys_updated_on"`
	TimeFormat              string `json:"time_format"`
	TimeSheetPolicy         string `json:"time_sheet_policy"`
	TimeZone                string `json:"time_zone"`
	Title                   string `json:"title"`
	UserName                string `json:"user_name"`
	Vip                     string `json:"vip"`
	WebServiceAccessOnly    string `json:"web_service_access_only"`
	Zip                     string `json:"zip"`
}

type ContactGetResponse

type ContactGetResponse struct {
	Result Contact `json:"result"`
}

type ContactListResponse

type ContactListResponse struct {
	Result []Contact `json:"result"`
}

type HTTPError

type HTTPError struct {
	Code    int
	Message string
	Detail  string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type NowTable

type NowTable struct {
	*ServiceNow
}

func (*NowTable) Get

func (sn *NowTable) Get(tableName string, sysId string, excludeReferenceLink bool, result interface{}) error

Get table details.

See: https://docs.servicenow.com/bundle/tokyo-application-development/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET-id

func (*NowTable) List

func (sn *NowTable) List(tableName string, limit int, offset int, query string, excludeReferenceLink bool, result interface{}) error

List all tables.

See: https://docs.servicenow.com/bundle/tokyo-application-development/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET

type OAuthTokenResponse

type OAuthTokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
}

type ServiceNow

type ServiceNow struct {
	NowContact           *NowContact
	NowConsumer          *NowConsumer
	NowTable             *NowTable
	SnChgRestChange      *SnChgRestChange
	SnChgRestChangeModel *SnChgRestChangeModel
	SnChgRestChangeTask  *SnChgRestChangeTask
	SnChgRestChangeCi    *SnChgRestChangeCi
	// contains filtered or unexported fields
}

func New

func New(config Config) (serviceNow *ServiceNow, err error)

New creates a new ServiceNow client by authenticating using the supplied credentials.

type SnChgRestChangeCi

type SnChgRestChangeCi struct {
	*ServiceNow
}

func (*SnChgRestChangeCi) List

func (sn *SnChgRestChangeCi) List(changeSysId string, associationType string, limit int, offset int, query string, result interface{}) error

List change ci.

See: https://docs.servicenow.com/bundle/rome-application-development/page/integrate/inbound-rest/concept/change-management-api.html#title_change-GET-ci

type SnChgRestChangeModel

type SnChgRestChangeModel struct {
	*ServiceNow
}

type SnChgRestChangeTask

type SnChgRestChangeTask struct {
	*ServiceNow
}

func (*SnChgRestChangeTask) List

func (sn *SnChgRestChangeTask) List(changeSysId string, limit int, offset int, query string, result interface{}) error

List all change tasks.

See: https://docs.servicenow.com/bundle/rome-application-development/page/integrate/inbound-rest/concept/change-management-api.html#title_change-GET-task

Jump to

Keyboard shortcuts

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