ringcentral

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerURLProduction  = "https://platform.ringcentral.com"
	ServerURLSandbox     = "https://platform.devtest.ringcentral.com"
	ProductionHostname   = "platform.ringcentral.com"
	SandboxHostname      = "platform.devtest.ringcentral.com"
	AuthURLFormat        = "https://%s/restapi/oauth/authorize"
	TokenURLFormat       = "https://%s/restapi/oauth/token"
	AuthURLPart          = "restapi/oauth/authorize"
	TokenURLPart         = "restapi/oauth/token"
	MeURL                = "/restapi/v1.0/account/~/extension/~"
	RestAPI1dot0Fragment = "restapi/v1.0"
)

Variables

View Source
var (
	EnvServerURL    = "RC_SERVER_URL"
	EnvClientID     = "RC_CLIENT_ID"
	EnvClientSecret = "RC_CLIENT_SECRET"
	EnvUsername     = "RC_USER_USERNAME"
	EnvExtension    = "RC_USER_EXTENSION"
	EnvPassword     = "RC_USER_PASSWORD"
)
View Source
var (
	Hostname = "platform.devtest.ringcentral.com"
)

Functions

func BuildURL

func BuildURL(urlFragment string, addRestAPI bool, queryValues url.Values) string

func NewClientPassword

func NewClientPassword(app ApplicationCredentials, user UserCredentials) (*http.Client, error)

func NewEndpoint

func NewEndpoint(hostnameOrBasePath string) oauth2.Endpoint

func SetHostnameForURL added in v0.1.0

func SetHostnameForURL(serverURLString string) error

Types

type ApplicationCredentials

type ApplicationCredentials struct {
	ServerURL    string
	ClientID     string
	ClientSecret string
	RedirectURL  string
}

func (*ApplicationCredentials) Config

func (app *ApplicationCredentials) Config() oauth2.Config

type ClientUtil

type ClientUtil struct {
	Client *http.Client             `json:"-"`
	User   RingCentralExtensionInfo `json:"user,omitempty"`
}

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

func NewClientUtil

func NewClientUtil(client *http.Client) ClientUtil

func (*ClientUtil) GetSCIMUser

func (apiutil *ClientUtil) GetSCIMUser() (scimutil.User, error)

func (*ClientUtil) GetUserinfo

func (apiutil *ClientUtil) GetUserinfo() (RingCentralExtensionInfo, error)

GetUserinfo retrieves the userinfo from the https://graph.facebook.com/v2.9/{user-id} endpoint.

func (*ClientUtil) SetClient

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

type RingCentralAccount

type RingCentralAccount struct {
	URI string `json:"uri,omitempty"`
	ID  string `json:"id,omitempty"`
}

type RingCentralContact

type RingCentralContact struct {
	FirstName string `json:"firstName,omitempty"`
	LastName  string `json:"lastName,omitempty"`
	Email     string `json:"email,omitempty"`
}

type RingCentralExtensionInfo

type RingCentralExtensionInfo struct {
	ID              int64              `json:"id,omitempty"`
	ExtensionNumber string             `json:"extensionNumber,omitempty"`
	Contact         RingCentralContact `json:"contact,omitempty"`
	Name            string             `json:"name,omitempty"`
	Account         RingCentralAccount `json:"account,omitempty"`
}

type UserCredentials added in v0.1.0

type UserCredentials struct {
	Username  string
	Extension string
	Password  string
}

Jump to

Keyboard shortcuts

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