quake_timesheets_client 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -21
  3. data/build.sh +1 -1
  4. data/docs/ApprovalTypesApi.md +36 -38
  5. data/docs/ApprovalsApi.md +36 -40
  6. data/docs/CreateApprovalTypesInput.md +22 -0
  7. data/docs/CreateApprovalsInput.md +24 -0
  8. data/docs/CreateDatasetsInput.md +18 -0
  9. data/docs/CreateEntriesInput.md +28 -0
  10. data/docs/CreatePeopleInput.md +20 -0
  11. data/docs/DatasetsApi.md +51 -49
  12. data/docs/EntriesApi.md +52 -72
  13. data/docs/PeopleApi.md +36 -36
  14. data/docs/UpdateEntriesInput.md +28 -0
  15. data/lib/quake_timesheets_client.rb +7 -1
  16. data/lib/quake_timesheets_client/api/approval_types_api.rb +33 -52
  17. data/lib/quake_timesheets_client/api/approvals_api.rb +34 -65
  18. data/lib/quake_timesheets_client/api/datasets_api.rb +45 -50
  19. data/lib/quake_timesheets_client/api/entries_api.rb +53 -93
  20. data/lib/quake_timesheets_client/api/people_api.rb +33 -45
  21. data/lib/quake_timesheets_client/api_client.rb +1 -1
  22. data/lib/quake_timesheets_client/api_error.rb +1 -1
  23. data/lib/quake_timesheets_client/configuration.rb +1 -1
  24. data/lib/quake_timesheets_client/models/approval.rb +1 -1
  25. data/lib/quake_timesheets_client/models/approval_type.rb +1 -1
  26. data/lib/quake_timesheets_client/models/create_approval_types_input.rb +254 -0
  27. data/lib/quake_timesheets_client/models/create_approvals_input.rb +304 -0
  28. data/lib/quake_timesheets_client/models/create_datasets_input.rb +224 -0
  29. data/lib/quake_timesheets_client/models/create_entries_input.rb +301 -0
  30. data/lib/quake_timesheets_client/models/create_people_input.rb +239 -0
  31. data/lib/quake_timesheets_client/models/dataset.rb +1 -1
  32. data/lib/quake_timesheets_client/models/entry.rb +1 -1
  33. data/lib/quake_timesheets_client/models/person.rb +1 -1
  34. data/lib/quake_timesheets_client/models/update_entries_input.rb +301 -0
  35. data/lib/quake_timesheets_client/version.rb +2 -2
  36. data/quake_timesheets_client.gemspec +1 -1
  37. data/ruby.config.yaml +1 -1
  38. data/spec/api_client_spec.rb +1 -1
  39. data/spec/configuration_spec.rb +1 -1
  40. data/spec/models/create_approval_types_input_spec.rb +46 -0
  41. data/spec/models/create_approvals_input_spec.rb +56 -0
  42. data/spec/models/create_datasets_input_spec.rb +34 -0
  43. data/spec/models/create_entries_input_spec.rb +68 -0
  44. data/spec/models/create_people_input_spec.rb +40 -0
  45. data/spec/models/update_entries_input_spec.rb +68 -0
  46. data/spec/spec_helper.rb +1 -1
  47. metadata +26 -2
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
- | [**get_api_v1_people**](PeopleApi.md#get_api_v1_people) | **GET** /api/v1/people | Search for people matching filters |
8
- | [**post_api_v1_people**](PeopleApi.md#post_api_v1_people) | **POST** /api/v1/people | Create a new Person record |
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
- ## get_api_v1_people
11
+ ## create_people
12
12
 
13
- > <Array<Person>> get_api_v1_people(opts)
13
+ > <Person> create_people(opts)
14
14
 
15
- Search for people matching filters
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' # String | Filter to the people belonging to one of the identified datasets
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
- # Search for people matching filters
37
- result = api_instance.get_api_v1_people(opts)
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->get_api_v1_people: #{e}"
40
+ puts "Error when calling PeopleApi->create_people: #{e}"
41
41
  end
42
42
  ```
43
43
 
44
- #### Using the get_api_v1_people_with_http_info variant
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(<Array<Person>>, Integer, Hash)> get_api_v1_people_with_http_info(opts)
48
+ > <Array(<Person>, Integer, Hash)> create_people_with_http_info(opts)
49
49
 
50
50
  ```ruby
51
51
  begin
52
- # Search for people matching filters
53
- data, status_code, headers = api_instance.get_api_v1_people_with_http_info(opts)
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 # => <Array<Person>>
56
+ p data # => <Person>
57
57
  rescue Quake::Timesheets::ApiError => e
58
- puts "Error when calling PeopleApi->get_api_v1_people_with_http_info: #{e}"
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
- | **dataset_id** | **String** | Filter to the people belonging to one of the identified datasets | [optional] |
66
+ | **create_people_input** | [**CreatePeopleInput**](CreatePeopleInput.md) | | [optional] |
67
67
 
68
68
  ### Return type
69
69
 
70
- [**Array&lt;Person&gt;**](Person.md)
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**: Not defined
78
+ - **Content-Type**: application/json
79
79
  - **Accept**: */*
80
80
 
81
81
 
82
- ## post_api_v1_people
82
+ ## index_people
83
83
 
84
- > <Person> post_api_v1_people(name, dataset_id)
84
+ > <Array<Person>> index_people(opts)
85
85
 
86
- Create a new Person record
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
- name = 'name_example' # String | Human readable name for the Person object (usually the subject's real name)
103
- dataset_id = 'dataset_id_example' # String | Dataset to which the Person object should belong
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
- # Create a new Person record
107
- result = api_instance.post_api_v1_people(name, dataset_id)
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->post_api_v1_people: #{e}"
111
+ puts "Error when calling PeopleApi->index_people: #{e}"
111
112
  end
112
113
  ```
113
114
 
114
- #### Using the post_api_v1_people_with_http_info variant
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>, Integer, Hash)> post_api_v1_people_with_http_info(name, dataset_id)
119
+ > <Array(<Array<Person>>, Integer, Hash)> index_people_with_http_info(opts)
119
120
 
120
121
  ```ruby
121
122
  begin
122
- # Create a new Person record
123
- data, status_code, headers = api_instance.post_api_v1_people_with_http_info(name, dataset_id)
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->post_api_v1_people_with_http_info: #{e}"
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
- | **name** | **String** | Human readable name for the Person object (usually the subject&#39;s real name) | |
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**](Person.md)
141
+ [**Array&lt;Person&gt;**](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**: application/x-www-form-urlencoded, multipart/form-data
149
+ - **Content-Type**: Not defined
150
150
  - **Accept**: */*
151
151
 
@@ -0,0 +1,28 @@
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
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'quake_timesheets_client'
18
+
19
+ instance = Quake::Timesheets::UpdateEntriesInput.new(
20
+ person_id: null,
21
+ start_at: null,
22
+ end_at: null,
23
+ quantity: null,
24
+ unit: null,
25
+ external_reference: null
26
+ )
27
+ ```
28
+
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #TimesheetsApi (params in:formData)
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:formData)
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
- # Search for approval types matching filters
22
+ # Create a new Approval Type
23
23
  # @param [Hash] opts the optional parameters
24
- # @option opts [String] :dataset_id Filter to the approval types belonging to one of the identified datasets
25
- # @return [Array<ApprovalType>]
26
- def get_api_v1_approval_types(opts = {})
27
- data, _status_code, _headers = get_api_v1_approval_types_with_http_info(opts)
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
- # Search for approval types matching filters
31
+ # Create a new Approval Type
32
32
  # @param [Hash] opts the optional parameters
33
- # @option opts [String] :dataset_id Filter to the approval types belonging to one of the identified datasets
34
- # @return [Array<(Array<ApprovalType>, Integer, Hash)>] Array<ApprovalType> data, response status code and response headers
35
- def get_api_v1_approval_types_with_http_info(opts = {})
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.get_api_v1_approval_types ...'
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'])
56
57
 
57
58
  # return_type
58
- return_type = opts[:debug_return_type] || 'Array<ApprovalType>'
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.get_api_v1_approval_types",
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(:GET, local_var_path, new_options)
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#get_api_v1_approval_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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
- # Create a new Approval Type
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
- # @return [ApprovalType]
86
- def post_api_v1_approval_types(weight, name, dataset_id, opts = {})
87
- data, _status_code, _headers = post_api_v1_approval_types_with_http_info(weight, name, dataset_id, opts)
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
- # Create a new Approval Type
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
- # @return [Array<(ApprovalType, Integer, Hash)>] ApprovalType data, response status code and response headers
97
- def post_api_v1_approval_types_with_http_info(weight, name, dataset_id, opts = {})
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.post_api_v1_approval_types ...'
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.post_api_v1_approval_types",
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(:POST, local_var_path, new_options)
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#post_api_v1_approval_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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:formData)
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
- # Search for approval types matching filters
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
- # @return [Array<Approval>]
26
- def get_api_v1_approvals(dataset_id, opts = {})
27
- data, _status_code, _headers = get_api_v1_approvals_with_http_info(dataset_id, opts)
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
- # Search for approval types matching filters
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
- # @return [Array<(Array<Approval>, Integer, Hash)>] Array<Approval> data, response status code and response headers
35
- def get_api_v1_approvals_with_http_info(dataset_id, opts = {})
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.get_api_v1_approvals ...'
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'])
60
57
 
61
58
  # return_type
62
- return_type = opts[:debug_return_type] || 'Array<Approval>'
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.get_api_v1_approvals",
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(:GET, local_var_path, new_options)
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#get_api_v1_approvals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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
- # Create a new Approval
85
- # @param state [String]
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 post_api_v1_approvals(state, approval_type_id, entry_ids, dataset_id, opts = {})
92
- data, _status_code, _headers = post_api_v1_approvals_with_http_info(state, approval_type_id, entry_ids, dataset_id, opts)
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
- # Create a new Approval
97
- # @param state [String]
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, Integer, Hash)>] Approval data, response status code and response headers
103
- def post_api_v1_approvals_with_http_info(state, approval_type_id, entry_ids, dataset_id, opts = {})
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.post_api_v1_approvals ...'
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.post_api_v1_approvals"
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.post_api_v1_approvals",
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(:POST, local_var_path, new_options)
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#post_api_v1_approvals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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