insights-approval-api-client 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +142 -0
  4. data/Rakefile +10 -0
  5. data/client-meta.json +9 -0
  6. data/docs/Action.md +27 -0
  7. data/docs/ActionApi.md +172 -0
  8. data/docs/ActionCollection.md +21 -0
  9. data/docs/CollectionLinks.md +23 -0
  10. data/docs/CollectionMetadata.md +21 -0
  11. data/docs/GraphqlApi.md +62 -0
  12. data/docs/GraphqlIn.md +21 -0
  13. data/docs/GraphqlOut.md +19 -0
  14. data/docs/GroupRef.md +19 -0
  15. data/docs/HttpApiError.md +19 -0
  16. data/docs/HttpApiErrorCollection.md +17 -0
  17. data/docs/Request.md +49 -0
  18. data/docs/RequestApi.md +292 -0
  19. data/docs/RequestCollection.md +21 -0
  20. data/docs/RequestIn.md +23 -0
  21. data/docs/ResourceObject.md +21 -0
  22. data/docs/Tag.md +17 -0
  23. data/docs/TagResource.md +21 -0
  24. data/docs/Template.md +23 -0
  25. data/docs/TemplateApi.md +124 -0
  26. data/docs/TemplateCollection.md +21 -0
  27. data/docs/Workflow.md +29 -0
  28. data/docs/WorkflowApi.md +469 -0
  29. data/docs/WorkflowCollection.md +21 -0
  30. data/generate.sh +9 -0
  31. data/git_push.sh +58 -0
  32. data/insights-approval-api-client.gemspec +39 -0
  33. data/lib/insights-approval-api-client.rb +63 -0
  34. data/lib/insights-approval-api-client/api/action_api.rb +231 -0
  35. data/lib/insights-approval-api-client/api/graphql_api.rb +86 -0
  36. data/lib/insights-approval-api-client/api/request_api.rb +381 -0
  37. data/lib/insights-approval-api-client/api/template_api.rb +169 -0
  38. data/lib/insights-approval-api-client/api/workflow_api.rb +630 -0
  39. data/lib/insights-approval-api-client/api_client.rb +386 -0
  40. data/lib/insights-approval-api-client/api_error.rb +57 -0
  41. data/lib/insights-approval-api-client/configuration.rb +268 -0
  42. data/lib/insights-approval-api-client/models/action.rb +293 -0
  43. data/lib/insights-approval-api-client/models/action_collection.rb +226 -0
  44. data/lib/insights-approval-api-client/models/collection_links.rb +237 -0
  45. data/lib/insights-approval-api-client/models/collection_metadata.rb +227 -0
  46. data/lib/insights-approval-api-client/models/graphql_in.rb +237 -0
  47. data/lib/insights-approval-api-client/models/graphql_out.rb +219 -0
  48. data/lib/insights-approval-api-client/models/group_ref.rb +223 -0
  49. data/lib/insights-approval-api-client/models/http_api_error.rb +218 -0
  50. data/lib/insights-approval-api-client/models/http_api_error_collection.rb +210 -0
  51. data/lib/insights-approval-api-client/models/request.rb +417 -0
  52. data/lib/insights-approval-api-client/models/request_collection.rb +226 -0
  53. data/lib/insights-approval-api-client/models/request_in.rb +255 -0
  54. data/lib/insights-approval-api-client/models/resource_object.rb +243 -0
  55. data/lib/insights-approval-api-client/models/tag.rb +207 -0
  56. data/lib/insights-approval-api-client/models/tag_resource.rb +242 -0
  57. data/lib/insights-approval-api-client/models/template.rb +235 -0
  58. data/lib/insights-approval-api-client/models/template_collection.rb +226 -0
  59. data/lib/insights-approval-api-client/models/workflow.rb +283 -0
  60. data/lib/insights-approval-api-client/models/workflow_collection.rb +226 -0
  61. data/lib/insights-approval-api-client/version.rb +15 -0
  62. data/openapi.json +1540 -0
  63. data/spec/api/action_api_spec.rb +72 -0
  64. data/spec/api/graphql_api_spec.rb +47 -0
  65. data/spec/api/request_api_spec.rb +100 -0
  66. data/spec/api/template_api_spec.rb +62 -0
  67. data/spec/api/workflow_api_spec.rb +145 -0
  68. data/spec/api_client_spec.rb +226 -0
  69. data/spec/configuration_spec.rb +42 -0
  70. data/spec/models/action_collection_spec.rb +53 -0
  71. data/spec/models/action_spec.rb +75 -0
  72. data/spec/models/collection_links_spec.rb +59 -0
  73. data/spec/models/collection_metadata_spec.rb +53 -0
  74. data/spec/models/graphql_in_spec.rb +53 -0
  75. data/spec/models/graphql_out_spec.rb +47 -0
  76. data/spec/models/group_ref_spec.rb +47 -0
  77. data/spec/models/http_api_error_collection_spec.rb +41 -0
  78. data/spec/models/http_api_error_spec.rb +47 -0
  79. data/spec/models/request_collection_spec.rb +53 -0
  80. data/spec/models/request_in_spec.rb +59 -0
  81. data/spec/models/request_spec.rb +145 -0
  82. data/spec/models/resource_object_spec.rb +53 -0
  83. data/spec/models/tag_resource_spec.rb +53 -0
  84. data/spec/models/tag_spec.rb +41 -0
  85. data/spec/models/template_collection_spec.rb +53 -0
  86. data/spec/models/template_spec.rb +59 -0
  87. data/spec/models/workflow_collection_spec.rb +53 -0
  88. data/spec/models/workflow_spec.rb +77 -0
  89. data/spec/spec_helper.rb +111 -0
  90. metadata +218 -0
@@ -0,0 +1,226 @@
1
+ =begin
2
+ #Insights Service Approval APIs
3
+
4
+ #APIs to query approval service
5
+
6
+ The version of the OpenAPI document: 1.2.0
7
+ Contact: support@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module ApprovalApiClient
16
+ class WorkflowCollection
17
+ attr_accessor :meta
18
+
19
+ attr_accessor :links
20
+
21
+ attr_accessor :data
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'meta' => :'meta',
27
+ :'links' => :'links',
28
+ :'data' => :'data'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'meta' => :'CollectionMetadata',
36
+ :'links' => :'CollectionLinks',
37
+ :'data' => :'Array<Workflow>'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ApprovalApiClient::WorkflowCollection` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ApprovalApiClient::WorkflowCollection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'meta')
63
+ self.meta = attributes[:'meta']
64
+ end
65
+
66
+ if attributes.key?(:'links')
67
+ self.links = attributes[:'links']
68
+ end
69
+
70
+ if attributes.key?(:'data')
71
+ if (value = attributes[:'data']).is_a?(Array)
72
+ self.data = value
73
+ end
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ meta == o.meta &&
96
+ links == o.links &&
97
+ data == o.data
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Integer] Hash code
108
+ def hash
109
+ [meta, links, data].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def self.build_from_hash(attributes)
116
+ new.build_from_hash(attributes)
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ self.class.openapi_types.each_pair do |key, type|
125
+ if type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :DateTime
146
+ DateTime.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ ApprovalApiClient.const_get(type).build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+ end
226
+ end
@@ -0,0 +1,15 @@
1
+ =begin
2
+ #Insights Service Approval APIs
3
+
4
+ #APIs to query approval service
5
+
6
+ The version of the OpenAPI document: 1.2.0
7
+ Contact: support@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.2
10
+
11
+ =end
12
+
13
+ module ApprovalApiClient
14
+ VERSION = '1.2.0'
15
+ end
@@ -0,0 +1,1540 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "title": "Insights Service Approval APIs",
5
+ "description": "APIs to query approval service",
6
+ "version": "1.2.0",
7
+ "contact": {
8
+ "email": "support@redhat.com"
9
+ },
10
+ "license": {
11
+ "name": "Apache 2.0",
12
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
13
+ }
14
+ },
15
+ "tags": [
16
+ {
17
+ "name": "Action",
18
+ "description": "Operations about actions"
19
+ },
20
+ {
21
+ "name": "Request",
22
+ "description": "Operations about requests"
23
+ },
24
+ {
25
+ "name": "Template",
26
+ "description": "Operations about templates"
27
+ },
28
+ {
29
+ "name": "Workflow",
30
+ "description": "Operations about workflows"
31
+ },
32
+ {
33
+ "name": "Graphql",
34
+ "description": "Operations about GraphQL"
35
+ }
36
+ ],
37
+ "paths": {
38
+ "/graphql": {
39
+ "post": {
40
+ "tags": [
41
+ "Graphql"
42
+ ],
43
+ "summary": "Perform a GraphQL Query",
44
+ "operationId": "postGraphql",
45
+ "description": "Performs a GraphQL Query",
46
+ "requestBody": {
47
+ "content": {
48
+ "application/json": {
49
+ "schema": {
50
+ "$ref": "#/components/schemas/GraphqlIn"
51
+ }
52
+ }
53
+ },
54
+ "description": "GraphQL Query Request",
55
+ "required": true
56
+ },
57
+ "responses": {
58
+ "200": {
59
+ "description": "GraphQL Query Response",
60
+ "content": {
61
+ "application/json": {
62
+ "schema": {
63
+ "$ref": "#/components/schemas/GraphqlOut"
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ },
71
+ "/actions/{id}": {
72
+ "get": {
73
+ "tags": [
74
+ "Action"
75
+ ],
76
+ "summary": "Return an user action by id",
77
+ "description": "Return an user action by id, available to all",
78
+ "operationId": "showAction",
79
+ "parameters": [
80
+ {
81
+ "$ref": "#/components/parameters/id"
82
+ }
83
+ ],
84
+ "responses": {
85
+ "200": {
86
+ "description": "Success",
87
+ "content": {
88
+ "*/*": {
89
+ "schema": {
90
+ "$ref": "#/components/schemas/Action"
91
+ }
92
+ }
93
+ }
94
+ },
95
+ "400": {
96
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
97
+ },
98
+ "403": {
99
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
100
+ },
101
+ "404": {
102
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
103
+ }
104
+ }
105
+ }
106
+ },
107
+ "/requests/{request_id}/actions": {
108
+ "post": {
109
+ "tags": [
110
+ "Action"
111
+ ],
112
+ "summary": "Add an action to a given request",
113
+ "description": "Add an action to a given request. Admin can do approve, deny, memo, and cancel operations; approver can do approve, deny and memo operations; while requester can do only cancel operation.",
114
+ "operationId": "createAction",
115
+ "parameters": [
116
+ {
117
+ "$ref": "#/components/parameters/request_id"
118
+ }
119
+ ],
120
+ "requestBody": {
121
+ "content": {
122
+ "application/json": {
123
+ "schema": {
124
+ "$ref": "#/components/schemas/Action",
125
+ "required": [
126
+ "operation"
127
+ ]
128
+ }
129
+ }
130
+ },
131
+ "description": "Action object that will be added",
132
+ "required": true
133
+ },
134
+ "responses": {
135
+ "201": {
136
+ "description": "Success",
137
+ "content": {
138
+ "application/json": {
139
+ "schema": {
140
+ "$ref": "#/components/schemas/Action"
141
+ }
142
+ }
143
+ }
144
+ },
145
+ "400": {
146
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
147
+ },
148
+ "403": {
149
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
150
+ },
151
+ "404": {
152
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
153
+ }
154
+ }
155
+ },
156
+ "get": {
157
+ "tags": [
158
+ "Action"
159
+ ],
160
+ "summary": "List all actions of a request",
161
+ "description": "Return actions in a given request, available for admin/approver",
162
+ "operationId": "listActionsByRequest",
163
+ "parameters": [
164
+ {
165
+ "$ref": "#/components/parameters/request_id"
166
+ }
167
+ ],
168
+ "responses": {
169
+ "200": {
170
+ "description": "Success",
171
+ "headers": {
172
+ "X-total-count": {
173
+ "description": "Total number of items",
174
+ "schema": {
175
+ "type": "integer"
176
+ }
177
+ }
178
+ },
179
+ "content": {
180
+ "application/json": {
181
+ "schema": {
182
+ "$ref": "#/components/schemas/ActionCollection"
183
+ }
184
+ }
185
+ }
186
+ },
187
+ "400": {
188
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
189
+ },
190
+ "403": {
191
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
192
+ },
193
+ "404": {
194
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
195
+ }
196
+ }
197
+ }
198
+ },
199
+ "/requests": {
200
+ "get": {
201
+ "tags": [
202
+ "Request"
203
+ ],
204
+ "summary": "Return an array of requester made approval requests, available to anyone",
205
+ "description": "The result depends on the x-rh-persona header (approval/admin, approval/requseter, or approval/approver). Program generated child requests are not included.",
206
+ "operationId": "listRequests",
207
+ "parameters": [
208
+ {
209
+ "$ref": "#/components/parameters/persona"
210
+ },
211
+ {
212
+ "$ref": "#/components/parameters/limit"
213
+ },
214
+ {
215
+ "$ref": "#/components/parameters/offset"
216
+ },
217
+ {
218
+ "$ref": "#/components/parameters/filter"
219
+ },
220
+ {
221
+ "$ref": "#/components/parameters/sort_by"
222
+ }
223
+ ],
224
+ "responses": {
225
+ "200": {
226
+ "description": "Success",
227
+ "headers": {
228
+ "X-total-count": {
229
+ "description": "Total number of items",
230
+ "schema": {
231
+ "type": "integer"
232
+ }
233
+ }
234
+ },
235
+ "content": {
236
+ "application/json": {
237
+ "schema": {
238
+ "$ref": "#/components/schemas/RequestCollection"
239
+ }
240
+ }
241
+ }
242
+ },
243
+ "400": {
244
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
245
+ },
246
+ "403": {
247
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
248
+ },
249
+ "404": {
250
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
251
+ }
252
+ }
253
+ },
254
+ "post": {
255
+ "tags": [
256
+ "Request"
257
+ ],
258
+ "summary": "Add an approval request by given parameters",
259
+ "description": "Add an approval request by given parameters, available to anyone",
260
+ "operationId": "createRequest",
261
+ "requestBody": {
262
+ "content": {
263
+ "application/json": {
264
+ "schema": {
265
+ "$ref": "#/components/schemas/RequestIn"
266
+ }
267
+ }
268
+ },
269
+ "description": "Parameters need to create a request",
270
+ "required": true
271
+ },
272
+ "responses": {
273
+ "201": {
274
+ "description": "Success",
275
+ "content": {
276
+ "application/json": {
277
+ "schema": {
278
+ "$ref": "#/components/schemas/Request"
279
+ }
280
+ }
281
+ }
282
+ },
283
+ "400": {
284
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
285
+ },
286
+ "403": {
287
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
288
+ },
289
+ "404": {
290
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
291
+ }
292
+ }
293
+ }
294
+ },
295
+ "/requests/{id}": {
296
+ "get": {
297
+ "tags": [
298
+ "Request"
299
+ ],
300
+ "summary": "Return an approval request by given id",
301
+ "description": "Return an approval request by given id, available to anyone who can access the request",
302
+ "operationId": "showRequest",
303
+ "parameters": [
304
+ {
305
+ "$ref": "#/components/parameters/id"
306
+ }
307
+ ],
308
+ "responses": {
309
+ "200": {
310
+ "description": "Success",
311
+ "content": {
312
+ "*/*": {
313
+ "schema": {
314
+ "$ref": "#/components/schemas/Request"
315
+ }
316
+ }
317
+ }
318
+ },
319
+ "400": {
320
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
321
+ },
322
+ "403": {
323
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
324
+ },
325
+ "404": {
326
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
327
+ }
328
+ }
329
+ }
330
+ },
331
+ "/requests/{request_id}/requests": {
332
+ "get": {
333
+ "tags": [
334
+ "Request"
335
+ ],
336
+ "summary": "Return an array of child requests of a given request id",
337
+ "description": "Return an array of child requests of a given request id. The result depends on the x-rh-persona header (approval/admin, approval/requseter, or approval/approver).",
338
+ "operationId": "listRequestsByRequest",
339
+ "parameters": [
340
+ {
341
+ "$ref": "#/components/parameters/persona"
342
+ },
343
+ {
344
+ "$ref": "#/components/parameters/request_id"
345
+ }
346
+ ],
347
+ "responses": {
348
+ "200": {
349
+ "description": "Success",
350
+ "headers": {
351
+ "X-total-count": {
352
+ "description": "Total number of items",
353
+ "schema": {
354
+ "type": "integer"
355
+ }
356
+ }
357
+ },
358
+ "content": {
359
+ "application/json": {
360
+ "schema": {
361
+ "$ref": "#/components/schemas/RequestCollection"
362
+ }
363
+ }
364
+ }
365
+ },
366
+ "400": {
367
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
368
+ },
369
+ "403": {
370
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
371
+ },
372
+ "404": {
373
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
374
+ }
375
+ }
376
+ }
377
+ },
378
+ "/requests/{request_id}/content": {
379
+ "get": {
380
+ "tags": [
381
+ "Request"
382
+ ],
383
+ "summary": "Return request content of a given request id",
384
+ "description": "Return request content of a given request id, available to all",
385
+ "operationId": "showRequestContent",
386
+ "parameters": [
387
+ {
388
+ "$ref": "#/components/parameters/request_id"
389
+ }
390
+ ],
391
+ "responses": {
392
+ "200": {
393
+ "description": "Success",
394
+ "content": {
395
+ "application/json": {
396
+ "schema": {
397
+ "$ref": "#/components/schemas/RequestContent"
398
+ }
399
+ }
400
+ }
401
+ },
402
+ "400": {
403
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
404
+ },
405
+ "403": {
406
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
407
+ },
408
+ "404": {
409
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
410
+ }
411
+ }
412
+ }
413
+ },
414
+ "/templates": {
415
+ "get": {
416
+ "tags": [
417
+ "Template"
418
+ ],
419
+ "summary": "Return all templates, only available for admin",
420
+ "description": "Return all templates",
421
+ "operationId": "listTemplates",
422
+ "parameters": [
423
+ {
424
+ "$ref": "#/components/parameters/limit"
425
+ },
426
+ {
427
+ "$ref": "#/components/parameters/offset"
428
+ },
429
+ {
430
+ "$ref": "#/components/parameters/filter"
431
+ },
432
+ {
433
+ "$ref": "#/components/parameters/sort_by"
434
+ }
435
+ ],
436
+ "responses": {
437
+ "200": {
438
+ "description": "Success",
439
+ "headers": {
440
+ "X-total-count": {
441
+ "description": "Total number of items",
442
+ "schema": {
443
+ "type": "integer"
444
+ }
445
+ }
446
+ },
447
+ "content": {
448
+ "application/json": {
449
+ "schema": {
450
+ "$ref": "#/components/schemas/TemplateCollection"
451
+ }
452
+ }
453
+ }
454
+ },
455
+ "400": {
456
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
457
+ },
458
+ "403": {
459
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
460
+ },
461
+ "404": {
462
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
463
+ }
464
+ }
465
+ }
466
+ },
467
+ "/templates/{id}": {
468
+ "get": {
469
+ "tags": [
470
+ "Template"
471
+ ],
472
+ "summary": "Return a template by given id, only available for admin",
473
+ "description": "Return a template by given id",
474
+ "operationId": "showTemplate",
475
+ "parameters": [
476
+ {
477
+ "$ref": "#/components/parameters/id"
478
+ }
479
+ ],
480
+ "responses": {
481
+ "200": {
482
+ "description": "Success",
483
+ "content": {
484
+ "*/*": {
485
+ "schema": {
486
+ "$ref": "#/components/schemas/Template"
487
+ }
488
+ }
489
+ }
490
+ },
491
+ "400": {
492
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
493
+ },
494
+ "403": {
495
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
496
+ },
497
+ "404": {
498
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
499
+ }
500
+ }
501
+ }
502
+ },
503
+ "/workflows": {
504
+ "get": {
505
+ "tags": [
506
+ "Workflow"
507
+ ],
508
+ "summary": "Return all approval workflows, only available for admin",
509
+ "description": "Depends on the query parameters, either return all workflows in ascending sequence order when no parameters are provided; or return the workflows linking to the resource object whose app_name, object_type and object_id are specified by query parameters",
510
+ "operationId": "listWorkflows",
511
+ "parameters": [
512
+ {
513
+ "$ref": "#/components/parameters/app_name"
514
+ },
515
+ {
516
+ "$ref": "#/components/parameters/object_id"
517
+ },
518
+ {
519
+ "$ref": "#/components/parameters/object_type"
520
+ },
521
+ {
522
+ "$ref": "#/components/parameters/limit"
523
+ },
524
+ {
525
+ "$ref": "#/components/parameters/offset"
526
+ },
527
+ {
528
+ "$ref": "#/components/parameters/filter"
529
+ },
530
+ {
531
+ "$ref": "#/components/parameters/sort_by"
532
+ }
533
+ ],
534
+ "responses": {
535
+ "200": {
536
+ "description": "Success",
537
+ "headers": {
538
+ "X-total-count": {
539
+ "description": "Total number of items",
540
+ "schema": {
541
+ "type": "integer"
542
+ }
543
+ }
544
+ },
545
+ "content": {
546
+ "*/*": {
547
+ "schema": {
548
+ "$ref": "#/components/schemas/WorkflowCollection"
549
+ }
550
+ }
551
+ }
552
+ },
553
+ "400": {
554
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
555
+ },
556
+ "403": {
557
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
558
+ },
559
+ "404": {
560
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
561
+ }
562
+ }
563
+ }
564
+ },
565
+ "/templates/{template_id}/workflows": {
566
+ "get": {
567
+ "tags": [
568
+ "Workflow"
569
+ ],
570
+ "summary": "Return an array of workflows by given template id, only available for admin",
571
+ "description": "Return an array of workflows by given template id",
572
+ "operationId": "listWorkflowsByTemplate",
573
+ "parameters": [
574
+ {
575
+ "$ref": "#/components/parameters/template_id"
576
+ },
577
+ {
578
+ "$ref": "#/components/parameters/limit"
579
+ },
580
+ {
581
+ "$ref": "#/components/parameters/offset"
582
+ },
583
+ {
584
+ "$ref": "#/components/parameters/filter"
585
+ },
586
+ {
587
+ "$ref": "#/components/parameters/sort_by"
588
+ }
589
+ ],
590
+ "responses": {
591
+ "200": {
592
+ "description": "Success",
593
+ "headers": {
594
+ "X-total-count": {
595
+ "description": "Total number of items",
596
+ "schema": {
597
+ "type": "integer"
598
+ }
599
+ }
600
+ },
601
+ "content": {
602
+ "application/json": {
603
+ "schema": {
604
+ "$ref": "#/components/schemas/WorkflowCollection"
605
+ }
606
+ }
607
+ }
608
+ },
609
+ "400": {
610
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
611
+ },
612
+ "403": {
613
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
614
+ },
615
+ "404": {
616
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
617
+ }
618
+ }
619
+ },
620
+ "post": {
621
+ "tags": [
622
+ "Workflow"
623
+ ],
624
+ "summary": "Add a workflow by given template id, only available for admin",
625
+ "description": "Add a workflow by given template id",
626
+ "operationId": "addWorkflowToTemplate",
627
+ "parameters": [
628
+ {
629
+ "$ref": "#/components/parameters/template_id"
630
+ }
631
+ ],
632
+ "requestBody": {
633
+ "content": {
634
+ "application/json": {
635
+ "schema": {
636
+ "$ref": "#/components/schemas/Workflow",
637
+ "required": [
638
+ "name",
639
+ "group_refs"
640
+ ]
641
+ }
642
+ }
643
+ },
644
+ "description": "Parameters need to create workflow",
645
+ "required": true
646
+ },
647
+ "responses": {
648
+ "201": {
649
+ "description": "Success",
650
+ "content": {
651
+ "application/json": {
652
+ "schema": {
653
+ "$ref": "#/components/schemas/Workflow"
654
+ }
655
+ }
656
+ }
657
+ },
658
+ "400": {
659
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
660
+ },
661
+ "403": {
662
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
663
+ },
664
+ "404": {
665
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
666
+ }
667
+ }
668
+ }
669
+ },
670
+ "/workflows/{id}": {
671
+ "get": {
672
+ "tags": [
673
+ "Workflow"
674
+ ],
675
+ "summary": "Return an approval workflow by given id, only available for admin",
676
+ "description": "Return an approval workflow by given id",
677
+ "operationId": "showWorkflow",
678
+ "parameters": [
679
+ {
680
+ "$ref": "#/components/parameters/id"
681
+ }
682
+ ],
683
+ "responses": {
684
+ "200": {
685
+ "description": "Success",
686
+ "content": {
687
+ "*/*": {
688
+ "schema": {
689
+ "$ref": "#/components/schemas/Workflow"
690
+ }
691
+ }
692
+ }
693
+ },
694
+ "400": {
695
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
696
+ },
697
+ "403": {
698
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
699
+ },
700
+ "404": {
701
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
702
+ }
703
+ }
704
+ },
705
+ "patch": {
706
+ "tags": [
707
+ "Workflow"
708
+ ],
709
+ "summary": "Update an approval workflow by given id, only available for admin",
710
+ "description": "Update an approval workflow by given id",
711
+ "operationId": "updateWorkflow",
712
+ "parameters": [
713
+ {
714
+ "$ref": "#/components/parameters/id"
715
+ }
716
+ ],
717
+ "requestBody": {
718
+ "content": {
719
+ "application/json": {
720
+ "schema": {
721
+ "$ref": "#/components/schemas/Workflow",
722
+ "required": [
723
+ "name",
724
+ "group_refs"
725
+ ]
726
+ }
727
+ }
728
+ },
729
+ "description": "Parameters need to update approval workflow",
730
+ "required": true
731
+ },
732
+ "responses": {
733
+ "200": {
734
+ "description": "Success",
735
+ "content": {
736
+ "*/*": {
737
+ "schema": {
738
+ "$ref": "#/components/schemas/Workflow"
739
+ }
740
+ }
741
+ }
742
+ },
743
+ "400": {
744
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
745
+ },
746
+ "403": {
747
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
748
+ },
749
+ "404": {
750
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
751
+ }
752
+ }
753
+ },
754
+ "delete": {
755
+ "tags": [
756
+ "Workflow"
757
+ ],
758
+ "summary": "Delete approval workflow by given id, only available for admin",
759
+ "description": "Delete approval workflow by given id",
760
+ "operationId": "destroyWorkflow",
761
+ "parameters": [
762
+ {
763
+ "$ref": "#/components/parameters/id"
764
+ }
765
+ ],
766
+ "responses": {
767
+ "204": {
768
+ "description": "Workflow Deleted"
769
+ },
770
+ "400": {
771
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
772
+ },
773
+ "403": {
774
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
775
+ },
776
+ "404": {
777
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
778
+ }
779
+ }
780
+ }
781
+ },
782
+ "/workflows/{id}/link": {
783
+ "post": {
784
+ "tags": [
785
+ "Workflow"
786
+ ],
787
+ "summary": "Create a resource link to a given workflow",
788
+ "operationId": "linkWorkflow",
789
+ "description": "Link a resource object to a given workflow",
790
+ "parameters": [
791
+ {
792
+ "$ref": "#/components/parameters/id"
793
+ }
794
+ ],
795
+ "requestBody": {
796
+ "content": {
797
+ "application/json": {
798
+ "schema": {
799
+ "$ref": "#/components/schemas/ResourceObject"
800
+ }
801
+ }
802
+ },
803
+ "description": "Parameters needed to create a link",
804
+ "required": true
805
+ },
806
+ "responses": {
807
+ "200": {
808
+ "description": "Success"
809
+ },
810
+ "400": {
811
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
812
+ },
813
+ "403": {
814
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
815
+ },
816
+ "404": {
817
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
818
+ }
819
+ }
820
+ }
821
+ },
822
+ "/workflows/{id}/unlink": {
823
+ "post": {
824
+ "tags": [
825
+ "Workflow"
826
+ ],
827
+ "summary": "Break the link between a resource object and selected workflow",
828
+ "operationId": "unlinkWorkflow",
829
+ "description": "Break the link between a resource object and selected workflow",
830
+ "parameters": [
831
+ {
832
+ "$ref": "#/components/parameters/id"
833
+ }
834
+ ],
835
+ "requestBody": {
836
+ "content": {
837
+ "application/json": {
838
+ "schema": {
839
+ "$ref": "#/components/schemas/ResourceObject"
840
+ }
841
+ }
842
+ },
843
+ "description": "Parameters needed to remove a link",
844
+ "required": true
845
+ },
846
+ "responses": {
847
+ "200": {
848
+ "description": "Success"
849
+ },
850
+ "400": {
851
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
852
+ },
853
+ "403": {
854
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
855
+ },
856
+ "404": {
857
+ "$ref": "#/components/schemas/HttpApiErrorCollection"
858
+ }
859
+ }
860
+ }
861
+ }
862
+ },
863
+ "security": [
864
+ {
865
+ "Basic_auth": []
866
+ }
867
+ ],
868
+ "servers": [
869
+ {
870
+ "url": "https://cloud.redhat.com/{basePath}",
871
+ "description": "Production Server",
872
+ "variables": {
873
+ "basePath": {
874
+ "default": "/api/approval/v1.2"
875
+ }
876
+ }
877
+ },
878
+ {
879
+ "url": "http://localhost:{port}/{basePath}",
880
+ "description": "Development Server",
881
+ "variables": {
882
+ "port": {
883
+ "default": "3000"
884
+ },
885
+ "basePath": {
886
+ "default": "/api/approval/v1.2"
887
+ }
888
+ }
889
+ }
890
+ ],
891
+ "components": {
892
+ "parameters": {
893
+ "id": {
894
+ "name": "id",
895
+ "in": "path",
896
+ "description": "Query by id",
897
+ "required": true,
898
+ "schema": {
899
+ "type": "string",
900
+ "pattern": "^\\d+$"
901
+ }
902
+ },
903
+ "template_id": {
904
+ "name": "template_id",
905
+ "in": "path",
906
+ "description": "Id of template",
907
+ "required": true,
908
+ "schema": {
909
+ "type": "string",
910
+ "pattern": "^\\d+$"
911
+ }
912
+ },
913
+ "workflow_id": {
914
+ "name": "workflow_id",
915
+ "in": "path",
916
+ "description": "Id of workflow",
917
+ "required": true,
918
+ "schema": {
919
+ "type": "string",
920
+ "pattern": "^\\d+$"
921
+ }
922
+ },
923
+ "request_id": {
924
+ "name": "request_id",
925
+ "in": "path",
926
+ "description": "Id of request",
927
+ "required": true,
928
+ "schema": {
929
+ "type": "string",
930
+ "pattern": "^\\d+$"
931
+ }
932
+ },
933
+ "limit": {
934
+ "name": "limit",
935
+ "in": "query",
936
+ "description": "How many items to return at one time (max 1000)",
937
+ "required": false,
938
+ "schema": {
939
+ "type": "integer",
940
+ "format": "int32",
941
+ "minimum": 1,
942
+ "maximum": 1000,
943
+ "default": 100
944
+ }
945
+ },
946
+ "offset": {
947
+ "name": "offset",
948
+ "in": "query",
949
+ "description": "Starting Offset",
950
+ "required": false,
951
+ "schema": {
952
+ "type": "integer",
953
+ "format": "int32",
954
+ "minimum": 0,
955
+ "default": 0
956
+ }
957
+ },
958
+ "app_name": {
959
+ "name": "app_name",
960
+ "in": "query",
961
+ "description": "Name of the application",
962
+ "required": false,
963
+ "schema": {
964
+ "type": "string"
965
+ }
966
+ },
967
+ "object_id": {
968
+ "name": "object_id",
969
+ "in": "query",
970
+ "description": "Id of the resource object",
971
+ "required": false,
972
+ "schema": {
973
+ "type": "string"
974
+ }
975
+ },
976
+ "object_type": {
977
+ "name": "object_type",
978
+ "in": "query",
979
+ "description": "Type of the resource object",
980
+ "required": false,
981
+ "schema": {
982
+ "type": "string"
983
+ }
984
+ },
985
+ "filter": {
986
+ "in": "query",
987
+ "name": "filter",
988
+ "description": "Filter for querying collections.",
989
+ "required": false,
990
+ "style": "deepObject",
991
+ "explode": true,
992
+ "schema": {
993
+ "type": "object"
994
+ }
995
+ },
996
+ "sort_by": {
997
+ "name": "sort_by",
998
+ "in": "query",
999
+ "description": "Parameter to sort collection",
1000
+ "required": false,
1001
+ "schema": {
1002
+ "type": "string"
1003
+ }
1004
+ },
1005
+ "persona": {
1006
+ "in": "header",
1007
+ "name": "x-rh-persona",
1008
+ "description": "Current login user's persona",
1009
+ "required": false,
1010
+ "schema": {
1011
+ "type": "string",
1012
+ "enum": ["approval/admin", "approval/approver", "approval/requester"]
1013
+ }
1014
+ }
1015
+ },
1016
+ "securitySchemes": {
1017
+ "Basic_auth": {
1018
+ "type": "http",
1019
+ "description": "The userid/password is needed when accessing this API externally",
1020
+ "scheme": "basic"
1021
+ }
1022
+ },
1023
+ "schemas": {
1024
+ "GraphqlIn": {
1025
+ "type": "object",
1026
+ "properties": {
1027
+ "query": {
1028
+ "type": "string",
1029
+ "description": "The GraphQL query",
1030
+ "default": "{}"
1031
+ },
1032
+ "operationName": {
1033
+ "type": "string",
1034
+ "description": "If the Query contains several named operations, the operationName controls which one should be executed",
1035
+ "default": ""
1036
+ },
1037
+ "variables": {
1038
+ "type": "object",
1039
+ "description": "Optional Query variables",
1040
+ "nullable": true
1041
+ }
1042
+ },
1043
+ "required": [
1044
+ "query"
1045
+ ]
1046
+ },
1047
+ "GraphqlOut": {
1048
+ "type": "object",
1049
+ "properties": {
1050
+ "data": {
1051
+ "type": "object",
1052
+ "description": "Results from the GraphQL query"
1053
+ },
1054
+ "errors": {
1055
+ "type": "array",
1056
+ "description": "Errors resulting from the GraphQL query",
1057
+ "items": {
1058
+ "type": "object"
1059
+ }
1060
+ }
1061
+ }
1062
+ },
1063
+ "Action": {
1064
+ "type": "object",
1065
+ "properties": {
1066
+ "id": {
1067
+ "type": "string",
1068
+ "readOnly": true
1069
+ },
1070
+ "created_at": {
1071
+ "type": "string",
1072
+ "format": "date-time",
1073
+ "description": "Timestamp of creation",
1074
+ "readOnly": true
1075
+ },
1076
+ "request_id": {
1077
+ "type": "string",
1078
+ "description": "Associated request id",
1079
+ "readOnly": true
1080
+ },
1081
+ "processed_by": {
1082
+ "type": "string",
1083
+ "description": "The person who performs the action"
1084
+ },
1085
+ "operation": {
1086
+ "type": "string",
1087
+ "description": "Types of action, may be one of the value (approve, cancel, deny, error, notify, memo, skip, or start). The request state will be updated according to the operation.",
1088
+ "enum": [
1089
+ "approve",
1090
+ "cancel",
1091
+ "deny",
1092
+ "error",
1093
+ "notify",
1094
+ "memo",
1095
+ "skip",
1096
+ "start"
1097
+ ],
1098
+ "default": "memo"
1099
+ },
1100
+ "comments": {
1101
+ "type": "string",
1102
+ "description": "Comments for action",
1103
+ "nullable": true
1104
+ }
1105
+ }
1106
+ },
1107
+ "ResourceObject": {
1108
+ "type": "object",
1109
+ "description": "Resource object definition",
1110
+ "required": [
1111
+ "object_type",
1112
+ "app_name",
1113
+ "object_id"
1114
+ ],
1115
+ "properties": {
1116
+ "object_type": {
1117
+ "type": "string",
1118
+ "description": "Object type"
1119
+ },
1120
+ "app_name": {
1121
+ "type": "string",
1122
+ "description": "Application name the object belongs to"
1123
+ },
1124
+ "object_id": {
1125
+ "type": "string",
1126
+ "description": "Id of the object"
1127
+ }
1128
+ }
1129
+ },
1130
+ "RequestIn": {
1131
+ "type": "object",
1132
+ "description": "Input parameters for approval request object.",
1133
+ "required": [
1134
+ "name",
1135
+ "content",
1136
+ "tag_resources"
1137
+ ],
1138
+ "properties": {
1139
+ "name": {
1140
+ "type": "string",
1141
+ "description": "Request name"
1142
+ },
1143
+ "description": {
1144
+ "type": "string",
1145
+ "description": "Request description"
1146
+ },
1147
+ "content": {
1148
+ "type": "object",
1149
+ "description": "JSON object with request content"
1150
+ },
1151
+ "tag_resources": {
1152
+ "type": "array",
1153
+ "description": "collection of resources having tags that determine the workflows for the request",
1154
+ "items": {
1155
+ "$ref": "#/components/schemas/TagResource"
1156
+ }
1157
+ }
1158
+ }
1159
+ },
1160
+ "TagResource": {
1161
+ "description": "Resource with tags",
1162
+ "type": "object",
1163
+ "required": [
1164
+ "app_name",
1165
+ "object_type",
1166
+ "tags"
1167
+ ],
1168
+ "properties": {
1169
+ "app_name": {
1170
+ "type": "string"
1171
+ },
1172
+ "object_type": {
1173
+ "type": "string"
1174
+ },
1175
+ "tags": {
1176
+ "type": "array",
1177
+ "items": {
1178
+ "$ref": "#/components/schemas/Tag"
1179
+ }
1180
+ }
1181
+ }
1182
+ },
1183
+ "Tag": {
1184
+ "description": "tag details",
1185
+ "type": "object",
1186
+ "properties": {
1187
+ "tag": {
1188
+ "example": "/namespace/architecture=x86_64",
1189
+ "type": "string"
1190
+ }
1191
+ },
1192
+ "additionalProperties": false
1193
+ },
1194
+ "Request": {
1195
+ "description": "Approval request. It may have child requests. Only a leaf node request can have workflow_id",
1196
+ "type": "object",
1197
+ "properties": {
1198
+ "id": {
1199
+ "type": "string",
1200
+ "readOnly": true
1201
+ },
1202
+ "state": {
1203
+ "type": "string",
1204
+ "description": "The state of the request. Possible value: canceled, completed, failed, notified, skipped, or started",
1205
+ "enum": [
1206
+ "canceled",
1207
+ "completed",
1208
+ "failed",
1209
+ "notified",
1210
+ "pending",
1211
+ "skipped",
1212
+ "started"
1213
+ ],
1214
+ "readOnly": true
1215
+ },
1216
+ "decision": {
1217
+ "type": "string",
1218
+ "description": "Approval decision. Possible value: undecided, approved, canceled, denied, or error",
1219
+ "enum": [
1220
+ "undecided",
1221
+ "approved",
1222
+ "canceled",
1223
+ "denied",
1224
+ "error"
1225
+ ],
1226
+ "readOnly": true
1227
+ },
1228
+ "reason": {
1229
+ "type": "string",
1230
+ "description": "Reason for the decision. Optional. Present normally when the decision is denied",
1231
+ "readOnly": true,
1232
+ "nullable": true
1233
+ },
1234
+ "workflow_id": {
1235
+ "type": "string",
1236
+ "description": "Associate workflow id. Available only if the request is a leaf node",
1237
+ "readOnly": true,
1238
+ "nullable": true
1239
+ },
1240
+ "created_at": {
1241
+ "type": "string",
1242
+ "format": "date-time",
1243
+ "description": "Timestamp of creation",
1244
+ "readOnly": true
1245
+ },
1246
+ "notified_at": {
1247
+ "type": "string",
1248
+ "format": "date-time",
1249
+ "description": "Timestamp of notification sent to approvers",
1250
+ "readOnly": true,
1251
+ "nullable": true
1252
+ },
1253
+ "finished_at": {
1254
+ "type": "string",
1255
+ "format": "date-time",
1256
+ "description": "Timestamp of finishing (skipped, canceled, or completed)",
1257
+ "readOnly": true,
1258
+ "nullable": true
1259
+ },
1260
+ "number_of_children": {
1261
+ "type": "integer",
1262
+ "description": "Number of child requests",
1263
+ "readOnly": true
1264
+ },
1265
+ "number_of_finished_children": {
1266
+ "type": "integer",
1267
+ "description": "Number of finished child requests",
1268
+ "readOnly": true
1269
+ },
1270
+ "owner": {
1271
+ "type": "string",
1272
+ "description": "Requester's id",
1273
+ "readOnly": true
1274
+ },
1275
+ "requester_name": {
1276
+ "type": "string",
1277
+ "description": "Requester's full name",
1278
+ "readOnly": true
1279
+ },
1280
+ "name": {
1281
+ "type": "string",
1282
+ "description": "Request name",
1283
+ "readOnly": true
1284
+ },
1285
+ "description": {
1286
+ "type": "string",
1287
+ "description": "Request description",
1288
+ "readOnly": true
1289
+ },
1290
+ "group_name": {
1291
+ "type": "string",
1292
+ "description": "Name of approver group(s) assigned to approve this request",
1293
+ "readOnly": true
1294
+ },
1295
+ "parent_id": {
1296
+ "type": "string",
1297
+ "description": "Parent request id",
1298
+ "readOnly": true
1299
+ },
1300
+ "metadata": {
1301
+ "type": "object",
1302
+ "title": "Metadata",
1303
+ "description": "JSON Metadata about the request",
1304
+ "readOnly": true
1305
+ }
1306
+ }
1307
+ },
1308
+ "RequestContent": {
1309
+ "type": "object",
1310
+ "description": "The content of a request"
1311
+ },
1312
+ "Template": {
1313
+ "type": "object",
1314
+ "description": "The template to categorize workflows.",
1315
+ "properties": {
1316
+ "id": {
1317
+ "type": "string",
1318
+ "readOnly": true
1319
+ },
1320
+ "title": {
1321
+ "type": "string",
1322
+ "readOnly": true
1323
+ },
1324
+ "description": {
1325
+ "type": "string",
1326
+ "readOnly": true
1327
+ },
1328
+ "metadata": {
1329
+ "type": "object",
1330
+ "title": "Metadata",
1331
+ "description": "JSON Metadata about the template",
1332
+ "readOnly": true
1333
+ }
1334
+ }
1335
+ },
1336
+ "Workflow": {
1337
+ "description": "The workflow to process approval requests. Each workflow is linked to multiple groups of approvals.",
1338
+ "type": "object",
1339
+ "properties": {
1340
+ "id": {
1341
+ "type": "string",
1342
+ "readOnly": true
1343
+ },
1344
+ "template_id": {
1345
+ "type": "string",
1346
+ "description": "Associated template id",
1347
+ "readOnly": true
1348
+ },
1349
+ "name": {
1350
+ "type": "string"
1351
+ },
1352
+ "description": {
1353
+ "type": "string",
1354
+ "nullable": true
1355
+ },
1356
+ "sequence": {
1357
+ "type": "integer",
1358
+ "description": "an indicator of the execution order for selected workflows",
1359
+ "minimum": 0,
1360
+ "exclusiveMinimum": true
1361
+ },
1362
+ "group_refs": {
1363
+ "type": "array",
1364
+ "description": "Group reference ids associated with workflow",
1365
+ "items": {
1366
+ "$ref": "#/components/schemas/GroupRef"
1367
+ },
1368
+ "uniqueItems": true
1369
+ },
1370
+ "metadata": {
1371
+ "type": "object",
1372
+ "title": "Metadata",
1373
+ "description": "JSON Metadata about the workflow",
1374
+ "readOnly": true
1375
+ }
1376
+ }
1377
+ },
1378
+ "GroupRef": {
1379
+ "type": "object",
1380
+ "description": "Group reference describing a RBAC group name and ID",
1381
+ "required": [
1382
+ "uuid"
1383
+ ],
1384
+ "properties": {
1385
+ "name": {
1386
+ "type": "string",
1387
+ "description": "Group name"
1388
+ },
1389
+ "uuid": {
1390
+ "type": "string",
1391
+ "description": "Group UUID",
1392
+ "format": "uuid"
1393
+ }
1394
+ }
1395
+ },
1396
+ "ActionCollection": {
1397
+ "type": "object",
1398
+ "properties": {
1399
+ "meta": {
1400
+ "$ref": "#/components/schemas/CollectionMetadata"
1401
+ },
1402
+ "links": {
1403
+ "$ref": "#/components/schemas/CollectionLinks"
1404
+ },
1405
+ "data": {
1406
+ "type": "array",
1407
+ "items": {
1408
+ "$ref": "#/components/schemas/Action"
1409
+ }
1410
+ }
1411
+ }
1412
+ },
1413
+ "RequestCollection": {
1414
+ "type": "object",
1415
+ "properties": {
1416
+ "meta": {
1417
+ "$ref": "#/components/schemas/CollectionMetadata"
1418
+ },
1419
+ "links": {
1420
+ "$ref": "#/components/schemas/CollectionLinks"
1421
+ },
1422
+ "data": {
1423
+ "type": "array",
1424
+ "items": {
1425
+ "$ref": "#/components/schemas/Request"
1426
+ }
1427
+ }
1428
+ }
1429
+ },
1430
+ "TemplateCollection": {
1431
+ "type": "object",
1432
+ "properties": {
1433
+ "meta": {
1434
+ "$ref": "#/components/schemas/CollectionMetadata"
1435
+ },
1436
+ "links": {
1437
+ "$ref": "#/components/schemas/CollectionLinks"
1438
+ },
1439
+ "data": {
1440
+ "type": "array",
1441
+ "items": {
1442
+ "$ref": "#/components/schemas/Template"
1443
+ }
1444
+ }
1445
+ }
1446
+ },
1447
+ "WorkflowCollection": {
1448
+ "type": "object",
1449
+ "properties": {
1450
+ "meta": {
1451
+ "$ref": "#/components/schemas/CollectionMetadata"
1452
+ },
1453
+ "links": {
1454
+ "$ref": "#/components/schemas/CollectionLinks"
1455
+ },
1456
+ "data": {
1457
+ "type": "array",
1458
+ "items": {
1459
+ "$ref": "#/components/schemas/Workflow"
1460
+ }
1461
+ }
1462
+ }
1463
+ },
1464
+ "CollectionLinks": {
1465
+ "type": "object",
1466
+ "properties": {
1467
+ "first": {
1468
+ "type": "string",
1469
+ "title": "First Link",
1470
+ "description": "The link to fetch the first group of items in the result set"
1471
+ },
1472
+ "last": {
1473
+ "type": "string",
1474
+ "title": "Last Link",
1475
+ "description": "The link to fetch the last group of items in the result set"
1476
+ },
1477
+ "prev": {
1478
+ "type": "string",
1479
+ "title": "Previous Link",
1480
+ "description": "The link to fetch the previous group of items in the result set"
1481
+ },
1482
+ "next": {
1483
+ "type": "string",
1484
+ "title": "Next Link",
1485
+ "description": "The link to fetch the next group of items in the result set"
1486
+ }
1487
+ }
1488
+ },
1489
+ "CollectionMetadata": {
1490
+ "type": "object",
1491
+ "properties": {
1492
+ "count": {
1493
+ "type": "integer",
1494
+ "title": "Total number of items in the result set",
1495
+ "description": "This is the total number of items in the result set, of which only a subset is returned defined by the QueryLimit parameter"
1496
+ },
1497
+ "limit": {
1498
+ "type": "integer",
1499
+ "title": "The number of items in each page",
1500
+ "description": "This is the number of items each page can display"
1501
+ },
1502
+ "offset": {
1503
+ "type": "integer",
1504
+ "title": "Offset from beginning of the result set",
1505
+ "description": "This is the offset from beginning of the result set"
1506
+ }
1507
+ }
1508
+ },
1509
+ "HttpApiErrorCollection": {
1510
+ "type": "object",
1511
+ "description": "API Error collection",
1512
+ "properties": {
1513
+ "errors": {
1514
+ "type": "array",
1515
+ "description": "Error list from the API query",
1516
+ "items": {
1517
+ "$ref": "#/components/schemas/HttpApiError"
1518
+ }
1519
+ }
1520
+ }
1521
+ },
1522
+ "HttpApiError": {
1523
+ "type": "object",
1524
+ "description": "API Error",
1525
+ "properties": {
1526
+ "status": {
1527
+ "type": "string",
1528
+ "description": "HTTP status code",
1529
+ "example": "400"
1530
+ },
1531
+ "details": {
1532
+ "type": "string",
1533
+ "description": "Error details",
1534
+ "example": "Bad Request"
1535
+ }
1536
+ }
1537
+ }
1538
+ }
1539
+ }
1540
+ }