Documentation ¶
Index ¶
- Constants
- Variables
- func BuildRequest(graphqlReq *graphql.Request, bearerToken string, tenantID string) (*http.Request, error)
- type IPreferencesSvc
- type PreferenceItem
- type PreferencesInput
- type PreferencesOutput
- type PreferencesSvc
- func (t *PreferencesSvc) CreatePreferences(in *PreferencesInput, rf graphql.ResponseFields) (*PreferencesOutput, error)
- func (t *PreferencesSvc) CreateTenantPreferences(in *PreferencesInput, rf graphql.ResponseFields) (*PreferencesOutput, error)
- func (t *PreferencesSvc) GetNotificationPreferences(in *PreferencesInput, rf graphql.ResponseFields) (*PreferencesOutput, error)
- func (t *PreferencesSvc) GetPreferencesByKey(in *PreferencesInput, rf graphql.ResponseFields) (*PreferencesOutput, error)
- func (t *PreferencesSvc) ListTenantPreferencesByKey(in *PreferencesInput, rf graphql.ResponseFields) ([]*PreferencesOutput, error)
- type RequestError
- type UserEmail
Constants ¶
View Source
const ( DefaultFields graphql.ResponseFields = ` id created_at updated_at user_id key preference_items {key, value} ` EmailKey = "email" )
Variables ¶
View Source
var (
DefaultURL = "https://api.ctpx.secureworks.com/graphql"
)
Functions ¶
Types ¶
type IPreferencesSvc ¶
type IPreferencesSvc interface { CreatePreferences(*PreferencesInput, graphql.ResponseFields) (*PreferencesOutput, error) CreateTenantPreferences(in *PreferencesInput, rf graphql.ResponseFields) (*PreferencesOutput, error) GetPreferencesByKey(*PreferencesInput, graphql.ResponseFields) (*PreferencesOutput, error) ListTenantPreferencesByKey(in *PreferencesInput, rf graphql.ResponseFields) ([]*PreferencesOutput, error) }
IPreferencesSvc defines what the the Preferences API can do
type PreferenceItem ¶
type PreferencesInput ¶
type PreferencesOutput ¶
type PreferencesOutput struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` UserID string `json:"user_id" db:"user_id"` //only used for userPreferences TenantID string `json:"tenant_id" db:"tenant_id"` // only used for tenantPreferences Key string `json:"key" db:"key"` PreferenceItems []PreferenceItem `json:"preference_items"` }
type PreferencesSvc ¶
type PreferencesSvc struct {
// contains filtered or unexported fields
}
PreferencesSvc is the concrete implementation of the interface against the real api
func NewPreferencesSvc ¶
func NewPreferencesSvc(c *client.Client, serviceName string) *PreferencesSvc
NewPreferenceSvc takes a client from `client` package -- see examples/preferences.go for an example
func (*PreferencesSvc) CreatePreferences ¶
func (t *PreferencesSvc) CreatePreferences(in *PreferencesInput, rf graphql.ResponseFields) (*PreferencesOutput, error)
func (*PreferencesSvc) CreateTenantPreferences ¶
func (t *PreferencesSvc) CreateTenantPreferences(in *PreferencesInput, rf graphql.ResponseFields) (*PreferencesOutput, error)
func (*PreferencesSvc) GetNotificationPreferences ¶
func (t *PreferencesSvc) GetNotificationPreferences(in *PreferencesInput, rf graphql.ResponseFields) (*PreferencesOutput, error)
func (*PreferencesSvc) GetPreferencesByKey ¶
func (t *PreferencesSvc) GetPreferencesByKey(in *PreferencesInput, rf graphql.ResponseFields) (*PreferencesOutput, error)
func (*PreferencesSvc) ListTenantPreferencesByKey ¶
func (t *PreferencesSvc) ListTenantPreferencesByKey(in *PreferencesInput, rf graphql.ResponseFields) ([]*PreferencesOutput, error)
type RequestError ¶
RequestError is a custom error type to capture a request response body and a response code
func NewRequestError ¶
func NewRequestError(respBody io.Reader, respCode int) *RequestError
NewRequestError takes a response body and a response code and returns a custom error to the CreateNotification caller for failed request
func (*RequestError) Error ¶
func (b *RequestError) Error() string
type UserEmail ¶
type UserEmail struct { Mention bool `json:"mention"` AssigneeChange bool `json:"assignee_change"` AwaitingAction bool `json:"awaiting_action"` GroupMention bool `json:"group_mention"` GroupAssigneeChange bool `json:"group_assignee_change"` GroupAwaitingAction bool `json:"group_awaiting_action"` ExportsCSVReady bool `json:"exports_csv_ready"` }
Click to show internal directories.
Click to hide internal directories.