serializer

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNestedFieldValue added in v1.1.4

func GetNestedFieldValue(field interface{}) (string, error)

Types

type APIErrorResponse added in v1.0.0

type APIErrorResponse struct {
	ID         string `json:"id"`
	Message    string `json:"message"`
	StatusCode int    `json:"-"`
}

Error struct to store error ids and error message.

func (*APIErrorResponse) Error added in v1.0.0

func (a *APIErrorResponse) Error() string

type ConnectedResponse added in v1.0.0

type ConnectedResponse struct {
	Connected bool `json:"connected"`
}

type NestedField added in v1.1.4

type NestedField struct {
	DisplayValue string `json:"display_value"`
	Link         string `json:"link"`
}

func (*NestedField) LoadFromMap added in v1.1.4

func (nf *NestedField) LoadFromMap(m map[string]interface{}) error

type ServiceNowComment added in v1.2.0

type ServiceNowComment struct {
	CommentsAndWorkNotes string `json:"comments_and_work_notes"`
}

type ServiceNowCommentPayload added in v1.2.0

type ServiceNowCommentPayload struct {
	Comments string `json:"comments"`
}

func ServiceNowCommentPayloadFromJSON added in v1.2.0

func ServiceNowCommentPayloadFromJSON(data io.Reader) (*ServiceNowCommentPayload, error)

type ServiceNowCommentsResult added in v1.2.0

type ServiceNowCommentsResult struct {
	Result *ServiceNowComment `json:"result"`
}

type ServiceNowEvent added in v1.0.0

type ServiceNowEvent struct {
	SubscriptionID   string `json:"sys_id"`
	RecordID         string `json:"record_id"`
	ChannelID        string `json:"mm_channel_id"`
	UserID           string `json:"mm_user_id"`
	SubscriptionType string `json:"type"`
	RecordType       string `json:"record_type"`
	RecordTypeName   string `json:"record_type_name"`
	Events           string `json:"subscription_events"`
	Number           string `json:"number"`
	ShortDescription string `json:"short_description"`
	State            string `json:"state"`
	Priority         string `json:"priority"`
	AssignedTo       string `json:"assigned_to"`
	AssignmentGroup  string `json:"assignment_group"`
	// TODO: Remove the nolint comment by changing spelling of occurred in the update set XML
	EventOccured string `json:"event_occured"` // nolint
}

func ServiceNowEventFromJSON added in v1.0.0

func ServiceNowEventFromJSON(data io.Reader) (*ServiceNowEvent, error)

func (*ServiceNowEvent) CreateNotificationPost added in v1.0.0

func (se *ServiceNowEvent) CreateNotificationPost(botID, serviceNowURL string) *model.Post

type ServiceNowPartialRecord added in v1.0.0

type ServiceNowPartialRecord struct {
	SysID            string `json:"sys_id"`
	Number           string `json:"number"`
	ShortDescription string `json:"short_description"`
}

type ServiceNowPartialRecordsResult added in v1.0.0

type ServiceNowPartialRecordsResult struct {
	Result []*ServiceNowPartialRecord `json:"result"`
}

type ServiceNowRecord added in v1.0.0

type ServiceNowRecord struct {
	SysID            string      `json:"sys_id"`
	Number           string      `json:"number"`
	ShortDescription string      `json:"short_description"`
	RecordType       string      `json:"record_type,omitempty"`
	State            string      `json:"state,omitempty"`
	Priority         string      `json:"priority,omitempty"`
	Workflow         string      `json:"workflow_state,omitempty"`
	AssignedTo       interface{} `json:"assigned_to,omitempty"`
	AssignmentGroup  interface{} `json:"assignment_group,omitempty"`
	KnowledgeBase    interface{} `json:"kb_knowledge_base,omitempty"`
	Category         interface{} `json:"kb_category,omitempty"`
	Author           interface{} `json:"author,omitempty"`
}

func ServiceNowRecordFromJSON added in v1.1.4

func ServiceNowRecordFromJSON(data io.Reader) (*ServiceNowRecord, error)

func (*ServiceNowRecord) CreateSharingPost added in v1.1.4

func (sr *ServiceNowRecord) CreateSharingPost(channelID, botID, serviceNowURL, sharedByUsername string) *model.Post

func (*ServiceNowRecord) HandleNestedFields added in v1.1.4

func (sr *ServiceNowRecord) HandleNestedFields() error

type ServiceNowRecordResult added in v1.0.0

type ServiceNowRecordResult struct {
	Result *ServiceNowRecord `json:"result"`
}

type SubscriptionAuthDetails

type SubscriptionAuthDetails struct {
	Result []*SubscriptionAuthPayload `json:"result"`
}

type SubscriptionAuthPayload

type SubscriptionAuthPayload struct {
	ServerURL string `json:"server_url"`
	APISecret string `json:"api_secret"`
}

type SubscriptionPayload

type SubscriptionPayload struct {
	ChannelID          *string `json:"channel_id"`
	UserID             *string `json:"user_id"`
	Type               *string `json:"type"`
	RecordType         *string `json:"record_type"`
	RecordID           *string `json:"record_id"`
	IsActive           *bool   `json:"is_active"`
	SubscriptionEvents *string `json:"subscription_events"`
	ServerURL          *string `json:"server_url"`
}

func SubscriptionFromJSON added in v1.0.0

func SubscriptionFromJSON(data io.Reader) (*SubscriptionPayload, error)

func (*SubscriptionPayload) IsValidForCreation added in v0.1.2

func (s *SubscriptionPayload) IsValidForCreation(siteURL string) error

func (*SubscriptionPayload) IsValidForUpdation added in v0.1.2

func (s *SubscriptionPayload) IsValidForUpdation(siteURL string) error

type SubscriptionResponse

type SubscriptionResponse struct {
	SysID              string `json:"sys_id"`
	UserID             string `json:"user_id"`
	UserName           string `json:"-"`
	ChannelID          string `json:"channel_id"`
	ChannelName        string `json:"-"`
	RecordType         string `json:"record_type"`
	RecordID           string `json:"record_id"`
	SubscriptionEvents string `json:"subscription_events"`
	Type               string `json:"type"`
	ServerURL          string `json:"server_url"`
	IsActive           string `json:"is_active"`
	Number             string `json:"number"`
	ShortDescription   string `json:"short_description"`
}

func (*SubscriptionResponse) GetFormattedSubscription added in v1.0.0

func (s *SubscriptionResponse) GetFormattedSubscription() string

type SubscriptionResult added in v0.1.2

type SubscriptionResult struct {
	Result *SubscriptionResponse `json:"result"`
}

type SubscriptionsResult

type SubscriptionsResult struct {
	Result []*SubscriptionResponse `json:"result"`
}

type User added in v1.1.1

type User struct {
	MattermostUserID string
	OAuth2Token      string
}

Jump to

Keyboard shortcuts

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