gonest

package
v0.0.0-...-a8427c8 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	// contains filtered or unexported fields
}

func (*APIClient) CallAPI

func (c *APIClient) CallAPI(path string, method string,
	postBody interface{},
	headerParams map[string]string,
	queryParams url.Values,
	formParams map[string]string,
	fileName string,
	fileBytes []byte) (*resty.Response, error)

func (*APIClient) ParameterToString

func (c *APIClient) ParameterToString(obj interface{}, collectionFormat string) string

func (*APIClient) SelectHeaderAccept

func (c *APIClient) SelectHeaderAccept(accepts []string) string

func (*APIClient) SelectHeaderContentType

func (c *APIClient) SelectHeaderContentType(contentTypes []string) string

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type Configuration

type Configuration struct {
	Username      string            `json:"userName,omitempty"`
	Password      string            `json:"password,omitempty"`
	APIKeyPrefix  map[string]string `json:"APIKeyPrefix,omitempty"`
	APIKey        map[string]string `json:"APIKey,omitempty"`
	Debug         bool              `json:"debug,omitempty"`
	DebugFile     string            `json:"debugFile,omitempty"`
	OAuthToken    string            `json:"oAuthToken,omitempty"`
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	AccessToken   string            `json:"accessToken,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	APIClient     *APIClient
	Transport     *http.Transport
	Timeout       *time.Duration `json:"timeout,omitempty"`
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

func (*Configuration) GetAPIKeyWithPrefix

func (c *Configuration) GetAPIKeyWithPrefix(APIKeyIdentifier string) string

func (*Configuration) GetBasicAuthEncodedString

func (c *Configuration) GetBasicAuthEncodedString() string

type ModelError

type ModelError struct {

	// Short error message format.
	Error_ int32 `json:"error,omitempty"`

	// Provides a URL to detailed information about the error condition (this page).
	Type_ string `json:"type,omitempty"`

	// Long error message format that may use variables to provide additional details. When a variable is included in the message, it will appear in the **details** object.
	Message string `json:"message,omitempty"`

	// A text string that holds an error identifier that is unique to each individual call. We may ask you for the instance number if you report an issue with the service.
	Instance string `json:"instance,omitempty"`

	// Optional. Contains variables that are inserted into the message. Messages can contain multiple variables.
	Details string `json:"details,omitempty"`
}

type NestApi

type NestApi struct {
	Configuration *Configuration
}

func NewNestApi

func NewNestApi() *NestApi

func NewNestApiWithBasePath

func NewNestApiWithBasePath(basePath string) *NestApi

func (NestApi) DevicesThermostatsThermostatUidGet

func (a NestApi) DevicesThermostatsThermostatUidGet(thermostatUid string) (*ThermostatStatus, *APIResponse, error)

*

  • Get thermostat information
  • The Products endpoint returns information about the *Uber* products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order. *
  • @param thermostatUid NEST Thermostat unique id.
  • @return *ThermostatStatus

type NestThermostatApi

type NestThermostatApi struct {
	Configuration *Configuration
}

func NewNestThermostatApi

func NewNestThermostatApi() *NestThermostatApi

func NewNestThermostatApiWithBasePath

func NewNestThermostatApiWithBasePath(basePath string) *NestThermostatApi

func (NestThermostatApi) DevicesThermostatsThermostatUidGet

func (a NestThermostatApi) DevicesThermostatsThermostatUidGet(thermostatUid string) (*ThermostatStatus, *APIResponse, error)

*

  • Get thermostat information
  • The Products endpoint returns information about the *Uber* products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order. *
  • @param thermostatUid NEST Thermostat unique id.
  • @return *ThermostatStatus

type ThermostatApi

type ThermostatApi struct {
	Configuration *Configuration
}

func NewThermostatApi

func NewThermostatApi() *ThermostatApi

func NewThermostatApiWithBasePath

func NewThermostatApiWithBasePath(basePath string) *ThermostatApi

func (ThermostatApi) DevicesThermostatsThermostatUidGet

func (a ThermostatApi) DevicesThermostatsThermostatUidGet(thermostatUid string) (*ThermostatStatus, *APIResponse, error)

*

  • Get thermostat information
  • The Products endpoint returns information about the *Uber* products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order. *
  • @param thermostatUid NEST Thermostat unique id.
  • @return *ThermostatStatus

type ThermostatStatus

type ThermostatStatus struct {

	// Humidity, in percent (%) format, measured at the device, rounded to the nearest 5%. Range: 0-100
	Humidity float64 `json:"humidity,omitempty"`

	// Specifies language and region (or country) preference. Examples: \"en-GB\", \"en-US\", \"es-US\", \"fr-CA\", \"fr-CA\", \"nl-NL\"
	Locale string `json:"locale,omitempty"`

	// Fahrenheit or Celsius; used with temperature display. Values: \"F\", \"C\"
	TemperatureScale string `json:"temperature_scale,omitempty"`

	// Emergency Heat status in systems with heat pumps for cooling. When Emergency Heat is on:     * The user can adjust the target temperature on the device, but cannot change the mode until Emergency Heat is turned off    * The “`hvac_mode“` can still be changed via the API  See [What's Emergency Heat?](https://nest.com/support/article/What-s-Emergency-Heat-and-does-Nest-support-it) for more information on how the Nest Thermostat supports Emergency Heat.
	IsUsingEmergencyHeat bool `json:"is_using_emergency_heat,omitempty"`

	// System ability to control the fan independently from heating or cooling.
	HasFan bool `json:"has_fan,omitempty"`

	// Software version using semantic versioning. Example: 5.1.6
	SoftwareVersion string `json:"software_version,omitempty"`

	// Displayed when the thermostat is set to an energy-saving temperature.
	HasLeaf bool `json:"has_leaf,omitempty"`

	// A unique, Nest-generated identifier that represents [name](https://developers.nest.com/documentation/cloud/api-thermostat#name), the display name of the device. Learn more about where names for [Nest Thermostats](https://nest.com/support/article/How-do-I-change-the-name-of-my-Nest-Learning-Thermostat), [Nest Protects](https://nest.com/support/article/Learn-more-about-Nest-Protect-locations-names-and-labels) and [Nest Cams](https://nest.com/support/article/How-do-I-change-the-name-of-my-Nest-Cam).
	WhereId string `json:"where_id,omitempty"`

	// Nest Thermostat unique identifier.
	DeviceId string `json:"device_id,omitempty"`

	// Display name of the device. Can be any room name from a list we provide, or a custom name. Example: \"Hallway\"
	Name string `json:"name,omitempty"`

	// System ability to heat.
	CanHeat bool `json:"can_heat,omitempty"`

	// System ability to cool (has AC).
	CanCool bool `json:"can_cool,omitempty"`

	// Desired temperature, in half degrees Celsius (0.5°C). Used when [hvac_mode](https://developers.nest.com/documentation/cloud/api-thermostat#hvac_mode) = “`heat“` or “`cool“`.  Value range: 9-32
	TargetTemperatureC float64 `json:"target_temperature_c,omitempty"`

	// Desired temperature, in full degrees Fahrenheit (1°F). Used when [hvac_mode](https://developers.nest.com/documentation/cloud/api-thermostat#hvac_mode) = “`heat“` or “`cool“`.  Value range: 50-90
	TargetTemperatureF float64 `json:"target_temperature_f,omitempty"`

	// Maximum target temperature, displayed in half degrees Celsius (0.5°C). Used when [hvac_mode]([hvac_mode](https://developers.nest.com/documentation/cloud/api-thermostat#hvac_mode)) = “`heat-cool“` (Heat•Cool mode).
	TargetTemperatureHighC float64 `json:"target_temperature_high_c,omitempty"`

	// Maximum target temperature, displayed in whole degrees Fahrenheit (1°F). Used when [hvac_mode]([hvac_mode](https://developers.nest.com/documentation/cloud/api-thermostat#hvac_mode)) = “`heat-cool“` (Heat•Cool mode).
	TargetTemperatureHighF float64 `json:"target_temperature_high_f,omitempty"`

	// Minimum target temperature, displayed in half degrees Celsius (0.5°C). Used when [hvac_mode]([hvac_mode](https://developers.nest.com/documentation/cloud/api-thermostat#hvac_mode)) = “`heat-cool“` (Heat•Cool mode).
	TargetTemperatureLowC float64 `json:"target_temperature_low_c,omitempty"`

	// Minimum target temperature, displayed in whole degrees Fahrenheit (1°F). Used when [hvac_mode]([hvac_mode](https://developers.nest.com/documentation/cloud/api-thermostat#hvac_mode)) = “`heat-cool“` (Heat•Cool mode).
	TargetTemperatureLowF float64 `json:"target_temperature_low_f,omitempty"`

	// Temperature, measured at the device, in half degrees Celsius (0.5°C).
	AmbientTemperatureC float64 `json:"ambient_temperature_c,omitempty"`

	// Temperature, measured at the device, in whole degrees Fahrenheit (1°F).
	AmbientTemperatureF float64 `json:"ambient_temperature_f,omitempty"`

	// Maximum away temperature, displayed in half degrees Celsius (0.5°C). > WARNING: This data value has been deprecated. Use [eco_temperature_high_c](https://developers.nest.com/documentation/cloud/api-thermostat#eco_temperature_high_c) instead.
	AwayTemperatureHighC float64 `json:"away_temperature_high_c,omitempty"`

	// Maximum away temperature, displayed in whole degrees Fahrenheit (1°F). > WARNING: This data value has been deprecated. Use [eco_temperature_high_f](https://developers.nest.com/documentation/cloud/api-thermostat#eco_temperature_high_f) instead.
	AwayTemperatureHighF float64 `json:"away_temperature_high_f,omitempty"`

	// Minimum away temperature, displayed in half degrees Celsius (0.5°C). > WARNING: This data value has been deprecated. Use [eco_temperature_high_c](https://developers.nest.com/documentation/cloud/api-thermostat#eco_temperature_high_c) instead.
	AwayTemperatureLowC float64 `json:"away_temperature_low_c,omitempty"`

	// Minimum away temperature, displayed in whole degrees Fahrenheit (1°F). > WARNING: This data value has been deprecated. Use [eco_temperature_low_f](https://developers.nest.com/documentation/cloud/api-thermostat#eco_temperature_low_f) instead.
	AwayTemperatureLowF float64 `json:"away_temperature_low_f,omitempty"`

	// Maximum Eco Temperature, displayed in half degrees Celsius (0.5°C). Used when hvac_mode = “`eco“`.
	EcoTemperatureHighC float64 `json:"eco_temperature_high_c,omitempty"`

	// Maximum Eco Temperature, displayed in whole degrees Fahrenheit (1°F). Used when hvac_mode = “`eco“`.
	EcoTemperatureHighF float64 `json:"eco_temperature_high_f,omitempty"`

	// Minimum Eco Temperature, displayed in half degrees Celsius (0.5°C). Used when hvac_mode = eco.
	EcoTemperatureLowC float64 `json:"eco_temperature_low_c,omitempty"`

	// Minimum Eco Temperature, displayed in whole degrees Fahrenheit (1°F). Used when hvac_mode = eco.
	EcoTemperatureLowF float64 `json:"eco_temperature_low_f,omitempty"`

	// Thermostat Lock status. When true, the [Thermostat Lock](https://nest.com/support/article/How-can-I-lock-Nest-so-that-it-can-only-be-adjusted-within-a-certain-temperature-range) feature is enabled, and restricts the temperature range to these min/max values: [locked_temp_min_f](https://developers.nest.com/documentation/cloud/api-thermostat#locked_temp_min_f), [locked_temp_max_f](https://developers.nest.com/documentation/cloud/api-thermostat#locked_temp_max_f), [locked_temp_min_c](https://developers.nest.com/documentation/cloud/api-thermostat#locked_temp_min_c), and [locked_temp_max_c](https://developers.nest.com/documentation/cloud/api-thermostat#locked_temp_max_c).
	IsLocked bool `json:"is_locked,omitempty"`

	// Minimum [Thermostat Lock](https://nest.com/support/article/How-can-I-lock-Nest-so-that-it-can-only-be-adjusted-within-a-certain-temperature-range) temperature, displayed in half degrees Celsius (0.5°C). Used when [is_locked](https://developers.nest.com/documentation/cloud/api-thermostat#is_locked) is “`true“`.
	LockedTempMinC float64 `json:"locked_temp_min_c,omitempty"`

	// Minimum [Thermostat Lock](https://nest.com/support/article/How-can-I-lock-Nest-so-that-it-can-only-be-adjusted-within-a-certain-temperature-range) temperature, displayed in whole degrees Fahrenheit (1°F). Used when [is_locked](https://developers.nest.com/documentation/cloud/api-thermostat#is_locked) is “`true“`.
	LockedTempMinF float64 `json:"locked_temp_min_f,omitempty"`

	// Maximum [Thermostat Lock](https://nest.com/support/article/How-can-I-lock-Nest-so-that-it-can-only-be-adjusted-within-a-certain-temperature-range) temperature, displayed in half degrees Celsius (0.5°C). Used when [is_locked](https://developers.nest.com/documentation/cloud/api-thermostat#is_locked) is “`true“`.
	LockedTempMaxC float64 `json:"locked_temp_max_c,omitempty"`

	// Maximum [Thermostat Lock](https://nest.com/support/article/How-can-I-lock-Nest-so-that-it-can-only-be-adjusted-within-a-certain-temperature-range) temperature, displayed in whole degrees Fahrenheit (1°F). Used when [is_locked](https://developers.nest.com/documentation/cloud/api-thermostat#is_locked) is “`true“`.
	LockedTempMaxF float64 `json:"locked_temp_max_f,omitempty"`

	// Sunblock active status. Used with [sunlight_correction_enabled](https://developers.nest.com/documentation/cloud/api-thermostat#sunlight_correction_enabled). When true, indicates that the Thermostat is located in direct sunlight. For more info, see [What is Sunblock](https://nest.com/support/article/What-is-Sunblock)?
	SunlightCorrectionActive bool `json:"sunlight_correction_active,omitempty"`

	// Sunblock enabled status. Used with [sunlight_correction_active](https://developers.nest.com/documentation/cloud/api-thermostat#sunlight_correction_active). When “`true“`, Sunblock technology is enabled, and the Thermostat is automatically adjusting to direct sunlight, reading and setting the correct temperature. For more info, see [What is Sunblock](https://nest.com/support/article/What-is-Sunblock)?
	SunlightCorrectionEnabled bool `json:"sunlight_correction_enabled,omitempty"`

	// Structure unique identifier. Example: \"VqFabWH21nw...\"
	StructureId string `json:"structure_id,omitempty"`

	// Indicates if the fan timer is engaged; used with [fan_timer_duration](https://developers.nest.com/documentation/cloud/api-thermostat#fan_timer_duration) to turn on the fan for a (user-specified) preset duration. See [Advanced Fan Control](support.nest.com/article/How-do-I-use-Nest-to-turn-on-my-fan-without-heating-or-cooling) for more information on how customers set fan duration.'
	FanTimerActive bool `json:"fan_timer_active,omitempty"`

	// Timestamp showing when the fan timer reaches 0 (stop time), in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
	FanTimerTimeout time.Time `json:"fan_timer_timeout,omitempty"`

	// Specifies the length of time (in minutes) that the fan is set to run. The [fan_timer_active](https://developers.nest.com/documentation/cloud/api-thermostat#fan_timer_active) setting turns on the fan. The [fan_timer_timeout](https://developers.nest.com/documentation/cloud/api-thermostat#fan_timer_timeout) value indicates the timestamp when “`fan_timer_duration“` is set to end. Values: 15, 30, 45, 60, 120, 240, 480, 720 To learn how customers set the fan timer, see [Timer Duration](https://nest.com/support/article/How-do-I-use-Nest-to-turn-on-my-fan-without-heating-or-cooling.'
	FanTimerDuration int32 `json:"fan_timer_duration,omitempty"`

	// Displays the last-selected [hvac_mode](https://developers.nest.com/documentation/cloud/api-thermostat#hvac_mode). Used when switching from hvac_mode = eco on a device with outdated firmware. Values: \"heat\", \"cool\", \"heat-cool\", \"off\", blank (no value) To learn more about switching betwen Eco and non-Eco modes, see the [Thermostat Guide](https://developers.nest.com/documentation/cloud/thermostat-guide#switching_between_eco_and_non-eco_modes).
	PreviousHvacMode string `json:"previous_hvac_mode,omitempty"`

	// Indicates HVAC system heating/cooling modes, like Heat•Cool for systems with heating and cooling capacity, or Eco Temperatures for energy savings.    * “`hvac_mode“` can be changed if the Thermostat is [locked](https://developers.nest.com/documentation/cloud/api-thermostat#is_locked)    * [target_temperature_f](https://developers.nest.com/documentation/cloud/api-thermostat#target_temperature_f) and [target_temperature_c](https://developers.nest.com/documentation/cloud/api-thermostat#target_temperature_c) cannot be changed if “`hvac_mode“` = “`off“` or “`eco“`. Values : [\"heat\", \"cool\", \"heat-cool\", \"eco\", \"off\"]
	HvacMode string `json:"hvac_mode,omitempty"`

	// The time, in minutes, that it will take for the structure to reach the target temperature. Values: \"~0\", \"<5\", \"~15\", \"~90\", \"120\" See [Time-to-Temperature](https://nest.com/support/article/What-is-Time-to-Temperature) for more information.'
	TimeToTarget string `json:"time_to_target,omitempty"`

	// When in training mode, the Nest Thermostat learns about the HVAC system and discovers how much time it takes to reach the target temperature. When the Thermostat has enough information to make a reasonable estimate of the time to reach the target temperature, this value will change from training to ready. Values: \"training\", \"ready\" See [Time-to-Temperature](https://nest.com/support/article/What-is-Time-to-Temperature) for more information.'
	TimeToTargetTraining string `json:"time_to_target_training,omitempty"`

	// The display name of the device. Associated with the Thermostat [where_id](https://developers.nest.com/documentation/cloud/api-thermostat#where_id). Can be any room name from a list we provide, or a custom name. Learn more about where names for [Nest Thermostats](https://nest.com/support/article/How-do-I-change-the-name-of-my-Nest-Learning-Thermostat), [Nest Protects](https://nest.com/support/article/Learn-more-about-Nest-Protect-locations-names-and-labels) and [Nest Cams](https://nest.com/support/article/How-do-I-change-the-name-of-my-Nest-Cam).
	WhereName string `json:"where_name,omitempty"`

	// Thermostat [custom label](https://developers.nest.com/documentation/cloud/thermostat-guide#label). Appears in parentheses, after the where name. Examples: \"Upstairs\", \"Guest room\", \"Playroom\"
	Label string `json:"label,omitempty"`

	// Long display name of the device. Includes a custom (label), created by the user, or via [wheres](https://developers.nest.com/documentation/cloud/api-structure#wheres).
	NameLong string `json:"name_long,omitempty"`

	// Device connection status with the Nest service.
	IsOnline bool `json:"is_online,omitempty"`

	// Indicates whether HVAC system is actively heating, cooling or is off. Use this value to indicate HVAC activity state. When off, the HVAC system is not actively heating or cooling. hvac_state is independent of fan operation. Values: \"heating\", \"cooling\", \"off\"
	HvacState string `json:"hvac_state,omitempty"`
}

Jump to

Keyboard shortcuts

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