losant_rest 1.12.0 → 1.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/docs/_schemas.md +17509 -8097
- data/docs/application.md +6 -6
- data/docs/applicationApiTokens.md +1 -1
- data/docs/applications.md +1 -1
- data/docs/dataTable.md +1 -1
- data/docs/dataTableRows.md +1 -1
- data/docs/dataTables.md +1 -1
- data/docs/device.md +43 -0
- data/docs/devices.md +41 -2
- data/docs/edgeDeployment.md +49 -0
- data/docs/events.md +3 -3
- data/docs/experience.md +1 -1
- data/docs/experienceDomains.md +1 -1
- data/docs/experienceGroup.md +2 -0
- data/docs/experienceSlugs.md +1 -1
- data/docs/experienceVersion.md +3 -3
- data/docs/experienceVersions.md +2 -2
- data/docs/experienceView.md +4 -4
- data/docs/experienceViews.md +2 -2
- data/docs/file.md +5 -5
- data/docs/files.md +2 -2
- data/docs/flow.md +41 -0
- data/docs/flowVersions.md +44 -0
- data/docs/instance.md +168 -0
- data/docs/instanceApiToken.md +133 -0
- data/docs/instanceApiTokens.md +91 -0
- data/docs/instanceMember.md +133 -0
- data/docs/instanceMembers.md +91 -0
- data/docs/instanceOrg.md +135 -0
- data/docs/instanceOrgInvite.md +139 -0
- data/docs/instanceOrgInvites.md +96 -0
- data/docs/instanceOrgMember.md +139 -0
- data/docs/instanceOrgMembers.md +96 -0
- data/docs/instanceOrgs.md +91 -0
- data/docs/instances.md +50 -0
- data/docs/me.md +1 -1
- data/docs/org.md +1 -1
- data/docs/userApiToken.md +125 -0
- data/docs/userApiTokens.md +87 -0
- data/lib/losant_rest/application.rb +7 -7
- data/lib/losant_rest/application_api_token.rb +1 -1
- data/lib/losant_rest/application_api_tokens.rb +2 -2
- data/lib/losant_rest/application_certificate.rb +1 -1
- data/lib/losant_rest/application_certificate_authorities.rb +1 -1
- data/lib/losant_rest/application_certificate_authority.rb +1 -1
- data/lib/losant_rest/application_certificates.rb +1 -1
- data/lib/losant_rest/application_dashboard.rb +1 -1
- data/lib/losant_rest/application_dashboards.rb +1 -1
- data/lib/losant_rest/application_key.rb +1 -1
- data/lib/losant_rest/application_keys.rb +1 -1
- data/lib/losant_rest/application_template.rb +1 -1
- data/lib/losant_rest/application_templates.rb +1 -1
- data/lib/losant_rest/applications.rb +2 -2
- data/lib/losant_rest/audit_log.rb +1 -1
- data/lib/losant_rest/audit_logs.rb +1 -1
- data/lib/losant_rest/auth.rb +1 -1
- data/lib/losant_rest/client.rb +63 -3
- data/lib/losant_rest/dashboard.rb +1 -1
- data/lib/losant_rest/dashboards.rb +1 -1
- data/lib/losant_rest/data.rb +1 -1
- data/lib/losant_rest/data_table.rb +2 -2
- data/lib/losant_rest/data_table_row.rb +1 -1
- data/lib/losant_rest/data_table_rows.rb +2 -2
- data/lib/losant_rest/data_tables.rb +2 -2
- data/lib/losant_rest/device.rb +51 -1
- data/lib/losant_rest/device_recipe.rb +1 -1
- data/lib/losant_rest/device_recipes.rb +1 -1
- data/lib/losant_rest/devices.rb +49 -3
- data/lib/losant_rest/edge_deployment.rb +81 -0
- data/lib/losant_rest/edge_deployments.rb +1 -1
- data/lib/losant_rest/error.rb +1 -1
- data/lib/losant_rest/event.rb +1 -1
- data/lib/losant_rest/events.rb +4 -4
- data/lib/losant_rest/experience.rb +2 -2
- data/lib/losant_rest/experience_domain.rb +1 -1
- data/lib/losant_rest/experience_domains.rb +2 -2
- data/lib/losant_rest/experience_endpoint.rb +1 -1
- data/lib/losant_rest/experience_endpoints.rb +1 -1
- data/lib/losant_rest/experience_group.rb +5 -1
- data/lib/losant_rest/experience_groups.rb +1 -1
- data/lib/losant_rest/experience_slug.rb +1 -1
- data/lib/losant_rest/experience_slugs.rb +2 -2
- data/lib/losant_rest/experience_user.rb +1 -1
- data/lib/losant_rest/experience_users.rb +1 -1
- data/lib/losant_rest/experience_version.rb +4 -4
- data/lib/losant_rest/experience_versions.rb +3 -3
- data/lib/losant_rest/experience_view.rb +5 -5
- data/lib/losant_rest/experience_views.rb +3 -3
- data/lib/losant_rest/file.rb +5 -5
- data/lib/losant_rest/files.rb +3 -3
- data/lib/losant_rest/flow.rb +47 -1
- data/lib/losant_rest/flow_version.rb +1 -1
- data/lib/losant_rest/flow_versions.rb +51 -1
- data/lib/losant_rest/flows.rb +1 -1
- data/lib/losant_rest/instance.rb +227 -0
- data/lib/losant_rest/instance_api_token.rb +176 -0
- data/lib/losant_rest/instance_api_tokens.rb +136 -0
- data/lib/losant_rest/instance_member.rb +176 -0
- data/lib/losant_rest/instance_members.rb +134 -0
- data/lib/losant_rest/instance_org.rb +180 -0
- data/lib/losant_rest/instance_org_invite.rb +182 -0
- data/lib/losant_rest/instance_org_invites.rb +138 -0
- data/lib/losant_rest/instance_org_member.rb +182 -0
- data/lib/losant_rest/instance_org_members.rb +138 -0
- data/lib/losant_rest/instance_orgs.rb +139 -0
- data/lib/losant_rest/instances.rb +88 -0
- data/lib/losant_rest/integration.rb +1 -1
- data/lib/losant_rest/integrations.rb +1 -1
- data/lib/losant_rest/me.rb +2 -2
- data/lib/losant_rest/notebook.rb +1 -1
- data/lib/losant_rest/notebooks.rb +1 -1
- data/lib/losant_rest/org.rb +2 -2
- data/lib/losant_rest/org_invites.rb +1 -1
- data/lib/losant_rest/orgs.rb +1 -1
- data/lib/losant_rest/user_api_token.rb +170 -0
- data/lib/losant_rest/user_api_tokens.rb +132 -0
- data/lib/losant_rest/utils.rb +1 -1
- data/lib/losant_rest/version.rb +2 -2
- data/lib/losant_rest/webhook.rb +1 -1
- data/lib/losant_rest/webhooks.rb +1 -1
- data/lib/losant_rest.rb +16 -1
- data/schemas/advancedDeviceQuery.json +309 -0
- data/schemas/apiToken.json +2 -1
- data/schemas/apiTokenPost.json +431 -0
- data/schemas/apiTokens.json +4 -2
- data/schemas/applicationApiTokenPost.json +1 -0
- data/schemas/applicationDashboardPost.json +39 -17
- data/schemas/auditLog.json +4 -0
- data/schemas/auditLogFilter.json +4 -0
- data/schemas/auditLogs.json +4 -0
- data/schemas/bulkDeleteResponse.json +12 -0
- data/schemas/dashboard.json +39 -17
- data/schemas/dashboardPatch.json +39 -17
- data/schemas/dashboardPost.json +39 -17
- data/schemas/dashboardSendReport.json +4 -0
- data/schemas/dashboards.json +39 -17
- data/schemas/dataTableRowsDelete.json +1 -1
- data/schemas/devicePayloadCounts.json +24 -0
- data/schemas/devicesDeletePost.json +309 -0
- data/schemas/devicesExportPayloadCountPost.json +1350 -0
- data/schemas/devicesExportPost.json +309 -0
- data/schemas/devicesPatch.json +309 -0
- data/schemas/devicesRemoveDataPost.json +309 -0
- data/schemas/edgeDeployment.json +16 -0
- data/schemas/edgeDeployments.json +16 -0
- data/schemas/eventsDeleted.json +1 -1
- data/schemas/experienceGroup.json +6 -0
- data/schemas/experienceGroups.json +6 -0
- data/schemas/experienceLinkedResources.json +381 -6
- data/schemas/filePost.json +8 -2
- data/schemas/flow.json +127 -2
- data/schemas/flowPatch.json +127 -2
- data/schemas/flowPost.json +127 -2
- data/schemas/flowStorageMetadata.json +13 -0
- data/schemas/flowVersion.json +254 -4
- data/schemas/flowVersionPost.json +127 -2
- data/schemas/flowVersions.json +254 -4
- data/schemas/flowVersionsDeletePost.json +941 -0
- data/schemas/flows.json +127 -2
- data/schemas/flowsImportPost.json +254 -4
- data/schemas/flowsImportResult.json +381 -6
- data/schemas/githubLogin.json +64 -11
- data/schemas/historicalSummaries.json +43 -0
- data/schemas/historicalSummary.json +490 -0
- data/schemas/instance.json +60 -0
- data/schemas/instanceMember.json +41 -0
- data/schemas/instanceMemberPatch.json +17 -0
- data/schemas/instanceMemberPost.json +37 -0
- data/schemas/instanceMembers.json +77 -0
- data/schemas/instanceOrg.json +14 -0
- data/schemas/instanceOrgMember.json +45 -0
- data/schemas/instanceOrgMemberPatch.json +69 -0
- data/schemas/instanceOrgMemberPost.json +161 -0
- data/schemas/instanceOrgMembers.json +42 -0
- data/schemas/instanceOrgPatch.json +19 -0
- data/schemas/instanceOrgPost.json +177 -0
- data/schemas/instanceOrgs.json +18 -0
- data/schemas/instancePatch.json +67 -0
- data/schemas/instanceReportOptionsPost.json +41 -0
- data/schemas/me.json +30 -14
- data/schemas/multiDeviceCommand.json +309 -0
- data/schemas/notebook.json +45 -0
- data/schemas/notebookPatch.json +30 -0
- data/schemas/notebookPost.json +30 -0
- data/schemas/notebooks.json +45 -0
- data/schemas/org.json +30 -14
- data/schemas/orgInvite.json +90 -0
- data/schemas/orgInviteCollection.json +130 -0
- data/schemas/orgInvites.json +82 -77
- data/schemas/orgPatch.json +0 -9
- data/schemas/orgRoleInfo.json +69 -0
- data/schemas/orgs.json +30 -14
- data/schemas/payloadStats.json +126 -0
- data/schemas/userCredentials.json +64 -11
- data/schemas/userPost.json +64 -11
- data/schemas/validateContextError.json +34 -0
- data/schemas/validateContextSuccess.json +34 -0
- data/schemas/virtualButtonPress.json +4 -0
- metadata +55 -3
data/lib/losant_rest/orgs.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# The MIT License (MIT)
|
2
2
|
#
|
3
|
-
# Copyright (c)
|
3
|
+
# Copyright (c) 2021 Losant IoT, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -0,0 +1,170 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2021 Losant IoT, Inc.
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
require "json"
|
24
|
+
|
25
|
+
module LosantRest
|
26
|
+
|
27
|
+
# Class containing all the actions for the User Api Token Resource
|
28
|
+
class UserApiToken
|
29
|
+
|
30
|
+
def initialize(client)
|
31
|
+
@client = client
|
32
|
+
end
|
33
|
+
|
34
|
+
# Deletes an API Token
|
35
|
+
#
|
36
|
+
# Authentication:
|
37
|
+
# The client must be configured with a valid api
|
38
|
+
# access token to call this action. The token
|
39
|
+
# must include at least one of the following scopes:
|
40
|
+
# all.User, userApiToken.*, or userApiToken.delete.
|
41
|
+
#
|
42
|
+
# Parameters:
|
43
|
+
# * {string} apiTokenId - ID associated with the API token
|
44
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
45
|
+
# * {boolean} _actions - Return resource actions in response
|
46
|
+
# * {boolean} _links - Return resource link in response
|
47
|
+
# * {boolean} _embedded - Return embedded resources in response
|
48
|
+
#
|
49
|
+
# Responses:
|
50
|
+
# * 200 - If API token was successfully deleted (https://api.losant.com/#/definitions/success)
|
51
|
+
#
|
52
|
+
# Errors:
|
53
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
54
|
+
# * 404 - Error if API token was not found (https://api.losant.com/#/definitions/error)
|
55
|
+
def delete(params = {})
|
56
|
+
params = Utils.symbolize_hash_keys(params)
|
57
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
58
|
+
headers = {}
|
59
|
+
body = nil
|
60
|
+
|
61
|
+
raise ArgumentError.new("apiTokenId is required") unless params.has_key?(:apiTokenId)
|
62
|
+
|
63
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
64
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
65
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
66
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
67
|
+
|
68
|
+
path = "/me/tokens/#{params[:apiTokenId]}"
|
69
|
+
|
70
|
+
@client.request(
|
71
|
+
method: :delete,
|
72
|
+
path: path,
|
73
|
+
query: query_params,
|
74
|
+
headers: headers,
|
75
|
+
body: body)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Retrieves information on an API token
|
79
|
+
#
|
80
|
+
# Authentication:
|
81
|
+
# The client must be configured with a valid api
|
82
|
+
# access token to call this action. The token
|
83
|
+
# must include at least one of the following scopes:
|
84
|
+
# all.User, all.User.read, userApiToken.*, or userApiToken.get.
|
85
|
+
#
|
86
|
+
# Parameters:
|
87
|
+
# * {string} apiTokenId - ID associated with the API token
|
88
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
89
|
+
# * {boolean} _actions - Return resource actions in response
|
90
|
+
# * {boolean} _links - Return resource link in response
|
91
|
+
# * {boolean} _embedded - Return embedded resources in response
|
92
|
+
#
|
93
|
+
# Responses:
|
94
|
+
# * 200 - API token information (https://api.losant.com/#/definitions/apiToken)
|
95
|
+
#
|
96
|
+
# Errors:
|
97
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
98
|
+
# * 404 - Error if API token was not found (https://api.losant.com/#/definitions/error)
|
99
|
+
def get(params = {})
|
100
|
+
params = Utils.symbolize_hash_keys(params)
|
101
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
102
|
+
headers = {}
|
103
|
+
body = nil
|
104
|
+
|
105
|
+
raise ArgumentError.new("apiTokenId is required") unless params.has_key?(:apiTokenId)
|
106
|
+
|
107
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
108
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
109
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
110
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
111
|
+
|
112
|
+
path = "/me/tokens/#{params[:apiTokenId]}"
|
113
|
+
|
114
|
+
@client.request(
|
115
|
+
method: :get,
|
116
|
+
path: path,
|
117
|
+
query: query_params,
|
118
|
+
headers: headers,
|
119
|
+
body: body)
|
120
|
+
end
|
121
|
+
|
122
|
+
# Updates information about an API token
|
123
|
+
#
|
124
|
+
# Authentication:
|
125
|
+
# The client must be configured with a valid api
|
126
|
+
# access token to call this action. The token
|
127
|
+
# must include at least one of the following scopes:
|
128
|
+
# all.User, userApiToken.*, or userApiToken.patch.
|
129
|
+
#
|
130
|
+
# Parameters:
|
131
|
+
# * {string} apiTokenId - ID associated with the API token
|
132
|
+
# * {hash} apiToken - Object containing new properties of the API token (https://api.losant.com/#/definitions/apiTokenPatch)
|
133
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
134
|
+
# * {boolean} _actions - Return resource actions in response
|
135
|
+
# * {boolean} _links - Return resource link in response
|
136
|
+
# * {boolean} _embedded - Return embedded resources in response
|
137
|
+
#
|
138
|
+
# Responses:
|
139
|
+
# * 200 - Updated API token information (https://api.losant.com/#/definitions/apiToken)
|
140
|
+
#
|
141
|
+
# Errors:
|
142
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
143
|
+
# * 404 - Error if API token was not found (https://api.losant.com/#/definitions/error)
|
144
|
+
def patch(params = {})
|
145
|
+
params = Utils.symbolize_hash_keys(params)
|
146
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
147
|
+
headers = {}
|
148
|
+
body = nil
|
149
|
+
|
150
|
+
raise ArgumentError.new("apiTokenId is required") unless params.has_key?(:apiTokenId)
|
151
|
+
raise ArgumentError.new("apiToken is required") unless params.has_key?(:apiToken)
|
152
|
+
|
153
|
+
body = params[:apiToken] if params.has_key?(:apiToken)
|
154
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
155
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
156
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
157
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
158
|
+
|
159
|
+
path = "/me/tokens/#{params[:apiTokenId]}"
|
160
|
+
|
161
|
+
@client.request(
|
162
|
+
method: :patch,
|
163
|
+
path: path,
|
164
|
+
query: query_params,
|
165
|
+
headers: headers,
|
166
|
+
body: body)
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
170
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2021 Losant IoT, Inc.
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
require "json"
|
24
|
+
|
25
|
+
module LosantRest
|
26
|
+
|
27
|
+
# Class containing all the actions for the User Api Tokens Resource
|
28
|
+
class UserApiTokens
|
29
|
+
|
30
|
+
def initialize(client)
|
31
|
+
@client = client
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns the API tokens for a user
|
35
|
+
#
|
36
|
+
# Authentication:
|
37
|
+
# The client must be configured with a valid api
|
38
|
+
# access token to call this action. The token
|
39
|
+
# must include at least one of the following scopes:
|
40
|
+
# all.User, all.User.read, userApiTokens.*, or userApiTokens.get.
|
41
|
+
#
|
42
|
+
# Parameters:
|
43
|
+
# * {string} sortField - Field to sort the results by. Accepted values are: name, status, id, creationDate, lastUpdated, expirationDate
|
44
|
+
# * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
|
45
|
+
# * {string} page - Which page of results to return
|
46
|
+
# * {string} perPage - How many items to return per page
|
47
|
+
# * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name, status
|
48
|
+
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
|
49
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
50
|
+
# * {boolean} _actions - Return resource actions in response
|
51
|
+
# * {boolean} _links - Return resource link in response
|
52
|
+
# * {boolean} _embedded - Return embedded resources in response
|
53
|
+
#
|
54
|
+
# Responses:
|
55
|
+
# * 200 - Collection of API tokens (https://api.losant.com/#/definitions/apiToken)
|
56
|
+
#
|
57
|
+
# Errors:
|
58
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
59
|
+
def get(params = {})
|
60
|
+
params = Utils.symbolize_hash_keys(params)
|
61
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
62
|
+
headers = {}
|
63
|
+
body = nil
|
64
|
+
|
65
|
+
|
66
|
+
query_params[:sortField] = params[:sortField] if params.has_key?(:sortField)
|
67
|
+
query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
|
68
|
+
query_params[:page] = params[:page] if params.has_key?(:page)
|
69
|
+
query_params[:perPage] = params[:perPage] if params.has_key?(:perPage)
|
70
|
+
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
|
71
|
+
query_params[:filter] = params[:filter] if params.has_key?(:filter)
|
72
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
73
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
74
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
75
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
76
|
+
|
77
|
+
path = "/me/tokens"
|
78
|
+
|
79
|
+
@client.request(
|
80
|
+
method: :get,
|
81
|
+
path: path,
|
82
|
+
query: query_params,
|
83
|
+
headers: headers,
|
84
|
+
body: body)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Create a new API token for an user
|
88
|
+
#
|
89
|
+
# Authentication:
|
90
|
+
# The client must be configured with a valid api
|
91
|
+
# access token to call this action. The token
|
92
|
+
# must include at least one of the following scopes:
|
93
|
+
# all.User, userApiTokens.*, or userApiTokens.post.
|
94
|
+
#
|
95
|
+
# Parameters:
|
96
|
+
# * {hash} apiToken - API token information (https://api.losant.com/#/definitions/apiTokenPost)
|
97
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
98
|
+
# * {boolean} _actions - Return resource actions in response
|
99
|
+
# * {boolean} _links - Return resource link in response
|
100
|
+
# * {boolean} _embedded - Return embedded resources in response
|
101
|
+
#
|
102
|
+
# Responses:
|
103
|
+
# * 201 - The successfully created API token (https://api.losant.com/#/definitions/apiToken)
|
104
|
+
#
|
105
|
+
# Errors:
|
106
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
107
|
+
def post(params = {})
|
108
|
+
params = Utils.symbolize_hash_keys(params)
|
109
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
110
|
+
headers = {}
|
111
|
+
body = nil
|
112
|
+
|
113
|
+
raise ArgumentError.new("apiToken is required") unless params.has_key?(:apiToken)
|
114
|
+
|
115
|
+
body = params[:apiToken] if params.has_key?(:apiToken)
|
116
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
117
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
118
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
119
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
120
|
+
|
121
|
+
path = "/me/tokens"
|
122
|
+
|
123
|
+
@client.request(
|
124
|
+
method: :post,
|
125
|
+
path: path,
|
126
|
+
query: query_params,
|
127
|
+
headers: headers,
|
128
|
+
body: body)
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
132
|
+
end
|
data/lib/losant_rest/utils.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# The MIT License (MIT)
|
2
2
|
#
|
3
|
-
# Copyright (c)
|
3
|
+
# Copyright (c) 2021 Losant IoT, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the "Software"), to deal
|
data/lib/losant_rest/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# The MIT License (MIT)
|
2
2
|
#
|
3
|
-
# Copyright (c)
|
3
|
+
# Copyright (c) 2021 Losant IoT, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -21,5 +21,5 @@
|
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
23
|
module LosantRest
|
24
|
-
VERSION = "1.
|
24
|
+
VERSION = "1.14.1"
|
25
25
|
end
|
data/lib/losant_rest/webhook.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# The MIT License (MIT)
|
2
2
|
#
|
3
|
-
# Copyright (c)
|
3
|
+
# Copyright (c) 2021 Losant IoT, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the "Software"), to deal
|
data/lib/losant_rest/webhooks.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# The MIT License (MIT)
|
2
2
|
#
|
3
|
-
# Copyright (c)
|
3
|
+
# Copyright (c) 2021 Losant IoT, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the "Software"), to deal
|
data/lib/losant_rest.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# The MIT License (MIT)
|
2
2
|
#
|
3
|
-
# Copyright (c)
|
3
|
+
# Copyright (c) 2021 Losant IoT, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -51,6 +51,7 @@ require_relative "losant_rest/device"
|
|
51
51
|
require_relative "losant_rest/device_recipe"
|
52
52
|
require_relative "losant_rest/device_recipes"
|
53
53
|
require_relative "losant_rest/devices"
|
54
|
+
require_relative "losant_rest/edge_deployment"
|
54
55
|
require_relative "losant_rest/edge_deployments"
|
55
56
|
require_relative "losant_rest/event"
|
56
57
|
require_relative "losant_rest/events"
|
@@ -75,6 +76,18 @@ require_relative "losant_rest/flow"
|
|
75
76
|
require_relative "losant_rest/flow_version"
|
76
77
|
require_relative "losant_rest/flow_versions"
|
77
78
|
require_relative "losant_rest/flows"
|
79
|
+
require_relative "losant_rest/instance"
|
80
|
+
require_relative "losant_rest/instance_api_token"
|
81
|
+
require_relative "losant_rest/instance_api_tokens"
|
82
|
+
require_relative "losant_rest/instance_member"
|
83
|
+
require_relative "losant_rest/instance_members"
|
84
|
+
require_relative "losant_rest/instance_org"
|
85
|
+
require_relative "losant_rest/instance_org_invite"
|
86
|
+
require_relative "losant_rest/instance_org_invites"
|
87
|
+
require_relative "losant_rest/instance_org_member"
|
88
|
+
require_relative "losant_rest/instance_org_members"
|
89
|
+
require_relative "losant_rest/instance_orgs"
|
90
|
+
require_relative "losant_rest/instances"
|
78
91
|
require_relative "losant_rest/integration"
|
79
92
|
require_relative "losant_rest/integrations"
|
80
93
|
require_relative "losant_rest/me"
|
@@ -83,6 +96,8 @@ require_relative "losant_rest/notebooks"
|
|
83
96
|
require_relative "losant_rest/org"
|
84
97
|
require_relative "losant_rest/org_invites"
|
85
98
|
require_relative "losant_rest/orgs"
|
99
|
+
require_relative "losant_rest/user_api_token"
|
100
|
+
require_relative "losant_rest/user_api_tokens"
|
86
101
|
require_relative "losant_rest/webhook"
|
87
102
|
require_relative "losant_rest/webhooks"
|
88
103
|
require_relative "losant_rest/client"
|
@@ -1012,6 +1012,315 @@
|
|
1012
1012
|
"additionalProperties": false
|
1013
1013
|
}
|
1014
1014
|
]
|
1015
|
+
},
|
1016
|
+
"disconnectedAt": {
|
1017
|
+
"oneOf": [
|
1018
|
+
{
|
1019
|
+
"type": [
|
1020
|
+
"string",
|
1021
|
+
"number",
|
1022
|
+
"boolean",
|
1023
|
+
"null"
|
1024
|
+
]
|
1025
|
+
},
|
1026
|
+
{
|
1027
|
+
"type": "object",
|
1028
|
+
"properties": {
|
1029
|
+
"$eq": {
|
1030
|
+
"type": [
|
1031
|
+
"string",
|
1032
|
+
"number",
|
1033
|
+
"boolean",
|
1034
|
+
"null"
|
1035
|
+
]
|
1036
|
+
},
|
1037
|
+
"$ne": {
|
1038
|
+
"type": [
|
1039
|
+
"string",
|
1040
|
+
"number",
|
1041
|
+
"boolean",
|
1042
|
+
"null"
|
1043
|
+
]
|
1044
|
+
},
|
1045
|
+
"$gt": {
|
1046
|
+
"type": [
|
1047
|
+
"string",
|
1048
|
+
"number",
|
1049
|
+
"boolean",
|
1050
|
+
"null"
|
1051
|
+
]
|
1052
|
+
},
|
1053
|
+
"$lt": {
|
1054
|
+
"type": [
|
1055
|
+
"string",
|
1056
|
+
"number",
|
1057
|
+
"boolean",
|
1058
|
+
"null"
|
1059
|
+
]
|
1060
|
+
},
|
1061
|
+
"$gte": {
|
1062
|
+
"type": [
|
1063
|
+
"string",
|
1064
|
+
"number",
|
1065
|
+
"boolean",
|
1066
|
+
"null"
|
1067
|
+
]
|
1068
|
+
},
|
1069
|
+
"$lte": {
|
1070
|
+
"type": [
|
1071
|
+
"string",
|
1072
|
+
"number",
|
1073
|
+
"boolean",
|
1074
|
+
"null"
|
1075
|
+
]
|
1076
|
+
},
|
1077
|
+
"$startsWith": {
|
1078
|
+
"type": "string",
|
1079
|
+
"minLength": 1
|
1080
|
+
},
|
1081
|
+
"$endsWith": {
|
1082
|
+
"type": "string",
|
1083
|
+
"minLength": 1
|
1084
|
+
},
|
1085
|
+
"$contains": {
|
1086
|
+
"type": "string",
|
1087
|
+
"minLength": 1
|
1088
|
+
},
|
1089
|
+
"$ci": {
|
1090
|
+
"type": "boolean"
|
1091
|
+
},
|
1092
|
+
"$in": {
|
1093
|
+
"type": "array",
|
1094
|
+
"maxItems": 100,
|
1095
|
+
"items": {
|
1096
|
+
"type": [
|
1097
|
+
"string",
|
1098
|
+
"number",
|
1099
|
+
"boolean"
|
1100
|
+
]
|
1101
|
+
}
|
1102
|
+
},
|
1103
|
+
"$nin": {
|
1104
|
+
"type": "array",
|
1105
|
+
"maxItems": 100,
|
1106
|
+
"items": {
|
1107
|
+
"type": [
|
1108
|
+
"string",
|
1109
|
+
"number",
|
1110
|
+
"boolean"
|
1111
|
+
]
|
1112
|
+
}
|
1113
|
+
}
|
1114
|
+
},
|
1115
|
+
"additionalProperties": false
|
1116
|
+
}
|
1117
|
+
]
|
1118
|
+
},
|
1119
|
+
"connectedAt": {
|
1120
|
+
"oneOf": [
|
1121
|
+
{
|
1122
|
+
"type": [
|
1123
|
+
"string",
|
1124
|
+
"number",
|
1125
|
+
"boolean",
|
1126
|
+
"null"
|
1127
|
+
]
|
1128
|
+
},
|
1129
|
+
{
|
1130
|
+
"type": "object",
|
1131
|
+
"properties": {
|
1132
|
+
"$eq": {
|
1133
|
+
"type": [
|
1134
|
+
"string",
|
1135
|
+
"number",
|
1136
|
+
"boolean",
|
1137
|
+
"null"
|
1138
|
+
]
|
1139
|
+
},
|
1140
|
+
"$ne": {
|
1141
|
+
"type": [
|
1142
|
+
"string",
|
1143
|
+
"number",
|
1144
|
+
"boolean",
|
1145
|
+
"null"
|
1146
|
+
]
|
1147
|
+
},
|
1148
|
+
"$gt": {
|
1149
|
+
"type": [
|
1150
|
+
"string",
|
1151
|
+
"number",
|
1152
|
+
"boolean",
|
1153
|
+
"null"
|
1154
|
+
]
|
1155
|
+
},
|
1156
|
+
"$lt": {
|
1157
|
+
"type": [
|
1158
|
+
"string",
|
1159
|
+
"number",
|
1160
|
+
"boolean",
|
1161
|
+
"null"
|
1162
|
+
]
|
1163
|
+
},
|
1164
|
+
"$gte": {
|
1165
|
+
"type": [
|
1166
|
+
"string",
|
1167
|
+
"number",
|
1168
|
+
"boolean",
|
1169
|
+
"null"
|
1170
|
+
]
|
1171
|
+
},
|
1172
|
+
"$lte": {
|
1173
|
+
"type": [
|
1174
|
+
"string",
|
1175
|
+
"number",
|
1176
|
+
"boolean",
|
1177
|
+
"null"
|
1178
|
+
]
|
1179
|
+
},
|
1180
|
+
"$startsWith": {
|
1181
|
+
"type": "string",
|
1182
|
+
"minLength": 1
|
1183
|
+
},
|
1184
|
+
"$endsWith": {
|
1185
|
+
"type": "string",
|
1186
|
+
"minLength": 1
|
1187
|
+
},
|
1188
|
+
"$contains": {
|
1189
|
+
"type": "string",
|
1190
|
+
"minLength": 1
|
1191
|
+
},
|
1192
|
+
"$ci": {
|
1193
|
+
"type": "boolean"
|
1194
|
+
},
|
1195
|
+
"$in": {
|
1196
|
+
"type": "array",
|
1197
|
+
"maxItems": 100,
|
1198
|
+
"items": {
|
1199
|
+
"type": [
|
1200
|
+
"string",
|
1201
|
+
"number",
|
1202
|
+
"boolean"
|
1203
|
+
]
|
1204
|
+
}
|
1205
|
+
},
|
1206
|
+
"$nin": {
|
1207
|
+
"type": "array",
|
1208
|
+
"maxItems": 100,
|
1209
|
+
"items": {
|
1210
|
+
"type": [
|
1211
|
+
"string",
|
1212
|
+
"number",
|
1213
|
+
"boolean"
|
1214
|
+
]
|
1215
|
+
}
|
1216
|
+
}
|
1217
|
+
},
|
1218
|
+
"additionalProperties": false
|
1219
|
+
}
|
1220
|
+
]
|
1221
|
+
},
|
1222
|
+
"connectionStatus": {
|
1223
|
+
"oneOf": [
|
1224
|
+
{
|
1225
|
+
"type": [
|
1226
|
+
"string",
|
1227
|
+
"number",
|
1228
|
+
"boolean",
|
1229
|
+
"null"
|
1230
|
+
]
|
1231
|
+
},
|
1232
|
+
{
|
1233
|
+
"type": "object",
|
1234
|
+
"properties": {
|
1235
|
+
"$eq": {
|
1236
|
+
"type": [
|
1237
|
+
"string",
|
1238
|
+
"number",
|
1239
|
+
"boolean",
|
1240
|
+
"null"
|
1241
|
+
]
|
1242
|
+
},
|
1243
|
+
"$ne": {
|
1244
|
+
"type": [
|
1245
|
+
"string",
|
1246
|
+
"number",
|
1247
|
+
"boolean",
|
1248
|
+
"null"
|
1249
|
+
]
|
1250
|
+
},
|
1251
|
+
"$gt": {
|
1252
|
+
"type": [
|
1253
|
+
"string",
|
1254
|
+
"number",
|
1255
|
+
"boolean",
|
1256
|
+
"null"
|
1257
|
+
]
|
1258
|
+
},
|
1259
|
+
"$lt": {
|
1260
|
+
"type": [
|
1261
|
+
"string",
|
1262
|
+
"number",
|
1263
|
+
"boolean",
|
1264
|
+
"null"
|
1265
|
+
]
|
1266
|
+
},
|
1267
|
+
"$gte": {
|
1268
|
+
"type": [
|
1269
|
+
"string",
|
1270
|
+
"number",
|
1271
|
+
"boolean",
|
1272
|
+
"null"
|
1273
|
+
]
|
1274
|
+
},
|
1275
|
+
"$lte": {
|
1276
|
+
"type": [
|
1277
|
+
"string",
|
1278
|
+
"number",
|
1279
|
+
"boolean",
|
1280
|
+
"null"
|
1281
|
+
]
|
1282
|
+
},
|
1283
|
+
"$startsWith": {
|
1284
|
+
"type": "string",
|
1285
|
+
"minLength": 1
|
1286
|
+
},
|
1287
|
+
"$endsWith": {
|
1288
|
+
"type": "string",
|
1289
|
+
"minLength": 1
|
1290
|
+
},
|
1291
|
+
"$contains": {
|
1292
|
+
"type": "string",
|
1293
|
+
"minLength": 1
|
1294
|
+
},
|
1295
|
+
"$ci": {
|
1296
|
+
"type": "boolean"
|
1297
|
+
},
|
1298
|
+
"$in": {
|
1299
|
+
"type": "array",
|
1300
|
+
"maxItems": 100,
|
1301
|
+
"items": {
|
1302
|
+
"type": [
|
1303
|
+
"string",
|
1304
|
+
"number",
|
1305
|
+
"boolean"
|
1306
|
+
]
|
1307
|
+
}
|
1308
|
+
},
|
1309
|
+
"$nin": {
|
1310
|
+
"type": "array",
|
1311
|
+
"maxItems": 100,
|
1312
|
+
"items": {
|
1313
|
+
"type": [
|
1314
|
+
"string",
|
1315
|
+
"number",
|
1316
|
+
"boolean"
|
1317
|
+
]
|
1318
|
+
}
|
1319
|
+
}
|
1320
|
+
},
|
1321
|
+
"additionalProperties": false
|
1322
|
+
}
|
1323
|
+
]
|
1015
1324
|
}
|
1016
1325
|
},
|
1017
1326
|
"additionalProperties": false
|