Documentation ¶
Index ¶
- Variables
- type DisplayValue
- type Fragmentdeprecated
- type LogicalOperatordeprecated
- type OrderBydeprecated
- func NewOrderBy() *OrderBydeprecated
- type OrderDirectiondeprecated
- type PageIterator
- type PageResult
- type Querydeprecated
- func NewQuery() *Querydeprecated
- type RelationalOperatordeprecated
- type TableCollectionResponse
- type TableEntry
- type TableGetRequestConfiguration
- type TableItemDeleteRequestConfiguration
- type TableItemGetRequestConfiguration
- type TableItemPutRequestConfiguration
- type TableItemRequestBuilder
- func (rB *TableItemRequestBuilder) Delete(params *TableItemRequestBuilderDeleteQueryParameters) error
- func (rB *TableItemRequestBuilder) Get(params *TableItemRequestBuilderGetQueryParameters) (*TableItemResponse, error)
- func (rB *TableItemRequestBuilder) Put(tableEntry map[string]string, ...) (*TableItemResponse, error)
- type TableItemRequestBuilderDeleteQueryParameters
- type TableItemRequestBuilderGetQueryParameters
- type TableItemRequestBuilderPutQueryParameters
- type TableItemResponse
- type TablePostRequestConfiguration
- type TableRequestBuilder
- func (T *TableRequestBuilder) ById(sysId string) *TableItemRequestBuilder
- func (T *TableRequestBuilder) Count() (int, error)
- func (rB *TableRequestBuilder) Get(params *TableRequestBuilderGetQueryParameters) (*TableCollectionResponse, error)
- func (rB *TableRequestBuilder) Post(data map[string]string, params *TableRequestBuilderPostQueryParamters) (*TableItemResponse, error)deprecated
- func (rB *TableRequestBuilder) Post2(data map[string]string, params *TableRequestBuilderPostQueryParameters) (*TableItemResponse, error)
- type TableRequestBuilderGetQueryParameters
- type TableRequestBuilderPostQueryParameters
- type TableRequestBuilderPostQueryParamtersdeprecated
- type TableResponse
- type TableValue
- func (tV *TableValue) Bool() (bool, error)
- func (tV *TableValue) Float() (float64, error)
- func (tV *TableValue) GetType() reflect.Typedeprecated
- func (tv *TableValue) Int() (int64, error)
- func (tV *TableValue) String() (string, error)
- func (tV *TableValue) ToBool() (bool, error)deprecated
- func (tV *TableValue) ToFloat64() (float64, error)deprecated
- func (tV *TableValue) ToInt64() (int64, error)deprecated
- func (tV *TableValue) ToString() (string, error)deprecated
- func (tV *TableValue) Type() reflect.Type
- type View
Constants ¶
This section is empty.
Variables ¶
var ( ErrNilClient = errors.New("client can't be nil") ErrNilResponse = errors.New("response can't be nil") ErrNilResult = errors.New("result property missing in response object") ErrWrongResponseType = errors.New("incorrect Response Type") ErrParsing = errors.New("parsing nextLink url failed") )
Functions ¶
This section is empty.
Types ¶
type DisplayValue ¶
type DisplayValue string
const ( TRUE DisplayValue = "true" FALSE DisplayValue = "false" ALL DisplayValue = "all" )
type Fragment
deprecated
added in
v1.1.0
Fragment represents a query fragment with a field, operator, and value.
Deprecated: deprecated since {version}. Please use core.Fragment instead.
func NewFragment
deprecated
added in
v1.1.0
func NewFragment(field string, operator RelationalOperator, value interface{}) *Fragment
NewFragment creates a new query fragment with the specified field, operator, and value.
Deprecated: deprecated since {version}. Please use core.NewFragment instead.
type LogicalOperator
deprecated
added in
v1.1.0
type LogicalOperator = core.LogicalOperator
LogicalOperator ...
Deprecated: deprecated since {version}. Please use core.LogicalOperator instead.
const ( // And ... // // Deprecated: deprecated since {version}. Please use core.And instead. And LogicalOperator = core.And // Or ... // // Deprecated: deprecated since {version}. Please use core.Or instead. Or LogicalOperator = core.Or )
type OrderBy
deprecated
added in
v1.1.0
OrderBy represents an order-by clause.
Deprecated: deprecated since {version}. Please use core.OrderBy instead.
func NewOrderBy
deprecated
added in
v1.1.0
func NewOrderBy() *OrderBy
NewOrderBy Creates new order by.
Deprecated: deprecated since {version}. Please use core.NewOrderBy instead.
type OrderDirection
deprecated
added in
v1.1.0
type OrderDirection = core.OrderDirection
OrderDirection represents the order direction for sorting.
Deprecated: deprecated since {version}. Please use core.OrderDirection instead.
const ( // Unset ... // // Deprecated: deprecated since {version}. Please use core.Unset instead. Unset OrderDirection = core.Unset // Asc ... // // Deprecated: deprecated since {version}. Please use core.Asc instead. Asc OrderDirection = core.Asc // Desc ... // // Deprecated: deprecated since {version}. Please use core.Desc instead. Desc OrderDirection = core.Desc )
type PageIterator ¶
type PageIterator struct {
// contains filtered or unexported fields
}
PageIterator represents an iterator for paginated results from a table.
func NewPageIterator ¶
func NewPageIterator(currentPage interface{}, client core.Client) (*PageIterator, error)
NewPageIterator creates a new PageIterator instance.
func (*PageIterator) Iterate ¶
func (p *PageIterator) Iterate(callback func(pageItem *TableEntry) bool) error
Iterate iterates through pages and invokes the provided callback for each page item.
type PageResult ¶
type PageResult struct { Result []*TableEntry NextPageLink string PreviousPageLink string FirstPageLink string LastPageLink string }
PageResult represents a single page of results from a table.
type Query
deprecated
added in
v1.1.0
Query represents a ServiceNow query and its conditions.
Deprecated: deprecated since {version}. Please use core.Query instead.
type RelationalOperator
deprecated
added in
v1.1.0
type RelationalOperator = core.RelationalOperator
Deprecated: deprecated since {version}. Please use core.RelationalOperator instead.
RelationalOperator ...
const ( // Deprecated: deprecated since {version}. Please use core.Null instead. // // Null ... Null RelationalOperator = core.Null // Deprecated: deprecated since {version}. Please use core.Is instead. // // Is ... Is RelationalOperator = core.Is // Deprecated: deprecated since {version}. Please use core.IsNot instead. // // IsNot ... IsNot RelationalOperator = core.IsNot // Deprecated: deprecated since {version}. Please use core.GreaterThan instead. // // GreaterThan ... GreaterThan RelationalOperator = core.GreaterThan // Deprecated: deprecated since {version}. Please use core.GreaterOrEqual instead. // // GreaterOrEqual ... GreaterOrEqual RelationalOperator = core.GreaterOrEqual // Deprecated: deprecated since {version}. Please use core.LessThan instead. // // LessThan ... LessThan RelationalOperator = core.LessOrEqual // Deprecated: deprecated since {version}. Please use core.LessOrEqual instead. // // LessOrEqual ... LessOrEqual RelationalOperator = core.LessOrEqual // Deprecated: deprecated since {version}. Please use core.Contains instead. // // Contains ... Contains RelationalOperator = core.Contains // Deprecated: deprecated since {version}. Please use core.NotContains instead. // // NotContains ... NotContains RelationalOperator = core.NotContains // Deprecated: deprecated since {version}. Please use core.StartsWith instead. // // StartsWith ... StartsWith RelationalOperator = core.StartsWith // Deprecated: deprecated since {version}. Please use core.EndsWith instead. // // EndsWith ... EndsWith RelationalOperator = core.EndsWith // Deprecated: deprecated since {version}. Please use core.Between instead. // // Between ... Between RelationalOperator = core.Between // Deprecated: deprecated since {version}. Please use core.IsSame instead. // // IsSame ... IsSame RelationalOperator = core.IsSame // Deprecated: deprecated since {version}. Please use core.IsDifferent instead. // // IsDifferent ... IsDifferent RelationalOperator = core.IsDifferent // Deprecated: deprecated since {version}. Please use core.IsEmpty instead. // // IsEmpty ... IsEmpty RelationalOperator = core.IsEmpty )
type TableCollectionResponse ¶
type TableCollectionResponse struct { Result []*TableEntry NextPageLink string PreviousPageLink string FirstPageLink string LastPageLink string }
func (*TableCollectionResponse) ParseHeaders ¶ added in v1.1.0
func (cR *TableCollectionResponse) ParseHeaders(headers http.Header)
type TableEntry ¶
type TableEntry map[string]interface{}
TableEntry represents a single Service-Now Table Entry.
func (TableEntry) Keys ¶ added in v1.2.1
func (tE TableEntry) Keys() []string
Keys returns a slice of the TableEntry's keys
func (TableEntry) Value ¶
func (tE TableEntry) Value(key string) *TableValue
Value returns a TableValue if a valid key is provided.
type TableGetRequestConfiguration ¶ added in v1.2.2
type TableGetRequestConfiguration struct { Header interface{} QueryParameters *TableRequestBuilderGetQueryParameters Data interface{} ErrorMapping core.ErrorMapping // contains filtered or unexported fields }
type TableItemDeleteRequestConfiguration ¶ added in v1.2.2
type TableItemDeleteRequestConfiguration struct { Header interface{} QueryParameters *TableItemRequestBuilderDeleteQueryParameters Data interface{} ErrorMapping core.ErrorMapping // contains filtered or unexported fields }
type TableItemGetRequestConfiguration ¶ added in v1.2.2
type TableItemGetRequestConfiguration struct { Header interface{} QueryParameters *TableItemRequestBuilderGetQueryParameters Data interface{} ErrorMapping core.ErrorMapping // contains filtered or unexported fields }
type TableItemPutRequestConfiguration ¶ added in v1.2.2
type TableItemPutRequestConfiguration struct { Header interface{} QueryParameters *TableItemRequestBuilderPutQueryParameters Data interface{} ErrorMapping core.ErrorMapping // contains filtered or unexported fields }
type TableItemRequestBuilder ¶
type TableItemRequestBuilder struct {
core.RequestBuilder
}
func NewTableItemRequestBuilder ¶
func NewTableItemRequestBuilder(client core.Client, pathParameters map[string]string) *TableItemRequestBuilder
NewTableItemRequestBuilder creates a new instance of the TableItemRequestBuilder associated with the given URL and Client. It accepts the URL and Client as parameters and returns a pointer to the created TableItemRequestBuilder.
func (*TableItemRequestBuilder) Delete ¶
func (rB *TableItemRequestBuilder) Delete(params *TableItemRequestBuilderDeleteQueryParameters) error
Delete sends an HTTP DELETE request using the specified query parameters and returns an error if the request or response encounters any issues.
Parameters:
- params: An instance of TableItemRequestBuilderDeleteQueryParameters to include in the DELETE request.
Returns:
- error: An error if there was an issue with the request or response, or nil if the request was successful.
func (*TableItemRequestBuilder) Get ¶
func (rB *TableItemRequestBuilder) Get(params *TableItemRequestBuilderGetQueryParameters) (*TableItemResponse, error)
Get sends an HTTP GET request using the specified query parameters and returns a TableItemResponse.
Parameters:
- params: An instance of TableItemRequestBuilderGetQueryParameters to include in the GET request.
Returns:
- *TableItemResponse: The response data as a TableItemResponse.
- error: An error if there was an issue with the request or response.
func (*TableItemRequestBuilder) Put ¶
func (rB *TableItemRequestBuilder) Put(tableEntry map[string]string, params *TableItemRequestBuilderPutQueryParameters) (*TableItemResponse, error)
Put updates a table item using an HTTP PUT request. It takes a map of table entry data and optional query parameters to send in the request. The method returns a TableItemResponse representing the updated item or an error if the request fails.
Parameters:
- tableEntry: A map containing the data to update the table item.
- params: An optional pointer to TableItemRequestBuilderPutQueryParameters, which can be used to specify query parameters for the request.
Returns:
- *TableItemResponse: A TableItemResponse containing the updated item data.
- error: An error, if the request fails at any point, such as request information creation or JSON deserialization.
type TableItemRequestBuilderDeleteQueryParameters ¶
type TableItemRequestBuilderDeleteQueryParameters struct { //Flag that indicates whether to restrict the record search to only the domains for which the logged in user is configured. // //Valid values: // //- false: Exclude the record if it is in a domain that the currently logged in user is not configured to access. // //- true: Include the record even if it is in a domain that the currently logged in user is not configured to access. QueryNoDomain bool `query:"sysparm_query_no_domain"` }
type TableItemRequestBuilderGetQueryParameters ¶
type TableItemRequestBuilderGetQueryParameters struct { //Determines the type of data returned, either the actual values from the database or the display values of the fields. //Display values are manipulated based on the actual value in the database and user or system settings and preferences. //If returning display values, the value that is returned is dependent on the field type. //- Choice fields: The database value may be a number, but the display value will be more descriptive. // //- Date fields: The database value is in UTC format, while the display value is based on the user's time zone. // //- Encrypted text: The database value is encrypted, while the displayed value is unencrypted based on the user's encryption context. // //- Reference fields: The database value is sys_id, but the display value is a display field of the referenced record. DisplayValue DisplayValue `query:"sysparm_display_value"` //Flag that indicates whether to exclude Table API links for reference fields. // //Valid values: // //- true: Exclude Table API links for reference fields. // //- false: Include Table API links for reference fields. ExcludeReferenceLink bool `query:"sysparm_exclude_reference_link"` //list of fields to return in the response. Fields []string `query:"sysparm_fields"` //Flag that indicates whether to restrict the record search to only the domains for which the logged in user is configured. // //Valid values: // //- false: Exclude the record if it is in a domain that the currently logged in user is not configured to access. // //- true: Include the record even if it is in a domain that the currently logged in user is not configured to access. QueryNoDomain bool `query:"sysparm_query_no_domain"` // UI view for which to render the data. Determines the fields returned in the response. // //Valid values: // //- desktop //- mobile //- both //If you also specify the sysparm_fields parameter, it takes precedent. View View `query:"sysparm_view"` }
type TableItemRequestBuilderPutQueryParameters ¶
type TableItemRequestBuilderPutQueryParameters struct { DisplayValue DisplayValue `query:"sysparm_display_value"` ExcludeReferenceLink bool `query:"sysparm_exclude_reference_link"` Fields []string `query:"sysparm_fields"` InputDisplayValue bool `query:"sysparm_input_display_value"` QueryNoDomain bool `query:"sysparm_query_no_domain"` View View `query:"sysparm_view"` }
type TableItemResponse ¶
type TableItemResponse struct {
Result *TableEntry
}
func (*TableItemResponse) ParseHeaders ¶ added in v1.1.0
func (iR *TableItemResponse) ParseHeaders(headers http.Header)
type TablePostRequestConfiguration ¶ added in v1.2.2
type TablePostRequestConfiguration struct { Header interface{} QueryParameters *TableRequestBuilderPostQueryParameters Data map[string]string ErrorMapping core.ErrorMapping // contains filtered or unexported fields }
type TableRequestBuilder ¶
type TableRequestBuilder struct {
core.RequestBuilder
}
func NewTableRequestBuilder ¶
func NewTableRequestBuilder(client core.Client, pathParameters map[string]string) *TableRequestBuilder
NewTableRequestBuilder creates a new instance of the TableRequestBuilder associated with the given URL and Client. It accepts the URL and Client as parameters and returns a pointer to the created TableRequestBuilder.
func (*TableRequestBuilder) ById ¶
func (T *TableRequestBuilder) ById(sysId string) *TableItemRequestBuilder
ById returns a TableItemRequestBuilder for a specific record in the table. It accepts the sysId of the record as a parameter and constructs the URL for the record. The returned TableItemRequestBuilder can be used to build and execute requests for the specific record.
func (*TableRequestBuilder) Count ¶
func (T *TableRequestBuilder) Count() (int, error)
Count sends an HTTP HEAD request and retrieves the value of "X-Total-Count" from the response header, which represents the count of items.
Returns:
- int: The count of items.
- error: An error if there was an issue with the request or response.
func (*TableRequestBuilder) Get ¶
func (rB *TableRequestBuilder) Get(params *TableRequestBuilderGetQueryParameters) (*TableCollectionResponse, error)
Get sends an HTTP GET request using the specified query parameters and returns a TableCollectionResponse.
Parameters:
- params: An instance of TableRequestBuilderGetQueryParameters to include in the GET request.
Returns:
- *TableCollectionResponse: The response data as a TableCollectionResponse.
- error: An error if there was an issue with the request or response.
func (*TableRequestBuilder) Post
deprecated
func (rB *TableRequestBuilder) Post(data map[string]string, params *TableRequestBuilderPostQueryParamters) (*TableItemResponse, error)
Deprecated: deprecated since v{version}. Use `Post2` instead. Post sends an HTTP Post request with the provided data and query parameters and returns an `TableItemResponse`.
Parameters:
- data: A map[string]string representing data to be included in the request body.
- params: An instance of `*TableRequestBuilderPostQueryParameters` for query parameters.
Returns:
- *TableResponse: The response data as a TableResponse.
- error: An error if there was an issue with the request or response.
func (*TableRequestBuilder) Post2 ¶ added in v1.2.2
func (rB *TableRequestBuilder) Post2(data map[string]string, params *TableRequestBuilderPostQueryParameters) (*TableItemResponse, error)
Post2 sends an HTTP Post request with the provided data and query paramters and returns an `TableItemResponse`.
Parameters:
- data: A map[string]string representing data to be included in the request body.
- params: An instance of `*TableRequestBuilderPostQueryParameters` for query parameters
type TableRequestBuilderGetQueryParameters ¶
type TableRequestBuilderGetQueryParameters struct { //Determines the type of data returned, either the actual values from the database or the display values of the fields. //Display values are manipulated based on the actual value in the database and user or system settings and preferences. //If returning display values, the value that is returned is dependent on the field type. //- Choice fields: The database value may be a number, but the display value will be more descriptive. // //- Date fields: The database value is in UTC format, while the display value is based on the user's time zone. // //- Encrypted text: The database value is encrypted, while the displayed value is unencrypted based on the user's encryption context. // //- Reference fields: The database value is sys_id, but the display value is a display field of the referenced record. DisplayValue DisplayValue `query:"sysparm_display_value"` //Flag that indicates whether to exclude Table API links for reference fields. // //Valid values: // //- true: Exclude Table API links for reference fields. // //- false: Include Table API links for reference fields. ExcludeReferenceLink bool `query:"sysparm_exclude_reference_link"` //list of fields to return in the response. Fields []string `query:"sysparm_fields"` //Flag that indicates whether to restrict the record search to only the domains for which the logged in user is configured. // //Valid values: // //- false: Exclude the record if it is in a domain that the currently logged in user is not configured to access. // //- true: Include the record even if it is in a domain that the currently logged in user is not configured to access. QueryNoDomain bool `query:"sysparm_query_no_domain"` // UI view for which to render the data. Determines the fields returned in the response. // //Valid values: // //- desktop //- mobile //- both //If you also specify the sysparm_fields parameter, it takes precedent. View View `query:"sysparm_view"` Limit int `query:"sysparm_limit"` NoCount bool `query:"sysparm_no_count"` Offset int `query:"sysparm_offset"` Query string `query:"sysparm_query"` QueryCategory string `query:"sysparm_query_category"` SuppressPaginationHeader bool `uriparameter:"sysparm_suppress_pagination_header"` }
type TableRequestBuilderPostQueryParameters ¶ added in v1.2.2
type TableRequestBuilderPostQueryParameters struct { //Determines the type of data returned, either the actual values from the database or the display values of the fields. //Display values are manipulated based on the actual value in the database and user or system settings and preferences. //If returning display values, the value that is returned is dependent on the field type. //- Choice fields: The database value may be a number, but the display value will be more descriptive. // //- Date fields: The database value is in UTC format, while the display value is based on the user's time zone. // //- Encrypted text: The database value is encrypted, while the displayed value is unencrypted based on the user's encryption context. // //- Reference fields: The database value is sys_id, but the display value is a display field of the referenced record. DisplayValue DisplayValue `query:"sysparm_display_value"` //Flag that indicates whether to exclude Table API links for reference fields. // //Valid values: // //- true: Exclude Table API links for reference fields. // //- false: Include Table API links for reference fields. ExcludeReferenceLink bool `query:"sysparm_exclude_reference_link"` //list of fields to return in the response. Fields []string `query:"sysparm_fields"` InputDisplayValue bool `query:"sysparm_input_display_value"` // UI view for which to render the data. Determines the fields returned in the response. // //Valid values: // //- desktop //- mobile //- both //If you also specify the sysparm_fields parameter, it takes precedent. View View `query:"sysparm_view"` }
type TableRequestBuilderPostQueryParamters
deprecated
type TableRequestBuilderPostQueryParamters struct { //Determines the type of data returned, either the actual values from the database or the display values of the fields. //Display values are manipulated based on the actual value in the database and user or system settings and preferences. //If returning display values, the value that is returned is dependent on the field type. //- Choice fields: The database value may be a number, but the display value will be more descriptive. // //- Date fields: The database value is in UTC format, while the display value is based on the user's time zone. // //- Encrypted text: The database value is encrypted, while the displayed value is unencrypted based on the user's encryption context. // //- Reference fields: The database value is sys_id, but the display value is a display field of the referenced record. DisplayValue DisplayValue `query:"sysparm_display_value"` //Flag that indicates whether to exclude Table API links for reference fields. // //Valid values: // //- true: Exclude Table API links for reference fields. // //- false: Include Table API links for reference fields. ExcludeReferenceLink bool `query:"sysparm_exclude_reference_link"` //list of fields to return in the response. Fields []string `query:"sysparm_fields"` InputDisplayValue bool `query:"sysparm_input_display_value"` // UI view for which to render the data. Determines the fields returned in the response. // //Valid values: // //- desktop //- mobile //- both //If you also specify the sysparm_fields parameter, it takes precedent. View View `query:"sysparm_view"` }
Deprecated: deprecated as of v{version}. use `TableRequestBuilderPostQueryParameters` instead
type TableResponse ¶
type TableResponse struct {
Result TableEntry
}
type TableValue ¶
type TableValue struct {
// contains filtered or unexported fields
}
TableValue is the reflection interface to a table value.
func (*TableValue) Bool ¶ added in v1.2.1
func (tV *TableValue) Bool() (bool, error)
Bool returns tV's underlying value, as a bool.
func (*TableValue) Float ¶ added in v1.2.1
func (tV *TableValue) Float() (float64, error)
Float returns tV's underlying value, as a float64.
func (*TableValue) GetType
deprecated
func (tV *TableValue) GetType() reflect.Type
Deprecated: deprecated as of {version} please utilize `Type`
GetType returns tV's underlying value type.
func (*TableValue) Int ¶ added in v1.2.1
func (tv *TableValue) Int() (int64, error)
Int returns tV's underlying value, as an int64.
func (*TableValue) String ¶ added in v1.2.1
func (tV *TableValue) String() (string, error)
String returns tV's underlying value, as a string.
func (*TableValue) ToBool
deprecated
func (tV *TableValue) ToBool() (bool, error)
Deprecated: deprecated as of {version} please utilize `Bool`
ToBool returns tV's underlying value, as a bool.
func (*TableValue) ToFloat64
deprecated
func (tV *TableValue) ToFloat64() (float64, error)
Deprecated: deprecated as of {version} please utilize `ToFloat64`
ToFloat64 returns tV's underlying value, as a float64.
func (*TableValue) ToInt64
deprecated
func (tV *TableValue) ToInt64() (int64, error)
Deprecated: deprecated as of {version} please utilize `ToInt64`
ToInt64 returns tV's underlying value, as an int64.
func (*TableValue) ToString
deprecated
func (tV *TableValue) ToString() (string, error)
Deprecated: deprecated as of {version} please utilize `String`
ToString returns tV's underlying value, as a string.
func (*TableValue) Type ¶ added in v1.2.1
func (tV *TableValue) Type() reflect.Type
Type returns tV's underlying value type.
Source Files ¶
- display_value.go
- errors.go
- fragment.go
- helper.go
- logical_operator.go
- order_by.go
- order_direction.go
- page_iterator.go
- page_result.go
- query.go
- relational_operator.go
- table_collection_response.go
- table_entry.go
- table_get_request_configuration.go
- table_item_Put_request_configuration.go
- table_item_delete_request_configuration.go
- table_item_get_request_configuration.go
- table_item_request_builder.go
- table_item_request_builder_delete_query_parameters.go
- table_item_request_builder_get_query_parameters.go
- table_item_request_builder_put_query_parameters.go
- table_item_response.go
- table_post_request_configuration.go
- table_request_builder.go
- table_request_builder_get_query_parameters.go
- table_request_builder_post_query_paramters.go
- table_response.go
- table_value.go
- view.go