Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
bitbucket.org/bactosense/bactocloud-api-client
This is the backend API documentation.
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.
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")
Default configuration comes with Servers
field that contains server objects as defined in the OpenAPI specification.
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 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.
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",
},
})
All URIs are relative to http://apitest.bactocloud.com
Class | Method | HTTP request | Description |
---|---|---|---|
AdminAPI | AdminDeviceAddPost | Post /admin/device/add | Add a new device |
AdminAPI | AdminPost | Post /admin | Admin Actions |
AdminAPI | AdminSystemGet | Get /admin/system | Get the system info of the server |
AdminAPI | AdminUserGet | Get /admin/user | Get all users |
ApiAPI | HelloGet | Get /hello | Hello |
ApiAPI | IotV1CommandAcknowledgePut | Put /iot/v1/command/acknowledge | Acknowledge command execution WIP |
ApiAPI | IotV1CommandGet | Get /iot/v1/command | Poll commands |
ApiAPI | IotV1ConfigPut | Put /iot/v1/config | Update device configuration |
ApiAPI | IotV1DataPost | Post /iot/v1/data | Add device data |
ApiAPI | IotV1EnrollDelete | Delete /iot/v1/enroll | Unenroll device |
ApiAPI | IotV1EnrollPost | Post /iot/v1/enroll | Enroll device |
ApiAPI | IotV1HelloGet | Get /iot/v1/hello | Hello |
ApiAPI | IotV1OrganizationGet | Get /iot/v1/organization | Get organization |
ApiAPI | IotV1StatusPost | Post /iot/v1/status | Add device status |
AuthAPI | GenerateTotpPost | Post /generate_totp | TOTP Generate |
AuthAPI | GoogleCallbackGet | Get /google/callback | Google Callback WIP |
AuthAPI | GoogleLoginGet | Get /google/login | Google Login WIP |
AuthAPI | LoginPost | Post /login | Login workflow with TOTP |
AuthAPI | VerifyTotpPost | Post /verify_totp | TOTP Set Verified Flag |
DataAPI | ComputationPost | Post /computation | Add a computation to the database |
DataAPI | DataExportPost | Post /data/export | Export data from the database |
DataAPI | DataFcsFileIdGet | Get /data/fcs/{file_id} | Retrieves an FCS stream as an array of floats |
DataAPI | DataFileFileIdGet | Get /data/file/{file_id} | Get a file from a data point |
DataAPI | DataIdGet | Get /data/{id} | Get a single data point with all config |
DataAPI | DataListPost | Post /data/list | Get data for a list of devices, filtered by the request body. |
DataAPI | DataPatch | Patch /data/ | Edit a data point |
DeviceAPI | DeviceCommandCommandIdDelete | Delete /device/command/{command_id} | Cancel a command in the database. |
DeviceAPI | DeviceCommandDeviceIdGet | Get /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. |
DeviceAPI | DeviceCommandPost | Post /device/command | Add a new command |
DeviceAPI | DeviceDataBucketDeviceIdGet | Get /device/data/{bucket}/{device_id} | Get data for only a device, only the last with a limit |
DeviceAPI | DeviceGet | Get /device | |
DeviceAPI | DeviceIdDelete | Delete /device/{id} | Unenroll a device from the database |
DeviceAPI | DevicePackageDeviceIdActivationCodeGet | Get /device/package/{device_id}/{activation_code} | Test the activation code |
DeviceAPI | DevicePatch | Patch /device | Edit a device in the database, not in the device itself |
DeviceAPI | DeviceStatusIdLimitGet | Get /device/status/{id}/{limit} | Get a number of last status for a device |
LoginAPI | ConfirmPasswordForgottenPost | Post /confirm_password_forgotten | Confirm Password Forgotten |
LoginAPI | RequestPasswordForgottenPost | Post /request_password_forgotten | Password Forgotten |
OrganizationAPI | OrganizationApikeyPost | Post /organization/apikey | Add Organization API Key |
OrganizationAPI | OrganizationDelete | Delete /organization | DeleteOrganizationHandler |
OrganizationAPI | OrganizationDeviceGet | Get /organization/device | GetOrganizationDevicesHandler gets the devices of the organization |
OrganizationAPI | OrganizationEditPut | Put /organization/edit | EditOrganizationHandler |
OrganizationAPI | OrganizationEnrollIdDelete | Delete /organization/enroll/{id} | DeleteEnrollCodeHandler |
OrganizationAPI | OrganizationEnrollPost | Post /organization/enroll | CreateEnrollCodeHandler |
OrganizationAPI | OrganizationGet | Get /organization | GetOrganizationHandler gets the organization |
OrganizationAPI | OrganizationInviteCodeDelete | Delete /organization/invite/{code} | Delete Organization Invite |
OrganizationAPI | OrganizationInviteCodeGet | Get /organization/invite/{code} | Accept Organization Invite |
OrganizationAPI | OrganizationInvitePost | Post /organization/invite | Send Organization Invite |
OrganizationAPI | OrganizationLeaveDelete | Delete /organization/leave | Leave Organization |
OrganizationAPI | OrganizationPost | Post /organization | creates a new organization |
OrganizationAPI | OrganizationUserUserIdDelete | Delete /organization/user/{user_id} | Exclude Organization User |
PermissionsAPI | PermissionGet | Get /permission | Get all permissions |
PermissionsAPI | PermissionTreeGet | Get /permission/tree | Get permission tree by roles |
PermissionsAPI | RoleAddPost | Post /role/add | Add a new role WIP |
PermissionsAPI | UserUserIdRoleRoleIdPut | Put /user/{user_id}/role/{role_id} | Assign a role to a user WIP |
UserAPI | RegisterPost | Post /register | Register |
UserAPI | UserConfirmPasswordResetPost | Post /user/confirm_password_reset | Confirm Password Reset |
UserAPI | UserGet | Get /user | Get User |
UserAPI | UserPut | Put /user | Modify User |
UserAPI | UserRequestPasswordResetPost | Post /user/request_password_reset | Change Password |
UserAPI | UserRequestSalesPost | Post /user/request_sales | Request Sales |
UserAPI | VerifyEmailPost | Post /verify_email | Verify Email |
WsAPI | WsAuthGet | Get /ws/auth | WebSocket authentication |
WsAPI | WsGet | Get /ws | WebSocket |
Authentication schemes defined for the API:
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)
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)
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)
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
FAQs
Unknown package
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.