quake_timesheets_client 0.1.0 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +74 -0
- data/README.md +27 -21
- data/build.sh +1 -1
- data/docs/ApprovalTypesApi.md +36 -38
- data/docs/ApprovalsApi.md +36 -40
- data/docs/CreateApprovalTypesInput.md +22 -0
- data/docs/CreateApprovalsInput.md +24 -0
- data/docs/CreateDatasetsInput.md +18 -0
- data/docs/CreateEntriesInput.md +30 -0
- data/docs/CreatePeopleInput.md +20 -0
- data/docs/DatasetsApi.md +51 -49
- data/docs/EntriesApi.md +52 -72
- data/docs/Entry.md +2 -0
- data/docs/PeopleApi.md +36 -36
- data/docs/UpdateEntriesInput.md +30 -0
- data/lib/quake_timesheets_client.rb +7 -1
- data/lib/quake_timesheets_client/api/approval_types_api.rb +33 -52
- data/lib/quake_timesheets_client/api/approvals_api.rb +34 -65
- data/lib/quake_timesheets_client/api/datasets_api.rb +45 -50
- data/lib/quake_timesheets_client/api/entries_api.rb +54 -94
- data/lib/quake_timesheets_client/api/people_api.rb +33 -45
- data/lib/quake_timesheets_client/api_client.rb +1 -1
- data/lib/quake_timesheets_client/api_error.rb +1 -1
- data/lib/quake_timesheets_client/configuration.rb +1 -1
- data/lib/quake_timesheets_client/models/approval.rb +1 -1
- data/lib/quake_timesheets_client/models/approval_type.rb +1 -1
- data/lib/quake_timesheets_client/models/create_approval_types_input.rb +254 -0
- data/lib/quake_timesheets_client/models/create_approvals_input.rb +304 -0
- data/lib/quake_timesheets_client/models/create_datasets_input.rb +224 -0
- data/lib/quake_timesheets_client/models/create_entries_input.rb +313 -0
- data/lib/quake_timesheets_client/models/create_people_input.rb +239 -0
- data/lib/quake_timesheets_client/models/dataset.rb +1 -1
- data/lib/quake_timesheets_client/models/entry.rb +19 -2
- data/lib/quake_timesheets_client/models/person.rb +1 -1
- data/lib/quake_timesheets_client/models/update_entries_input.rb +313 -0
- data/lib/quake_timesheets_client/version.rb +2 -2
- data/quake_timesheets_client.gemspec +1 -1
- data/ruby-templates/api.mustache +206 -0
- data/ruby.config.yaml +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/create_approval_types_input_spec.rb +46 -0
- data/spec/models/create_approvals_input_spec.rb +56 -0
- data/spec/models/create_datasets_input_spec.rb +34 -0
- data/spec/models/create_entries_input_spec.rb +68 -0
- data/spec/models/create_people_input_spec.rb +40 -0
- data/spec/models/update_entries_input_spec.rb +68 -0
- data/spec/spec_helper.rb +1 -1
- metadata +34 -9
- data/commands +0 -13
data/docs/Entry.md
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
| **quantity** | **Float** | | [optional] |
|
13
13
|
| **unit** | **String** | | [optional] |
|
14
14
|
| **external_reference** | **String** | Unique identifier of the activity this Entry relates to | [optional] |
|
15
|
+
| **tags** | **Array<String>** | The Tags attached to this entry. | |
|
15
16
|
| **created_at** | **String** | Time at which the record was created | |
|
16
17
|
| **updated_at** | **String** | Time at which the record was updated | |
|
17
18
|
|
@@ -29,6 +30,7 @@ instance = Quake::Timesheets::Entry.new(
|
|
29
30
|
quantity: null,
|
30
31
|
unit: null,
|
31
32
|
external_reference: null,
|
33
|
+
tags: null,
|
32
34
|
created_at: null,
|
33
35
|
updated_at: null
|
34
36
|
)
|
data/docs/PeopleApi.md
CHANGED
@@ -4,15 +4,15 @@ All URIs are relative to *https://timesheetsapi.svc.lumbry.co.uk:443*
|
|
4
4
|
|
5
5
|
| Method | HTTP request | Description |
|
6
6
|
| ------ | ------------ | ----------- |
|
7
|
-
| [**
|
8
|
-
| [**
|
7
|
+
| [**create_people**](PeopleApi.md#create_people) | **POST** /api/v1/people | Create a new Person record |
|
8
|
+
| [**index_people**](PeopleApi.md#index_people) | **GET** /api/v1/people | Search for people matching filters |
|
9
9
|
|
10
10
|
|
11
|
-
##
|
11
|
+
## create_people
|
12
12
|
|
13
|
-
> <
|
13
|
+
> <Person> create_people(opts)
|
14
14
|
|
15
|
-
|
15
|
+
Create a new Person record
|
16
16
|
|
17
17
|
### Examples
|
18
18
|
|
@@ -29,33 +29,33 @@ end
|
|
29
29
|
|
30
30
|
api_instance = Quake::Timesheets::PeopleApi.new
|
31
31
|
opts = {
|
32
|
-
dataset_id: 'dataset_id_example' #
|
32
|
+
create_people_input: Quake::Timesheets::CreatePeopleInput.new({dataset_id: 'dataset_id_example', name: 'name_example'}) # CreatePeopleInput |
|
33
33
|
}
|
34
34
|
|
35
35
|
begin
|
36
|
-
#
|
37
|
-
result = api_instance.
|
36
|
+
# Create a new Person record
|
37
|
+
result = api_instance.create_people(opts)
|
38
38
|
p result
|
39
39
|
rescue Quake::Timesheets::ApiError => e
|
40
|
-
puts "Error when calling PeopleApi->
|
40
|
+
puts "Error when calling PeopleApi->create_people: #{e}"
|
41
41
|
end
|
42
42
|
```
|
43
43
|
|
44
|
-
#### Using the
|
44
|
+
#### Using the create_people_with_http_info variant
|
45
45
|
|
46
46
|
This returns an Array which contains the response data, status code and headers.
|
47
47
|
|
48
|
-
> <Array(<
|
48
|
+
> <Array(<Person>, Integer, Hash)> create_people_with_http_info(opts)
|
49
49
|
|
50
50
|
```ruby
|
51
51
|
begin
|
52
|
-
#
|
53
|
-
data, status_code, headers = api_instance.
|
52
|
+
# Create a new Person record
|
53
|
+
data, status_code, headers = api_instance.create_people_with_http_info(opts)
|
54
54
|
p status_code # => 2xx
|
55
55
|
p headers # => { ... }
|
56
|
-
p data # => <
|
56
|
+
p data # => <Person>
|
57
57
|
rescue Quake::Timesheets::ApiError => e
|
58
|
-
puts "Error when calling PeopleApi->
|
58
|
+
puts "Error when calling PeopleApi->create_people_with_http_info: #{e}"
|
59
59
|
end
|
60
60
|
```
|
61
61
|
|
@@ -63,11 +63,11 @@ end
|
|
63
63
|
|
64
64
|
| Name | Type | Description | Notes |
|
65
65
|
| ---- | ---- | ----------- | ----- |
|
66
|
-
| **
|
66
|
+
| **create_people_input** | [**CreatePeopleInput**](CreatePeopleInput.md) | | [optional] |
|
67
67
|
|
68
68
|
### Return type
|
69
69
|
|
70
|
-
[**
|
70
|
+
[**Person**](Person.md)
|
71
71
|
|
72
72
|
### Authorization
|
73
73
|
|
@@ -75,15 +75,15 @@ end
|
|
75
75
|
|
76
76
|
### HTTP request headers
|
77
77
|
|
78
|
-
- **Content-Type**:
|
78
|
+
- **Content-Type**: application/json
|
79
79
|
- **Accept**: */*
|
80
80
|
|
81
81
|
|
82
|
-
##
|
82
|
+
## index_people
|
83
83
|
|
84
|
-
> <Person
|
84
|
+
> <Array<Person>> index_people(opts)
|
85
85
|
|
86
|
-
|
86
|
+
Search for people matching filters
|
87
87
|
|
88
88
|
### Examples
|
89
89
|
|
@@ -99,33 +99,34 @@ Quake::Timesheets.configure do |config|
|
|
99
99
|
end
|
100
100
|
|
101
101
|
api_instance = Quake::Timesheets::PeopleApi.new
|
102
|
-
|
103
|
-
dataset_id
|
102
|
+
opts = {
|
103
|
+
dataset_id: 'dataset_id_example' # String | Filter to the people belonging to one of the identified datasets
|
104
|
+
}
|
104
105
|
|
105
106
|
begin
|
106
|
-
#
|
107
|
-
result = api_instance.
|
107
|
+
# Search for people matching filters
|
108
|
+
result = api_instance.index_people(opts)
|
108
109
|
p result
|
109
110
|
rescue Quake::Timesheets::ApiError => e
|
110
|
-
puts "Error when calling PeopleApi->
|
111
|
+
puts "Error when calling PeopleApi->index_people: #{e}"
|
111
112
|
end
|
112
113
|
```
|
113
114
|
|
114
|
-
#### Using the
|
115
|
+
#### Using the index_people_with_http_info variant
|
115
116
|
|
116
117
|
This returns an Array which contains the response data, status code and headers.
|
117
118
|
|
118
|
-
> <Array(<Person
|
119
|
+
> <Array(<Array<Person>>, Integer, Hash)> index_people_with_http_info(opts)
|
119
120
|
|
120
121
|
```ruby
|
121
122
|
begin
|
122
|
-
#
|
123
|
-
data, status_code, headers = api_instance.
|
123
|
+
# Search for people matching filters
|
124
|
+
data, status_code, headers = api_instance.index_people_with_http_info(opts)
|
124
125
|
p status_code # => 2xx
|
125
126
|
p headers # => { ... }
|
126
|
-
p data # => <Person
|
127
|
+
p data # => <Array<Person>>
|
127
128
|
rescue Quake::Timesheets::ApiError => e
|
128
|
-
puts "Error when calling PeopleApi->
|
129
|
+
puts "Error when calling PeopleApi->index_people_with_http_info: #{e}"
|
129
130
|
end
|
130
131
|
```
|
131
132
|
|
@@ -133,12 +134,11 @@ end
|
|
133
134
|
|
134
135
|
| Name | Type | Description | Notes |
|
135
136
|
| ---- | ---- | ----------- | ----- |
|
136
|
-
| **
|
137
|
-
| **dataset_id** | **String** | Dataset to which the Person object should belong | |
|
137
|
+
| **dataset_id** | **String** | Filter to the people belonging to one of the identified datasets | [optional] |
|
138
138
|
|
139
139
|
### Return type
|
140
140
|
|
141
|
-
[**Person
|
141
|
+
[**Array<Person>**](Person.md)
|
142
142
|
|
143
143
|
### Authorization
|
144
144
|
|
@@ -146,6 +146,6 @@ end
|
|
146
146
|
|
147
147
|
### HTTP request headers
|
148
148
|
|
149
|
-
- **Content-Type**:
|
149
|
+
- **Content-Type**: Not defined
|
150
150
|
- **Accept**: */*
|
151
151
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Quake::Timesheets::UpdateEntriesInput
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **person_id** | **String** | ID of the person to which this entry pertains | [optional] |
|
8
|
+
| **start_at** | **String** | Time period at which this entry starts | [optional] |
|
9
|
+
| **end_at** | **String** | Time period at which this entry ends | [optional] |
|
10
|
+
| **quantity** | **Float** | | [optional] |
|
11
|
+
| **unit** | **String** | | [optional] |
|
12
|
+
| **external_reference** | **String** | Unique identifier of the activity this Entry relates to | [optional] |
|
13
|
+
| **tags** | **Array<String>** | The Tags attached to this entries. Can take an Array of UUIDs of existing Tags, or any String which will find or create a Tag with that value | [optional] |
|
14
|
+
|
15
|
+
## Example
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'quake_timesheets_client'
|
19
|
+
|
20
|
+
instance = Quake::Timesheets::UpdateEntriesInput.new(
|
21
|
+
person_id: null,
|
22
|
+
start_at: null,
|
23
|
+
end_at: null,
|
24
|
+
quantity: null,
|
25
|
+
unit: null,
|
26
|
+
external_reference: null,
|
27
|
+
tags: null
|
28
|
+
)
|
29
|
+
```
|
30
|
+
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
#TimesheetsApi (params in:
|
2
|
+
#TimesheetsApi (params in:body)
|
3
3
|
|
4
4
|
# <p>Another API description</p>
|
5
5
|
|
@@ -28,9 +28,15 @@ require 'quake_timesheets_client/configuration'
|
|
28
28
|
# Models
|
29
29
|
require 'quake_timesheets_client/models/approval'
|
30
30
|
require 'quake_timesheets_client/models/approval_type'
|
31
|
+
require 'quake_timesheets_client/models/create_approval_types_input'
|
32
|
+
require 'quake_timesheets_client/models/create_approvals_input'
|
33
|
+
require 'quake_timesheets_client/models/create_datasets_input'
|
34
|
+
require 'quake_timesheets_client/models/create_entries_input'
|
35
|
+
require 'quake_timesheets_client/models/create_people_input'
|
31
36
|
require 'quake_timesheets_client/models/dataset'
|
32
37
|
require 'quake_timesheets_client/models/entry'
|
33
38
|
require 'quake_timesheets_client/models/person'
|
39
|
+
require 'quake_timesheets_client/models/update_entries_input'
|
34
40
|
|
35
41
|
# APIs
|
36
42
|
require 'quake_timesheets_client/api/approval_types_api'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
#TimesheetsApi (params in:
|
2
|
+
#TimesheetsApi (params in:body)
|
3
3
|
|
4
4
|
# <p>Another API description</p>
|
5
5
|
|
@@ -19,49 +19,50 @@ module Quake::Timesheets
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
#
|
22
|
+
# Create a new Approval Type
|
23
23
|
# @param [Hash] opts the optional parameters
|
24
|
-
# @option opts [
|
25
|
-
# @return [
|
26
|
-
def
|
27
|
-
data, _status_code, _headers =
|
24
|
+
# @option opts [CreateApprovalTypesInput] :create_approval_types_input
|
25
|
+
# @return [ApprovalType]
|
26
|
+
def create_approval_types(opts = {})
|
27
|
+
data, _status_code, _headers = create_approval_types_with_http_info(opts)
|
28
28
|
data
|
29
29
|
end
|
30
30
|
|
31
|
-
#
|
31
|
+
# Create a new Approval Type
|
32
32
|
# @param [Hash] opts the optional parameters
|
33
|
-
# @option opts [
|
34
|
-
# @return [Array<(
|
35
|
-
def
|
33
|
+
# @option opts [CreateApprovalTypesInput] :create_approval_types_input
|
34
|
+
# @return [Array<(ApprovalType, Integer, Hash)>] ApprovalType data, response status code and response headers
|
35
|
+
def create_approval_types_with_http_info(opts = {})
|
36
36
|
if @api_client.config.debugging
|
37
|
-
@api_client.config.logger.debug 'Calling API: ApprovalTypesApi.
|
37
|
+
@api_client.config.logger.debug 'Calling API: ApprovalTypesApi.create_approval_types ...'
|
38
38
|
end
|
39
39
|
# resource path
|
40
40
|
local_var_path = '/api/v1/approval_types'
|
41
41
|
|
42
42
|
# query parameters
|
43
43
|
query_params = opts[:query_params] || {}
|
44
|
-
query_params[:'dataset_id'] = opts[:'dataset_id'] if !opts[:'dataset_id'].nil?
|
45
44
|
|
46
45
|
# header parameters
|
47
46
|
header_params = opts[:header_params] || {}
|
48
47
|
# HTTP header 'Accept' (if needed)
|
49
48
|
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
49
|
+
# HTTP header 'Content-Type'
|
50
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
50
51
|
|
51
52
|
# form parameters
|
52
53
|
form_params = opts[:form_params] || {}
|
53
54
|
|
54
55
|
# http body (model)
|
55
|
-
post_body = opts[:debug_body]
|
56
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_approval_types_input'] || opts[:body])
|
56
57
|
|
57
58
|
# return_type
|
58
|
-
return_type = opts[:debug_return_type] || '
|
59
|
+
return_type = opts[:debug_return_type] || 'ApprovalType'
|
59
60
|
|
60
61
|
# auth_names
|
61
62
|
auth_names = opts[:debug_auth_names] || ['authToken']
|
62
63
|
|
63
64
|
new_options = opts.merge(
|
64
|
-
:operation => :"ApprovalTypesApi.
|
65
|
+
:operation => :"ApprovalTypesApi.create_approval_types",
|
65
66
|
:header_params => header_params,
|
66
67
|
:query_params => query_params,
|
67
68
|
:form_params => form_params,
|
@@ -70,76 +71,56 @@ module Quake::Timesheets
|
|
70
71
|
:return_type => return_type
|
71
72
|
)
|
72
73
|
|
73
|
-
data, status_code, headers = @api_client.call_api(:
|
74
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
74
75
|
if @api_client.config.debugging
|
75
|
-
@api_client.config.logger.debug "API called: ApprovalTypesApi#
|
76
|
+
@api_client.config.logger.debug "API called: ApprovalTypesApi#create_approval_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
76
77
|
end
|
77
78
|
return data, status_code, headers
|
78
79
|
end
|
79
80
|
|
80
|
-
#
|
81
|
-
# @param weight [Float] The weight provided by approvals of this type
|
82
|
-
# @param name [String] The name of the approval type
|
83
|
-
# @param dataset_id [String] ID of the dataset this approval type is linked to
|
81
|
+
# Search for approval types matching filters
|
84
82
|
# @param [Hash] opts the optional parameters
|
85
|
-
# @
|
86
|
-
|
87
|
-
|
83
|
+
# @option opts [String] :dataset_id Filter to the approval types belonging to one of the identified datasets
|
84
|
+
# @return [Array<ApprovalType>]
|
85
|
+
def index_approval_types(opts = {})
|
86
|
+
data, _status_code, _headers = index_approval_types_with_http_info(opts)
|
88
87
|
data
|
89
88
|
end
|
90
89
|
|
91
|
-
#
|
92
|
-
# @param weight [Float] The weight provided by approvals of this type
|
93
|
-
# @param name [String] The name of the approval type
|
94
|
-
# @param dataset_id [String] ID of the dataset this approval type is linked to
|
90
|
+
# Search for approval types matching filters
|
95
91
|
# @param [Hash] opts the optional parameters
|
96
|
-
# @
|
97
|
-
|
92
|
+
# @option opts [String] :dataset_id Filter to the approval types belonging to one of the identified datasets
|
93
|
+
# @return [Array<(Array<ApprovalType>, Integer, Hash)>] Array<ApprovalType> data, response status code and response headers
|
94
|
+
def index_approval_types_with_http_info(opts = {})
|
98
95
|
if @api_client.config.debugging
|
99
|
-
@api_client.config.logger.debug 'Calling API: ApprovalTypesApi.
|
100
|
-
end
|
101
|
-
# verify the required parameter 'weight' is set
|
102
|
-
if @api_client.config.client_side_validation && weight.nil?
|
103
|
-
fail ArgumentError, "Missing the required parameter 'weight' when calling ApprovalTypesApi.post_api_v1_approval_types"
|
104
|
-
end
|
105
|
-
# verify the required parameter 'name' is set
|
106
|
-
if @api_client.config.client_side_validation && name.nil?
|
107
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling ApprovalTypesApi.post_api_v1_approval_types"
|
108
|
-
end
|
109
|
-
# verify the required parameter 'dataset_id' is set
|
110
|
-
if @api_client.config.client_side_validation && dataset_id.nil?
|
111
|
-
fail ArgumentError, "Missing the required parameter 'dataset_id' when calling ApprovalTypesApi.post_api_v1_approval_types"
|
96
|
+
@api_client.config.logger.debug 'Calling API: ApprovalTypesApi.index_approval_types ...'
|
112
97
|
end
|
113
98
|
# resource path
|
114
99
|
local_var_path = '/api/v1/approval_types'
|
115
100
|
|
116
101
|
# query parameters
|
117
102
|
query_params = opts[:query_params] || {}
|
103
|
+
query_params[:'dataset_id'] = opts[:'dataset_id'] if !opts[:'dataset_id'].nil?
|
118
104
|
|
119
105
|
# header parameters
|
120
106
|
header_params = opts[:header_params] || {}
|
121
107
|
# HTTP header 'Accept' (if needed)
|
122
108
|
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
123
|
-
# HTTP header 'Content-Type'
|
124
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded', 'multipart/form-data'])
|
125
109
|
|
126
110
|
# form parameters
|
127
111
|
form_params = opts[:form_params] || {}
|
128
|
-
form_params['weight'] = weight
|
129
|
-
form_params['name'] = name
|
130
|
-
form_params['dataset_id'] = dataset_id
|
131
112
|
|
132
113
|
# http body (model)
|
133
114
|
post_body = opts[:debug_body]
|
134
115
|
|
135
116
|
# return_type
|
136
|
-
return_type = opts[:debug_return_type] || 'ApprovalType'
|
117
|
+
return_type = opts[:debug_return_type] || 'Array<ApprovalType>'
|
137
118
|
|
138
119
|
# auth_names
|
139
120
|
auth_names = opts[:debug_auth_names] || ['authToken']
|
140
121
|
|
141
122
|
new_options = opts.merge(
|
142
|
-
:operation => :"ApprovalTypesApi.
|
123
|
+
:operation => :"ApprovalTypesApi.index_approval_types",
|
143
124
|
:header_params => header_params,
|
144
125
|
:query_params => query_params,
|
145
126
|
:form_params => form_params,
|
@@ -148,9 +129,9 @@ module Quake::Timesheets
|
|
148
129
|
:return_type => return_type
|
149
130
|
)
|
150
131
|
|
151
|
-
data, status_code, headers = @api_client.call_api(:
|
132
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
152
133
|
if @api_client.config.debugging
|
153
|
-
@api_client.config.logger.debug "API called: ApprovalTypesApi#
|
134
|
+
@api_client.config.logger.debug "API called: ApprovalTypesApi#index_approval_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
154
135
|
end
|
155
136
|
return data, status_code, headers
|
156
137
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
#TimesheetsApi (params in:
|
2
|
+
#TimesheetsApi (params in:body)
|
3
3
|
|
4
4
|
# <p>Another API description</p>
|
5
5
|
|
@@ -19,53 +19,50 @@ module Quake::Timesheets
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
#
|
23
|
-
# @param dataset_id [String] Filter to the approvals belonging to one of the identified datasets
|
22
|
+
# Create a new Approval
|
24
23
|
# @param [Hash] opts the optional parameters
|
25
|
-
# @
|
26
|
-
|
27
|
-
|
24
|
+
# @option opts [CreateApprovalsInput] :create_approvals_input
|
25
|
+
# @return [Approval]
|
26
|
+
def create_approvals(opts = {})
|
27
|
+
data, _status_code, _headers = create_approvals_with_http_info(opts)
|
28
28
|
data
|
29
29
|
end
|
30
30
|
|
31
|
-
#
|
32
|
-
# @param dataset_id [String] Filter to the approvals belonging to one of the identified datasets
|
31
|
+
# Create a new Approval
|
33
32
|
# @param [Hash] opts the optional parameters
|
34
|
-
# @
|
35
|
-
|
33
|
+
# @option opts [CreateApprovalsInput] :create_approvals_input
|
34
|
+
# @return [Array<(Approval, Integer, Hash)>] Approval data, response status code and response headers
|
35
|
+
def create_approvals_with_http_info(opts = {})
|
36
36
|
if @api_client.config.debugging
|
37
|
-
@api_client.config.logger.debug 'Calling API: ApprovalsApi.
|
38
|
-
end
|
39
|
-
# verify the required parameter 'dataset_id' is set
|
40
|
-
if @api_client.config.client_side_validation && dataset_id.nil?
|
41
|
-
fail ArgumentError, "Missing the required parameter 'dataset_id' when calling ApprovalsApi.get_api_v1_approvals"
|
37
|
+
@api_client.config.logger.debug 'Calling API: ApprovalsApi.create_approvals ...'
|
42
38
|
end
|
43
39
|
# resource path
|
44
40
|
local_var_path = '/api/v1/approvals'
|
45
41
|
|
46
42
|
# query parameters
|
47
43
|
query_params = opts[:query_params] || {}
|
48
|
-
query_params[:'dataset_id'] = dataset_id
|
49
44
|
|
50
45
|
# header parameters
|
51
46
|
header_params = opts[:header_params] || {}
|
52
47
|
# HTTP header 'Accept' (if needed)
|
53
48
|
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
49
|
+
# HTTP header 'Content-Type'
|
50
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
54
51
|
|
55
52
|
# form parameters
|
56
53
|
form_params = opts[:form_params] || {}
|
57
54
|
|
58
55
|
# http body (model)
|
59
|
-
post_body = opts[:debug_body]
|
56
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_approvals_input'] || opts[:body])
|
60
57
|
|
61
58
|
# return_type
|
62
|
-
return_type = opts[:debug_return_type] || '
|
59
|
+
return_type = opts[:debug_return_type] || 'Approval'
|
63
60
|
|
64
61
|
# auth_names
|
65
62
|
auth_names = opts[:debug_auth_names] || ['authToken']
|
66
63
|
|
67
64
|
new_options = opts.merge(
|
68
|
-
:operation => :"ApprovalsApi.
|
65
|
+
:operation => :"ApprovalsApi.create_approvals",
|
69
66
|
:header_params => header_params,
|
70
67
|
:query_params => query_params,
|
71
68
|
:form_params => form_params,
|
@@ -74,88 +71,60 @@ module Quake::Timesheets
|
|
74
71
|
:return_type => return_type
|
75
72
|
)
|
76
73
|
|
77
|
-
data, status_code, headers = @api_client.call_api(:
|
74
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
78
75
|
if @api_client.config.debugging
|
79
|
-
@api_client.config.logger.debug "API called: ApprovalsApi#
|
76
|
+
@api_client.config.logger.debug "API called: ApprovalsApi#create_approvals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
77
|
end
|
81
78
|
return data, status_code, headers
|
82
79
|
end
|
83
80
|
|
84
|
-
#
|
85
|
-
# @param
|
86
|
-
# @param approval_type_id [String] The ID of the Approval Type of this Approval
|
87
|
-
# @param entry_ids [Array<String>] The ID of the Entry this Approval is linked to
|
88
|
-
# @param dataset_id [String] ID of the dataset this approval type is linked to
|
81
|
+
# Search for approval types matching filters
|
82
|
+
# @param dataset_id [String] Filter to the approvals belonging to one of the identified datasets
|
89
83
|
# @param [Hash] opts the optional parameters
|
90
|
-
# @return [Approval]
|
91
|
-
def
|
92
|
-
data, _status_code, _headers =
|
84
|
+
# @return [Array<Approval>]
|
85
|
+
def index_approvals(dataset_id, opts = {})
|
86
|
+
data, _status_code, _headers = index_approvals_with_http_info(dataset_id, opts)
|
93
87
|
data
|
94
88
|
end
|
95
89
|
|
96
|
-
#
|
97
|
-
# @param
|
98
|
-
# @param approval_type_id [String] The ID of the Approval Type of this Approval
|
99
|
-
# @param entry_ids [Array<String>] The ID of the Entry this Approval is linked to
|
100
|
-
# @param dataset_id [String] ID of the dataset this approval type is linked to
|
90
|
+
# Search for approval types matching filters
|
91
|
+
# @param dataset_id [String] Filter to the approvals belonging to one of the identified datasets
|
101
92
|
# @param [Hash] opts the optional parameters
|
102
|
-
# @return [Array<(Approval
|
103
|
-
def
|
93
|
+
# @return [Array<(Array<Approval>, Integer, Hash)>] Array<Approval> data, response status code and response headers
|
94
|
+
def index_approvals_with_http_info(dataset_id, opts = {})
|
104
95
|
if @api_client.config.debugging
|
105
|
-
@api_client.config.logger.debug 'Calling API: ApprovalsApi.
|
106
|
-
end
|
107
|
-
# verify the required parameter 'state' is set
|
108
|
-
if @api_client.config.client_side_validation && state.nil?
|
109
|
-
fail ArgumentError, "Missing the required parameter 'state' when calling ApprovalsApi.post_api_v1_approvals"
|
110
|
-
end
|
111
|
-
# verify enum value
|
112
|
-
allowable_values = ["requested", "approved", "withdrawn"]
|
113
|
-
if @api_client.config.client_side_validation && !allowable_values.include?(state)
|
114
|
-
fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
|
115
|
-
end
|
116
|
-
# verify the required parameter 'approval_type_id' is set
|
117
|
-
if @api_client.config.client_side_validation && approval_type_id.nil?
|
118
|
-
fail ArgumentError, "Missing the required parameter 'approval_type_id' when calling ApprovalsApi.post_api_v1_approvals"
|
119
|
-
end
|
120
|
-
# verify the required parameter 'entry_ids' is set
|
121
|
-
if @api_client.config.client_side_validation && entry_ids.nil?
|
122
|
-
fail ArgumentError, "Missing the required parameter 'entry_ids' when calling ApprovalsApi.post_api_v1_approvals"
|
96
|
+
@api_client.config.logger.debug 'Calling API: ApprovalsApi.index_approvals ...'
|
123
97
|
end
|
124
98
|
# verify the required parameter 'dataset_id' is set
|
125
99
|
if @api_client.config.client_side_validation && dataset_id.nil?
|
126
|
-
fail ArgumentError, "Missing the required parameter 'dataset_id' when calling ApprovalsApi.
|
100
|
+
fail ArgumentError, "Missing the required parameter 'dataset_id' when calling ApprovalsApi.index_approvals"
|
127
101
|
end
|
128
102
|
# resource path
|
129
103
|
local_var_path = '/api/v1/approvals'
|
130
104
|
|
131
105
|
# query parameters
|
132
106
|
query_params = opts[:query_params] || {}
|
107
|
+
query_params[:'dataset_id'] = dataset_id
|
133
108
|
|
134
109
|
# header parameters
|
135
110
|
header_params = opts[:header_params] || {}
|
136
111
|
# HTTP header 'Accept' (if needed)
|
137
112
|
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
138
|
-
# HTTP header 'Content-Type'
|
139
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded', 'multipart/form-data'])
|
140
113
|
|
141
114
|
# form parameters
|
142
115
|
form_params = opts[:form_params] || {}
|
143
|
-
form_params['state'] = state
|
144
|
-
form_params['approval_type_id'] = approval_type_id
|
145
|
-
form_params['entry_ids'] = @api_client.build_collection_param(entry_ids, :csv)
|
146
|
-
form_params['dataset_id'] = dataset_id
|
147
116
|
|
148
117
|
# http body (model)
|
149
118
|
post_body = opts[:debug_body]
|
150
119
|
|
151
120
|
# return_type
|
152
|
-
return_type = opts[:debug_return_type] || 'Approval'
|
121
|
+
return_type = opts[:debug_return_type] || 'Array<Approval>'
|
153
122
|
|
154
123
|
# auth_names
|
155
124
|
auth_names = opts[:debug_auth_names] || ['authToken']
|
156
125
|
|
157
126
|
new_options = opts.merge(
|
158
|
-
:operation => :"ApprovalsApi.
|
127
|
+
:operation => :"ApprovalsApi.index_approvals",
|
159
128
|
:header_params => header_params,
|
160
129
|
:query_params => query_params,
|
161
130
|
:form_params => form_params,
|
@@ -164,9 +133,9 @@ module Quake::Timesheets
|
|
164
133
|
:return_type => return_type
|
165
134
|
)
|
166
135
|
|
167
|
-
data, status_code, headers = @api_client.call_api(:
|
136
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
168
137
|
if @api_client.config.debugging
|
169
|
-
@api_client.config.logger.debug "API called: ApprovalsApi#
|
138
|
+
@api_client.config.logger.debug "API called: ApprovalsApi#index_approvals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
170
139
|
end
|
171
140
|
return data, status_code, headers
|
172
141
|
end
|