losant_rest 1.19.4 → 1.19.6
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 +9 -9
- data/docs/_schemas.md +1142 -63
- data/docs/instanceAuditLog.md +49 -0
- data/docs/instanceAuditLogs.md +53 -0
- data/examples/auth.rb +1 -1
- data/examples/list_devices.rb +1 -1
- data/lib/platform_rest/application.rb +1 -1
- data/lib/platform_rest/application_api_token.rb +1 -1
- data/lib/platform_rest/application_api_tokens.rb +1 -1
- data/lib/platform_rest/application_certificate.rb +1 -1
- data/lib/platform_rest/application_certificate_authorities.rb +1 -1
- data/lib/platform_rest/application_certificate_authority.rb +1 -1
- data/lib/platform_rest/application_certificates.rb +1 -1
- data/lib/platform_rest/application_dashboard.rb +1 -1
- data/lib/platform_rest/application_dashboards.rb +1 -1
- data/lib/platform_rest/application_key.rb +1 -1
- data/lib/platform_rest/application_keys.rb +1 -1
- data/lib/platform_rest/application_template.rb +1 -1
- data/lib/platform_rest/application_templates.rb +1 -1
- data/lib/platform_rest/applications.rb +1 -1
- data/lib/platform_rest/audit_log.rb +1 -1
- data/lib/platform_rest/audit_logs.rb +1 -1
- data/lib/platform_rest/auth.rb +1 -1
- data/lib/platform_rest/client.rb +11 -3
- data/lib/platform_rest/credential.rb +1 -1
- data/lib/platform_rest/credentials.rb +1 -1
- data/lib/platform_rest/dashboard.rb +1 -1
- data/lib/platform_rest/dashboards.rb +1 -1
- data/lib/platform_rest/data.rb +1 -1
- data/lib/platform_rest/data_table.rb +1 -1
- data/lib/platform_rest/data_table_row.rb +1 -1
- data/lib/platform_rest/data_table_rows.rb +1 -1
- data/lib/platform_rest/data_tables.rb +1 -1
- data/lib/platform_rest/device.rb +1 -1
- data/lib/platform_rest/device_recipe.rb +1 -1
- data/lib/platform_rest/device_recipes.rb +1 -1
- data/lib/platform_rest/devices.rb +1 -1
- data/lib/platform_rest/edge_deployment.rb +1 -1
- data/lib/platform_rest/edge_deployments.rb +1 -1
- data/lib/platform_rest/embedded_deployment.rb +1 -1
- data/lib/platform_rest/embedded_deployments.rb +1 -1
- data/lib/platform_rest/error.rb +1 -1
- data/lib/platform_rest/event.rb +1 -1
- data/lib/platform_rest/events.rb +1 -1
- data/lib/platform_rest/experience.rb +1 -1
- data/lib/platform_rest/experience_domain.rb +1 -1
- data/lib/platform_rest/experience_domains.rb +1 -1
- data/lib/platform_rest/experience_endpoint.rb +1 -1
- data/lib/platform_rest/experience_endpoints.rb +1 -1
- data/lib/platform_rest/experience_group.rb +1 -1
- data/lib/platform_rest/experience_groups.rb +1 -1
- data/lib/platform_rest/experience_slug.rb +1 -1
- data/lib/platform_rest/experience_slugs.rb +1 -1
- data/lib/platform_rest/experience_user.rb +1 -1
- data/lib/platform_rest/experience_users.rb +1 -1
- data/lib/platform_rest/experience_version.rb +1 -1
- data/lib/platform_rest/experience_versions.rb +1 -1
- data/lib/platform_rest/experience_view.rb +1 -1
- data/lib/platform_rest/experience_views.rb +1 -1
- data/lib/platform_rest/file.rb +1 -1
- data/lib/platform_rest/files.rb +1 -1
- data/lib/platform_rest/flow.rb +1 -1
- data/lib/platform_rest/flow_version.rb +1 -1
- data/lib/platform_rest/flow_versions.rb +1 -1
- data/lib/platform_rest/flows.rb +1 -1
- data/lib/platform_rest/instance.rb +1 -1
- data/lib/platform_rest/instance_api_token.rb +1 -1
- data/lib/platform_rest/instance_api_tokens.rb +1 -1
- data/lib/{losant_rest/application_template.rb → platform_rest/instance_audit_log.rb} +13 -11
- data/lib/{losant_rest/audit_logs.rb → platform_rest/instance_audit_logs.rb} +12 -12
- data/lib/platform_rest/instance_custom_node.rb +1 -1
- data/lib/platform_rest/instance_custom_nodes.rb +1 -1
- data/lib/platform_rest/instance_member.rb +1 -1
- data/lib/platform_rest/instance_members.rb +1 -1
- data/lib/platform_rest/instance_org.rb +1 -1
- data/lib/platform_rest/instance_org_invite.rb +1 -1
- data/lib/platform_rest/instance_org_invites.rb +1 -1
- data/lib/platform_rest/instance_org_member.rb +1 -1
- data/lib/platform_rest/instance_org_members.rb +1 -1
- data/lib/platform_rest/instance_orgs.rb +1 -1
- data/lib/platform_rest/instance_sandbox.rb +1 -1
- data/lib/platform_rest/instance_sandboxes.rb +1 -1
- data/lib/platform_rest/instances.rb +1 -1
- data/lib/platform_rest/integration.rb +1 -1
- data/lib/platform_rest/integrations.rb +1 -1
- data/lib/platform_rest/me.rb +1 -1
- data/lib/platform_rest/notebook.rb +1 -1
- data/lib/platform_rest/notebooks.rb +1 -1
- data/lib/platform_rest/org.rb +1 -1
- data/lib/platform_rest/org_invites.rb +1 -1
- data/lib/platform_rest/orgs.rb +1 -1
- data/lib/platform_rest/resource_job.rb +1 -1
- data/lib/platform_rest/resource_jobs.rb +1 -1
- data/lib/platform_rest/user_api_token.rb +1 -1
- data/lib/platform_rest/user_api_tokens.rb +1 -1
- data/lib/platform_rest/utils.rb +1 -1
- data/lib/{losant_rest → platform_rest}/version.rb +3 -3
- data/lib/platform_rest/webhook.rb +1 -1
- data/lib/platform_rest/webhooks.rb +1 -1
- data/lib/platform_rest.rb +3 -1
- data/losant_rest.gemspec +2 -2
- data/schemas/apiTokenPost.json +9 -1
- data/schemas/auditLog.json +3 -2
- data/schemas/auditLogFilter.json +3 -2
- data/schemas/auditLogs.json +3 -2
- data/schemas/credential.json +50 -1
- data/schemas/credentialLinkedResources.json +81 -4
- data/schemas/credentialPatch.json +56 -0
- data/schemas/credentialPost.json +71 -1
- data/schemas/credentials.json +50 -1
- data/schemas/deviceConnectionStatus.json +6 -2
- data/schemas/devicesHistoricalImportPost.json +25 -0
- data/schemas/experienceLinkedResources.json +7 -5
- data/schemas/experienceView.json +1 -2
- data/schemas/experienceViewPatch.json +1 -2
- data/schemas/experienceViewPost.json +2 -4
- data/schemas/experienceViews.json +1 -2
- data/schemas/flow.json +2 -1
- data/schemas/flowPatch.json +2 -1
- data/schemas/flowPost.json +2 -1
- data/schemas/flowVersion.json +4 -2
- data/schemas/flowVersionPost.json +2 -1
- data/schemas/flowVersions.json +4 -2
- data/schemas/flows.json +2 -1
- data/schemas/flowsImportPost.json +4 -2
- data/schemas/flowsImportResult.json +6 -3
- data/schemas/githubLogin.json +9 -1
- data/schemas/instance.json +1 -4
- data/schemas/instanceAuditLog.json +94 -0
- data/schemas/instanceAuditLogFilter.json +106 -0
- data/schemas/instanceAuditLogs.json +41 -0
- data/schemas/instanceCustomNodePatch.json +2 -1
- data/schemas/instanceCustomNodePost.json +2 -1
- data/schemas/instanceOrgMember.json +4 -1
- data/schemas/instances.json +1 -4
- data/schemas/integration.json +75 -1
- data/schemas/integrationPatch.json +73 -0
- data/schemas/integrationPost.json +75 -1
- data/schemas/integrations.json +75 -1
- data/schemas/mePatch.json +18 -0
- data/schemas/samlResponse.json +9 -1
- data/schemas/userCredentials.json +9 -1
- data/schemas/userPost.json +9 -1
- data/test/basic_test.rb +6 -6
- data/test/test_helper.rb +1 -1
- metadata +11 -94
- data/lib/losant_rest/application.rb +0 -932
- data/lib/losant_rest/application_api_token.rb +0 -176
- data/lib/losant_rest/application_api_tokens.rb +0 -136
- data/lib/losant_rest/application_certificate.rb +0 -176
- data/lib/losant_rest/application_certificate_authorities.rb +0 -138
- data/lib/losant_rest/application_certificate_authority.rb +0 -176
- data/lib/losant_rest/application_certificates.rb +0 -138
- data/lib/losant_rest/application_dashboard.rb +0 -225
- data/lib/losant_rest/application_dashboards.rb +0 -138
- data/lib/losant_rest/application_key.rb +0 -176
- data/lib/losant_rest/application_keys.rb +0 -141
- data/lib/losant_rest/application_templates.rb +0 -176
- data/lib/losant_rest/applications.rb +0 -142
- data/lib/losant_rest/audit_log.rb +0 -81
- data/lib/losant_rest/auth.rb +0 -245
- data/lib/losant_rest/client.rb +0 -410
- data/lib/losant_rest/credential.rb +0 -224
- data/lib/losant_rest/credentials.rb +0 -138
- data/lib/losant_rest/dashboard.rb +0 -268
- data/lib/losant_rest/dashboards.rb +0 -136
- data/lib/losant_rest/data.rb +0 -176
- data/lib/losant_rest/data_table.rb +0 -274
- data/lib/losant_rest/data_table_row.rb +0 -182
- data/lib/losant_rest/data_table_rows.rb +0 -343
- data/lib/losant_rest/data_tables.rb +0 -138
- data/lib/losant_rest/device.rb +0 -749
- data/lib/losant_rest/device_recipe.rb +0 -234
- data/lib/losant_rest/device_recipes.rb +0 -146
- data/lib/losant_rest/devices.rb +0 -707
- data/lib/losant_rest/edge_deployment.rb +0 -81
- data/lib/losant_rest/edge_deployments.rb +0 -236
- data/lib/losant_rest/embedded_deployment.rb +0 -81
- data/lib/losant_rest/embedded_deployments.rb +0 -280
- data/lib/losant_rest/error.rb +0 -34
- data/lib/losant_rest/event.rb +0 -176
- data/lib/losant_rest/events.rb +0 -341
- data/lib/losant_rest/experience.rb +0 -142
- data/lib/losant_rest/experience_domain.rb +0 -176
- data/lib/losant_rest/experience_domains.rb +0 -126
- data/lib/losant_rest/experience_endpoint.rb +0 -230
- data/lib/losant_rest/experience_endpoints.rb +0 -200
- data/lib/losant_rest/experience_group.rb +0 -180
- data/lib/losant_rest/experience_groups.rb +0 -141
- data/lib/losant_rest/experience_slug.rb +0 -176
- data/lib/losant_rest/experience_slugs.rb +0 -126
- data/lib/losant_rest/experience_user.rb +0 -176
- data/lib/losant_rest/experience_users.rb +0 -142
- data/lib/losant_rest/experience_version.rb +0 -176
- data/lib/losant_rest/experience_versions.rb +0 -138
- data/lib/losant_rest/experience_view.rb +0 -228
- data/lib/losant_rest/experience_views.rb +0 -142
- data/lib/losant_rest/file.rb +0 -226
- data/lib/losant_rest/files.rb +0 -144
- data/lib/losant_rest/flow.rb +0 -580
- data/lib/losant_rest/flow_version.rb +0 -352
- data/lib/losant_rest/flow_versions.rb +0 -201
- data/lib/losant_rest/flows.rb +0 -310
- data/lib/losant_rest/instance.rb +0 -377
- data/lib/losant_rest/instance_api_token.rb +0 -176
- data/lib/losant_rest/instance_api_tokens.rb +0 -136
- data/lib/losant_rest/instance_custom_node.rb +0 -282
- data/lib/losant_rest/instance_custom_nodes.rb +0 -136
- data/lib/losant_rest/instance_member.rb +0 -176
- data/lib/losant_rest/instance_members.rb +0 -134
- data/lib/losant_rest/instance_org.rb +0 -336
- data/lib/losant_rest/instance_org_invite.rb +0 -182
- data/lib/losant_rest/instance_org_invites.rb +0 -138
- data/lib/losant_rest/instance_org_member.rb +0 -182
- data/lib/losant_rest/instance_org_members.rb +0 -138
- data/lib/losant_rest/instance_orgs.rb +0 -139
- data/lib/losant_rest/instance_sandbox.rb +0 -181
- data/lib/losant_rest/instance_sandboxes.rb +0 -98
- data/lib/losant_rest/instances.rb +0 -88
- data/lib/losant_rest/integration.rb +0 -178
- data/lib/losant_rest/integrations.rb +0 -138
- data/lib/losant_rest/me.rb +0 -790
- data/lib/losant_rest/notebook.rb +0 -423
- data/lib/losant_rest/notebooks.rb +0 -138
- data/lib/losant_rest/org.rb +0 -663
- data/lib/losant_rest/org_invites.rb +0 -124
- data/lib/losant_rest/orgs.rb +0 -140
- data/lib/losant_rest/resource_job.rb +0 -326
- data/lib/losant_rest/resource_jobs.rb +0 -138
- data/lib/losant_rest/user_api_token.rb +0 -170
- data/lib/losant_rest/user_api_tokens.rb +0 -132
- data/lib/losant_rest/utils.rb +0 -44
- data/lib/losant_rest/webhook.rb +0 -178
- data/lib/losant_rest/webhooks.rb +0 -138
- data/lib/losant_rest.rb +0 -129
data/lib/losant_rest/client.rb
DELETED
@@ -1,410 +0,0 @@
|
|
1
|
-
# The MIT License (MIT)
|
2
|
-
#
|
3
|
-
# Copyright (c) 2023 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 "httparty"
|
24
|
-
|
25
|
-
module LosantRest
|
26
|
-
# Losant API
|
27
|
-
#
|
28
|
-
# User API for accessing Losant data
|
29
|
-
#
|
30
|
-
# Built For Version 1.26.0
|
31
|
-
class Client
|
32
|
-
attr_accessor :auth_token, :url
|
33
|
-
|
34
|
-
def initialize(options = {})
|
35
|
-
self.auth_token = options.fetch(:auth_token, nil)
|
36
|
-
self.url = options.fetch(:url, "https://api.losant.com")
|
37
|
-
end
|
38
|
-
|
39
|
-
def application
|
40
|
-
@application ||= Application.new(self)
|
41
|
-
end
|
42
|
-
|
43
|
-
def application_api_token
|
44
|
-
@application_api_token ||= ApplicationApiToken.new(self)
|
45
|
-
end
|
46
|
-
|
47
|
-
def application_api_tokens
|
48
|
-
@application_api_tokens ||= ApplicationApiTokens.new(self)
|
49
|
-
end
|
50
|
-
|
51
|
-
def application_certificate
|
52
|
-
@application_certificate ||= ApplicationCertificate.new(self)
|
53
|
-
end
|
54
|
-
|
55
|
-
def application_certificate_authorities
|
56
|
-
@application_certificate_authorities ||= ApplicationCertificateAuthorities.new(self)
|
57
|
-
end
|
58
|
-
|
59
|
-
def application_certificate_authority
|
60
|
-
@application_certificate_authority ||= ApplicationCertificateAuthority.new(self)
|
61
|
-
end
|
62
|
-
|
63
|
-
def application_certificates
|
64
|
-
@application_certificates ||= ApplicationCertificates.new(self)
|
65
|
-
end
|
66
|
-
|
67
|
-
def application_dashboard
|
68
|
-
@application_dashboard ||= ApplicationDashboard.new(self)
|
69
|
-
end
|
70
|
-
|
71
|
-
def application_dashboards
|
72
|
-
@application_dashboards ||= ApplicationDashboards.new(self)
|
73
|
-
end
|
74
|
-
|
75
|
-
def application_key
|
76
|
-
@application_key ||= ApplicationKey.new(self)
|
77
|
-
end
|
78
|
-
|
79
|
-
def application_keys
|
80
|
-
@application_keys ||= ApplicationKeys.new(self)
|
81
|
-
end
|
82
|
-
|
83
|
-
def application_template
|
84
|
-
@application_template ||= ApplicationTemplate.new(self)
|
85
|
-
end
|
86
|
-
|
87
|
-
def application_templates
|
88
|
-
@application_templates ||= ApplicationTemplates.new(self)
|
89
|
-
end
|
90
|
-
|
91
|
-
def applications
|
92
|
-
@applications ||= Applications.new(self)
|
93
|
-
end
|
94
|
-
|
95
|
-
def audit_log
|
96
|
-
@audit_log ||= AuditLog.new(self)
|
97
|
-
end
|
98
|
-
|
99
|
-
def audit_logs
|
100
|
-
@audit_logs ||= AuditLogs.new(self)
|
101
|
-
end
|
102
|
-
|
103
|
-
def auth
|
104
|
-
@auth ||= Auth.new(self)
|
105
|
-
end
|
106
|
-
|
107
|
-
def credential
|
108
|
-
@credential ||= Credential.new(self)
|
109
|
-
end
|
110
|
-
|
111
|
-
def credentials
|
112
|
-
@credentials ||= Credentials.new(self)
|
113
|
-
end
|
114
|
-
|
115
|
-
def dashboard
|
116
|
-
@dashboard ||= Dashboard.new(self)
|
117
|
-
end
|
118
|
-
|
119
|
-
def dashboards
|
120
|
-
@dashboards ||= Dashboards.new(self)
|
121
|
-
end
|
122
|
-
|
123
|
-
def data
|
124
|
-
@data ||= Data.new(self)
|
125
|
-
end
|
126
|
-
|
127
|
-
def data_table
|
128
|
-
@data_table ||= DataTable.new(self)
|
129
|
-
end
|
130
|
-
|
131
|
-
def data_table_row
|
132
|
-
@data_table_row ||= DataTableRow.new(self)
|
133
|
-
end
|
134
|
-
|
135
|
-
def data_table_rows
|
136
|
-
@data_table_rows ||= DataTableRows.new(self)
|
137
|
-
end
|
138
|
-
|
139
|
-
def data_tables
|
140
|
-
@data_tables ||= DataTables.new(self)
|
141
|
-
end
|
142
|
-
|
143
|
-
def device
|
144
|
-
@device ||= Device.new(self)
|
145
|
-
end
|
146
|
-
|
147
|
-
def device_recipe
|
148
|
-
@device_recipe ||= DeviceRecipe.new(self)
|
149
|
-
end
|
150
|
-
|
151
|
-
def device_recipes
|
152
|
-
@device_recipes ||= DeviceRecipes.new(self)
|
153
|
-
end
|
154
|
-
|
155
|
-
def devices
|
156
|
-
@devices ||= Devices.new(self)
|
157
|
-
end
|
158
|
-
|
159
|
-
def edge_deployment
|
160
|
-
@edge_deployment ||= EdgeDeployment.new(self)
|
161
|
-
end
|
162
|
-
|
163
|
-
def edge_deployments
|
164
|
-
@edge_deployments ||= EdgeDeployments.new(self)
|
165
|
-
end
|
166
|
-
|
167
|
-
def embedded_deployment
|
168
|
-
@embedded_deployment ||= EmbeddedDeployment.new(self)
|
169
|
-
end
|
170
|
-
|
171
|
-
def embedded_deployments
|
172
|
-
@embedded_deployments ||= EmbeddedDeployments.new(self)
|
173
|
-
end
|
174
|
-
|
175
|
-
def event
|
176
|
-
@event ||= Event.new(self)
|
177
|
-
end
|
178
|
-
|
179
|
-
def events
|
180
|
-
@events ||= Events.new(self)
|
181
|
-
end
|
182
|
-
|
183
|
-
def experience
|
184
|
-
@experience ||= Experience.new(self)
|
185
|
-
end
|
186
|
-
|
187
|
-
def experience_domain
|
188
|
-
@experience_domain ||= ExperienceDomain.new(self)
|
189
|
-
end
|
190
|
-
|
191
|
-
def experience_domains
|
192
|
-
@experience_domains ||= ExperienceDomains.new(self)
|
193
|
-
end
|
194
|
-
|
195
|
-
def experience_endpoint
|
196
|
-
@experience_endpoint ||= ExperienceEndpoint.new(self)
|
197
|
-
end
|
198
|
-
|
199
|
-
def experience_endpoints
|
200
|
-
@experience_endpoints ||= ExperienceEndpoints.new(self)
|
201
|
-
end
|
202
|
-
|
203
|
-
def experience_group
|
204
|
-
@experience_group ||= ExperienceGroup.new(self)
|
205
|
-
end
|
206
|
-
|
207
|
-
def experience_groups
|
208
|
-
@experience_groups ||= ExperienceGroups.new(self)
|
209
|
-
end
|
210
|
-
|
211
|
-
def experience_slug
|
212
|
-
@experience_slug ||= ExperienceSlug.new(self)
|
213
|
-
end
|
214
|
-
|
215
|
-
def experience_slugs
|
216
|
-
@experience_slugs ||= ExperienceSlugs.new(self)
|
217
|
-
end
|
218
|
-
|
219
|
-
def experience_user
|
220
|
-
@experience_user ||= ExperienceUser.new(self)
|
221
|
-
end
|
222
|
-
|
223
|
-
def experience_users
|
224
|
-
@experience_users ||= ExperienceUsers.new(self)
|
225
|
-
end
|
226
|
-
|
227
|
-
def experience_version
|
228
|
-
@experience_version ||= ExperienceVersion.new(self)
|
229
|
-
end
|
230
|
-
|
231
|
-
def experience_versions
|
232
|
-
@experience_versions ||= ExperienceVersions.new(self)
|
233
|
-
end
|
234
|
-
|
235
|
-
def experience_view
|
236
|
-
@experience_view ||= ExperienceView.new(self)
|
237
|
-
end
|
238
|
-
|
239
|
-
def experience_views
|
240
|
-
@experience_views ||= ExperienceViews.new(self)
|
241
|
-
end
|
242
|
-
|
243
|
-
def file
|
244
|
-
@file ||= File.new(self)
|
245
|
-
end
|
246
|
-
|
247
|
-
def files
|
248
|
-
@files ||= Files.new(self)
|
249
|
-
end
|
250
|
-
|
251
|
-
def flow
|
252
|
-
@flow ||= Flow.new(self)
|
253
|
-
end
|
254
|
-
|
255
|
-
def flow_version
|
256
|
-
@flow_version ||= FlowVersion.new(self)
|
257
|
-
end
|
258
|
-
|
259
|
-
def flow_versions
|
260
|
-
@flow_versions ||= FlowVersions.new(self)
|
261
|
-
end
|
262
|
-
|
263
|
-
def flows
|
264
|
-
@flows ||= Flows.new(self)
|
265
|
-
end
|
266
|
-
|
267
|
-
def instance
|
268
|
-
@instance ||= Instance.new(self)
|
269
|
-
end
|
270
|
-
|
271
|
-
def instance_api_token
|
272
|
-
@instance_api_token ||= InstanceApiToken.new(self)
|
273
|
-
end
|
274
|
-
|
275
|
-
def instance_api_tokens
|
276
|
-
@instance_api_tokens ||= InstanceApiTokens.new(self)
|
277
|
-
end
|
278
|
-
|
279
|
-
def instance_custom_node
|
280
|
-
@instance_custom_node ||= InstanceCustomNode.new(self)
|
281
|
-
end
|
282
|
-
|
283
|
-
def instance_custom_nodes
|
284
|
-
@instance_custom_nodes ||= InstanceCustomNodes.new(self)
|
285
|
-
end
|
286
|
-
|
287
|
-
def instance_member
|
288
|
-
@instance_member ||= InstanceMember.new(self)
|
289
|
-
end
|
290
|
-
|
291
|
-
def instance_members
|
292
|
-
@instance_members ||= InstanceMembers.new(self)
|
293
|
-
end
|
294
|
-
|
295
|
-
def instance_org
|
296
|
-
@instance_org ||= InstanceOrg.new(self)
|
297
|
-
end
|
298
|
-
|
299
|
-
def instance_org_invite
|
300
|
-
@instance_org_invite ||= InstanceOrgInvite.new(self)
|
301
|
-
end
|
302
|
-
|
303
|
-
def instance_org_invites
|
304
|
-
@instance_org_invites ||= InstanceOrgInvites.new(self)
|
305
|
-
end
|
306
|
-
|
307
|
-
def instance_org_member
|
308
|
-
@instance_org_member ||= InstanceOrgMember.new(self)
|
309
|
-
end
|
310
|
-
|
311
|
-
def instance_org_members
|
312
|
-
@instance_org_members ||= InstanceOrgMembers.new(self)
|
313
|
-
end
|
314
|
-
|
315
|
-
def instance_orgs
|
316
|
-
@instance_orgs ||= InstanceOrgs.new(self)
|
317
|
-
end
|
318
|
-
|
319
|
-
def instance_sandbox
|
320
|
-
@instance_sandbox ||= InstanceSandbox.new(self)
|
321
|
-
end
|
322
|
-
|
323
|
-
def instance_sandboxes
|
324
|
-
@instance_sandboxes ||= InstanceSandboxes.new(self)
|
325
|
-
end
|
326
|
-
|
327
|
-
def instances
|
328
|
-
@instances ||= Instances.new(self)
|
329
|
-
end
|
330
|
-
|
331
|
-
def integration
|
332
|
-
@integration ||= Integration.new(self)
|
333
|
-
end
|
334
|
-
|
335
|
-
def integrations
|
336
|
-
@integrations ||= Integrations.new(self)
|
337
|
-
end
|
338
|
-
|
339
|
-
def me
|
340
|
-
@me ||= Me.new(self)
|
341
|
-
end
|
342
|
-
|
343
|
-
def notebook
|
344
|
-
@notebook ||= Notebook.new(self)
|
345
|
-
end
|
346
|
-
|
347
|
-
def notebooks
|
348
|
-
@notebooks ||= Notebooks.new(self)
|
349
|
-
end
|
350
|
-
|
351
|
-
def org
|
352
|
-
@org ||= Org.new(self)
|
353
|
-
end
|
354
|
-
|
355
|
-
def org_invites
|
356
|
-
@org_invites ||= OrgInvites.new(self)
|
357
|
-
end
|
358
|
-
|
359
|
-
def orgs
|
360
|
-
@orgs ||= Orgs.new(self)
|
361
|
-
end
|
362
|
-
|
363
|
-
def resource_job
|
364
|
-
@resource_job ||= ResourceJob.new(self)
|
365
|
-
end
|
366
|
-
|
367
|
-
def resource_jobs
|
368
|
-
@resource_jobs ||= ResourceJobs.new(self)
|
369
|
-
end
|
370
|
-
|
371
|
-
def user_api_token
|
372
|
-
@user_api_token ||= UserApiToken.new(self)
|
373
|
-
end
|
374
|
-
|
375
|
-
def user_api_tokens
|
376
|
-
@user_api_tokens ||= UserApiTokens.new(self)
|
377
|
-
end
|
378
|
-
|
379
|
-
def webhook
|
380
|
-
@webhook ||= Webhook.new(self)
|
381
|
-
end
|
382
|
-
|
383
|
-
def webhooks
|
384
|
-
@webhooks ||= Webhooks.new(self)
|
385
|
-
end
|
386
|
-
|
387
|
-
def request(options = {})
|
388
|
-
headers = options.fetch(:headers, {})
|
389
|
-
method = options.fetch(:method, :get)
|
390
|
-
|
391
|
-
headers["Accept"] = "application/json"
|
392
|
-
headers["Content-Type"] = "application/json"
|
393
|
-
headers["Accept-Version"] = "^1.26.0"
|
394
|
-
headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
|
395
|
-
path = self.url + options.fetch(:path, "")
|
396
|
-
|
397
|
-
response = HTTParty.send(method, path,
|
398
|
-
query: Utils.fix_query_arrays(options[:query]),
|
399
|
-
body: options[:body] && options[:body].to_json(),
|
400
|
-
headers: headers)
|
401
|
-
|
402
|
-
result = response.parsed_response
|
403
|
-
if response.code >= 400
|
404
|
-
raise ResponseError.new(response.code, result)
|
405
|
-
end
|
406
|
-
|
407
|
-
result
|
408
|
-
end
|
409
|
-
end
|
410
|
-
end
|
@@ -1,224 +0,0 @@
|
|
1
|
-
# The MIT License (MIT)
|
2
|
-
#
|
3
|
-
# Copyright (c) 2023 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 Credential Resource
|
28
|
-
class Credential
|
29
|
-
|
30
|
-
def initialize(client)
|
31
|
-
@client = client
|
32
|
-
end
|
33
|
-
|
34
|
-
# Deletes a credential
|
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.Application, all.Organization, all.User, credential.*, or credential.delete.
|
41
|
-
#
|
42
|
-
# Parameters:
|
43
|
-
# * {string} applicationId - ID associated with the application
|
44
|
-
# * {string} credentialId - ID associated with the credential
|
45
|
-
# * {string} losantdomain - Domain scope of request (rarely needed)
|
46
|
-
# * {boolean} _actions - Return resource actions in response
|
47
|
-
# * {boolean} _links - Return resource link in response
|
48
|
-
# * {boolean} _embedded - Return embedded resources in response
|
49
|
-
#
|
50
|
-
# Responses:
|
51
|
-
# * 200 - If credential was successfully deleted (https://api.losant.com/#/definitions/success)
|
52
|
-
#
|
53
|
-
# Errors:
|
54
|
-
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
55
|
-
# * 404 - Error if credential was not found (https://api.losant.com/#/definitions/error)
|
56
|
-
def delete(params = {})
|
57
|
-
params = Utils.symbolize_hash_keys(params)
|
58
|
-
query_params = { _actions: false, _links: true, _embedded: true }
|
59
|
-
headers = {}
|
60
|
-
body = nil
|
61
|
-
|
62
|
-
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
63
|
-
raise ArgumentError.new("credentialId is required") unless params.has_key?(:credentialId)
|
64
|
-
|
65
|
-
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
66
|
-
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
67
|
-
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
68
|
-
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
69
|
-
|
70
|
-
path = "/applications/#{params[:applicationId]}/credentials/#{params[:credentialId]}"
|
71
|
-
|
72
|
-
@client.request(
|
73
|
-
method: :delete,
|
74
|
-
path: path,
|
75
|
-
query: query_params,
|
76
|
-
headers: headers,
|
77
|
-
body: body)
|
78
|
-
end
|
79
|
-
|
80
|
-
# Retrieves information on a credential
|
81
|
-
#
|
82
|
-
# Authentication:
|
83
|
-
# The client must be configured with a valid api
|
84
|
-
# access token to call this action. The token
|
85
|
-
# must include at least one of the following scopes:
|
86
|
-
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, credential.*, or credential.get.
|
87
|
-
#
|
88
|
-
# Parameters:
|
89
|
-
# * {string} applicationId - ID associated with the application
|
90
|
-
# * {string} credentialId - ID associated with the credential
|
91
|
-
# * {string} losantdomain - Domain scope of request (rarely needed)
|
92
|
-
# * {boolean} _actions - Return resource actions in response
|
93
|
-
# * {boolean} _links - Return resource link in response
|
94
|
-
# * {boolean} _embedded - Return embedded resources in response
|
95
|
-
#
|
96
|
-
# Responses:
|
97
|
-
# * 200 - credential information (https://api.losant.com/#/definitions/credential)
|
98
|
-
#
|
99
|
-
# Errors:
|
100
|
-
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
101
|
-
# * 404 - Error if credential was not found (https://api.losant.com/#/definitions/error)
|
102
|
-
def get(params = {})
|
103
|
-
params = Utils.symbolize_hash_keys(params)
|
104
|
-
query_params = { _actions: false, _links: true, _embedded: true }
|
105
|
-
headers = {}
|
106
|
-
body = nil
|
107
|
-
|
108
|
-
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
109
|
-
raise ArgumentError.new("credentialId is required") unless params.has_key?(:credentialId)
|
110
|
-
|
111
|
-
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
112
|
-
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
113
|
-
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
114
|
-
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
115
|
-
|
116
|
-
path = "/applications/#{params[:applicationId]}/credentials/#{params[:credentialId]}"
|
117
|
-
|
118
|
-
@client.request(
|
119
|
-
method: :get,
|
120
|
-
path: path,
|
121
|
-
query: query_params,
|
122
|
-
headers: headers,
|
123
|
-
body: body)
|
124
|
-
end
|
125
|
-
|
126
|
-
# Retrieves information on resources linked to a credential
|
127
|
-
#
|
128
|
-
# Authentication:
|
129
|
-
# The client must be configured with a valid api
|
130
|
-
# access token to call this action. The token
|
131
|
-
# must include at least one of the following scopes:
|
132
|
-
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, credential.*, or credential.linkedResources.
|
133
|
-
#
|
134
|
-
# Parameters:
|
135
|
-
# * {string} applicationId - ID associated with the application
|
136
|
-
# * {string} credentialId - ID associated with the credential
|
137
|
-
# * {string} includeCustomNodes - If the result of the request should also include the details of any custom nodes referenced by returned workflows
|
138
|
-
# * {string} losantdomain - Domain scope of request (rarely needed)
|
139
|
-
# * {boolean} _actions - Return resource actions in response
|
140
|
-
# * {boolean} _links - Return resource link in response
|
141
|
-
# * {boolean} _embedded - Return embedded resources in response
|
142
|
-
#
|
143
|
-
# Responses:
|
144
|
-
# * 200 - Linked resource information (https://api.losant.com/#/definitions/credentialLinkedResources)
|
145
|
-
#
|
146
|
-
# Errors:
|
147
|
-
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
148
|
-
# * 404 - Error if credential was not found (https://api.losant.com/#/definitions/error)
|
149
|
-
def linked_resources(params = {})
|
150
|
-
params = Utils.symbolize_hash_keys(params)
|
151
|
-
query_params = { _actions: false, _links: true, _embedded: true }
|
152
|
-
headers = {}
|
153
|
-
body = nil
|
154
|
-
|
155
|
-
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
156
|
-
raise ArgumentError.new("credentialId is required") unless params.has_key?(:credentialId)
|
157
|
-
|
158
|
-
query_params[:includeCustomNodes] = params[:includeCustomNodes] if params.has_key?(:includeCustomNodes)
|
159
|
-
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
160
|
-
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
161
|
-
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
162
|
-
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
163
|
-
|
164
|
-
path = "/applications/#{params[:applicationId]}/credentials/#{params[:credentialId]}/linkedResources"
|
165
|
-
|
166
|
-
@client.request(
|
167
|
-
method: :get,
|
168
|
-
path: path,
|
169
|
-
query: query_params,
|
170
|
-
headers: headers,
|
171
|
-
body: body)
|
172
|
-
end
|
173
|
-
|
174
|
-
# Updates information about a credential
|
175
|
-
#
|
176
|
-
# Authentication:
|
177
|
-
# The client must be configured with a valid api
|
178
|
-
# access token to call this action. The token
|
179
|
-
# must include at least one of the following scopes:
|
180
|
-
# all.Application, all.Organization, all.User, credential.*, or credential.patch.
|
181
|
-
#
|
182
|
-
# Parameters:
|
183
|
-
# * {string} applicationId - ID associated with the application
|
184
|
-
# * {string} credentialId - ID associated with the credential
|
185
|
-
# * {hash} credential - Object containing new properties of the credential (https://api.losant.com/#/definitions/credentialPatch)
|
186
|
-
# * {string} losantdomain - Domain scope of request (rarely needed)
|
187
|
-
# * {boolean} _actions - Return resource actions in response
|
188
|
-
# * {boolean} _links - Return resource link in response
|
189
|
-
# * {boolean} _embedded - Return embedded resources in response
|
190
|
-
#
|
191
|
-
# Responses:
|
192
|
-
# * 200 - Updated credential information (https://api.losant.com/#/definitions/credential)
|
193
|
-
#
|
194
|
-
# Errors:
|
195
|
-
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
196
|
-
# * 404 - Error if credential was not found (https://api.losant.com/#/definitions/error)
|
197
|
-
def patch(params = {})
|
198
|
-
params = Utils.symbolize_hash_keys(params)
|
199
|
-
query_params = { _actions: false, _links: true, _embedded: true }
|
200
|
-
headers = {}
|
201
|
-
body = nil
|
202
|
-
|
203
|
-
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
204
|
-
raise ArgumentError.new("credentialId is required") unless params.has_key?(:credentialId)
|
205
|
-
raise ArgumentError.new("credential is required") unless params.has_key?(:credential)
|
206
|
-
|
207
|
-
body = params[:credential] if params.has_key?(:credential)
|
208
|
-
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
209
|
-
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
210
|
-
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
211
|
-
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
212
|
-
|
213
|
-
path = "/applications/#{params[:applicationId]}/credentials/#{params[:credentialId]}"
|
214
|
-
|
215
|
-
@client.request(
|
216
|
-
method: :patch,
|
217
|
-
path: path,
|
218
|
-
query: query_params,
|
219
|
-
headers: headers,
|
220
|
-
body: body)
|
221
|
-
end
|
222
|
-
|
223
|
-
end
|
224
|
-
end
|