Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

bitbucket.org/bactosense/bactocloud-api-client

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitbucket.org/bactosense/bactocloud-api-client


Version published
Created

Go API client for bactocloud_client

This is the backend API documentation.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 0.1
  • Package version: 1.0.0
  • Generator version: 7.8.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://www.bnovate.com

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import bactocloud_client "bitbucket.org/bactosense/bactocloud-api-client"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value bactocloud_client.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), bactocloud_client.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value bactocloud_client.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), bactocloud_client.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using bactocloud_client.ContextOperationServerIndices and bactocloud_client.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), bactocloud_client.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), bactocloud_client.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://apitest.bactocloud.com

ClassMethodHTTP requestDescription
AdminAPIAdminDeviceAddPostPost /admin/device/addAdd a new device
AdminAPIAdminPostPost /adminAdmin Actions
AdminAPIAdminSystemGetGet /admin/systemGet the system info of the server
AdminAPIAdminUserGetGet /admin/userGet all users
ApiAPIHelloGetGet /helloHello
ApiAPIIotV1CommandAcknowledgePutPut /iot/v1/command/acknowledgeAcknowledge command execution WIP
ApiAPIIotV1CommandGetGet /iot/v1/commandPoll commands
ApiAPIIotV1ConfigPutPut /iot/v1/configUpdate device configuration
ApiAPIIotV1DataPostPost /iot/v1/dataAdd device data
ApiAPIIotV1EnrollDeleteDelete /iot/v1/enrollUnenroll device
ApiAPIIotV1EnrollPostPost /iot/v1/enrollEnroll device
ApiAPIIotV1HelloGetGet /iot/v1/helloHello
ApiAPIIotV1OrganizationGetGet /iot/v1/organizationGet organization
ApiAPIIotV1StatusPostPost /iot/v1/statusAdd device status
AuthAPIGenerateTotpPostPost /generate_totpTOTP Generate
AuthAPIGoogleCallbackGetGet /google/callbackGoogle Callback WIP
AuthAPIGoogleLoginGetGet /google/loginGoogle Login WIP
AuthAPILoginPostPost /loginLogin workflow with TOTP
AuthAPIVerifyTotpPostPost /verify_totpTOTP Set Verified Flag
DataAPIComputationPostPost /computationAdd a computation to the database
DataAPIDataExportPostPost /data/exportExport data from the database
DataAPIDataFcsFileIdGetGet /data/fcs/{file_id}Retrieves an FCS stream as an array of floats
DataAPIDataFileFileIdGetGet /data/file/{file_id}Get a file from a data point
DataAPIDataIdGetGet /data/{id}Get a single data point with all config
DataAPIDataListPostPost /data/listGet data for a list of devices, filtered by the request body.
DataAPIDataPatchPatch /data/Edit a data point
DeviceAPIDeviceCommandCommandIdDeleteDelete /device/command/{command_id}Cancel a command in the database.
DeviceAPIDeviceCommandDeviceIdGetGet /device/command/{device_id}gets the list of commands for a specified connected user. Limits the commands to a default value (for example 100 results) per device.
DeviceAPIDeviceCommandPostPost /device/commandAdd a new command
DeviceAPIDeviceDataBucketDeviceIdGetGet /device/data/{bucket}/{device_id}Get data for only a device, only the last with a limit
DeviceAPIDeviceGetGet /device
DeviceAPIDeviceIdDeleteDelete /device/{id}Unenroll a device from the database
DeviceAPIDevicePackageDeviceIdActivationCodeGetGet /device/package/{device_id}/{activation_code}Test the activation code
DeviceAPIDevicePatchPatch /deviceEdit a device in the database, not in the device itself
DeviceAPIDeviceStatusIdLimitGetGet /device/status/{id}/{limit}Get a number of last status for a device
LoginAPIConfirmPasswordForgottenPostPost /confirm_password_forgottenConfirm Password Forgotten
LoginAPIRequestPasswordForgottenPostPost /request_password_forgottenPassword Forgotten
OrganizationAPIOrganizationApikeyPostPost /organization/apikeyAdd Organization API Key
OrganizationAPIOrganizationDeleteDelete /organizationDeleteOrganizationHandler
OrganizationAPIOrganizationDeviceGetGet /organization/deviceGetOrganizationDevicesHandler gets the devices of the organization
OrganizationAPIOrganizationEditPutPut /organization/editEditOrganizationHandler
OrganizationAPIOrganizationEnrollIdDeleteDelete /organization/enroll/{id}DeleteEnrollCodeHandler
OrganizationAPIOrganizationEnrollPostPost /organization/enrollCreateEnrollCodeHandler
OrganizationAPIOrganizationGetGet /organizationGetOrganizationHandler gets the organization
OrganizationAPIOrganizationInviteCodeDeleteDelete /organization/invite/{code}Delete Organization Invite
OrganizationAPIOrganizationInviteCodeGetGet /organization/invite/{code}Accept Organization Invite
OrganizationAPIOrganizationInvitePostPost /organization/inviteSend Organization Invite
OrganizationAPIOrganizationLeaveDeleteDelete /organization/leaveLeave Organization
OrganizationAPIOrganizationPostPost /organizationcreates a new organization
OrganizationAPIOrganizationUserUserIdDeleteDelete /organization/user/{user_id}Exclude Organization User
PermissionsAPIPermissionGetGet /permissionGet all permissions
PermissionsAPIPermissionTreeGetGet /permission/treeGet permission tree by roles
PermissionsAPIRoleAddPostPost /role/addAdd a new role WIP
PermissionsAPIUserUserIdRoleRoleIdPutPut /user/{user_id}/role/{role_id}Assign a role to a user WIP
UserAPIRegisterPostPost /registerRegister
UserAPIUserConfirmPasswordResetPostPost /user/confirm_password_resetConfirm Password Reset
UserAPIUserGetGet /userGet User
UserAPIUserPutPut /userModify User
UserAPIUserRequestPasswordResetPostPost /user/request_password_resetChange Password
UserAPIUserRequestSalesPostPost /user/request_salesRequest Sales
UserAPIVerifyEmailPostPost /verify_emailVerify Email
WsAPIWsAuthGetGet /ws/authWebSocket authentication
WsAPIWsGetGet /wsWebSocket

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

BactosenseApiKey

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		bactocloud_client.ContextAPIKeys,
		map[string]bactocloud_client.APIKey{
			"Authorization": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

JWT

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		bactocloud_client.ContextAPIKeys,
		map[string]bactocloud_client.APIKey{
			"Authorization": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

SymmetricalKeyAuth

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: X-API-Key and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		bactocloud_client.ContextAPIKeys,
		map[string]bactocloud_client.APIKey{
			"X-API-Key": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

adrian.shajkofci@bnovate.com

FAQs

Package last updated on 20 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts