losant_rest 1.8.6 → 1.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/_schemas.md +2143 -330
- data/docs/applicationCertificate.md +133 -0
- data/docs/applicationCertificateAuthorities.md +93 -0
- data/docs/applicationCertificateAuthority.md +133 -0
- data/docs/applicationCertificates.md +93 -0
- data/docs/auth.md +1 -1
- data/docs/dataTableRows.md +2 -0
- data/docs/events.md +1 -1
- data/docs/experienceUsers.md +2 -1
- data/lib/losant_rest.rb +4 -0
- data/lib/losant_rest/application_certificate.rb +174 -0
- data/lib/losant_rest/application_certificate_authorities.rb +136 -0
- data/lib/losant_rest/application_certificate_authority.rb +174 -0
- data/lib/losant_rest/application_certificates.rb +136 -0
- data/lib/losant_rest/auth.rb +1 -1
- data/lib/losant_rest/client.rb +18 -2
- data/lib/losant_rest/data_table_rows.rb +4 -0
- data/lib/losant_rest/events.rb +1 -1
- data/lib/losant_rest/experience_users.rb +3 -1
- data/lib/losant_rest/version.rb +1 -1
- data/schemas/applicationApiTokenPost.json +14 -0
- data/schemas/applicationCertificate.json +67 -0
- data/schemas/applicationCertificateAuthorities.json +93 -0
- data/schemas/applicationCertificateAuthority.json +51 -0
- data/schemas/applicationCertificateAuthorityPatch.json +26 -0
- data/schemas/applicationCertificateAuthorityPost.json +30 -0
- data/schemas/applicationCertificatePatch.json +21 -0
- data/schemas/applicationCertificatePost.json +51 -0
- data/schemas/applicationCertificates.json +109 -0
- data/schemas/dashboard.json +274 -72
- data/schemas/dashboardPatch.json +274 -72
- data/schemas/dashboardPost.json +274 -72
- data/schemas/dashboards.json +274 -72
- data/schemas/dataTableQuery.json +12 -0
- data/schemas/dataTableRowsExport.json +12 -0
- data/schemas/deviceCredentials.json +1 -3
- data/schemas/event.json +15 -0
- data/schemas/eventPatch.json +12 -1
- data/schemas/eventPost.json +16 -1
- data/schemas/events.json +15 -0
- data/schemas/experienceDomain.json +2 -6
- data/schemas/experienceDomainPatch.json +2 -6
- data/schemas/experienceDomainPost.json +2 -6
- data/schemas/experienceDomains.json +2 -6
- data/schemas/experienceGroup.json +38 -0
- data/schemas/experienceGroupPatch.json +38 -0
- data/schemas/experienceGroupPost.json +38 -0
- data/schemas/experienceGroups.json +38 -0
- data/schemas/flow.json +1 -0
- data/schemas/flowPatch.json +3 -2
- data/schemas/flowPost.json +1 -0
- data/schemas/flowVersion.json +2 -0
- data/schemas/flowVersionPost.json +1 -0
- data/schemas/flowVersions.json +2 -0
- data/schemas/flows.json +1 -0
- data/schemas/flowsImportPost.json +4 -2
- data/schemas/flowsImportResult.json +3 -0
- data/schemas/githubLogin.json +14 -0
- data/schemas/userCredentials.json +14 -0
- data/schemas/userPost.json +14 -0
- metadata +18 -2
data/docs/auth.md
CHANGED
@@ -37,7 +37,7 @@ No api access token is required to call this action.
|
|
37
37
|
|
38
38
|
| Code | Type | Description |
|
39
39
|
| ---- | ---- | ----------- |
|
40
|
-
| 200 | [Authenticated Device](_schemas.md#authenticated-device) | Successful authentication. The included api access token has the scope 'all.Device'. |
|
40
|
+
| 200 | [Authenticated Device](_schemas.md#authenticated-device) | Successful authentication. The included api access token by default has the scope 'all.Device'. |
|
41
41
|
|
42
42
|
#### Error Responses
|
43
43
|
|
data/docs/dataTableRows.md
CHANGED
@@ -126,6 +126,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
126
126
|
| sortDirection | string | N | Direction to sort the rows by. Accepted values are: asc, desc | asc | asc |
|
127
127
|
| limit | string | N | How many rows to return | 1000 | 0 |
|
128
128
|
| offset | string | N | How many rows to skip | 0 | 0 |
|
129
|
+
| includeFields | string | N | Comma-separated list of fields to include in resulting rows. When not provided, returns all fields. | | id,createdAt |
|
129
130
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
130
131
|
|
131
132
|
#### Successful Responses
|
@@ -212,6 +213,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
212
213
|
| sortDirection | string | N | Direction to sort the rows by. Accepted values are: asc, desc | asc | asc |
|
213
214
|
| limit | string | N | How many rows to return | 1000 | 0 |
|
214
215
|
| offset | string | N | How many rows to skip | 0 | 0 |
|
216
|
+
| includeFields | string | N | Comma-separated list of fields to include in resulting rows. When not provided, returns all fields. | | id,createdAt |
|
215
217
|
| query | [Data Table Query](_schemas.md#data-table-query) | N | Query to apply to filter the data table | | [Data Table Query Example](_schemas.md#data-table-query-example) |
|
216
218
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
217
219
|
|
data/docs/events.md
CHANGED
@@ -33,7 +33,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
33
33
|
| Name | Type | Required | Description | Default | Example |
|
34
34
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
35
35
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
36
|
-
| sortField | string | N | Field to sort the results by. Accepted values are: subject, id, creationDate | creationDate | subject |
|
36
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: subject, id, creationDate, lastUpdated, level, state, deviceId | creationDate | subject |
|
37
37
|
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | desc | asc |
|
38
38
|
| page | string | N | Which page of results to return | 0 | 0 |
|
39
39
|
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
data/docs/experienceUsers.md
CHANGED
@@ -37,7 +37,8 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
37
37
|
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
38
38
|
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: firstName, lastName, email | | email |
|
39
39
|
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*user |
|
40
|
-
| experienceGroupId | string | N | Filter users to those only in the specified group | | 575ec8687ae143cd83dc4a97 |
|
40
|
+
| experienceGroupId | string | N | Filter users to those only in the specified group, special experienceGroupIds of 'any' which will give users who are in at least one group and 'none' will give you users who are not in any groups. | | 575ec8687ae143cd83dc4a97 |
|
41
|
+
| includeAncestorGroups | string | N | If set will include members from ancestors of the specified experienceGroupId | | true |
|
41
42
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
42
43
|
|
43
44
|
#### Successful Responses
|
data/lib/losant_rest.rb
CHANGED
@@ -26,6 +26,10 @@ require_relative "losant_rest/utils"
|
|
26
26
|
require_relative "losant_rest/application"
|
27
27
|
require_relative "losant_rest/application_api_token"
|
28
28
|
require_relative "losant_rest/application_api_tokens"
|
29
|
+
require_relative "losant_rest/application_certificate"
|
30
|
+
require_relative "losant_rest/application_certificate_authorities"
|
31
|
+
require_relative "losant_rest/application_certificate_authority"
|
32
|
+
require_relative "losant_rest/application_certificates"
|
29
33
|
require_relative "losant_rest/application_key"
|
30
34
|
require_relative "losant_rest/application_keys"
|
31
35
|
require_relative "losant_rest/applications"
|
@@ -0,0 +1,174 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2019 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
|
+
module LosantRest
|
24
|
+
|
25
|
+
# Class containing all the actions for the Application Certificate Resource
|
26
|
+
class ApplicationCertificate
|
27
|
+
|
28
|
+
def initialize(client)
|
29
|
+
@client = client
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deletes an application certificate
|
33
|
+
#
|
34
|
+
# Authentication:
|
35
|
+
# The client must be configured with a valid api
|
36
|
+
# access token to call this action. The token
|
37
|
+
# must include at least one of the following scopes:
|
38
|
+
# all.Application, all.Organization, all.User, applicationCertificate.*, or applicationCertificate.delete.
|
39
|
+
#
|
40
|
+
# Parameters:
|
41
|
+
# * {string} applicationId - ID associated with the application
|
42
|
+
# * {string} applicationCertificateId - ID associated with the application certificate
|
43
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
44
|
+
# * {boolean} _actions - Return resource actions in response
|
45
|
+
# * {boolean} _links - Return resource link in response
|
46
|
+
# * {boolean} _embedded - Return embedded resources in response
|
47
|
+
#
|
48
|
+
# Responses:
|
49
|
+
# * 200 - If application certificate was successfully deleted (https://api.losant.com/#/definitions/success)
|
50
|
+
#
|
51
|
+
# Errors:
|
52
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
53
|
+
# * 404 - Error if application certificate was not found (https://api.losant.com/#/definitions/error)
|
54
|
+
def delete(params = {})
|
55
|
+
params = Utils.symbolize_hash_keys(params)
|
56
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
57
|
+
headers = {}
|
58
|
+
body = nil
|
59
|
+
|
60
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
61
|
+
raise ArgumentError.new("applicationCertificateId is required") unless params.has_key?(:applicationCertificateId)
|
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 = "/applications/#{params[:applicationId]}/certificates/#{params[:applicationCertificateId]}"
|
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 application certificate
|
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.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, applicationCertificate.*, or applicationCertificate.get.
|
85
|
+
#
|
86
|
+
# Parameters:
|
87
|
+
# * {string} applicationId - ID associated with the application
|
88
|
+
# * {string} applicationCertificateId - ID associated with the application certificate
|
89
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
90
|
+
# * {boolean} _actions - Return resource actions in response
|
91
|
+
# * {boolean} _links - Return resource link in response
|
92
|
+
# * {boolean} _embedded - Return embedded resources in response
|
93
|
+
#
|
94
|
+
# Responses:
|
95
|
+
# * 200 - Application certificate information (https://api.losant.com/#/definitions/applicationCertificate)
|
96
|
+
#
|
97
|
+
# Errors:
|
98
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
99
|
+
# * 404 - Error if application certificate was not found (https://api.losant.com/#/definitions/error)
|
100
|
+
def get(params = {})
|
101
|
+
params = Utils.symbolize_hash_keys(params)
|
102
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
103
|
+
headers = {}
|
104
|
+
body = nil
|
105
|
+
|
106
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
107
|
+
raise ArgumentError.new("applicationCertificateId is required") unless params.has_key?(:applicationCertificateId)
|
108
|
+
|
109
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
110
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
111
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
112
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
113
|
+
|
114
|
+
path = "/applications/#{params[:applicationId]}/certificates/#{params[:applicationCertificateId]}"
|
115
|
+
|
116
|
+
@client.request(
|
117
|
+
method: :get,
|
118
|
+
path: path,
|
119
|
+
query: query_params,
|
120
|
+
headers: headers,
|
121
|
+
body: body)
|
122
|
+
end
|
123
|
+
|
124
|
+
# Updates information about an application certificate
|
125
|
+
#
|
126
|
+
# Authentication:
|
127
|
+
# The client must be configured with a valid api
|
128
|
+
# access token to call this action. The token
|
129
|
+
# must include at least one of the following scopes:
|
130
|
+
# all.Application, all.Organization, all.User, applicationCertificate.*, or applicationCertificate.patch.
|
131
|
+
#
|
132
|
+
# Parameters:
|
133
|
+
# * {string} applicationId - ID associated with the application
|
134
|
+
# * {string} applicationCertificateId - ID associated with the application certificate
|
135
|
+
# * {hash} applicationCertificate - Object containing new properties of the application certificate (https://api.losant.com/#/definitions/applicationCertificatePatch)
|
136
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
137
|
+
# * {boolean} _actions - Return resource actions in response
|
138
|
+
# * {boolean} _links - Return resource link in response
|
139
|
+
# * {boolean} _embedded - Return embedded resources in response
|
140
|
+
#
|
141
|
+
# Responses:
|
142
|
+
# * 200 - Updated application certificate information (https://api.losant.com/#/definitions/applicationCertificate)
|
143
|
+
#
|
144
|
+
# Errors:
|
145
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
146
|
+
# * 404 - Error if application certificate was not found (https://api.losant.com/#/definitions/error)
|
147
|
+
def patch(params = {})
|
148
|
+
params = Utils.symbolize_hash_keys(params)
|
149
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
150
|
+
headers = {}
|
151
|
+
body = nil
|
152
|
+
|
153
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
154
|
+
raise ArgumentError.new("applicationCertificateId is required") unless params.has_key?(:applicationCertificateId)
|
155
|
+
raise ArgumentError.new("applicationCertificate is required") unless params.has_key?(:applicationCertificate)
|
156
|
+
|
157
|
+
body = params[:applicationCertificate] if params.has_key?(:applicationCertificate)
|
158
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
159
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
160
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
161
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
162
|
+
|
163
|
+
path = "/applications/#{params[:applicationId]}/certificates/#{params[:applicationCertificateId]}"
|
164
|
+
|
165
|
+
@client.request(
|
166
|
+
method: :patch,
|
167
|
+
path: path,
|
168
|
+
query: query_params,
|
169
|
+
headers: headers,
|
170
|
+
body: body)
|
171
|
+
end
|
172
|
+
|
173
|
+
end
|
174
|
+
end
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2019 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
|
+
module LosantRest
|
24
|
+
|
25
|
+
# Class containing all the actions for the Application Certificate Authorities Resource
|
26
|
+
class ApplicationCertificateAuthorities
|
27
|
+
|
28
|
+
def initialize(client)
|
29
|
+
@client = client
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns the application certificate authorities for an application
|
33
|
+
#
|
34
|
+
# Authentication:
|
35
|
+
# The client must be configured with a valid api
|
36
|
+
# access token to call this action. The token
|
37
|
+
# must include at least one of the following scopes:
|
38
|
+
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, applicationCertificateAuthorities.*, or applicationCertificateAuthorities.get.
|
39
|
+
#
|
40
|
+
# Parameters:
|
41
|
+
# * {string} applicationId - ID associated with the application
|
42
|
+
# * {string} sortField - Field to sort the results by. Accepted values are: name, status, id, creationDate, lastUpdated
|
43
|
+
# * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
|
44
|
+
# * {string} page - Which page of results to return
|
45
|
+
# * {string} perPage - How many items to return per page
|
46
|
+
# * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name, status
|
47
|
+
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
|
48
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
49
|
+
# * {boolean} _actions - Return resource actions in response
|
50
|
+
# * {boolean} _links - Return resource link in response
|
51
|
+
# * {boolean} _embedded - Return embedded resources in response
|
52
|
+
#
|
53
|
+
# Responses:
|
54
|
+
# * 200 - Collection of application certificate authorities (https://api.losant.com/#/definitions/applicationCertificateAuthorities)
|
55
|
+
#
|
56
|
+
# Errors:
|
57
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
58
|
+
# * 404 - Error if application was not found (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
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
66
|
+
|
67
|
+
query_params[:sortField] = params[:sortField] if params.has_key?(:sortField)
|
68
|
+
query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
|
69
|
+
query_params[:page] = params[:page] if params.has_key?(:page)
|
70
|
+
query_params[:perPage] = params[:perPage] if params.has_key?(:perPage)
|
71
|
+
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
|
72
|
+
query_params[:filter] = params[:filter] if params.has_key?(:filter)
|
73
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
74
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
75
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
76
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
77
|
+
|
78
|
+
path = "/applications/#{params[:applicationId]}/certificate-authorities"
|
79
|
+
|
80
|
+
@client.request(
|
81
|
+
method: :get,
|
82
|
+
path: path,
|
83
|
+
query: query_params,
|
84
|
+
headers: headers,
|
85
|
+
body: body)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Create a new application certificate authority for an application
|
89
|
+
#
|
90
|
+
# Authentication:
|
91
|
+
# The client must be configured with a valid api
|
92
|
+
# access token to call this action. The token
|
93
|
+
# must include at least one of the following scopes:
|
94
|
+
# all.Application, all.Organization, all.User, applicationCertificateAuthorities.*, or applicationCertificateAuthorities.post.
|
95
|
+
#
|
96
|
+
# Parameters:
|
97
|
+
# * {string} applicationId - ID associated with the application
|
98
|
+
# * {hash} applicationCertificateAuthority - Application certificate authority information (https://api.losant.com/#/definitions/applicationCertificateAuthorityPost)
|
99
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
100
|
+
# * {boolean} _actions - Return resource actions in response
|
101
|
+
# * {boolean} _links - Return resource link in response
|
102
|
+
# * {boolean} _embedded - Return embedded resources in response
|
103
|
+
#
|
104
|
+
# Responses:
|
105
|
+
# * 201 - Successfully created application certificate authority (https://api.losant.com/#/definitions/applicationCertificateAuthority)
|
106
|
+
#
|
107
|
+
# Errors:
|
108
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
109
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
110
|
+
def post(params = {})
|
111
|
+
params = Utils.symbolize_hash_keys(params)
|
112
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
113
|
+
headers = {}
|
114
|
+
body = nil
|
115
|
+
|
116
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
117
|
+
raise ArgumentError.new("applicationCertificateAuthority is required") unless params.has_key?(:applicationCertificateAuthority)
|
118
|
+
|
119
|
+
body = params[:applicationCertificateAuthority] if params.has_key?(:applicationCertificateAuthority)
|
120
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
121
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
122
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
123
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
124
|
+
|
125
|
+
path = "/applications/#{params[:applicationId]}/certificate-authorities"
|
126
|
+
|
127
|
+
@client.request(
|
128
|
+
method: :post,
|
129
|
+
path: path,
|
130
|
+
query: query_params,
|
131
|
+
headers: headers,
|
132
|
+
body: body)
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
end
|
@@ -0,0 +1,174 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2019 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
|
+
module LosantRest
|
24
|
+
|
25
|
+
# Class containing all the actions for the Application Certificate Authority Resource
|
26
|
+
class ApplicationCertificateAuthority
|
27
|
+
|
28
|
+
def initialize(client)
|
29
|
+
@client = client
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deletes an application certificate authority
|
33
|
+
#
|
34
|
+
# Authentication:
|
35
|
+
# The client must be configured with a valid api
|
36
|
+
# access token to call this action. The token
|
37
|
+
# must include at least one of the following scopes:
|
38
|
+
# all.Application, all.Organization, all.User, applicationCertificateAuthority.*, or applicationCertificateAuthority.delete.
|
39
|
+
#
|
40
|
+
# Parameters:
|
41
|
+
# * {string} applicationId - ID associated with the application
|
42
|
+
# * {string} applicationCertificateAuthorityId - ID associated with the application certificate authority
|
43
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
44
|
+
# * {boolean} _actions - Return resource actions in response
|
45
|
+
# * {boolean} _links - Return resource link in response
|
46
|
+
# * {boolean} _embedded - Return embedded resources in response
|
47
|
+
#
|
48
|
+
# Responses:
|
49
|
+
# * 200 - If application certificate authority was successfully deleted (https://api.losant.com/#/definitions/success)
|
50
|
+
#
|
51
|
+
# Errors:
|
52
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
53
|
+
# * 404 - Error if application certificate authority was not found (https://api.losant.com/#/definitions/error)
|
54
|
+
def delete(params = {})
|
55
|
+
params = Utils.symbolize_hash_keys(params)
|
56
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
57
|
+
headers = {}
|
58
|
+
body = nil
|
59
|
+
|
60
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
61
|
+
raise ArgumentError.new("applicationCertificateAuthorityId is required") unless params.has_key?(:applicationCertificateAuthorityId)
|
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 = "/applications/#{params[:applicationId]}/certificate-authorities/#{params[:applicationCertificateAuthorityId]}"
|
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 application certificate authority
|
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.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, applicationCertificateAuthority.*, or applicationCertificateAuthority.get.
|
85
|
+
#
|
86
|
+
# Parameters:
|
87
|
+
# * {string} applicationId - ID associated with the application
|
88
|
+
# * {string} applicationCertificateAuthorityId - ID associated with the application certificate authority
|
89
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
90
|
+
# * {boolean} _actions - Return resource actions in response
|
91
|
+
# * {boolean} _links - Return resource link in response
|
92
|
+
# * {boolean} _embedded - Return embedded resources in response
|
93
|
+
#
|
94
|
+
# Responses:
|
95
|
+
# * 200 - Application certificate authority information (https://api.losant.com/#/definitions/applicationCertificateAuthority)
|
96
|
+
#
|
97
|
+
# Errors:
|
98
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
99
|
+
# * 404 - Error if application certificate authority was not found (https://api.losant.com/#/definitions/error)
|
100
|
+
def get(params = {})
|
101
|
+
params = Utils.symbolize_hash_keys(params)
|
102
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
103
|
+
headers = {}
|
104
|
+
body = nil
|
105
|
+
|
106
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
107
|
+
raise ArgumentError.new("applicationCertificateAuthorityId is required") unless params.has_key?(:applicationCertificateAuthorityId)
|
108
|
+
|
109
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
110
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
111
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
112
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
113
|
+
|
114
|
+
path = "/applications/#{params[:applicationId]}/certificate-authorities/#{params[:applicationCertificateAuthorityId]}"
|
115
|
+
|
116
|
+
@client.request(
|
117
|
+
method: :get,
|
118
|
+
path: path,
|
119
|
+
query: query_params,
|
120
|
+
headers: headers,
|
121
|
+
body: body)
|
122
|
+
end
|
123
|
+
|
124
|
+
# Updates information about an application certificate authority
|
125
|
+
#
|
126
|
+
# Authentication:
|
127
|
+
# The client must be configured with a valid api
|
128
|
+
# access token to call this action. The token
|
129
|
+
# must include at least one of the following scopes:
|
130
|
+
# all.Application, all.Organization, all.User, applicationCertificateAuthority.*, or applicationCertificateAuthority.patch.
|
131
|
+
#
|
132
|
+
# Parameters:
|
133
|
+
# * {string} applicationId - ID associated with the application
|
134
|
+
# * {string} applicationCertificateAuthorityId - ID associated with the application certificate authority
|
135
|
+
# * {hash} applicationCertificateAuthority - Object containing new properties of the application certificate authority (https://api.losant.com/#/definitions/applicationCertificateAuthorityPatch)
|
136
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
137
|
+
# * {boolean} _actions - Return resource actions in response
|
138
|
+
# * {boolean} _links - Return resource link in response
|
139
|
+
# * {boolean} _embedded - Return embedded resources in response
|
140
|
+
#
|
141
|
+
# Responses:
|
142
|
+
# * 200 - Updated application certificate authority information (https://api.losant.com/#/definitions/applicationCertificateAuthority)
|
143
|
+
#
|
144
|
+
# Errors:
|
145
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
146
|
+
# * 404 - Error if application certificate authority was not found (https://api.losant.com/#/definitions/error)
|
147
|
+
def patch(params = {})
|
148
|
+
params = Utils.symbolize_hash_keys(params)
|
149
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
150
|
+
headers = {}
|
151
|
+
body = nil
|
152
|
+
|
153
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
154
|
+
raise ArgumentError.new("applicationCertificateAuthorityId is required") unless params.has_key?(:applicationCertificateAuthorityId)
|
155
|
+
raise ArgumentError.new("applicationCertificateAuthority is required") unless params.has_key?(:applicationCertificateAuthority)
|
156
|
+
|
157
|
+
body = params[:applicationCertificateAuthority] if params.has_key?(:applicationCertificateAuthority)
|
158
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
159
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
160
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
161
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
162
|
+
|
163
|
+
path = "/applications/#{params[:applicationId]}/certificate-authorities/#{params[:applicationCertificateAuthorityId]}"
|
164
|
+
|
165
|
+
@client.request(
|
166
|
+
method: :patch,
|
167
|
+
path: path,
|
168
|
+
query: query_params,
|
169
|
+
headers: headers,
|
170
|
+
body: body)
|
171
|
+
end
|
172
|
+
|
173
|
+
end
|
174
|
+
end
|