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,21 @@
1
+ # ApprovalApiClient::RequestCollection
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **meta** | [**CollectionMetadata**](CollectionMetadata.md) | | [optional]
8
+ **links** | [**CollectionLinks**](CollectionLinks.md) | | [optional]
9
+ **data** | [**Array<Request>**](Request.md) | | [optional]
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'ApprovalApiClient'
15
+
16
+ instance = ApprovalApiClient::RequestCollection.new(meta: null,
17
+ links: null,
18
+ data: null)
19
+ ```
20
+
21
+
@@ -0,0 +1,23 @@
1
+ # ApprovalApiClient::RequestIn
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **name** | **String** | Request name |
8
+ **description** | **String** | Request description | [optional]
9
+ **content** | [**Object**](.md) | JSON object with request content |
10
+ **tag_resources** | [**Array<TagResource>**](TagResource.md) | collection of resources having tags that determine the workflows for the request |
11
+
12
+ ## Code Sample
13
+
14
+ ```ruby
15
+ require 'ApprovalApiClient'
16
+
17
+ instance = ApprovalApiClient::RequestIn.new(name: null,
18
+ description: null,
19
+ content: null,
20
+ tag_resources: null)
21
+ ```
22
+
23
+
@@ -0,0 +1,21 @@
1
+ # ApprovalApiClient::ResourceObject
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **object_type** | **String** | Object type |
8
+ **app_name** | **String** | Application name the object belongs to |
9
+ **object_id** | **String** | Id of the object |
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'ApprovalApiClient'
15
+
16
+ instance = ApprovalApiClient::ResourceObject.new(object_type: null,
17
+ app_name: null,
18
+ object_id: null)
19
+ ```
20
+
21
+
@@ -0,0 +1,17 @@
1
+ # ApprovalApiClient::Tag
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **tag** | **String** | | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'ApprovalApiClient'
13
+
14
+ instance = ApprovalApiClient::Tag.new(tag: /namespace/architecture=x86_64)
15
+ ```
16
+
17
+
@@ -0,0 +1,21 @@
1
+ # ApprovalApiClient::TagResource
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **app_name** | **String** | |
8
+ **object_type** | **String** | |
9
+ **tags** | [**Array<Tag>**](Tag.md) | |
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'ApprovalApiClient'
15
+
16
+ instance = ApprovalApiClient::TagResource.new(app_name: null,
17
+ object_type: null,
18
+ tags: null)
19
+ ```
20
+
21
+
@@ -0,0 +1,23 @@
1
+ # ApprovalApiClient::Template
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **id** | **String** | | [optional] [readonly]
8
+ **title** | **String** | | [optional] [readonly]
9
+ **description** | **String** | | [optional] [readonly]
10
+ **metadata** | [**Object**](.md) | JSON Metadata about the template | [optional] [readonly]
11
+
12
+ ## Code Sample
13
+
14
+ ```ruby
15
+ require 'ApprovalApiClient'
16
+
17
+ instance = ApprovalApiClient::Template.new(id: null,
18
+ title: null,
19
+ description: null,
20
+ metadata: null)
21
+ ```
22
+
23
+
@@ -0,0 +1,124 @@
1
+ # ApprovalApiClient::TemplateApi
2
+
3
+ All URIs are relative to *https://cloud.redhat.com//api/approval/v1.2*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**list_templates**](TemplateApi.md#list_templates) | **GET** /templates | Return all templates, only available for admin
8
+ [**show_template**](TemplateApi.md#show_template) | **GET** /templates/{id} | Return a template by given id, only available for admin
9
+
10
+
11
+
12
+ ## list_templates
13
+
14
+ > TemplateCollection list_templates(opts)
15
+
16
+ Return all templates, only available for admin
17
+
18
+ Return all templates
19
+
20
+ ### Example
21
+
22
+ ```ruby
23
+ # load the gem
24
+ require 'insights-approval-api-client'
25
+ # setup authorization
26
+ ApprovalApiClient.configure do |config|
27
+ # Configure HTTP basic authorization: Basic_auth
28
+ config.username = 'YOUR USERNAME'
29
+ config.password = 'YOUR PASSWORD'
30
+ end
31
+
32
+ api_instance = ApprovalApiClient::TemplateApi.new
33
+ opts = {
34
+ limit: 100, # Integer | How many items to return at one time (max 1000)
35
+ offset: 0, # Integer | Starting Offset
36
+ filter: nil, # Object | Filter for querying collections.
37
+ sort_by: 'sort_by_example' # String | Parameter to sort collection
38
+ }
39
+
40
+ begin
41
+ #Return all templates, only available for admin
42
+ result = api_instance.list_templates(opts)
43
+ p result
44
+ rescue ApprovalApiClient::ApiError => e
45
+ puts "Exception when calling TemplateApi->list_templates: #{e}"
46
+ end
47
+ ```
48
+
49
+ ### Parameters
50
+
51
+
52
+ Name | Type | Description | Notes
53
+ ------------- | ------------- | ------------- | -------------
54
+ **limit** | **Integer**| How many items to return at one time (max 1000) | [optional] [default to 100]
55
+ **offset** | **Integer**| Starting Offset | [optional] [default to 0]
56
+ **filter** | [**Object**](.md)| Filter for querying collections. | [optional]
57
+ **sort_by** | **String**| Parameter to sort collection | [optional]
58
+
59
+ ### Return type
60
+
61
+ [**TemplateCollection**](TemplateCollection.md)
62
+
63
+ ### Authorization
64
+
65
+ [Basic_auth](../README.md#Basic_auth)
66
+
67
+ ### HTTP request headers
68
+
69
+ - **Content-Type**: Not defined
70
+ - **Accept**: application/json
71
+
72
+
73
+ ## show_template
74
+
75
+ > Template show_template(id)
76
+
77
+ Return a template by given id, only available for admin
78
+
79
+ Return a template by given id
80
+
81
+ ### Example
82
+
83
+ ```ruby
84
+ # load the gem
85
+ require 'insights-approval-api-client'
86
+ # setup authorization
87
+ ApprovalApiClient.configure do |config|
88
+ # Configure HTTP basic authorization: Basic_auth
89
+ config.username = 'YOUR USERNAME'
90
+ config.password = 'YOUR PASSWORD'
91
+ end
92
+
93
+ api_instance = ApprovalApiClient::TemplateApi.new
94
+ id = 'id_example' # String | Query by id
95
+
96
+ begin
97
+ #Return a template by given id, only available for admin
98
+ result = api_instance.show_template(id)
99
+ p result
100
+ rescue ApprovalApiClient::ApiError => e
101
+ puts "Exception when calling TemplateApi->show_template: #{e}"
102
+ end
103
+ ```
104
+
105
+ ### Parameters
106
+
107
+
108
+ Name | Type | Description | Notes
109
+ ------------- | ------------- | ------------- | -------------
110
+ **id** | **String**| Query by id |
111
+
112
+ ### Return type
113
+
114
+ [**Template**](Template.md)
115
+
116
+ ### Authorization
117
+
118
+ [Basic_auth](../README.md#Basic_auth)
119
+
120
+ ### HTTP request headers
121
+
122
+ - **Content-Type**: Not defined
123
+ - **Accept**: */*
124
+
@@ -0,0 +1,21 @@
1
+ # ApprovalApiClient::TemplateCollection
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **meta** | [**CollectionMetadata**](CollectionMetadata.md) | | [optional]
8
+ **links** | [**CollectionLinks**](CollectionLinks.md) | | [optional]
9
+ **data** | [**Array<Template>**](Template.md) | | [optional]
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'ApprovalApiClient'
15
+
16
+ instance = ApprovalApiClient::TemplateCollection.new(meta: null,
17
+ links: null,
18
+ data: null)
19
+ ```
20
+
21
+
@@ -0,0 +1,29 @@
1
+ # ApprovalApiClient::Workflow
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **id** | **String** | | [optional] [readonly]
8
+ **template_id** | **String** | Associated template id | [optional] [readonly]
9
+ **name** | **String** | | [optional]
10
+ **description** | **String** | | [optional]
11
+ **sequence** | **Integer** | an indicator of the execution order for selected workflows | [optional]
12
+ **group_refs** | [**Array<GroupRef>**](GroupRef.md) | Group reference ids associated with workflow | [optional]
13
+ **metadata** | [**Object**](.md) | JSON Metadata about the workflow | [optional] [readonly]
14
+
15
+ ## Code Sample
16
+
17
+ ```ruby
18
+ require 'ApprovalApiClient'
19
+
20
+ instance = ApprovalApiClient::Workflow.new(id: null,
21
+ template_id: null,
22
+ name: null,
23
+ description: null,
24
+ sequence: null,
25
+ group_refs: null,
26
+ metadata: null)
27
+ ```
28
+
29
+
@@ -0,0 +1,469 @@
1
+ # ApprovalApiClient::WorkflowApi
2
+
3
+ All URIs are relative to *https://cloud.redhat.com//api/approval/v1.2*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**add_workflow_to_template**](WorkflowApi.md#add_workflow_to_template) | **POST** /templates/{template_id}/workflows | Add a workflow by given template id, only available for admin
8
+ [**destroy_workflow**](WorkflowApi.md#destroy_workflow) | **DELETE** /workflows/{id} | Delete approval workflow by given id, only available for admin
9
+ [**link_workflow**](WorkflowApi.md#link_workflow) | **POST** /workflows/{id}/link | Create a resource link to a given workflow
10
+ [**list_workflows**](WorkflowApi.md#list_workflows) | **GET** /workflows | Return all approval workflows, only available for admin
11
+ [**list_workflows_by_template**](WorkflowApi.md#list_workflows_by_template) | **GET** /templates/{template_id}/workflows | Return an array of workflows by given template id, only available for admin
12
+ [**show_workflow**](WorkflowApi.md#show_workflow) | **GET** /workflows/{id} | Return an approval workflow by given id, only available for admin
13
+ [**unlink_workflow**](WorkflowApi.md#unlink_workflow) | **POST** /workflows/{id}/unlink | Break the link between a resource object and selected workflow
14
+ [**update_workflow**](WorkflowApi.md#update_workflow) | **PATCH** /workflows/{id} | Update an approval workflow by given id, only available for admin
15
+
16
+
17
+
18
+ ## add_workflow_to_template
19
+
20
+ > Workflow add_workflow_to_template(template_id, workflow)
21
+
22
+ Add a workflow by given template id, only available for admin
23
+
24
+ Add a workflow by given template id
25
+
26
+ ### Example
27
+
28
+ ```ruby
29
+ # load the gem
30
+ require 'insights-approval-api-client'
31
+ # setup authorization
32
+ ApprovalApiClient.configure do |config|
33
+ # Configure HTTP basic authorization: Basic_auth
34
+ config.username = 'YOUR USERNAME'
35
+ config.password = 'YOUR PASSWORD'
36
+ end
37
+
38
+ api_instance = ApprovalApiClient::WorkflowApi.new
39
+ template_id = 'template_id_example' # String | Id of template
40
+ workflow = ApprovalApiClient::Workflow.new # Workflow | Parameters need to create workflow
41
+
42
+ begin
43
+ #Add a workflow by given template id, only available for admin
44
+ result = api_instance.add_workflow_to_template(template_id, workflow)
45
+ p result
46
+ rescue ApprovalApiClient::ApiError => e
47
+ puts "Exception when calling WorkflowApi->add_workflow_to_template: #{e}"
48
+ end
49
+ ```
50
+
51
+ ### Parameters
52
+
53
+
54
+ Name | Type | Description | Notes
55
+ ------------- | ------------- | ------------- | -------------
56
+ **template_id** | **String**| Id of template |
57
+ **workflow** | [**Workflow**](Workflow.md)| Parameters need to create workflow |
58
+
59
+ ### Return type
60
+
61
+ [**Workflow**](Workflow.md)
62
+
63
+ ### Authorization
64
+
65
+ [Basic_auth](../README.md#Basic_auth)
66
+
67
+ ### HTTP request headers
68
+
69
+ - **Content-Type**: application/json
70
+ - **Accept**: application/json
71
+
72
+
73
+ ## destroy_workflow
74
+
75
+ > destroy_workflow(id)
76
+
77
+ Delete approval workflow by given id, only available for admin
78
+
79
+ Delete approval workflow by given id
80
+
81
+ ### Example
82
+
83
+ ```ruby
84
+ # load the gem
85
+ require 'insights-approval-api-client'
86
+ # setup authorization
87
+ ApprovalApiClient.configure do |config|
88
+ # Configure HTTP basic authorization: Basic_auth
89
+ config.username = 'YOUR USERNAME'
90
+ config.password = 'YOUR PASSWORD'
91
+ end
92
+
93
+ api_instance = ApprovalApiClient::WorkflowApi.new
94
+ id = 'id_example' # String | Query by id
95
+
96
+ begin
97
+ #Delete approval workflow by given id, only available for admin
98
+ api_instance.destroy_workflow(id)
99
+ rescue ApprovalApiClient::ApiError => e
100
+ puts "Exception when calling WorkflowApi->destroy_workflow: #{e}"
101
+ end
102
+ ```
103
+
104
+ ### Parameters
105
+
106
+
107
+ Name | Type | Description | Notes
108
+ ------------- | ------------- | ------------- | -------------
109
+ **id** | **String**| Query by id |
110
+
111
+ ### Return type
112
+
113
+ nil (empty response body)
114
+
115
+ ### Authorization
116
+
117
+ [Basic_auth](../README.md#Basic_auth)
118
+
119
+ ### HTTP request headers
120
+
121
+ - **Content-Type**: Not defined
122
+ - **Accept**: Not defined
123
+
124
+
125
+ ## link_workflow
126
+
127
+ > link_workflow(id, resource_object)
128
+
129
+ Create a resource link to a given workflow
130
+
131
+ Link a resource object to a given workflow
132
+
133
+ ### Example
134
+
135
+ ```ruby
136
+ # load the gem
137
+ require 'insights-approval-api-client'
138
+ # setup authorization
139
+ ApprovalApiClient.configure do |config|
140
+ # Configure HTTP basic authorization: Basic_auth
141
+ config.username = 'YOUR USERNAME'
142
+ config.password = 'YOUR PASSWORD'
143
+ end
144
+
145
+ api_instance = ApprovalApiClient::WorkflowApi.new
146
+ id = 'id_example' # String | Query by id
147
+ resource_object = ApprovalApiClient::ResourceObject.new # ResourceObject | Parameters needed to create a link
148
+
149
+ begin
150
+ #Create a resource link to a given workflow
151
+ api_instance.link_workflow(id, resource_object)
152
+ rescue ApprovalApiClient::ApiError => e
153
+ puts "Exception when calling WorkflowApi->link_workflow: #{e}"
154
+ end
155
+ ```
156
+
157
+ ### Parameters
158
+
159
+
160
+ Name | Type | Description | Notes
161
+ ------------- | ------------- | ------------- | -------------
162
+ **id** | **String**| Query by id |
163
+ **resource_object** | [**ResourceObject**](ResourceObject.md)| Parameters needed to create a link |
164
+
165
+ ### Return type
166
+
167
+ nil (empty response body)
168
+
169
+ ### Authorization
170
+
171
+ [Basic_auth](../README.md#Basic_auth)
172
+
173
+ ### HTTP request headers
174
+
175
+ - **Content-Type**: application/json
176
+ - **Accept**: Not defined
177
+
178
+
179
+ ## list_workflows
180
+
181
+ > WorkflowCollection list_workflows(opts)
182
+
183
+ Return all approval workflows, only available for admin
184
+
185
+ 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
186
+
187
+ ### Example
188
+
189
+ ```ruby
190
+ # load the gem
191
+ require 'insights-approval-api-client'
192
+ # setup authorization
193
+ ApprovalApiClient.configure do |config|
194
+ # Configure HTTP basic authorization: Basic_auth
195
+ config.username = 'YOUR USERNAME'
196
+ config.password = 'YOUR PASSWORD'
197
+ end
198
+
199
+ api_instance = ApprovalApiClient::WorkflowApi.new
200
+ opts = {
201
+ app_name: 'app_name_example', # String | Name of the application
202
+ object_id: 'object_id_example', # String | Id of the resource object
203
+ object_type: 'object_type_example', # String | Type of the resource object
204
+ limit: 100, # Integer | How many items to return at one time (max 1000)
205
+ offset: 0, # Integer | Starting Offset
206
+ filter: nil, # Object | Filter for querying collections.
207
+ sort_by: 'sort_by_example' # String | Parameter to sort collection
208
+ }
209
+
210
+ begin
211
+ #Return all approval workflows, only available for admin
212
+ result = api_instance.list_workflows(opts)
213
+ p result
214
+ rescue ApprovalApiClient::ApiError => e
215
+ puts "Exception when calling WorkflowApi->list_workflows: #{e}"
216
+ end
217
+ ```
218
+
219
+ ### Parameters
220
+
221
+
222
+ Name | Type | Description | Notes
223
+ ------------- | ------------- | ------------- | -------------
224
+ **app_name** | **String**| Name of the application | [optional]
225
+ **object_id** | **String**| Id of the resource object | [optional]
226
+ **object_type** | **String**| Type of the resource object | [optional]
227
+ **limit** | **Integer**| How many items to return at one time (max 1000) | [optional] [default to 100]
228
+ **offset** | **Integer**| Starting Offset | [optional] [default to 0]
229
+ **filter** | [**Object**](.md)| Filter for querying collections. | [optional]
230
+ **sort_by** | **String**| Parameter to sort collection | [optional]
231
+
232
+ ### Return type
233
+
234
+ [**WorkflowCollection**](WorkflowCollection.md)
235
+
236
+ ### Authorization
237
+
238
+ [Basic_auth](../README.md#Basic_auth)
239
+
240
+ ### HTTP request headers
241
+
242
+ - **Content-Type**: Not defined
243
+ - **Accept**: */*
244
+
245
+
246
+ ## list_workflows_by_template
247
+
248
+ > WorkflowCollection list_workflows_by_template(template_id, opts)
249
+
250
+ Return an array of workflows by given template id, only available for admin
251
+
252
+ Return an array of workflows by given template id
253
+
254
+ ### Example
255
+
256
+ ```ruby
257
+ # load the gem
258
+ require 'insights-approval-api-client'
259
+ # setup authorization
260
+ ApprovalApiClient.configure do |config|
261
+ # Configure HTTP basic authorization: Basic_auth
262
+ config.username = 'YOUR USERNAME'
263
+ config.password = 'YOUR PASSWORD'
264
+ end
265
+
266
+ api_instance = ApprovalApiClient::WorkflowApi.new
267
+ template_id = 'template_id_example' # String | Id of template
268
+ opts = {
269
+ limit: 100, # Integer | How many items to return at one time (max 1000)
270
+ offset: 0, # Integer | Starting Offset
271
+ filter: nil, # Object | Filter for querying collections.
272
+ sort_by: 'sort_by_example' # String | Parameter to sort collection
273
+ }
274
+
275
+ begin
276
+ #Return an array of workflows by given template id, only available for admin
277
+ result = api_instance.list_workflows_by_template(template_id, opts)
278
+ p result
279
+ rescue ApprovalApiClient::ApiError => e
280
+ puts "Exception when calling WorkflowApi->list_workflows_by_template: #{e}"
281
+ end
282
+ ```
283
+
284
+ ### Parameters
285
+
286
+
287
+ Name | Type | Description | Notes
288
+ ------------- | ------------- | ------------- | -------------
289
+ **template_id** | **String**| Id of template |
290
+ **limit** | **Integer**| How many items to return at one time (max 1000) | [optional] [default to 100]
291
+ **offset** | **Integer**| Starting Offset | [optional] [default to 0]
292
+ **filter** | [**Object**](.md)| Filter for querying collections. | [optional]
293
+ **sort_by** | **String**| Parameter to sort collection | [optional]
294
+
295
+ ### Return type
296
+
297
+ [**WorkflowCollection**](WorkflowCollection.md)
298
+
299
+ ### Authorization
300
+
301
+ [Basic_auth](../README.md#Basic_auth)
302
+
303
+ ### HTTP request headers
304
+
305
+ - **Content-Type**: Not defined
306
+ - **Accept**: application/json
307
+
308
+
309
+ ## show_workflow
310
+
311
+ > Workflow show_workflow(id)
312
+
313
+ Return an approval workflow by given id, only available for admin
314
+
315
+ Return an approval workflow by given id
316
+
317
+ ### Example
318
+
319
+ ```ruby
320
+ # load the gem
321
+ require 'insights-approval-api-client'
322
+ # setup authorization
323
+ ApprovalApiClient.configure do |config|
324
+ # Configure HTTP basic authorization: Basic_auth
325
+ config.username = 'YOUR USERNAME'
326
+ config.password = 'YOUR PASSWORD'
327
+ end
328
+
329
+ api_instance = ApprovalApiClient::WorkflowApi.new
330
+ id = 'id_example' # String | Query by id
331
+
332
+ begin
333
+ #Return an approval workflow by given id, only available for admin
334
+ result = api_instance.show_workflow(id)
335
+ p result
336
+ rescue ApprovalApiClient::ApiError => e
337
+ puts "Exception when calling WorkflowApi->show_workflow: #{e}"
338
+ end
339
+ ```
340
+
341
+ ### Parameters
342
+
343
+
344
+ Name | Type | Description | Notes
345
+ ------------- | ------------- | ------------- | -------------
346
+ **id** | **String**| Query by id |
347
+
348
+ ### Return type
349
+
350
+ [**Workflow**](Workflow.md)
351
+
352
+ ### Authorization
353
+
354
+ [Basic_auth](../README.md#Basic_auth)
355
+
356
+ ### HTTP request headers
357
+
358
+ - **Content-Type**: Not defined
359
+ - **Accept**: */*
360
+
361
+
362
+ ## unlink_workflow
363
+
364
+ > unlink_workflow(id, resource_object)
365
+
366
+ Break the link between a resource object and selected workflow
367
+
368
+ Break the link between a resource object and selected workflow
369
+
370
+ ### Example
371
+
372
+ ```ruby
373
+ # load the gem
374
+ require 'insights-approval-api-client'
375
+ # setup authorization
376
+ ApprovalApiClient.configure do |config|
377
+ # Configure HTTP basic authorization: Basic_auth
378
+ config.username = 'YOUR USERNAME'
379
+ config.password = 'YOUR PASSWORD'
380
+ end
381
+
382
+ api_instance = ApprovalApiClient::WorkflowApi.new
383
+ id = 'id_example' # String | Query by id
384
+ resource_object = ApprovalApiClient::ResourceObject.new # ResourceObject | Parameters needed to remove a link
385
+
386
+ begin
387
+ #Break the link between a resource object and selected workflow
388
+ api_instance.unlink_workflow(id, resource_object)
389
+ rescue ApprovalApiClient::ApiError => e
390
+ puts "Exception when calling WorkflowApi->unlink_workflow: #{e}"
391
+ end
392
+ ```
393
+
394
+ ### Parameters
395
+
396
+
397
+ Name | Type | Description | Notes
398
+ ------------- | ------------- | ------------- | -------------
399
+ **id** | **String**| Query by id |
400
+ **resource_object** | [**ResourceObject**](ResourceObject.md)| Parameters needed to remove a link |
401
+
402
+ ### Return type
403
+
404
+ nil (empty response body)
405
+
406
+ ### Authorization
407
+
408
+ [Basic_auth](../README.md#Basic_auth)
409
+
410
+ ### HTTP request headers
411
+
412
+ - **Content-Type**: application/json
413
+ - **Accept**: Not defined
414
+
415
+
416
+ ## update_workflow
417
+
418
+ > Workflow update_workflow(id, workflow)
419
+
420
+ Update an approval workflow by given id, only available for admin
421
+
422
+ Update an approval workflow by given id
423
+
424
+ ### Example
425
+
426
+ ```ruby
427
+ # load the gem
428
+ require 'insights-approval-api-client'
429
+ # setup authorization
430
+ ApprovalApiClient.configure do |config|
431
+ # Configure HTTP basic authorization: Basic_auth
432
+ config.username = 'YOUR USERNAME'
433
+ config.password = 'YOUR PASSWORD'
434
+ end
435
+
436
+ api_instance = ApprovalApiClient::WorkflowApi.new
437
+ id = 'id_example' # String | Query by id
438
+ workflow = ApprovalApiClient::Workflow.new # Workflow | Parameters need to update approval workflow
439
+
440
+ begin
441
+ #Update an approval workflow by given id, only available for admin
442
+ result = api_instance.update_workflow(id, workflow)
443
+ p result
444
+ rescue ApprovalApiClient::ApiError => e
445
+ puts "Exception when calling WorkflowApi->update_workflow: #{e}"
446
+ end
447
+ ```
448
+
449
+ ### Parameters
450
+
451
+
452
+ Name | Type | Description | Notes
453
+ ------------- | ------------- | ------------- | -------------
454
+ **id** | **String**| Query by id |
455
+ **workflow** | [**Workflow**](Workflow.md)| Parameters need to update approval workflow |
456
+
457
+ ### Return type
458
+
459
+ [**Workflow**](Workflow.md)
460
+
461
+ ### Authorization
462
+
463
+ [Basic_auth](../README.md#Basic_auth)
464
+
465
+ ### HTTP request headers
466
+
467
+ - **Content-Type**: application/json
468
+ - **Accept**: */*
469
+