zendesk

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnvZendeskUsername  = "ZENDESK_USERNAME"
	EnvZendeskPassword  = "ZENDESK_PASSWORD"
	EnvZendeskSubdomain = "ZENDESK_SUBDOMAIN"
)

Functions

func MeURL

func MeURL(subdomain string) string

func NewClientPassword

func NewClientPassword(ctx context.Context, emailAddress, password string) (*http.Client, error)

NewClientPassword creates a new http.Client using basic authentication.

func NewClientToken

func NewClientToken(ctx context.Context, emailAddress, apiToken string) (*http.Client, error)

NewClientToken creates a new http.Client using the Zendesk API token as specified here: https://developer.zendesk.com/rest_api/docs/core/introduction

Types

type ClientUtil

type ClientUtil struct {
	Client    *http.Client `json:"-"`
	Subdomain string       `json:"subdomain,omitempty"`
	MeUser    Me           `json:"user,omitempty"`
}

ClientUtil is a client library to retrieve user info from the Facebook API.

func NewClientUtil

func NewClientUtil(client *http.Client, subdomain string) ClientUtil

func (*ClientUtil) GetSCIMUser

func (cu *ClientUtil) GetSCIMUser() (scim.User, error)

func (*ClientUtil) GetUserinfo

func (cu *ClientUtil) GetUserinfo() (*Me, error)

func (*ClientUtil) SetClient

func (cu *ClientUtil) SetClient(client *http.Client)

type Me

type Me struct {
	ID                int64  `json:"id,omitempty"`
	URL               string `json:"url,omitempty"`
	Name              string `json:"name,omitempty"`
	Email             string `json:"email,omitempty"`
	Phone             string `json:"phone,omitempty"`
	SharedPhoneNumber string `json:"shared_phone_number,omitempty"`
}

func GetMe

func GetMe(client *http.Client, subdomain string) (*Me, *http.Response, error)

type MeResponse

type MeResponse struct {
	User Me `json:"user,omitempty"`
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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