kickflow 0.1.0 → 0.2.1

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +102 -100
  4. data/Rakefile +1 -1
  5. data/docs/DefaultApi.md +118 -114
  6. data/docs/FormField.md +3 -1
  7. data/docs/FormFieldDetail.md +2 -0
  8. data/docs/PatchTicketsTicketIdRequestInputsInner.md +4 -4
  9. data/docs/PatchTicketsTicketIdRequestSlipItemsInnerInputsInner.md +8 -2
  10. data/docs/PostFiles200Response.md +1 -1
  11. data/docs/PostTicketsIdCommentsRequest.md +1 -1
  12. data/docs/PostTicketsRequestInputsInner.md +4 -4
  13. data/docs/PostTicketsRequestSlipItemsInnerInputsInner.md +7 -1
  14. data/docs/PostTicketsRequestSlipItemsInnerInputsInnerTeamId.md +49 -0
  15. data/docs/PostTicketsRequestSlipItemsInnerInputsInnerTicketId.md +49 -0
  16. data/docs/PostTicketsRequestSlipItemsInnerInputsInnerUserId.md +49 -0
  17. data/docs/RouteStep.md +3 -1
  18. data/docs/Section.md +2 -0
  19. data/docs/SectionListItem.md +32 -0
  20. data/docs/SlipField.md +3 -1
  21. data/docs/SlipFieldDetail.md +2 -0
  22. data/docs/SlipItemInput.md +6 -0
  23. data/docs/SubStatus.md +1 -1
  24. data/docs/TicketWithStep.md +52 -0
  25. data/docs/TicketWorkflow.md +10 -6
  26. data/docs/UserImage.md +5 -1
  27. data/docs/Workflow.md +6 -4
  28. data/docs/WorkflowDetail.md +9 -5
  29. data/docs/WorkflowInTicket.md +10 -6
  30. data/kickflow.gemspec +8 -1
  31. data/lib/kickflow/api/_api.rb +115 -109
  32. data/lib/kickflow/configuration.rb +2 -2
  33. data/lib/kickflow/models/form_field.rb +16 -5
  34. data/lib/kickflow/models/form_field_detail.rb +12 -1
  35. data/lib/kickflow/models/patch_tickets_ticket_id_request_inputs_inner.rb +4 -4
  36. data/lib/kickflow/models/patch_tickets_ticket_id_request_slip_items_inner_inputs_inner.rb +30 -5
  37. data/lib/kickflow/models/post_files200_response.rb +1 -1
  38. data/lib/kickflow/models/post_tickets_id_comments_request.rb +1 -1
  39. data/lib/kickflow/models/post_tickets_request_inputs_inner.rb +4 -4
  40. data/lib/kickflow/models/post_tickets_request_slip_items_inner_inputs_inner.rb +29 -2
  41. data/lib/kickflow/models/post_tickets_request_slip_items_inner_inputs_inner_team_id.rb +106 -0
  42. data/lib/kickflow/models/post_tickets_request_slip_items_inner_inputs_inner_ticket_id.rb +106 -0
  43. data/lib/kickflow/models/post_tickets_request_slip_items_inner_inputs_inner_user_id.rb +106 -0
  44. data/lib/kickflow/models/role_create_body_permission_list_inner.rb +2 -2
  45. data/lib/kickflow/models/role_detail_all_of_permission_list.rb +2 -2
  46. data/lib/kickflow/models/role_update_body_permission_list_inner.rb +2 -2
  47. data/lib/kickflow/models/route_step.rb +22 -5
  48. data/lib/kickflow/models/route_step_condition_field.rb +34 -0
  49. data/lib/kickflow/models/section.rb +51 -1
  50. data/lib/kickflow/models/section_list_item.rb +336 -0
  51. data/lib/kickflow/models/slip_field.rb +18 -7
  52. data/lib/kickflow/models/slip_field_detail.rb +14 -3
  53. data/lib/kickflow/models/slip_item_input.rb +37 -1
  54. data/lib/kickflow/models/sub_status.rb +2 -0
  55. data/lib/kickflow/models/ticket_with_step.rb +568 -0
  56. data/lib/kickflow/models/user_image.rb +29 -9
  57. data/lib/kickflow/models/workflow.rb +17 -5
  58. data/lib/kickflow/models/workflow_detail.rb +30 -6
  59. data/lib/kickflow/models/workflow_in_ticket.rb +31 -7
  60. data/lib/kickflow/version.rb +1 -1
  61. data/lib/kickflow.rb +5 -3
  62. data/manifest.scm +7 -1
  63. data/pkg/kickflow-0.1.0.gem +0 -0
  64. data/pkg/kickflow-0.2.0.gem +0 -0
  65. data/spec/models/post_tickets_request_slip_items_inner_inputs_inner_team_id_spec.rb +32 -0
  66. data/spec/models/post_tickets_request_slip_items_inner_inputs_inner_ticket_id_spec.rb +32 -0
  67. data/spec/models/post_tickets_request_slip_items_inner_inputs_inner_user_id_spec.rb +32 -0
  68. data/spec/models/section_list_item_spec.rb +82 -0
  69. data/spec/models/ticket_with_step_spec.rb +146 -0
  70. data/vendor/schema.yaml +377 -167
  71. metadata +31 -3
@@ -0,0 +1,106 @@
1
+ =begin
2
+ #kickflow REST API v1
3
+
4
+ #kickflowの開発者用REST API (v1)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.7.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Kickflow
17
+ # ユーザーUUID。フィールドがユーザータイプのときのみ指定してください。
18
+ module PostTicketsRequestSlipItemsInnerInputsInnerUserId
19
+ class << self
20
+ # List of class defined in oneOf (OpenAPI v3)
21
+ def openapi_one_of
22
+ [
23
+ :'Array<String>',
24
+ :'String'
25
+ ]
26
+ end
27
+
28
+ # Builds the object
29
+ # @param [Mixed] Data to be matched against the list of oneOf items
30
+ # @return [Object] Returns the model or the data itself
31
+ def build(data)
32
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
33
+ # Note:
34
+ # - We do not attempt to check whether exactly one item matches.
35
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
36
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
37
+ # - TODO: scalar values are de facto behaving as if they were nullable.
38
+ # - TODO: logging when debugging is set.
39
+ openapi_one_of.each do |klass|
40
+ begin
41
+ next if klass == :AnyType # "nullable: true"
42
+ typed_data = find_and_cast_into_type(klass, data)
43
+ return typed_data if typed_data
44
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
45
+ end
46
+ end
47
+
48
+ openapi_one_of.include?(:AnyType) ? data : nil
49
+ end
50
+
51
+ private
52
+
53
+ SchemaMismatchError = Class.new(StandardError)
54
+
55
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
56
+ def find_and_cast_into_type(klass, data)
57
+ return if data.nil?
58
+
59
+ case klass.to_s
60
+ when 'Boolean'
61
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
62
+ when 'Float'
63
+ return data if data.instance_of?(Float)
64
+ when 'Integer'
65
+ return data if data.instance_of?(Integer)
66
+ when 'Time'
67
+ return Time.parse(data)
68
+ when 'Date'
69
+ return Date.parse(data)
70
+ when 'String'
71
+ return data if data.instance_of?(String)
72
+ when 'Object' # "type: object"
73
+ return data if data.instance_of?(Hash)
74
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
75
+ if data.instance_of?(Array)
76
+ sub_type = Regexp.last_match[:sub_type]
77
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
78
+ end
79
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
80
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
81
+ sub_type = Regexp.last_match[:sub_type]
82
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
83
+ end
84
+ else # model
85
+ const = Kickflow.const_get(klass)
86
+ if const
87
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
88
+ model = const.build(data)
89
+ return model if model
90
+ else
91
+ # raise if data contains keys that are not known to the model
92
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
93
+ model = const.build_from_hash(data)
94
+ return model if model
95
+ end
96
+ end
97
+ end
98
+
99
+ raise # if no match by now, raise
100
+ rescue
101
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
102
+ end
103
+ end
104
+ end
105
+
106
+ end
@@ -152,7 +152,7 @@ module Kickflow
152
152
  def valid?
153
153
  warn '[DEPRECATED] the `valid?` method is obsolete'
154
154
  return false if @permission.nil?
155
- permission_validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "ticket", "user", "team", "role", "master"])
155
+ permission_validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "user", "team", "role", "master", "ticket_read", "ticket_write", "label", "automation"])
156
156
  return false unless permission_validator.valid?(@permission)
157
157
  return false if @restricted.nil?
158
158
  true
@@ -161,7 +161,7 @@ module Kickflow
161
161
  # Custom attribute writer method checking allowed values (enum).
162
162
  # @param [Object] permission Object to be assigned
163
163
  def permission=(permission)
164
- validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "ticket", "user", "team", "role", "master"])
164
+ validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "user", "team", "role", "master", "ticket_read", "ticket_write", "label", "automation"])
165
165
  unless validator.valid?(permission)
166
166
  fail ArgumentError, "invalid value for \"permission\", must be one of #{validator.allowable_values}."
167
167
  end
@@ -170,7 +170,7 @@ module Kickflow
170
170
  def valid?
171
171
  warn '[DEPRECATED] the `valid?` method is obsolete'
172
172
  return false if @permission.nil?
173
- permission_validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "user", "team", "role", "master", "ticket_read", "ticket_write"])
173
+ permission_validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "user", "team", "role", "master", "ticket_read", "ticket_write", "label", "automation"])
174
174
  return false unless permission_validator.valid?(@permission)
175
175
  return false if @restricted.nil?
176
176
  return false if @folders.nil?
@@ -182,7 +182,7 @@ module Kickflow
182
182
  # Custom attribute writer method checking allowed values (enum).
183
183
  # @param [Object] permission Object to be assigned
184
184
  def permission=(permission)
185
- validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "user", "team", "role", "master", "ticket_read", "ticket_write"])
185
+ validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "user", "team", "role", "master", "ticket_read", "ticket_write", "label", "automation"])
186
186
  unless validator.valid?(permission)
187
187
  fail ArgumentError, "invalid value for \"permission\", must be one of #{validator.allowable_values}."
188
188
  end
@@ -170,7 +170,7 @@ module Kickflow
170
170
  def valid?
171
171
  warn '[DEPRECATED] the `valid?` method is obsolete'
172
172
  return false if @permission.nil?
173
- permission_validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "ticket", "user", "team", "role", "master"])
173
+ permission_validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "user", "team", "role", "master", "ticket_read", "ticket_write", "label", "automation"])
174
174
  return false unless permission_validator.valid?(@permission)
175
175
  return false if @restricted.nil?
176
176
  return false if @folder_ids.nil?
@@ -182,7 +182,7 @@ module Kickflow
182
182
  # Custom attribute writer method checking allowed values (enum).
183
183
  # @param [Object] permission Object to be assigned
184
184
  def permission=(permission)
185
- validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "ticket", "user", "team", "role", "master"])
185
+ validator = EnumAttributeValidator.new('String', ["tenant", "billing", "integration", "security", "audit", "stats", "workflow", "user", "team", "role", "master", "ticket_read", "ticket_write", "label", "automation"])
186
186
  unless validator.valid?(permission)
187
187
  fail ArgumentError, "invalid value for \"permission\", must be one of #{validator.allowable_values}."
188
188
  end
@@ -57,6 +57,9 @@ module Kickflow
57
57
 
58
58
  attr_accessor :route_step_condition
59
59
 
60
+ # コード
61
+ attr_accessor :code
62
+
60
63
  class EnumAttributeValidator
61
64
  attr_reader :datatype
62
65
  attr_reader :allowable_values
@@ -95,7 +98,8 @@ module Kickflow
95
98
  :'min_custom_assignees' => :'minCustomAssignees',
96
99
  :'users' => :'users',
97
100
  :'targets' => :'targets',
98
- :'route_step_condition' => :'routeStepCondition'
101
+ :'route_step_condition' => :'routeStepCondition',
102
+ :'code' => :'code'
99
103
  }
100
104
  end
101
105
 
@@ -120,7 +124,8 @@ module Kickflow
120
124
  :'min_custom_assignees' => :'Integer',
121
125
  :'users' => :'Array<User>',
122
126
  :'targets' => :'Array<RouteStepTarget>',
123
- :'route_step_condition' => :'RouteStepCondition'
127
+ :'route_step_condition' => :'RouteStepCondition',
128
+ :'code' => :'String'
124
129
  }
125
130
  end
126
131
 
@@ -130,7 +135,7 @@ module Kickflow
130
135
  :'instruction',
131
136
  :'fallback_type',
132
137
  :'min_custom_assignees',
133
- :'route_step_condition'
138
+ :'route_step_condition',
134
139
  ])
135
140
  end
136
141
 
@@ -232,6 +237,12 @@ module Kickflow
232
237
  if attributes.key?(:'route_step_condition')
233
238
  self.route_step_condition = attributes[:'route_step_condition']
234
239
  end
240
+
241
+ if attributes.key?(:'code')
242
+ self.code = attributes[:'code']
243
+ else
244
+ self.code = nil
245
+ end
235
246
  end
236
247
 
237
248
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -279,6 +290,10 @@ module Kickflow
279
290
  invalid_properties.push('invalid value for "users", users cannot be nil.')
280
291
  end
281
292
 
293
+ if @code.nil?
294
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
295
+ end
296
+
282
297
  invalid_properties
283
298
  end
284
299
 
@@ -302,6 +317,7 @@ module Kickflow
302
317
  return false if @allow_self_approval.nil?
303
318
  return false if @min_custom_assignees < 0
304
319
  return false if @users.nil?
320
+ return false if @code.nil?
305
321
  true
306
322
  end
307
323
 
@@ -363,7 +379,8 @@ module Kickflow
363
379
  min_custom_assignees == o.min_custom_assignees &&
364
380
  users == o.users &&
365
381
  targets == o.targets &&
366
- route_step_condition == o.route_step_condition
382
+ route_step_condition == o.route_step_condition &&
383
+ code == o.code
367
384
  end
368
385
 
369
386
  # @see the `==` method
@@ -375,7 +392,7 @@ module Kickflow
375
392
  # Calculates hash code according to all attributes.
376
393
  # @return [Integer] Hash code
377
394
  def hash
378
- [id, step_order, step_type, title, action_type, instruction, required_approvals_number, required_approvals_percent, fallback_type, allow_self_approval, min_custom_assignees, users, targets, route_step_condition].hash
395
+ [id, step_order, step_type, title, action_type, instruction, required_approvals_number, required_approvals_percent, fallback_type, allow_self_approval, min_custom_assignees, users, targets, route_step_condition, code].hash
379
396
  end
380
397
 
381
398
  # Builds the object from hash
@@ -40,6 +40,28 @@ module Kickflow
40
40
 
41
41
  attr_accessor :general_master_item
42
42
 
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
59
+
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
64
+
43
65
  # Attribute mapping from ruby-style variable name to JSON key.
44
66
  def self.attribute_map
45
67
  {
@@ -145,9 +167,21 @@ module Kickflow
145
167
  # @return true if the model is valid
146
168
  def valid?
147
169
  warn '[DEPRECATED] the `valid?` method is obsolete'
170
+ field_key_validator = EnumAttributeValidator.new('String', ["author_grade", "author_team", "text_variable", "number_variable", "checkbox_variable", "general_master_variable", "other_variable"])
171
+ return false unless field_key_validator.valid?(@field_key)
148
172
  true
149
173
  end
150
174
 
175
+ # Custom attribute writer method checking allowed values (enum).
176
+ # @param [Object] field_key Object to be assigned
177
+ def field_key=(field_key)
178
+ validator = EnumAttributeValidator.new('String', ["author_grade", "author_team", "text_variable", "number_variable", "checkbox_variable", "general_master_variable", "other_variable"])
179
+ unless validator.valid?(field_key)
180
+ fail ArgumentError, "invalid value for \"field_key\", must be one of #{validator.allowable_values}."
181
+ end
182
+ @field_key = field_key
183
+ end
184
+
151
185
  # Checks equality by comparing each attribute.
152
186
  # @param [Object] Object to be compared
153
187
  def ==(o)
@@ -19,6 +19,8 @@ module Kickflow
19
19
  # UUID
20
20
  attr_accessor :id
21
21
 
22
+ attr_accessor :section_type
23
+
22
24
  # タイトル
23
25
  attr_accessor :title
24
26
 
@@ -40,10 +42,33 @@ module Kickflow
40
42
  # 条件をすべて満たす必要があるかどうか
41
43
  attr_accessor :condition_all_of
42
44
 
45
+ class EnumAttributeValidator
46
+ attr_reader :datatype
47
+ attr_reader :allowable_values
48
+
49
+ def initialize(datatype, allowable_values)
50
+ @allowable_values = allowable_values.map do |value|
51
+ case datatype.to_s
52
+ when /Integer/i
53
+ value.to_i
54
+ when /Float/i
55
+ value.to_f
56
+ else
57
+ value
58
+ end
59
+ end
60
+ end
61
+
62
+ def valid?(value)
63
+ !value || allowable_values.include?(value)
64
+ end
65
+ end
66
+
43
67
  # Attribute mapping from ruby-style variable name to JSON key.
44
68
  def self.attribute_map
45
69
  {
46
70
  :'id' => :'id',
71
+ :'section_type' => :'sectionType',
47
72
  :'title' => :'title',
48
73
  :'description' => :'description',
49
74
  :'form_fields' => :'formFields',
@@ -63,6 +88,7 @@ module Kickflow
63
88
  def self.openapi_types
64
89
  {
65
90
  :'id' => :'String',
91
+ :'section_type' => :'String',
66
92
  :'title' => :'String',
67
93
  :'description' => :'String',
68
94
  :'form_fields' => :'Array<FormFieldDetail>',
@@ -102,6 +128,12 @@ module Kickflow
102
128
  self.id = nil
103
129
  end
104
130
 
131
+ if attributes.key?(:'section_type')
132
+ self.section_type = attributes[:'section_type']
133
+ else
134
+ self.section_type = nil
135
+ end
136
+
105
137
  if attributes.key?(:'title')
106
138
  self.title = attributes[:'title']
107
139
  else
@@ -156,6 +188,10 @@ module Kickflow
156
188
  invalid_properties.push('invalid value for "id", id cannot be nil.')
157
189
  end
158
190
 
191
+ if @section_type.nil?
192
+ invalid_properties.push('invalid value for "section_type", section_type cannot be nil.')
193
+ end
194
+
159
195
  if @form_fields.nil?
160
196
  invalid_properties.push('invalid value for "form_fields", form_fields cannot be nil.')
161
197
  end
@@ -184,6 +220,9 @@ module Kickflow
184
220
  def valid?
185
221
  warn '[DEPRECATED] the `valid?` method is obsolete'
186
222
  return false if @id.nil?
223
+ return false if @section_type.nil?
224
+ section_type_validator = EnumAttributeValidator.new('String', ["form"])
225
+ return false unless section_type_validator.valid?(@section_type)
187
226
  return false if @form_fields.nil?
188
227
  return false if @created_at.nil?
189
228
  return false if @updated_at.nil?
@@ -192,12 +231,23 @@ module Kickflow
192
231
  true
193
232
  end
194
233
 
234
+ # Custom attribute writer method checking allowed values (enum).
235
+ # @param [Object] section_type Object to be assigned
236
+ def section_type=(section_type)
237
+ validator = EnumAttributeValidator.new('String', ["form"])
238
+ unless validator.valid?(section_type)
239
+ fail ArgumentError, "invalid value for \"section_type\", must be one of #{validator.allowable_values}."
240
+ end
241
+ @section_type = section_type
242
+ end
243
+
195
244
  # Checks equality by comparing each attribute.
196
245
  # @param [Object] Object to be compared
197
246
  def ==(o)
198
247
  return true if self.equal?(o)
199
248
  self.class == o.class &&
200
249
  id == o.id &&
250
+ section_type == o.section_type &&
201
251
  title == o.title &&
202
252
  description == o.description &&
203
253
  form_fields == o.form_fields &&
@@ -216,7 +266,7 @@ module Kickflow
216
266
  # Calculates hash code according to all attributes.
217
267
  # @return [Integer] Hash code
218
268
  def hash
219
- [id, title, description, form_fields, created_at, updated_at, conditional, condition_all_of].hash
269
+ [id, section_type, title, description, form_fields, created_at, updated_at, conditional, condition_all_of].hash
220
270
  end
221
271
 
222
272
  # Builds the object from hash