Skip to content

Latest commit

 

History

History
154 lines (98 loc) · 4.84 KB

WidgetsAPI.md

File metadata and controls

154 lines (98 loc) · 4.84 KB

\WidgetsAPI

All URIs are relative to https://name.eliona.io/v2

Method HTTP request Description
GetDashboardWidgets Get /dashboards/{dashboard-id}/widgets Information about widgets on dashboard
PostDashboardWidget Post /dashboards/{dashboard-id}/widgets Adds widget to dashboard

GetDashboardWidgets

Widget GetDashboardWidgets(ctx, dashboardId).Expansions(expansions).Execute()

Information about widgets on dashboard

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	dashboardId := int32(4711) // int32 | The id of the dashboard
	expansions := []string{"Inner_example"} // []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.WidgetsAPI.GetDashboardWidgets(context.Background(), dashboardId).Expansions(expansions).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `WidgetsAPI.GetDashboardWidgets``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetDashboardWidgets`: Widget
	fmt.Fprintf(os.Stdout, "Response from `WidgetsAPI.GetDashboardWidgets`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
dashboardId int32 The id of the dashboard

Other Parameters

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

Name Type Description Notes

expansions | []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. |

Return type

Widget

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

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

PostDashboardWidget

PostDashboardWidget(ctx, dashboardId).Widget(widget).Expansions(expansions).Execute()

Adds widget to dashboard

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	dashboardId := int32(4711) // int32 | The id of the dashboard
	widget := *openapiclient.NewWidget("Weather") // Widget | 
	expansions := []string{"Inner_example"} // []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.WidgetsAPI.PostDashboardWidget(context.Background(), dashboardId).Widget(widget).Expansions(expansions).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `WidgetsAPI.PostDashboardWidget``: %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.
dashboardId int32 The id of the dashboard

Other Parameters

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

Name Type Description Notes

widget | Widget | | expansions | []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. |

Return type

(empty response body)

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

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