Skip to content

Latest commit

 

History

History
204 lines (142 loc) · 7.17 KB

File metadata and controls

204 lines (142 loc) · 7.17 KB

\ExternalDevicesAPI

All URIs are relative to https://api.notefile.net

Method HTTP request Description
CreateEventExtDevice Post /v1/products/{productUID}/ext-devices/{deviceUID}/event
ExtDeviceSessionClose Post /v1/products/{productUID}/ext-devices/{deviceUID}/session/close
ExtDeviceSessionOpen Post /v1/products/{productUID}/ext-devices/{deviceUID}/session/open

CreateEventExtDevice

CreateEventExtDevice(ctx, productUID, deviceUID).Event(event).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/blues/notehub-go"
)

func main() {
	productUID := "com.blues.bridge:sensors" // string |
	deviceUID := "dev:000000000000000" // string |
	event := *openapiclient.NewEvent() // Event | Event Object

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.ExternalDevicesAPI.CreateEventExtDevice(context.Background(), productUID, deviceUID).Event(event).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ExternalDevicesAPI.CreateEventExtDevice``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
productUID string
deviceUID string

Other Parameters

Other parameters are passed through a pointer to a apiCreateEventExtDeviceRequest struct via the builder pattern

Name Type Description Notes

event | Event | Event Object |

Return type

(empty response body)

Authorization

personalAccessToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ExtDeviceSessionClose

ExtDeviceSessionClose(ctx, productUID, deviceUID).DeviceSession(deviceSession).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/blues/notehub-go"
)

func main() {
	productUID := "com.blues.bridge:sensors" // string |
	deviceUID := "dev:000000000000000" // string |
	deviceSession := *openapiclient.NewDeviceSession() // DeviceSession | Session Object

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.ExternalDevicesAPI.ExtDeviceSessionClose(context.Background(), productUID, deviceUID).DeviceSession(deviceSession).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ExternalDevicesAPI.ExtDeviceSessionClose``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
productUID string
deviceUID string

Other Parameters

Other parameters are passed through a pointer to a apiExtDeviceSessionCloseRequest struct via the builder pattern

Name Type Description Notes

deviceSession | DeviceSession | Session Object |

Return type

(empty response body)

Authorization

personalAccessToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ExtDeviceSessionOpen

ExtDeviceSessionOpen(ctx, productUID, deviceUID).DeviceSession(deviceSession).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/blues/notehub-go"
)

func main() {
	productUID := "com.blues.bridge:sensors" // string |
	deviceUID := "dev:000000000000000" // string |
	deviceSession := *openapiclient.NewDeviceSession() // DeviceSession | Session Object

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.ExternalDevicesAPI.ExtDeviceSessionOpen(context.Background(), productUID, deviceUID).DeviceSession(deviceSession).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ExternalDevicesAPI.ExtDeviceSessionOpen``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
productUID string
deviceUID string

Other Parameters

Other parameters are passed through a pointer to a apiExtDeviceSessionOpenRequest struct via the builder pattern

Name Type Description Notes

deviceSession | DeviceSession | Session Object |

Return type

(empty response body)

Authorization

personalAccessToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]