Documentation
¶
Index ¶
- Constants
- type Application
- type ApplicationCategory
- type ApplicationMenu
- type ApplicationModule
- type BaseResult
- type BaseResultList
- type CSSInclude
- type CSSIncludeRelation
- type Client
- func (client *Client) CreateObject(endpoint string, objectToCreate Record) error
- func (client *Client) DeleteObject(endpoint string, id string) error
- func (client *Client) GetObject(endpoint string, id string, responseObjectOut Record) error
- func (client *Client) GetObjectByName(endpoint string, name string, responseObjectOut Record) error
- func (client *Client) UpdateObject(endpoint string, object Record) error
- type ContentCSS
- type DBTable
- type ErrorDetail
- type ExtensionPoint
- type JsInclude
- type JsIncludeRelation
- type OAuthEntity
- type Record
- type RestMessage
- type RestMessageHeader
- type RestMethod
- type RestMethodHeader
- type Role
- type ScriptInclude
- type ServiceNowClient
- type SystemProperty
- type SystemPropertyCategory
- type SystemPropertyRelation
- type UIMacro
- type UIPage
- type UIScript
- type Widget
- type WidgetDependency
- type WidgetDependencyRelation
Constants ¶
const EndpointApplication = "sys_app.do"
EndpointApplication is the endpoint to manage application records.
const EndpointApplicationCategory = "sys_app_category.do"
EndpointApplicationCategory is the endpoint to manage application category records.
const EndpointApplicationMenu = "sys_app_application.do"
EndpointApplicationMenu is the endpoint to manage application menu records.
const EndpointApplicationModule = "sys_app_module.do"
EndpointApplicationModule is the endpoint to manage application modules records.
const EndpointCSSInclude = "sp_css_include.do"
EndpointCSSInclude is the endpoint to manage CSS includes records.
const EndpointCSSIncludeRelation = "m2m_sp_dependency_css_include.do"
EndpointCSSIncludeRelation is the endpoint to manage CSS include relation records.
const EndpointContentCSS = "content_css.do"
EndpointContentCSS is the endpoint to manage content css records.
const EndpointDBTable = "sys_db_object.do"
EndpointDBTable is the endpoint to manage DB Table records.
const EndpointExtensionPoint = "sys_extension_point.do"
EndpointExtensionPoint is the endpoint to manage Extension Point records.
const EndpointJsInclude = "sp_js_include.do"
EndpointJsInclude is the endpoint to manage JS Include records.
const EndpointJsIncludeRelation = "m2m_sp_dependency_js_include.do"
EndpointJsIncludeRelation is the endpoint to manage JS Include Relation records.
const EndpointOAuthEntity = "oauth_entity.do"
EndpointOAuthEntity is the endpoint to manage oauth entity records.
const EndpointRestMessage = "sys_rest_message.do"
EndpointRestMessage is the endpoint to manage REST message records.
const EndpointRestMessageHeader = "sys_rest_message_headers.do"
EndpointRestMessageHeader is the endpoint to manage REST message header records.
const EndpointRestMethod = "sys_rest_message_fn.do"
EndpointRestMethod is the endpoint to manage REST message method records.
const EndpointRestMethodHeader = "sys_rest_message_fn_headers.do"
EndpointRestMethodHeader is the endpoint to manage REST Message method header records.
const EndpointRole = "sys_user_role.do"
EndpointRole is the endpoint to manage role records.
const EndpointScriptInclude = "sys_script_include.do"
EndpointScriptInclude is the endpoint to manage script include records.
const EndpointSystemProperty = "sys_properties.do"
EndpointSystemProperty is the endpoint to manage system property records.
const EndpointSystemPropertyCategory = "sys_properties_category.do"
EndpointSystemPropertyCategory is the endpoint to manage system property categories records.
const EndpointSystemPropertyRelation = "sys_properties_category_m2m.do"
EndpointSystemPropertyRelation is the endpoint to manage system property category relation records.
const EndpointUIMacro = "sys_ui_macro.do"
EndpointUIMacro is the endpoint to manage UI Macro records.
const EndpointUIPage = "sys_ui_page.do"
EndpointUIPage is the endpoint to manage UI Pages records.
const EndpointUIScript = "sys_ui_script.do"
EndpointUIScript is the endpoint to manage UI Script records.
const EndpointWidget = "sp_widget.do"
EndpointWidget is the endpoint to manage widget records.
const EndpointWidgetDependency = "sp_dependency.do"
EndpointWidgetDependency is the endpoint to manage widget dependency records.
const EndpointWidgetDependencyRelation = "m2m_sp_widget_dependency.do"
EndpointWidgetDependencyRelation is the endpoint to manage widget dependency relation records.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶ added in v0.4.0
type Application struct {
BaseResult
Name string `json:"name"`
Scope string `json:"scope"`
Version string `json:"version"`
}
Application is the json response for an application in ServiceNow.
type ApplicationCategory ¶ added in v0.6.0
type ApplicationCategory struct {
BaseResult
Name string `json:"name"`
Order string `json:"default_order"`
Style string `json:"style"`
}
ApplicationCategory represents the json response for a Application Category in ServiceNow.
type ApplicationMenu ¶ added in v0.3.0
type ApplicationMenu struct {
BaseResult
Title string `json:"title"`
Description string `json:"description"`
Hint string `json:"hint"`
DeviceType string `json:"device_type"`
Order int `json:"order,string"`
Roles string `json:"roles"`
CategoryID string `json:"category"`
Active bool `json:"active,string"`
}
ApplicationMenu is the json response for an application menu in ServiceNow.
type ApplicationModule ¶ added in v0.3.0
type ApplicationModule struct {
BaseResult
Title string `json:"title"`
MenuID string `json:"application"`
Hint string `json:"hint"`
Order int `json:"order,string"`
Roles string `json:"roles"`
Active bool `json:"active,string"`
OverrideMenuRoles bool `json:"override_menu_roles,string"`
LinkType string `json:"link_type"`
Arguments string `json:"query"`
WindowName string `json:"window_name"`
TableName string `json:"name"`
}
ApplicationModule is the json response for an application menu in ServiceNow.
type BaseResult ¶ added in v0.2.0
type BaseResult struct {
ID string `json:"sys_id,omitempty"`
ProtectionPolicy string `json:"sys_policy,omitempty"`
Scope string `json:"sys_scope,omitempty"`
Status string `json:"__status,omitempty"`
Error *ErrorDetail `json:"__error,omitempty"`
}
BaseResult is representing the default properties of all results.
func (BaseResult) GetError ¶ added in v0.6.0
func (record BaseResult) GetError() *ErrorDetail
GetError returns the Error of a BaseRecord, if any.
func (BaseResult) GetID ¶ added in v0.6.0
func (record BaseResult) GetID() string
GetID returns the ID of a BaseRecord.
func (BaseResult) GetScope ¶ added in v0.6.0
func (record BaseResult) GetScope() string
GetScope returns the Scope of a BaseRecord.
func (BaseResult) GetStatus ¶ added in v0.6.0
func (record BaseResult) GetStatus() string
GetStatus returns the Status of a BaseRecord.
type BaseResultList ¶ added in v0.6.0
type BaseResultList struct {
Records []json.RawMessage
}
BaseResultList represents the response from the API. Records are always returned inside an array.
type CSSInclude ¶ added in v0.6.0
type CSSInclude struct {
BaseResult
Source string `json:"source"`
Name string `json:"name"`
URL string `json:"url"`
StyleSheetID string `json:"sp_css"`
}
CSSInclude represents the json response for a CSS Include in ServiceNow.
type CSSIncludeRelation ¶ added in v0.6.0
type CSSIncludeRelation struct {
BaseResult
CSSIncludeID string `json:"sp_css_include"`
DependencyID string `json:"sp_dependency"`
Order int `json:"order,string"`
}
CSSIncludeRelation represents the json response for a CssIncludeRelation in ServiceNow.
type Client ¶ added in v0.8.0
Client is the client used to interact with ServiceNow API.
func (*Client) CreateObject ¶ added in v0.8.0
CreateObject creates a new object in ServiceNow, validates the response and fills the object with properties received from the service.
func (*Client) DeleteObject ¶ added in v0.8.0
DeleteObject deletes an object using a specific endpoing and sys_id.
func (*Client) GetObject ¶ added in v0.8.0
GetObject retrieves an object via a specific endpoint with a GET method and a specified sys_id. The response is parsed and fills the object in parameters. responseObjectOut parameter must be a pointer.
func (*Client) GetObjectByName ¶ added in v0.8.0
GetObjectByName retrieves an object via its name attribute.
type ContentCSS ¶ added in v0.6.0
type ContentCSS struct {
BaseResult
Name string `json:"name"`
Type string `json:"type"`
URL string `json:"url"`
Style string `json:"style"`
}
ContentCSS represents the json response for a Content Management Style Sheet in ServiceNow.
type DBTable ¶ added in v0.5.1
type DBTable struct {
BaseResult
Label string `json:"label"`
UserRole string `json:"user_role"`
Access string `json:"access"`
ReadAccess bool `json:"read_access,string"`
CreateAccess bool `json:"create_access,string"`
AlterAccess bool `json:"alter_access,string"`
DeleteAccess bool `json:"delete_access,string"`
WebServiceAccess bool `json:"ws_access,string"`
ConfigurationAccess bool `json:"configuration_access,string"`
Extendable bool `json:"is_extendable,string"`
LiveFeed bool `json:"live_feed_enabled,string"`
CreateAccessControls bool `json:"create_access_controls,string"`
CreateModule bool `json:"create_module,string"`
CreateMobileModule bool `json:"create_mobile_module,string"`
Name string `json:"name,omitempty"`
}
DBTable is the json response for a Table in ServiceNow.
type ErrorDetail ¶
ErrorDetail is the details of an error. Should be included in the json if status is not success.
type ExtensionPoint ¶ added in v0.8.0
type ExtensionPoint struct {
BaseResult
Name string `json:"name"`
RestrictScope bool `json:"restrict_scope,string"`
Description string `json:"description"`
Example string `json:"example"`
APIName string `json:"api_name,omitempty"`
}
ExtensionPoint represents the json response for a Extension Point in ServiceNow.
type JsInclude ¶ added in v0.2.0
type JsInclude struct {
BaseResult
Source string `json:"source"`
DisplayName string `json:"display_name"`
URL string `json:"url"`
UIScriptID string `json:"sys_ui_script"`
}
JsInclude represents the json response for a Js Include in ServiceNow.
type JsIncludeRelation ¶ added in v0.2.0
type JsIncludeRelation struct {
BaseResult
JsIncludeID string `json:"sp_js_include"`
DependencyID string `json:"sp_dependency"`
Order int `json:"order,string"`
}
JsIncludeRelation represents the json response for a JsIncludeRelation in ServiceNow.
type OAuthEntity ¶ added in v0.6.0
type OAuthEntity struct {
BaseResult
Name string `json:"name"`
ClientUUID string `json:"client_uuid,omitempty"`
ClientID string `json:"client_id,omitempty"`
AccessTokenLifespan int `json:"access_token_lifespan,string"`
RefreshTokenLifespan int `json:"refresh_token_lifespan,string"`
RedirectURL string `json:"redirect_url"`
LogoURL string `json:"logo_url"`
Access string `json:"access"`
}
OAuthEntity is the json response for a OAuthEntity in ServiceNow.
type Record ¶ added in v0.6.0
type Record interface {
GetID() string
GetScope() string
GetStatus() string
GetError() *ErrorDetail
}
Record is the interface for any BaseResult.
type RestMessage ¶ added in v0.6.0
type RestMessage struct {
BaseResult
Name string `json:"name"`
Description string `json:"description"`
RestEndpoint string `json:"rest_endpoint"`
Access string `json:"access"`
AuthenticationType string `json:"authentication_type"`
}
RestMessage represents the json response for a REST Message in ServiceNow.
type RestMessageHeader ¶ added in v0.6.0
type RestMessageHeader struct {
BaseResult
Name string `json:"name"`
Value string `json:"value"`
MessageID string `json:"rest_message"`
}
RestMessageHeader represents the json response for a HTTP header in ServiceNow.
type RestMethod ¶ added in v0.6.0
type RestMethod struct {
BaseResult
Name string `json:"function_name"`
MessageID string `json:"rest_message"`
HTTPMethod string `json:"http_method"`
RestEndpoint string `json:"rest_endpoint"`
AuthenticationType string `json:"authentication_type"`
QualifiedName string `json:"qualified_name,omitempty"`
}
RestMethod represents the json response for a HTTP method in ServiceNow.
type RestMethodHeader ¶ added in v0.6.0
type RestMethodHeader struct {
BaseResult
Name string `json:"name"`
Value string `json:"value"`
MethodID string `json:"rest_message_function"`
}
RestMethodHeader represents the json response for a HTTP header in ServiceNow.
type Role ¶ added in v0.3.0
type Role struct {
BaseResult
Name string `json:"name,omitempty"`
Description string `json:"description"`
ElevatedPrivilege bool `json:"elevated_privilege,string"`
Suffix string `json:"suffix"`
AssignableBy string `json:"assignable_by"`
}
Role is the json response for a role in ServiceNow.
type ScriptInclude ¶ added in v0.4.0
type ScriptInclude struct {
BaseResult
Name string `json:"name"`
ClientCallable bool `json:"client_callable,string"`
Description string `json:"description"`
Script string `json:"script"`
Active bool `json:"active,string"`
Access string `json:"access"`
APIName string `json:"api_name,omitempty"`
}
ScriptInclude is the json response for a Script Include in ServiceNow.
type ServiceNowClient ¶
type ServiceNowClient interface {
GetObject(string, string, Record) error
GetObjectByName(string, string, Record) error
CreateObject(string, Record) error
UpdateObject(string, Record) error
DeleteObject(string, string) error
}
ServiceNowClient defines possible methods to call on the ServiceNowClient.
type SystemProperty ¶ added in v0.6.0
type SystemProperty struct {
BaseResult
Suffix string `json:"suffix"`
Type string `json:"type"`
Choices string `json:"choices"`
IsPrivate bool `json:"is_private,string"`
IgnoreCache bool `json:"ignore_cache,string"`
Description string `json:"description"`
WriteRoles string `json:"write_roles"`
ReadRoles string `json:"read_roles"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
}
SystemProperty is the json response for a system property in ServiceNow.
type SystemPropertyCategory ¶ added in v0.6.0
type SystemPropertyCategory struct {
BaseResult
Name string `json:"name"`
TitleHTML string `json:"title"`
}
SystemPropertyCategory is the json response for a system property in ServiceNow.
type SystemPropertyRelation ¶ added in v0.6.0
type SystemPropertyRelation struct {
BaseResult
CategoryID string `json:"category"`
PropertyID string `json:"property"`
Order string `json:"order,omitempty"`
}
SystemPropertyRelation is the json response for a system property relation in ServiceNow.
type UIMacro ¶ added in v0.6.0
type UIMacro struct {
BaseResult
Name string `json:"name"`
Description string `json:"description"`
APIName string `json:"scoped_name"`
XML string `json:"xml"`
Active bool `json:"active,string"`
}
UIMacro is the json response for a UI Macro in ServiceNow.
type UIPage ¶ added in v0.6.0
type UIPage struct {
BaseResult
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"`
Endpoint string `json:"endpoint,omitempty"`
}
UIPage is the json response for a UI page in ServiceNow.
type UIScript ¶ added in v0.7.0
type UIScript struct {
BaseResult
Name string `json:"script_name"`
APIName string `json:"name,omitempty"`
Description string `json:"description"`
Script string `json:"script"`
Active bool `json:"active,string"`
UIType string `json:"ui_type"` // All: 10, Mobile: 1, Desktop 0
}
UIScript is the json response for a UI Script in ServiceNow.
type Widget ¶ added in v0.2.0
type Widget struct {
BaseResult
CustomID string `json:"id"`
Name string `json:"name"`
Template string `json:"template"`
CSS string `json:"css"`
Public bool `json:"public,string"`
Roles string `json:"roles"`
Link string `json:"link"`
Description string `json:"description"`
ClientScript string `json:"client_script"`
ServerScript string `json:"script"`
DemoData string `json:"demo_data"`
OptionSchema string `json:"option_schema"`
HasPreview bool `json:"has_preview,string"`
DataTable string `json:"data_table"`
ControllerAs string `json:"controller_as"`
}
Widget is the json response for a Widget in ServiceNow.
type WidgetDependency ¶ added in v0.2.0
type WidgetDependency struct {
BaseResult
Name string `json:"name"`
Module string `json:"module"`
PageLoad bool `json:"page_load,string"`
}
WidgetDependency represents the json response for a Widget Dependency in ServiceNow.
type WidgetDependencyRelation ¶ added in v0.2.0
type WidgetDependencyRelation struct {
BaseResult
DependencyID string `json:"sp_dependency"`
WidgetID string `json:"sp_widget"`
}
WidgetDependencyRelation represents the json response for a widget dependency relation in ServiceNow.
Source Files
¶
- client_application.go
- client_application_category.go
- client_application_menu.go
- client_application_module.go
- client_base.go
- client_content_css.go
- client_css_include.go
- client_css_include_relation.go
- client_db_table.go
- client_extension_point.go
- client_js_include.go
- client_js_include_relation.go
- client_oauth_entity.go
- client_rest_message.go
- client_rest_message_header.go
- client_rest_method.go
- client_rest_method_header.go
- client_role.go
- client_script_include.go
- client_system_property.go
- client_system_property_category.go
- client_system_property_relation.go
- client_ui_macro.go
- client_ui_page.go
- client_ui_script.go
- client_widget.go
- client_widget_dependency.go
- client_widget_dependency_relation.go