servicenowsdkgo

package module
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 38 Imported by: 1

README

ServiceNow SDK for Go

GitHub go.mod Go version GoDoc GitHub release (latest by date) GitHub issues GitHub Maintainability codecov

A Service-Now API client enabling Go programs to interact with Service-Now in a simple and uniform way

servicenow-sdk-go

Supported Service-Now APIs

API Status Issues
Account ✔️
ActivitySubscriptions ✔️
Agent Client Collector ✖️
Aggregate ✔️
AI Search External User Mapping ✖️
Alarm Management Open ✖️
Application Service ✔️
Appointment ✔️
Attachment ✔️ Attachment API Issues
Advanced Work Assignment (AWA) Agent ✖️
AWA Assignment ✖️
AWA Routing ✖️
Batch ✔️
Case ✔️
CMDB Instance ✔️
Custom Chat Chatbot Interoperability Framework (CCCIF) Media Resource ✖️
CdmApplicationsApi ✔️
CdmChangesetsApi ✔️
CdmEditorApi ✖️
CdmPoliciesApi ✔️
Documents ✔️
Tables ✔️ Table API Issues

Emoji Meaning
✔️ Supported
🆕 Preview
♻️ In progress
✖️ Not supported

Documentation

For detailed information on how to get started and use this SDK, please visit the official documentation.

Contributing

We welcome contributions from the community! Whether you're fixing a bug, adding a new feature, or improving documentation, please review our Contributor Guide to get started.

Documentation

Index

Constants

View Source
const Version = "1.12.0"

Version is the current version of the SDK x-release-please-start-version

Variables

View Source
var (
	ErrNilRequestInfo = errors.New("requestInfo cannot be nil")
	ErrNilContext     = errors.New("ctx cannot be nil")
)

Functions

This section is empty.

Types

type CdmRequestBuilder added in v1.11.0

type CdmRequestBuilder struct {
	internal.RequestBuilder
}

CdmRequestBuilder provides operations to manage Service-Now CDM.

func NewCdmRequestBuilder added in v1.11.0

func NewCdmRequestBuilder(rawURL string, requestAdapter abstractions.RequestAdapter) *CdmRequestBuilder

NewCdmRequestBuilder instantiates a new CdmRequestBuilder with the provided path parameters and request adapter.

func NewCdmRequestBuilderInternal added in v1.11.0

func NewCdmRequestBuilderInternal(pathParameters map[string]string, requestAdapter abstractions.RequestAdapter) *CdmRequestBuilder

func (*CdmRequestBuilder) Applications added in v1.12.0

Applications returns a ApplicationsRequestBuilder associated with the CdmRequestBuilder.

func (*CdmRequestBuilder) Changesets added in v1.12.0

Changesets returns a ChangesetsRequestBuilder associated with the CdmRequestBuilder.

func (*CdmRequestBuilder) Editor added in v1.12.0

Editor returns a CdmEditorRequestBuilder associated with the CdmRequestBuilder.

func (*CdmRequestBuilder) Policies added in v1.11.0

Policies returns a PolicyRequestBuilder associated with the CdmRequestBuilder.

type NowRequestBuilder

type NowRequestBuilder struct {
	core.RequestBuilder
}

DEPRECATED: deprecated since v1.11.0. Please use NowRequestBuilder2

func NewNowRequestBuilder deprecated

func NewNowRequestBuilder(url string, client core.Client) *NowRequestBuilder

Deprecated: deprecated since v1.8.0. Please use NewNowRequestBuilder2.

NewNowRequestBuilder creates a new instance of the NowRequestBuilder associated with the given URL and Client. It accepts the URL and Client as parameters and returns a pointer to the created NowRequestBuilder

func NewNowRequestBuilder2 added in v1.9.1

func NewNowRequestBuilder2(url string, client core.Client2) *NowRequestBuilder

DEPRECATED: deprecated since v1.11.0. Please use NewServiceNowRequestBuilder3

NewNowRequestBuilder2

func (*NowRequestBuilder) Attachment deprecated added in v1.1.0

Deprecated: deprecated since v1.8.0. Please use Attachment2.

Attachment returns an AttachmentRequestBuilder associated with the NowRequestBuilder. It allows you to work with attachments and manage attachments in ServiceNow.

func (*NowRequestBuilder) Attachment2 added in v1.9.1

Attachment returns an AttachmentRequestBuilder associated with the NowRequestBuilder. It allows you to work with attachments and manage attachments in ServiceNow.

func (*NowRequestBuilder) Batch added in v1.7.0

Batch returns a BatchRequestBuilder, entrypoint into the batch api.

func (*NowRequestBuilder) Table deprecated

func (rB *NowRequestBuilder) Table(tableName string) *tableapi.TableRequestBuilder

Deprecated: deprecated since v1.8.0. Please use Table2.

Table returns a TableRequestBuilder associated with the NowRequestBuilder. It accepts a table name as a parameter and constructs the URL for table-related requests. The returned TableRequestBuilder can be used to build and execute table-related requests.

func (*NowRequestBuilder) Table2 deprecated added in v1.9.1

func (rB *NowRequestBuilder) Table2(tableName string) *tableapi.TableRequestBuilder

Deprecated: deprecated since v1.9.0. Please use NowRequestBuilder.TableV2

func (*NowRequestBuilder) TableV2 added in v1.9.1

TableV2 returns a TableRequestBuilder2 associated with the NowRequestBuilder.

type NowRequestBuilder2 added in v1.11.0

type NowRequestBuilder2 struct {
	internal.RequestBuilder
}

func NewServiceNowRequestBuilder3 added in v1.11.0

func NewServiceNowRequestBuilder3(
	rawURL string,
	requestAdapter abstractions.RequestAdapter,
) *NowRequestBuilder2

func NewServiceNowRequestBuilder3Internal added in v1.11.0

func NewServiceNowRequestBuilder3Internal(pathParameters map[string]string, requestAdapter abstractions.RequestAdapter) *NowRequestBuilder2

func (*NowRequestBuilder2) Account added in v1.12.0

Account returns an AccountRequestBuilder associated with the NowRequestBuilder.

func (*NowRequestBuilder2) ActSub added in v1.12.0

ActSub returns an ActSubRequestBuilder associated with the NowRequestBuilder.

func (*NowRequestBuilder2) Attachment added in v1.11.0

func (*NowRequestBuilder2) Batch added in v1.11.0

func (*NowRequestBuilder2) Cmdb added in v1.12.0

Cmdb returns a CmdbRequestBuilder associated with the NowRequestBuilder.

func (*NowRequestBuilder2) Documents added in v1.12.0

Documents returns a DocumentsRequestBuilder associated with the NowRequestBuilder.

func (*NowRequestBuilder2) Table added in v1.11.0

type ServiceNowClient

type ServiceNowClient struct {
	// Deprecated: deprecated since v1.6.0.
	Credential core.Credential

	BaseUrl        string
	Session        webClient
	RequestAdapter abstractions.RequestAdapter
	// contains filtered or unexported fields
}

DEPRECATED: deprecated since v1.11.0. Please use ServiceNowServiceClient

func NewServiceNowClient deprecated

func NewServiceNowClient(credential core.Credential, instance string) *ServiceNowClient

Deprecated: deprecated since v1.6.0. Please use `NewServiceNowClient2` instead.

NewServiceNowClient creates a new instance of the ServiceNow client. It accepts a UsernamePasswordCredential and an instance URL. If the instance URL does not end with ".service-now.com/api", it appends the suffix. It returns a pointer to the Client.

func NewServiceNowClient2 added in v1.6.0

func NewServiceNowClient2(credential core.Credential, instance string) (*ServiceNowClient, error)

DEPRECATED: deprecated since v1.11.0. Please use NewServiceNowServiceClient

NewServiceNowClient2 creates a new instance of the ServiceNow client. It accepts a UsernamePasswordCredential and an instance URL. If the instance URL does not end with ".service-now.com/api", it appends the suffix. It returns a pointer to the Client.

func NewServiceNowClient2WithHTTPClient added in v1.9.1

func NewServiceNowClient2WithHTTPClient(credential core.Credential, instance string, httpClient *http.Client) (*ServiceNowClient, error)

func (*ServiceNowClient) Cdm added in v1.11.0

Cdm returns a CdmRequestBuilder associated with the Client. It prepares the CdmRequestBuilder with the base URL for the ServiceNow instance.

func (*ServiceNowClient) Now deprecated

Deprecated: deprecated since v1.8.0. Please use Now2.

Now returns a NowRequestBuilder associated with the Client. It prepares the NowRequestBuilder with the base URL for the ServiceNow instance.

func (*ServiceNowClient) Now2 added in v1.9.1

Now2 returns a NowRequestBuilder associated with the Client. It prepares the NowRequestBuilder with the base URL for the ServiceNow instance.

func (*ServiceNowClient) Send

func (c *ServiceNowClient) Send(requestInfo core.IRequestInformation, errorMapping core.ErrorMapping) (*http.Response, error)

func (*ServiceNowClient) SendWithContext

func (c *ServiceNowClient) SendWithContext(ctx context.Context, requestInfo core.IRequestInformation, errorMapping core.ErrorMapping) (*http.Response, error)

type ServiceNowServiceClient added in v1.11.0

type ServiceNowServiceClient struct {
	newInternal.RequestBuilder
}

ServiceNowServiceClient is the core service used by ServiceNowServiceClient to make requests to Service-Now's APIs

func NewServiceNowServiceClient added in v1.11.0

func NewServiceNowServiceClient(opts ...ServiceNowServiceClientOption) (*ServiceNowServiceClient, error)

NewServiceNowServiceClient creates a new ServiceNowServiceClient using the provided options.

func (*ServiceNowServiceClient) AppointmentBooking added in v1.12.0

func (*ServiceNowServiceClient) Cdm added in v1.11.0

func (*ServiceNowServiceClient) CustomerService added in v1.12.0

func (*ServiceNowServiceClient) Now added in v1.11.0

type ServiceNowServiceClientConfig added in v1.11.0

type ServiceNowServiceClientConfig struct {
	// contains filtered or unexported fields
}

ServiceNowServiceClientConfig represents possible configurations for the Service-Now service client.

func (*ServiceNowServiceClientConfig) Validate added in v1.11.0

func (c *ServiceNowServiceClientConfig) Validate() error

Validate checks if the configuration is valid.

type ServiceNowServiceClientOption added in v1.11.0

type ServiceNowServiceClientOption func(*ServiceNowServiceClientConfig) error

ServiceNowServiceClientOption is a function type that modifies the ServiceNowServiceClientConfig. It returns an error if the modification is not successful.

func WithAuthenticationProvider added in v1.11.0

func WithAuthenticationProvider(authenticationProvider authentication.AuthenticationProvider) ServiceNowServiceClientOption

WithAuthenticationProvider sets the authentication provider for the ServiceNowServiceClient.

func WithBackingStoreFactory added in v1.11.0

func WithBackingStoreFactory(backingStoreFactory store.BackingStoreFactory) ServiceNowServiceClientOption

WithBackingStoreFactory creates an option to set the backingStoreFactory for the ServiceNowServiceClient. It returns an error if the provided factory is nil.

func WithHTTPClient added in v1.11.0

func WithHTTPClient(client *http.Client) ServiceNowServiceClientOption

WithHTTPClient creates an option to set the HTTP client used by the requests.

func WithInstance added in v1.11.0

func WithInstance(instance string) ServiceNowServiceClientOption

WithInstance creates an option to set the instance of the default ServiceNow URL for the requests. It returns an error if the provided configuration is nil or the instance string is empty.

func WithMiddleware added in v1.11.0

func WithMiddleware(middleware ...nethttplibrary.Middleware) ServiceNowServiceClientOption

WithMiddleware creates an option to set the middleware used by the requests. It returns an error if the provided configuration is nil or the middleware slice is empty.

func WithRequestAdapter added in v1.11.0

func WithRequestAdapter(requestAdapter abstractions.RequestAdapter) ServiceNowServiceClientOption

WithRequestAdapter sets a pre-configured RequestAdapter for the ServiceNowServiceClient.

func WithURL added in v1.11.0

WithURL creates an option to set the base URL for the requests. It returns an error if the provided configuration is nil or the URL is empty.

Directories

Path Synopsis
docs
new
oauth2
Package oauth2 provides a spec-compliant OAuth2 client for various grant types.
Package oauth2 provides a spec-compliant OAuth2 client for various grant types.

Jump to

Keyboard shortcuts

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