ittybit 0.8.2 → 0.8.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68c5c28ca6b723ff4a4d39808a6d3abc4ed054fd989f634bbf6ad80bca79c1cc
4
- data.tar.gz: 16559f00f2413da6b35e47ef14b3c55205fd2444dd93a6ec3b7aec8863149bf0
3
+ metadata.gz: a65f665f880046ea331b315d969102979583ba709c6ef4b73a5e7c23e6b77178
4
+ data.tar.gz: fd10510c8d99a32badcb17e1f6b08fc8312dfa64a636c4cda067f8246dd3802a
5
5
  SHA512:
6
- metadata.gz: 9033149c63d7848dd8492b37d390fa94bf75f88cccb1599e62a0831044628f9da55f90d9f8937090336e3ae64079c87ba10a9381c1b78b4e4165063391f625ec
7
- data.tar.gz: 73293534e09b68e8ff28a50c1954f235e40963ec9fe7ef236dcd0d85a4952b5a6f867343109938749153cc13af2cd3cb799a77b251b9171e4e331cee908b3a75
6
+ metadata.gz: 7db7805ac44e8afacc665622687e4b304eeb309961108cd73376d294edd29d8824161ec77dda29f6a864b4724f4be7e765788b4007ad8fcd43ad7f7da5e22282
7
+ data.tar.gz: bf229423b5aece584190db51ed47f16814b5ce22ad178b558037b675efb19f924f04fa8c1f46930508102d62b3250156ebeac990614b22a022f6ac4dc9ec0454
@@ -77,7 +77,7 @@ module Ittybit
77
77
  # name: "My Example Automation",
78
78
  # description: "This workflow will run whenever new media is created.",
79
79
  # trigger: { kind: "event", event: "media.created" },
80
- # workflow: [{ kind: DESCRIPTION }, { kind: IMAGE, ref: "thumbnail" }, { kind: CONDITIONS, next_: [{ kind: "subtitle", ref: "subtitle" }] }],
80
+ # workflow: [{ kind: DESCRIPTION }, { kind: IMAGE, ref: "thumbnail" }, { kind: VIDEO, next_: [{ kind: "subtitles", ref: "subtitles" }] }],
81
81
  # status: ACTIVE
82
82
  # )
83
83
  def create(trigger:, workflow:, name: nil, description: nil, status: nil, request_options: nil)
@@ -197,7 +197,7 @@ module Ittybit
197
197
  # api.automations.update(
198
198
  # id: "id",
199
199
  # name: "My Updated Automation",
200
- # workflow: [{ kind: NSFW }, { kind: DESCRIPTION }, { kind: IMAGE, ref: "big_thumbnail" }, { kind: CONDITIONS, next_: [{ kind: "subtitle", ref: "subtitle" }] }],
200
+ # workflow: [{ kind: NSFW }, { kind: DESCRIPTION }, { kind: IMAGE, ref: "big_thumbnail" }, { kind: VIDEO, next_: [{ kind: "subtitle", ref: "subtitle" }] }],
201
201
  # status: ACTIVE
202
202
  # )
203
203
  def update(id:, name: nil, description: nil, trigger: nil, workflow: nil, status: nil, request_options: nil)
@@ -294,7 +294,7 @@ module Ittybit
294
294
  # name: "My Example Automation",
295
295
  # description: "This workflow will run whenever new media is created.",
296
296
  # trigger: { kind: "event", event: "media.created" },
297
- # workflow: [{ kind: DESCRIPTION }, { kind: IMAGE, ref: "thumbnail" }, { kind: CONDITIONS, next_: [{ kind: "subtitle", ref: "subtitle" }] }],
297
+ # workflow: [{ kind: DESCRIPTION }, { kind: IMAGE, ref: "thumbnail" }, { kind: VIDEO, next_: [{ kind: "subtitles", ref: "subtitles" }] }],
298
298
  # status: ACTIVE
299
299
  # )
300
300
  def create(trigger:, workflow:, name: nil, description: nil, status: nil, request_options: nil)
@@ -420,7 +420,7 @@ module Ittybit
420
420
  # api.automations.update(
421
421
  # id: "id",
422
422
  # name: "My Updated Automation",
423
- # workflow: [{ kind: NSFW }, { kind: DESCRIPTION }, { kind: IMAGE, ref: "big_thumbnail" }, { kind: CONDITIONS, next_: [{ kind: "subtitle", ref: "subtitle" }] }],
423
+ # workflow: [{ kind: NSFW }, { kind: DESCRIPTION }, { kind: IMAGE, ref: "big_thumbnail" }, { kind: VIDEO, next_: [{ kind: "subtitle", ref: "subtitle" }] }],
424
424
  # status: ACTIVE
425
425
  # )
426
426
  def update(id:, name: nil, description: nil, trigger: nil, workflow: nil, status: nil, request_options: nil)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "automation_trigger"
4
- require_relative "workflow_task_step"
4
+ require_relative "automation_workflow_item"
5
5
  require_relative "automation_status"
6
6
  require "date"
7
7
  require "ostruct"
@@ -17,7 +17,7 @@ module Ittybit
17
17
  attr_reader :description
18
18
  # @return [Ittybit::AutomationTrigger]
19
19
  attr_reader :trigger
20
- # @return [Array<Ittybit::WorkflowTaskStep>]
20
+ # @return [Array<Ittybit::AutomationWorkflowItem>]
21
21
  attr_reader :workflow
22
22
  # @return [Ittybit::AutomationStatus]
23
23
  attr_reader :status
@@ -37,7 +37,7 @@ module Ittybit
37
37
  # @param name [String]
38
38
  # @param description [String]
39
39
  # @param trigger [Ittybit::AutomationTrigger]
40
- # @param workflow [Array<Ittybit::WorkflowTaskStep>]
40
+ # @param workflow [Array<Ittybit::AutomationWorkflowItem>]
41
41
  # @param status [Ittybit::AutomationStatus]
42
42
  # @param created [DateTime]
43
43
  # @param updated [DateTime]
@@ -86,7 +86,7 @@ module Ittybit
86
86
  end
87
87
  workflow = parsed_json["workflow"]&.map do |item|
88
88
  item = item.to_json
89
- Ittybit::WorkflowTaskStep.from_json(json_object: item)
89
+ Ittybit::AutomationWorkflowItem.from_json(json_object: item)
90
90
  end
91
91
  status = parsed_json["status"]
92
92
  created = (DateTime.parse(parsed_json["created"]) unless parsed_json["created"].nil?)
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "workflow_task_step"
5
+ require_relative "conditions_task_step"
6
+
7
+ module Ittybit
8
+ class AutomationWorkflowItem
9
+ # Deserialize a JSON object to an instance of AutomationWorkflowItem
10
+ #
11
+ # @param json_object [String]
12
+ # @return [Ittybit::AutomationWorkflowItem]
13
+ def self.from_json(json_object:)
14
+ struct = JSON.parse(json_object, object_class: OpenStruct)
15
+ begin
16
+ Ittybit::WorkflowTaskStep.validate_raw(obj: struct)
17
+ return Ittybit::WorkflowTaskStep.from_json(json_object: struct) unless struct.nil?
18
+
19
+ return nil
20
+ rescue StandardError
21
+ # noop
22
+ end
23
+ begin
24
+ Ittybit::ConditionsTaskStep.validate_raw(obj: struct)
25
+ return Ittybit::ConditionsTaskStep.from_json(json_object: struct) unless struct.nil?
26
+
27
+ return nil
28
+ rescue StandardError
29
+ # noop
30
+ end
31
+ struct
32
+ end
33
+
34
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
35
+ # hash and check each fields type against the current object's property
36
+ # definitions.
37
+ #
38
+ # @param obj [Object]
39
+ # @return [Void]
40
+ def self.validate_raw(obj:)
41
+ begin
42
+ return Ittybit::WorkflowTaskStep.validate_raw(obj: obj)
43
+ rescue StandardError
44
+ # noop
45
+ end
46
+ begin
47
+ return Ittybit::ConditionsTaskStep.validate_raw(obj: obj)
48
+ rescue StandardError
49
+ # noop
50
+ end
51
+ raise("Passed value matched no type within the union, validation failed.")
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "conditions_task_step_conditions_item"
4
+ require_relative "conditions_task_step_next_item"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Ittybit
9
+ class ConditionsTaskStep
10
+ # @return [String]
11
+ attr_reader :kind
12
+ # @return [Array<Ittybit::ConditionsTaskStepConditionsItem>]
13
+ attr_reader :conditions
14
+ # @return [Array<Ittybit::ConditionsTaskStepNextItem>]
15
+ attr_reader :next_
16
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
17
+ attr_reader :additional_properties
18
+ # @return [Object]
19
+ attr_reader :_field_set
20
+ protected :_field_set
21
+
22
+ OMIT = Object.new
23
+
24
+ # @param kind [String]
25
+ # @param conditions [Array<Ittybit::ConditionsTaskStepConditionsItem>]
26
+ # @param next_ [Array<Ittybit::ConditionsTaskStepNextItem>]
27
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
28
+ # @return [Ittybit::ConditionsTaskStep]
29
+ def initialize(kind:, conditions:, next_: OMIT, additional_properties: nil)
30
+ @kind = kind
31
+ @conditions = conditions
32
+ @next_ = next_ if next_ != OMIT
33
+ @additional_properties = additional_properties
34
+ @_field_set = { "kind": kind, "conditions": conditions, "next": next_ }.reject do |_k, v|
35
+ v == OMIT
36
+ end
37
+ end
38
+
39
+ # Deserialize a JSON object to an instance of ConditionsTaskStep
40
+ #
41
+ # @param json_object [String]
42
+ # @return [Ittybit::ConditionsTaskStep]
43
+ def self.from_json(json_object:)
44
+ struct = JSON.parse(json_object, object_class: OpenStruct)
45
+ parsed_json = JSON.parse(json_object)
46
+ kind = parsed_json["kind"]
47
+ conditions = parsed_json["conditions"]&.map do |item|
48
+ item = item.to_json
49
+ Ittybit::ConditionsTaskStepConditionsItem.from_json(json_object: item)
50
+ end
51
+ next_ = parsed_json["next"]&.map do |item|
52
+ item = item.to_json
53
+ Ittybit::ConditionsTaskStepNextItem.from_json(json_object: item)
54
+ end
55
+ new(
56
+ kind: kind,
57
+ conditions: conditions,
58
+ next_: next_,
59
+ additional_properties: struct
60
+ )
61
+ end
62
+
63
+ # Serialize an instance of ConditionsTaskStep to a JSON object
64
+ #
65
+ # @return [String]
66
+ def to_json(*_args)
67
+ @_field_set&.to_json
68
+ end
69
+
70
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
71
+ # hash and check each fields type against the current object's property
72
+ # definitions.
73
+ #
74
+ # @param obj [Object]
75
+ # @return [Void]
76
+ def self.validate_raw(obj:)
77
+ obj.kind.is_a?(String) != false || raise("Passed value for field obj.kind is not the expected type, validation failed.")
78
+ obj.conditions.is_a?(Array) != false || raise("Passed value for field obj.conditions is not the expected type, validation failed.")
79
+ obj.next_&.is_a?(Array) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.")
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Ittybit
7
+ class ConditionsTaskStepConditionsItem
8
+ # @return [String]
9
+ attr_reader :prop
10
+ # @return [String]
11
+ attr_reader :value
12
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
13
+ attr_reader :additional_properties
14
+ # @return [Object]
15
+ attr_reader :_field_set
16
+ protected :_field_set
17
+
18
+ OMIT = Object.new
19
+
20
+ # @param prop [String]
21
+ # @param value [String]
22
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
+ # @return [Ittybit::ConditionsTaskStepConditionsItem]
24
+ def initialize(prop: OMIT, value: OMIT, additional_properties: nil)
25
+ @prop = prop if prop != OMIT
26
+ @value = value if value != OMIT
27
+ @additional_properties = additional_properties
28
+ @_field_set = { "prop": prop, "value": value }.reject do |_k, v|
29
+ v == OMIT
30
+ end
31
+ end
32
+
33
+ # Deserialize a JSON object to an instance of ConditionsTaskStepConditionsItem
34
+ #
35
+ # @param json_object [String]
36
+ # @return [Ittybit::ConditionsTaskStepConditionsItem]
37
+ def self.from_json(json_object:)
38
+ struct = JSON.parse(json_object, object_class: OpenStruct)
39
+ parsed_json = JSON.parse(json_object)
40
+ prop = parsed_json["prop"]
41
+ value = parsed_json["value"]
42
+ new(
43
+ prop: prop,
44
+ value: value,
45
+ additional_properties: struct
46
+ )
47
+ end
48
+
49
+ # Serialize an instance of ConditionsTaskStepConditionsItem to a JSON object
50
+ #
51
+ # @return [String]
52
+ def to_json(*_args)
53
+ @_field_set&.to_json
54
+ end
55
+
56
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
57
+ # hash and check each fields type against the current object's property
58
+ # definitions.
59
+ #
60
+ # @param obj [Object]
61
+ # @return [Void]
62
+ def self.validate_raw(obj:)
63
+ obj.prop&.is_a?(String) != false || raise("Passed value for field obj.prop is not the expected type, validation failed.")
64
+ obj.value&.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Ittybit
7
+ class ConditionsTaskStepNextItem
8
+ # @return [String]
9
+ attr_reader :kind
10
+ # @return [String]
11
+ attr_reader :ref
12
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
13
+ attr_reader :additional_properties
14
+ # @return [Object]
15
+ attr_reader :_field_set
16
+ protected :_field_set
17
+
18
+ OMIT = Object.new
19
+
20
+ # @param kind [String]
21
+ # @param ref [String]
22
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
+ # @return [Ittybit::ConditionsTaskStepNextItem]
24
+ def initialize(kind: OMIT, ref: OMIT, additional_properties: nil)
25
+ @kind = kind if kind != OMIT
26
+ @ref = ref if ref != OMIT
27
+ @additional_properties = additional_properties
28
+ @_field_set = { "kind": kind, "ref": ref }.reject do |_k, v|
29
+ v == OMIT
30
+ end
31
+ end
32
+
33
+ # Deserialize a JSON object to an instance of ConditionsTaskStepNextItem
34
+ #
35
+ # @param json_object [String]
36
+ # @return [Ittybit::ConditionsTaskStepNextItem]
37
+ def self.from_json(json_object:)
38
+ struct = JSON.parse(json_object, object_class: OpenStruct)
39
+ parsed_json = JSON.parse(json_object)
40
+ kind = parsed_json["kind"]
41
+ ref = parsed_json["ref"]
42
+ new(
43
+ kind: kind,
44
+ ref: ref,
45
+ additional_properties: struct
46
+ )
47
+ end
48
+
49
+ # Serialize an instance of ConditionsTaskStepNextItem to a JSON object
50
+ #
51
+ # @return [String]
52
+ def to_json(*_args)
53
+ @_field_set&.to_json
54
+ end
55
+
56
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
57
+ # hash and check each fields type against the current object's property
58
+ # definitions.
59
+ #
60
+ # @param obj [Object]
61
+ # @return [Void]
62
+ def self.validate_raw(obj:)
63
+ obj.kind&.is_a?(String) != false || raise("Passed value for field obj.kind is not the expected type, validation failed.")
64
+ obj.ref&.is_a?(String) != false || raise("Passed value for field obj.ref is not the expected type, validation failed.")
65
+ end
66
+ end
67
+ end
@@ -13,7 +13,6 @@ module Ittybit
13
13
  DESCRIPTION = "description"
14
14
  OUTLINE = "outline"
15
15
  PROMPT = "prompt"
16
- CONDITIONS = "conditions"
17
16
  HTTP = "http"
18
17
  end
19
18
  end
data/lib/requests.rb CHANGED
@@ -46,7 +46,7 @@ module Ittybit
46
46
 
47
47
  # @return [Hash{String => String}]
48
48
  def get_headers
49
- headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ittybit", "X-Fern-SDK-Version": "0.8.2" }
49
+ headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ittybit", "X-Fern-SDK-Version": "0.8.4" }
50
50
  headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless @token.nil?
51
51
  headers
52
52
  end
@@ -93,7 +93,7 @@ module Ittybit
93
93
 
94
94
  # @return [Hash{String => String}]
95
95
  def get_headers
96
- headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ittybit", "X-Fern-SDK-Version": "0.8.2" }
96
+ headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ittybit", "X-Fern-SDK-Version": "0.8.4" }
97
97
  headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless @token.nil?
98
98
  headers
99
99
  end
data/lib/types_export.rb CHANGED
@@ -12,11 +12,15 @@ require_relative "ittybit/types/links"
12
12
  require_relative "ittybit/types/links_list"
13
13
  require_relative "ittybit/types/error"
14
14
  require_relative "ittybit/types/automation_trigger"
15
+ require_relative "ittybit/types/workflow_task_step"
16
+ require_relative "ittybit/types/conditions_task_step"
17
+ require_relative "ittybit/types/automation_workflow_item"
15
18
  require_relative "ittybit/types/automation_status"
16
19
  require_relative "ittybit/types/automation"
20
+ require_relative "ittybit/types/conditions_task_step_conditions_item"
21
+ require_relative "ittybit/types/conditions_task_step_next_item"
17
22
  require_relative "ittybit/types/workflow_task_step_kind"
18
23
  require_relative "ittybit/types/workflow_task_step_next_item"
19
- require_relative "ittybit/types/workflow_task_step"
20
24
  require_relative "ittybit/types/file_object"
21
25
  require_relative "ittybit/types/file_kind"
22
26
  require_relative "ittybit/types/file_status"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ittybit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -115,6 +115,10 @@ files:
115
115
  - lib/ittybit/types/automation_response.rb
116
116
  - lib/ittybit/types/automation_status.rb
117
117
  - lib/ittybit/types/automation_trigger.rb
118
+ - lib/ittybit/types/automation_workflow_item.rb
119
+ - lib/ittybit/types/conditions_task_step.rb
120
+ - lib/ittybit/types/conditions_task_step_conditions_item.rb
121
+ - lib/ittybit/types/conditions_task_step_next_item.rb
118
122
  - lib/ittybit/types/confirmation.rb
119
123
  - lib/ittybit/types/confirmation_response.rb
120
124
  - lib/ittybit/types/error.rb