httputil

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocationRequest

func LocationRequest(url string, accessToken string) string

Types

type Adapter

type Adapter struct {
	V1 V1 `json:"v1"`
}

type Body

type Body struct {
	General General `json:"general"`
	Device  Device  `json:"device"`
	Adapter Adapter `json:"adapter"`
	Impulse Impulse `json:"impulse"`
}

type CommandTypes

type CommandTypes struct {
	ResetChip    ResetChip    `json:"reset-chip"`
	ResetNetwork ResetNetwork `json:"reset-network"`
}

type Context

type Context struct {
	EventID              string `json:"eventId"`
	EventOccurredTsMs    int64  `json:"eventOccurredTsMs"`
	AffectedEntityType   string `json:"affectedEntityType"`
	AffectedEntityID     string `json:"affectedEntityId"`
	AffectedEntityName   string `json:"affectedEntityName"`
	InitiatingEntityType string `json:"initiatingEntityType"`
	InitiatingEntityID   string `json:"initiatingEntityId"`
	InitiatingEntityName string `json:"initiatingEntityName"`
	InterfaceType        string `json:"interfaceType"`
	InterfaceID          string `json:"interfaceId"`
	InterfaceName        string `json:"interfaceName"`
	AffectedParentID     string `json:"affectedParentId"`
	AffectedParentName   string `json:"affectedParentName"`
	AccountID            string `json:"accountId"`
	ProgramID            string `json:"programId"`
	UserAgent            string `json:"userAgent"`
	IPAddress            string `json:"ipAddress"`
	AssetID              string `json:"assetId"`
	AssetKind            string `json:"assetKind"`
}

type Device

type Device struct {
	V1 V1 `json:"v1"`
}

type Event

type Event struct {
	DeviceName         string `json:"name"`
	DateInMilliSeconds int64  `json:"dateInMilliSeconds"`
	Type               string `json:"type"`
}

type ExchangeRequest

type ExchangeRequest struct {
	AccessToken string `json:"access_token"`
}

type ExchangeResponse

type ExchangeResponse struct {
	AccessToken string `json:"access_token"`
}

func AccessTokenRequest

func AccessTokenRequest(url string, exchangeRequest ExchangeRequest) ExchangeResponse

type FingerPrint

type FingerPrint struct {
	ManufacturerID string `json:"manufacturerId"`
	ProductID      string `json:"productId"`
	ProductType    string `json:"productType"`
}

type General

type General struct {
	V2 V2 `json:"v2"`
}

type History

type History struct {
	Body     []Body  `json:"body"`
	Context  Context `json:"context"`
	DataType string  `json:"datatype"`
	Message  string  `json:"msg"`
}

func HistoryRequest

func HistoryRequest(url string, accessToken string, locationID string, limit string) []History

type Impulse

type Impulse struct {
	ImpulseTypes []ImpulseV1 `json:"v1"`
}

type ImpulseV1

type ImpulseV1 struct {
	ImpulseType string `json:"impulseType"`
}

type OAuthRequest

type OAuthRequest struct {
	ClientID  string `json:"client_id"`
	GrantType string `json:"grant_type"`
	Password  string `json:"password"`
	Scope     string `json:"scope"`
	Username  string `json:"username"`
}

type OAuthRequestWithRefreshToken added in v1.3.0

type OAuthRequestWithRefreshToken struct {
	ClientID     string `json:"client_id"`
	GrantType    string `json:"grant_type"`
	RefreshToken string `json:"refresh_token"`
}

type OAuthResponse

type OAuthResponse struct {
	AccessToken       string `json:"access_token"`
	ExpiresIn         string `json:"expires_in"`
	RefreshToken      string `json:"refresh_token"`
	Scope             string `json:"scope"`
	TokenType         string `json:"token_type"`
	Error             string `json:"error"`
	ErrorDescription  string `json:"error_description"`
	NextTimeInSeconds int32  `json:"next_time_in_secs"`
	Phone             string `json:"phone"`
}

func AuthRequest

func AuthRequest(url string, oauthRequest OAuthRequest, code string) (OAuthResponse, error)

func AuthRequestWithRefreshToken added in v1.3.0

func AuthRequestWithRefreshToken(url string, oauthRequest OAuthRequestWithRefreshToken) (OAuthResponse, error)

type ResetChip

type ResetChip struct {
	RequiresTrust bool `json:"reset-chip"`
}

type ResetNetwork

type ResetNetwork struct {
	RequiresTrust bool `json:"reset-network"`
}

type RingWSConnection

type RingWSConnection struct {
	Server   string `json:"server"`
	AuthCode string `json:"authCode"`
}

RingWSConnection is a type for Ring Connection response API.

func ConnectionRequest

func ConnectionRequest(url string, locationId string, accessToken string) RingWSConnection

type UserLocation

type UserLocation struct {
	LocationID string `json:"location_id"`
}

type UserLocations

type UserLocations struct {
	Location []UserLocation `json:"user_locations"`
}

type V1

type V1 struct {
	Channel int `json:"channel"`
	// FingerPrint FingerPrint `json:"fingerprint"`
	PanID   int    `json:"panId"`
	Faulted bool   `json:"faulted"`
	Mode    string `json:"mode"`
}

type V2

type V2 struct {
	AdapterType   string `json:"adapterType"`
	BatteryLevel  int    `json:"batteryLevel"`
	BatteryStatus string `json:"batteryStatus"`
	CatalogID     string `json:"catalogId"`
	// CategoryID          string       `json:"categoryId"`
	CommStatus          string       `json:"commStatus"`
	CommandTypes        CommandTypes `json:"commandTypes"`
	DeviceFoundTime     int64        `json:"deviceFoundTime"`
	DeviceType          string       `json:"deviceType"`
	LastCommTime        int64        `json:"lastCommTime"`
	LastUpdate          int64        `json:"lastUpdate"`
	ManagerID           string       `json:"managerId"`
	Name                string       `json:"name"`
	PollInterval        int          `json:"pollInterval"`
	RoomID              int          `json:"roomId"`
	SetupByPluginStatus string       `json:"setupByPluginStatus"`
	SetupByUserStatus   string       `json:"setupByUserStatus"`
	SubCategoryID       int          `json:"subCategoryId"`
	Tags                []string     `json:"tags"`
	TamperStatus        string       `json:"tamperStatus"`
	ZID                 string       `json:"zid"`
	AdapterZID          string       `json:"adapterZid"`
}

Jump to

Keyboard shortcuts

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