client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorDetail

type ErrorDetail struct {
	Reason  string `json:"reason"`
	Message string `json:"message"`
}

Represents the details of an error. Should be included in the json if status is not success.

type ServiceNowClient

type ServiceNowClient struct {
	BaseUrl string
	Auth    string
}

Attributes of the client used to interact with ServiceNow API.

func NewClient

func NewClient(baseUrl string, username string, password string) *ServiceNowClient

Factory method to return a new ServiceNowClient.

func (*ServiceNowClient) CreateUiPage

func (client *ServiceNowClient) CreateUiPage(uiPage *UiPage) (*UiPage, error)

Creates a new UI Page in ServiceNow and returns the newly created page. The new page should include the GUID (sys_id) created in ServiceNow.

func (*ServiceNowClient) DeleteUiPage

func (client *ServiceNowClient) DeleteUiPage(id string) error

Deletes a UI Page in ServiceNow with the corresponding sys_id.

func (*ServiceNowClient) GetUiPage

func (client *ServiceNowClient) GetUiPage(id string) (*UiPage, error)

Retrieve a specific UI Page in ServiceNow with it's sys_id.

func (*ServiceNowClient) UpdateUiPage

func (client *ServiceNowClient) UpdateUiPage(uiPage *UiPage) error

Updates a UI Page in ServiceNow.

type UiPage

type UiPage struct {
	Id               string `json:"sys_id,omitempty"`
	Name             string `json:"name"`
	Description      string `json:"description"`
	Direct           bool   `json:"direct,string"`
	Html             string `json:"html"`
	ProcessingScript string `json:"processing_script"`
	ClientScript     string `json:"client_script"`
	Category         string `json:"category"`

	Status string       `json:"__status,omitempty"`
	Error  *ErrorDetail `json:"__error,omitempty"`
}

Represents the json response for a UI page in ServiceNow.

type UiPageResults

type UiPageResults struct {
	Results []UiPage `json:"records"`
}

Represents the object returned by ServiceNow API when saving or retrieving records.

Jump to

Keyboard shortcuts

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