ittybit 0.7.5.2 → 0.8.0
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/lib/ittybit/automations/client.rb +149 -87
- data/lib/ittybit/automations/types/update_automation_request_status.rb +10 -0
- data/lib/ittybit/automations/types/{automations_update_request_trigger_conditions_item.rb → update_automation_request_trigger.rb} +19 -21
- data/lib/ittybit/files/client.rb +67 -77
- data/lib/ittybit/media/client.rb +78 -34
- data/lib/ittybit/signatures/client.rb +20 -24
- data/lib/ittybit/signatures/types/signatures_create_request_method.rb +0 -3
- data/lib/ittybit/tasks/client.rb +45 -132
- data/lib/ittybit/types/automation.rb +19 -29
- data/lib/ittybit/types/automation_list_response.rb +15 -2
- data/lib/ittybit/types/automation_response.rb +15 -2
- data/lib/ittybit/types/automation_status.rb +1 -3
- data/lib/ittybit/types/automation_trigger.rb +11 -18
- data/lib/ittybit/types/{confirmation_response_data.rb → confirmation.rb} +11 -9
- data/lib/ittybit/types/confirmation_response.rb +20 -7
- data/lib/ittybit/types/file.rb +64 -68
- data/lib/ittybit/types/file_kind.rb +0 -1
- data/lib/ittybit/types/file_list_response.rb +15 -2
- data/lib/ittybit/types/file_object.rb +0 -1
- data/lib/ittybit/types/file_response.rb +15 -2
- data/lib/ittybit/types/file_status.rb +0 -1
- data/lib/ittybit/types/links.rb +4 -4
- data/lib/ittybit/types/links_list.rb +17 -32
- data/lib/ittybit/types/media.rb +34 -56
- data/lib/ittybit/types/media_kind.rb +0 -1
- data/lib/ittybit/types/media_list_response.rb +15 -2
- data/lib/ittybit/types/media_response.rb +15 -2
- data/lib/ittybit/types/media_source.rb +52 -53
- data/lib/ittybit/types/media_source_kind.rb +0 -1
- data/lib/ittybit/types/media_source_object.rb +0 -1
- data/lib/ittybit/types/media_source_orientation.rb +9 -0
- data/lib/ittybit/types/media_source_status.rb +0 -1
- data/lib/ittybit/types/meta_list.rb +40 -15
- data/lib/ittybit/types/meta_list_type.rb +8 -0
- data/lib/ittybit/types/signature.rb +14 -14
- data/lib/ittybit/types/signature_response.rb +15 -2
- data/lib/ittybit/types/task.rb +30 -50
- data/lib/ittybit/types/task_list_response.rb +15 -2
- data/lib/ittybit/types/task_response.rb +15 -2
- data/lib/ittybit/types/task_status.rb +0 -1
- data/lib/ittybit/types/task_summary.rb +20 -20
- data/lib/ittybit/types/task_summary_kind.rb +9 -13
- data/lib/ittybit/types/task_summary_status.rb +0 -1
- data/lib/ittybit/types/workflow_task_step.rb +22 -55
- data/lib/ittybit/types/workflow_task_step_kind.rb +8 -14
- data/lib/ittybit/types/{error_response.rb → workflow_task_step_next_item.rb} +21 -28
- data/lib/ittybit.rb +2 -2
- data/lib/requests.rb +8 -8
- data/lib/types_export.rb +6 -11
- metadata +8 -13
- data/lib/ittybit/automations/types/automations_update_request_trigger.rb +0 -75
- data/lib/ittybit/files/types/files_delete_response.rb +0 -89
- data/lib/ittybit/files/types/files_delete_response_data.rb +0 -60
- data/lib/ittybit/tasks/types/tasks_create_request_kind.rb +0 -22
- data/lib/ittybit/tasks/types/tasks_list_request_kind.rb +0 -26
- data/lib/ittybit/tasks/types/tasks_list_request_status.rb +0 -16
- data/lib/ittybit/types/automation_trigger_conditions_item.rb +0 -65
- data/lib/ittybit/types/media_urls.rb +0 -70
@@ -4,7 +4,7 @@ require "ostruct"
|
|
4
4
|
require "json"
|
5
5
|
|
6
6
|
module Ittybit
|
7
|
-
class
|
7
|
+
class Confirmation
|
8
8
|
# @return [String]
|
9
9
|
attr_reader :message
|
10
10
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -17,17 +17,19 @@ module Ittybit
|
|
17
17
|
|
18
18
|
# @param message [String]
|
19
19
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
-
# @return [Ittybit::
|
21
|
-
def initialize(message
|
22
|
-
@message = message
|
20
|
+
# @return [Ittybit::Confirmation]
|
21
|
+
def initialize(message: OMIT, additional_properties: nil)
|
22
|
+
@message = message if message != OMIT
|
23
23
|
@additional_properties = additional_properties
|
24
|
-
@_field_set = { "message": message }
|
24
|
+
@_field_set = { "message": message }.reject do |_k, v|
|
25
|
+
v == OMIT
|
26
|
+
end
|
25
27
|
end
|
26
28
|
|
27
|
-
# Deserialize a JSON object to an instance of
|
29
|
+
# Deserialize a JSON object to an instance of Confirmation
|
28
30
|
#
|
29
31
|
# @param json_object [String]
|
30
|
-
# @return [Ittybit::
|
32
|
+
# @return [Ittybit::Confirmation]
|
31
33
|
def self.from_json(json_object:)
|
32
34
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
33
35
|
parsed_json = JSON.parse(json_object)
|
@@ -35,7 +37,7 @@ module Ittybit
|
|
35
37
|
new(message: message, additional_properties: struct)
|
36
38
|
end
|
37
39
|
|
38
|
-
# Serialize an instance of
|
40
|
+
# Serialize an instance of Confirmation to a JSON object
|
39
41
|
#
|
40
42
|
# @return [String]
|
41
43
|
def to_json(*_args)
|
@@ -49,7 +51,7 @@ module Ittybit
|
|
49
51
|
# @param obj [Object]
|
50
52
|
# @return [Void]
|
51
53
|
def self.validate_raw(obj:)
|
52
|
-
obj.message
|
54
|
+
obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
|
53
55
|
end
|
54
56
|
end
|
55
57
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "meta"
|
4
|
-
require_relative "
|
4
|
+
require_relative "confirmation"
|
5
|
+
require_relative "error"
|
5
6
|
require_relative "links"
|
6
7
|
require "ostruct"
|
7
8
|
require "json"
|
@@ -10,8 +11,10 @@ module Ittybit
|
|
10
11
|
class ConfirmationResponse
|
11
12
|
# @return [Ittybit::META]
|
12
13
|
attr_reader :meta
|
13
|
-
# @return [Ittybit::
|
14
|
+
# @return [Ittybit::Confirmation]
|
14
15
|
attr_reader :data
|
16
|
+
# @return [Ittybit::Error]
|
17
|
+
attr_reader :error
|
15
18
|
# @return [Ittybit::Links]
|
16
19
|
attr_reader :links
|
17
20
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -23,16 +26,18 @@ module Ittybit
|
|
23
26
|
OMIT = Object.new
|
24
27
|
|
25
28
|
# @param meta [Ittybit::META]
|
26
|
-
# @param data [Ittybit::
|
29
|
+
# @param data [Ittybit::Confirmation]
|
30
|
+
# @param error [Ittybit::Error]
|
27
31
|
# @param links [Ittybit::Links]
|
28
32
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
33
|
# @return [Ittybit::ConfirmationResponse]
|
30
|
-
def initialize(meta: OMIT, data: OMIT, links: OMIT, additional_properties: nil)
|
34
|
+
def initialize(meta: OMIT, data: OMIT, error: OMIT, links: OMIT, additional_properties: nil)
|
31
35
|
@meta = meta if meta != OMIT
|
32
36
|
@data = data if data != OMIT
|
37
|
+
@error = error if error != OMIT
|
33
38
|
@links = links if links != OMIT
|
34
39
|
@additional_properties = additional_properties
|
35
|
-
@_field_set = { "meta": meta, "data": data, "links": links }.reject do |_k, v|
|
40
|
+
@_field_set = { "meta": meta, "data": data, "error": error, "links": links }.reject do |_k, v|
|
36
41
|
v == OMIT
|
37
42
|
end
|
38
43
|
end
|
@@ -49,7 +54,13 @@ module Ittybit
|
|
49
54
|
data = nil
|
50
55
|
else
|
51
56
|
data = parsed_json["data"].to_json
|
52
|
-
data = Ittybit::
|
57
|
+
data = Ittybit::Confirmation.from_json(json_object: data)
|
58
|
+
end
|
59
|
+
if parsed_json["error"].nil?
|
60
|
+
error = nil
|
61
|
+
else
|
62
|
+
error = parsed_json["error"].to_json
|
63
|
+
error = Ittybit::Error.from_json(json_object: error)
|
53
64
|
end
|
54
65
|
if parsed_json["links"].nil?
|
55
66
|
links = nil
|
@@ -60,6 +71,7 @@ module Ittybit
|
|
60
71
|
new(
|
61
72
|
meta: meta,
|
62
73
|
data: data,
|
74
|
+
error: error,
|
63
75
|
links: links,
|
64
76
|
additional_properties: struct
|
65
77
|
)
|
@@ -80,7 +92,8 @@ module Ittybit
|
|
80
92
|
# @return [Void]
|
81
93
|
def self.validate_raw(obj:)
|
82
94
|
obj.meta&.is_a?(Object) != false || raise("Passed value for field obj.meta is not the expected type, validation failed.")
|
83
|
-
obj.data.nil? || Ittybit::
|
95
|
+
obj.data.nil? || Ittybit::Confirmation.validate_raw(obj: obj.data)
|
96
|
+
obj.error.nil? || Ittybit::Error.validate_raw(obj: obj.error)
|
84
97
|
obj.links.nil? || Ittybit::Links.validate_raw(obj: obj.links)
|
85
98
|
end
|
86
99
|
end
|
data/lib/ittybit/types/file.rb
CHANGED
@@ -9,71 +9,69 @@ require "json"
|
|
9
9
|
|
10
10
|
module Ittybit
|
11
11
|
class File
|
12
|
-
# @return [String]
|
12
|
+
# @return [String]
|
13
13
|
attr_reader :id
|
14
|
-
# @return [String]
|
14
|
+
# @return [String]
|
15
15
|
attr_reader :media_id
|
16
|
-
# @return [Ittybit::FileObject]
|
16
|
+
# @return [Ittybit::FileObject]
|
17
17
|
attr_reader :object
|
18
|
-
# @return [Ittybit::FileKind]
|
18
|
+
# @return [Ittybit::FileKind]
|
19
19
|
attr_reader :kind
|
20
|
-
# @return [String]
|
20
|
+
# @return [String]
|
21
21
|
attr_reader :type
|
22
|
-
# @return [String]
|
22
|
+
# @return [String]
|
23
23
|
attr_reader :codec
|
24
|
-
# @return [String]
|
24
|
+
# @return [String]
|
25
25
|
attr_reader :container
|
26
|
-
# @return [Integer]
|
26
|
+
# @return [Integer]
|
27
27
|
attr_reader :width
|
28
|
-
# @return [Integer]
|
28
|
+
# @return [Integer]
|
29
29
|
attr_reader :height
|
30
|
-
# @return [String]
|
30
|
+
# @return [String]
|
31
31
|
attr_reader :orientation
|
32
|
-
# @return [Float]
|
32
|
+
# @return [Float]
|
33
33
|
attr_reader :rotation
|
34
|
-
# @return [Boolean]
|
34
|
+
# @return [Boolean]
|
35
35
|
attr_reader :transparency
|
36
|
-
# @return [Boolean]
|
36
|
+
# @return [Boolean]
|
37
37
|
attr_reader :animated
|
38
|
-
# @return [Integer]
|
38
|
+
# @return [Integer]
|
39
39
|
attr_reader :frames
|
40
|
-
# @return [Float]
|
40
|
+
# @return [Float]
|
41
41
|
attr_reader :duration
|
42
|
-
# @return [Float]
|
42
|
+
# @return [Float]
|
43
43
|
attr_reader :fps
|
44
|
-
# @return [Integer]
|
44
|
+
# @return [Integer]
|
45
45
|
attr_reader :filesize
|
46
|
-
# @return [Integer]
|
46
|
+
# @return [Integer]
|
47
47
|
attr_reader :bitrate
|
48
|
-
# @return [String]
|
48
|
+
# @return [String]
|
49
49
|
attr_reader :language
|
50
|
-
# @return [String]
|
50
|
+
# @return [String]
|
51
51
|
attr_reader :label
|
52
|
-
# @return [String]
|
53
|
-
# media `urls` object.
|
52
|
+
# @return [String]
|
54
53
|
attr_reader :ref
|
55
|
-
# @return [String]
|
54
|
+
# @return [String]
|
56
55
|
attr_reader :folder
|
57
|
-
# @return [String]
|
56
|
+
# @return [String]
|
58
57
|
attr_reader :filename
|
59
|
-
# @return [String]
|
58
|
+
# @return [String]
|
60
59
|
attr_reader :url
|
61
|
-
# @return [String]
|
60
|
+
# @return [String]
|
62
61
|
attr_reader :placeholder
|
63
|
-
# @return [String]
|
62
|
+
# @return [String]
|
64
63
|
attr_reader :background
|
65
|
-
# @return [Hash{String => Object}]
|
64
|
+
# @return [Hash{String => Object}]
|
66
65
|
attr_reader :metadata
|
67
|
-
# @return [Boolean]
|
66
|
+
# @return [Boolean]
|
68
67
|
attr_reader :original
|
69
|
-
# @return [String]
|
70
|
-
# file.
|
68
|
+
# @return [String]
|
71
69
|
attr_reader :created_by
|
72
|
-
# @return [DateTime]
|
70
|
+
# @return [DateTime]
|
73
71
|
attr_reader :created
|
74
|
-
# @return [DateTime]
|
72
|
+
# @return [DateTime]
|
75
73
|
attr_reader :updated
|
76
|
-
# @return [Ittybit::FileStatus]
|
74
|
+
# @return [Ittybit::FileStatus]
|
77
75
|
attr_reader :status
|
78
76
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
79
77
|
attr_reader :additional_properties
|
@@ -83,40 +81,38 @@ module Ittybit
|
|
83
81
|
|
84
82
|
OMIT = Object.new
|
85
83
|
|
86
|
-
# @param id [String]
|
87
|
-
# @param media_id [String]
|
88
|
-
# @param object [Ittybit::FileObject]
|
89
|
-
# @param kind [Ittybit::FileKind]
|
90
|
-
# @param type [String]
|
91
|
-
# @param codec [String]
|
92
|
-
# @param container [String]
|
93
|
-
# @param width [Integer]
|
94
|
-
# @param height [Integer]
|
95
|
-
# @param orientation [String]
|
96
|
-
# @param rotation [Float]
|
97
|
-
# @param transparency [Boolean]
|
98
|
-
# @param animated [Boolean]
|
99
|
-
# @param frames [Integer]
|
100
|
-
# @param duration [Float]
|
101
|
-
# @param fps [Float]
|
102
|
-
# @param filesize [Integer]
|
103
|
-
# @param bitrate [Integer]
|
104
|
-
# @param language [String]
|
105
|
-
# @param label [String]
|
106
|
-
# @param ref [String]
|
107
|
-
#
|
108
|
-
# @param
|
109
|
-
# @param
|
110
|
-
# @param
|
111
|
-
# @param
|
112
|
-
# @param
|
113
|
-
# @param
|
114
|
-
# @param
|
115
|
-
# @param
|
116
|
-
#
|
117
|
-
# @param
|
118
|
-
# @param updated [DateTime] Timestamp when the file record was last updated.
|
119
|
-
# @param status [Ittybit::FileStatus] Processing status of the file.
|
84
|
+
# @param id [String]
|
85
|
+
# @param media_id [String]
|
86
|
+
# @param object [Ittybit::FileObject]
|
87
|
+
# @param kind [Ittybit::FileKind]
|
88
|
+
# @param type [String]
|
89
|
+
# @param codec [String]
|
90
|
+
# @param container [String]
|
91
|
+
# @param width [Integer]
|
92
|
+
# @param height [Integer]
|
93
|
+
# @param orientation [String]
|
94
|
+
# @param rotation [Float]
|
95
|
+
# @param transparency [Boolean]
|
96
|
+
# @param animated [Boolean]
|
97
|
+
# @param frames [Integer]
|
98
|
+
# @param duration [Float]
|
99
|
+
# @param fps [Float]
|
100
|
+
# @param filesize [Integer]
|
101
|
+
# @param bitrate [Integer]
|
102
|
+
# @param language [String]
|
103
|
+
# @param label [String]
|
104
|
+
# @param ref [String]
|
105
|
+
# @param folder [String]
|
106
|
+
# @param filename [String]
|
107
|
+
# @param url [String]
|
108
|
+
# @param placeholder [String]
|
109
|
+
# @param background [String]
|
110
|
+
# @param metadata [Hash{String => Object}]
|
111
|
+
# @param original [Boolean]
|
112
|
+
# @param created_by [String]
|
113
|
+
# @param created [DateTime]
|
114
|
+
# @param updated [DateTime]
|
115
|
+
# @param status [Ittybit::FileStatus]
|
120
116
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
121
117
|
# @return [Ittybit::File]
|
122
118
|
def initialize(id:, media_id:, object:, kind:, type:, filesize:, url:, created:, updated:, status:, codec: OMIT, container: OMIT, width: OMIT, height: OMIT,
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "meta_list"
|
4
4
|
require_relative "file"
|
5
|
+
require_relative "error"
|
5
6
|
require_relative "links_list"
|
6
7
|
require "ostruct"
|
7
8
|
require "json"
|
@@ -12,6 +13,8 @@ module Ittybit
|
|
12
13
|
attr_reader :meta
|
13
14
|
# @return [Array<Ittybit::File>]
|
14
15
|
attr_reader :data
|
16
|
+
# @return [Ittybit::Error]
|
17
|
+
attr_reader :error
|
15
18
|
# @return [Ittybit::LinksList]
|
16
19
|
attr_reader :links
|
17
20
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -24,15 +27,17 @@ module Ittybit
|
|
24
27
|
|
25
28
|
# @param meta [Ittybit::MetaList]
|
26
29
|
# @param data [Array<Ittybit::File>]
|
30
|
+
# @param error [Ittybit::Error]
|
27
31
|
# @param links [Ittybit::LinksList]
|
28
32
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
33
|
# @return [Ittybit::FileListResponse]
|
30
|
-
def initialize(meta: OMIT, data: OMIT, links: OMIT, additional_properties: nil)
|
34
|
+
def initialize(meta: OMIT, data: OMIT, error: OMIT, links: OMIT, additional_properties: nil)
|
31
35
|
@meta = meta if meta != OMIT
|
32
36
|
@data = data if data != OMIT
|
37
|
+
@error = error if error != OMIT
|
33
38
|
@links = links if links != OMIT
|
34
39
|
@additional_properties = additional_properties
|
35
|
-
@_field_set = { "meta": meta, "data": data, "links": links }.reject do |_k, v|
|
40
|
+
@_field_set = { "meta": meta, "data": data, "error": error, "links": links }.reject do |_k, v|
|
36
41
|
v == OMIT
|
37
42
|
end
|
38
43
|
end
|
@@ -54,6 +59,12 @@ module Ittybit
|
|
54
59
|
item = item.to_json
|
55
60
|
Ittybit::File.from_json(json_object: item)
|
56
61
|
end
|
62
|
+
if parsed_json["error"].nil?
|
63
|
+
error = nil
|
64
|
+
else
|
65
|
+
error = parsed_json["error"].to_json
|
66
|
+
error = Ittybit::Error.from_json(json_object: error)
|
67
|
+
end
|
57
68
|
if parsed_json["links"].nil?
|
58
69
|
links = nil
|
59
70
|
else
|
@@ -63,6 +74,7 @@ module Ittybit
|
|
63
74
|
new(
|
64
75
|
meta: meta,
|
65
76
|
data: data,
|
77
|
+
error: error,
|
66
78
|
links: links,
|
67
79
|
additional_properties: struct
|
68
80
|
)
|
@@ -84,6 +96,7 @@ module Ittybit
|
|
84
96
|
def self.validate_raw(obj:)
|
85
97
|
obj.meta.nil? || Ittybit::MetaList.validate_raw(obj: obj.meta)
|
86
98
|
obj.data&.is_a?(Array) != false || raise("Passed value for field obj.data is not the expected type, validation failed.")
|
99
|
+
obj.error.nil? || Ittybit::Error.validate_raw(obj: obj.error)
|
87
100
|
obj.links.nil? || Ittybit::LinksList.validate_raw(obj: obj.links)
|
88
101
|
end
|
89
102
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "meta"
|
4
4
|
require_relative "file"
|
5
|
+
require_relative "error"
|
5
6
|
require_relative "links"
|
6
7
|
require "ostruct"
|
7
8
|
require "json"
|
@@ -12,6 +13,8 @@ module Ittybit
|
|
12
13
|
attr_reader :meta
|
13
14
|
# @return [Ittybit::File]
|
14
15
|
attr_reader :data
|
16
|
+
# @return [Ittybit::Error]
|
17
|
+
attr_reader :error
|
15
18
|
# @return [Ittybit::Links]
|
16
19
|
attr_reader :links
|
17
20
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -24,15 +27,17 @@ module Ittybit
|
|
24
27
|
|
25
28
|
# @param meta [Ittybit::META]
|
26
29
|
# @param data [Ittybit::File]
|
30
|
+
# @param error [Ittybit::Error]
|
27
31
|
# @param links [Ittybit::Links]
|
28
32
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
33
|
# @return [Ittybit::FileResponse]
|
30
|
-
def initialize(meta: OMIT, data: OMIT, links: OMIT, additional_properties: nil)
|
34
|
+
def initialize(meta: OMIT, data: OMIT, error: OMIT, links: OMIT, additional_properties: nil)
|
31
35
|
@meta = meta if meta != OMIT
|
32
36
|
@data = data if data != OMIT
|
37
|
+
@error = error if error != OMIT
|
33
38
|
@links = links if links != OMIT
|
34
39
|
@additional_properties = additional_properties
|
35
|
-
@_field_set = { "meta": meta, "data": data, "links": links }.reject do |_k, v|
|
40
|
+
@_field_set = { "meta": meta, "data": data, "error": error, "links": links }.reject do |_k, v|
|
36
41
|
v == OMIT
|
37
42
|
end
|
38
43
|
end
|
@@ -51,6 +56,12 @@ module Ittybit
|
|
51
56
|
data = parsed_json["data"].to_json
|
52
57
|
data = Ittybit::File.from_json(json_object: data)
|
53
58
|
end
|
59
|
+
if parsed_json["error"].nil?
|
60
|
+
error = nil
|
61
|
+
else
|
62
|
+
error = parsed_json["error"].to_json
|
63
|
+
error = Ittybit::Error.from_json(json_object: error)
|
64
|
+
end
|
54
65
|
if parsed_json["links"].nil?
|
55
66
|
links = nil
|
56
67
|
else
|
@@ -60,6 +71,7 @@ module Ittybit
|
|
60
71
|
new(
|
61
72
|
meta: meta,
|
62
73
|
data: data,
|
74
|
+
error: error,
|
63
75
|
links: links,
|
64
76
|
additional_properties: struct
|
65
77
|
)
|
@@ -81,6 +93,7 @@ module Ittybit
|
|
81
93
|
def self.validate_raw(obj:)
|
82
94
|
obj.meta&.is_a?(Object) != false || raise("Passed value for field obj.meta is not the expected type, validation failed.")
|
83
95
|
obj.data.nil? || Ittybit::File.validate_raw(obj: obj.data)
|
96
|
+
obj.error.nil? || Ittybit::Error.validate_raw(obj: obj.error)
|
84
97
|
obj.links.nil? || Ittybit::Links.validate_raw(obj: obj.links)
|
85
98
|
end
|
86
99
|
end
|
data/lib/ittybit/types/links.rb
CHANGED
@@ -5,9 +5,9 @@ require "json"
|
|
5
5
|
|
6
6
|
module Ittybit
|
7
7
|
class Links
|
8
|
-
# @return [String]
|
8
|
+
# @return [String]
|
9
9
|
attr_reader :self_
|
10
|
-
# @return [String]
|
10
|
+
# @return [String]
|
11
11
|
attr_reader :parent
|
12
12
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
13
13
|
attr_reader :additional_properties
|
@@ -17,8 +17,8 @@ module Ittybit
|
|
17
17
|
|
18
18
|
OMIT = Object.new
|
19
19
|
|
20
|
-
# @param self_ [String]
|
21
|
-
# @param parent [String]
|
20
|
+
# @param self_ [String]
|
21
|
+
# @param parent [String]
|
22
22
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
23
|
# @return [Ittybit::Links]
|
24
24
|
def initialize(self_: OMIT, parent: OMIT, additional_properties: nil)
|
@@ -5,17 +5,15 @@ require "json"
|
|
5
5
|
|
6
6
|
module Ittybit
|
7
7
|
class LinksList
|
8
|
-
# @return [String]
|
8
|
+
# @return [String]
|
9
9
|
attr_reader :self_
|
10
|
-
# @return [String]
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :first
|
12
|
+
# @return [String]
|
11
13
|
attr_reader :next_
|
12
|
-
# @return [String]
|
14
|
+
# @return [String]
|
13
15
|
attr_reader :prev
|
14
|
-
# @return [String]
|
15
|
-
attr_reader :parent
|
16
|
-
# @return [String] URL for the first page of results.
|
17
|
-
attr_reader :first
|
18
|
-
# @return [String] URL for the last page of results.
|
16
|
+
# @return [String]
|
19
17
|
attr_reader :last
|
20
18
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
21
19
|
attr_reader :additional_properties
|
@@ -25,31 +23,21 @@ module Ittybit
|
|
25
23
|
|
26
24
|
OMIT = Object.new
|
27
25
|
|
28
|
-
# @param self_ [String]
|
29
|
-
# @param
|
30
|
-
# @param
|
31
|
-
# @param
|
32
|
-
# @param
|
33
|
-
# @param last [String] URL for the last page of results.
|
26
|
+
# @param self_ [String]
|
27
|
+
# @param first [String]
|
28
|
+
# @param next_ [String]
|
29
|
+
# @param prev [String]
|
30
|
+
# @param last [String]
|
34
31
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
35
32
|
# @return [Ittybit::LinksList]
|
36
|
-
def initialize(self_: OMIT,
|
37
|
-
additional_properties: nil)
|
33
|
+
def initialize(self_: OMIT, first: OMIT, next_: OMIT, prev: OMIT, last: OMIT, additional_properties: nil)
|
38
34
|
@self_ = self_ if self_ != OMIT
|
35
|
+
@first = first if first != OMIT
|
39
36
|
@next_ = next_ if next_ != OMIT
|
40
37
|
@prev = prev if prev != OMIT
|
41
|
-
@parent = parent if parent != OMIT
|
42
|
-
@first = first if first != OMIT
|
43
38
|
@last = last if last != OMIT
|
44
39
|
@additional_properties = additional_properties
|
45
|
-
@_field_set = {
|
46
|
-
"self": self_,
|
47
|
-
"next": next_,
|
48
|
-
"prev": prev,
|
49
|
-
"parent": parent,
|
50
|
-
"first": first,
|
51
|
-
"last": last
|
52
|
-
}.reject do |_k, v|
|
40
|
+
@_field_set = { "self": self_, "first": first, "next": next_, "prev": prev, "last": last }.reject do |_k, v|
|
53
41
|
v == OMIT
|
54
42
|
end
|
55
43
|
end
|
@@ -62,17 +50,15 @@ module Ittybit
|
|
62
50
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
63
51
|
parsed_json = JSON.parse(json_object)
|
64
52
|
self_ = parsed_json["self"]
|
53
|
+
first = parsed_json["first"]
|
65
54
|
next_ = parsed_json["next"]
|
66
55
|
prev = parsed_json["prev"]
|
67
|
-
parent = parsed_json["parent"]
|
68
|
-
first = parsed_json["first"]
|
69
56
|
last = parsed_json["last"]
|
70
57
|
new(
|
71
58
|
self_: self_,
|
59
|
+
first: first,
|
72
60
|
next_: next_,
|
73
61
|
prev: prev,
|
74
|
-
parent: parent,
|
75
|
-
first: first,
|
76
62
|
last: last,
|
77
63
|
additional_properties: struct
|
78
64
|
)
|
@@ -93,10 +79,9 @@ module Ittybit
|
|
93
79
|
# @return [Void]
|
94
80
|
def self.validate_raw(obj:)
|
95
81
|
obj.self_&.is_a?(String) != false || raise("Passed value for field obj.self_ is not the expected type, validation failed.")
|
82
|
+
obj.first&.is_a?(String) != false || raise("Passed value for field obj.first is not the expected type, validation failed.")
|
96
83
|
obj.next_&.is_a?(String) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.")
|
97
84
|
obj.prev&.is_a?(String) != false || raise("Passed value for field obj.prev is not the expected type, validation failed.")
|
98
|
-
obj.parent&.is_a?(String) != false || raise("Passed value for field obj.parent is not the expected type, validation failed.")
|
99
|
-
obj.first&.is_a?(String) != false || raise("Passed value for field obj.first is not the expected type, validation failed.")
|
100
85
|
obj.last&.is_a?(String) != false || raise("Passed value for field obj.last is not the expected type, validation failed.")
|
101
86
|
end
|
102
87
|
end
|