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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ittybit/automations/client.rb +149 -87
  3. data/lib/ittybit/automations/types/update_automation_request_status.rb +10 -0
  4. data/lib/ittybit/automations/types/{automations_update_request_trigger_conditions_item.rb → update_automation_request_trigger.rb} +19 -21
  5. data/lib/ittybit/files/client.rb +67 -77
  6. data/lib/ittybit/media/client.rb +78 -34
  7. data/lib/ittybit/signatures/client.rb +20 -24
  8. data/lib/ittybit/signatures/types/signatures_create_request_method.rb +0 -3
  9. data/lib/ittybit/tasks/client.rb +45 -132
  10. data/lib/ittybit/types/automation.rb +19 -29
  11. data/lib/ittybit/types/automation_list_response.rb +15 -2
  12. data/lib/ittybit/types/automation_response.rb +15 -2
  13. data/lib/ittybit/types/automation_status.rb +1 -3
  14. data/lib/ittybit/types/automation_trigger.rb +11 -18
  15. data/lib/ittybit/types/{confirmation_response_data.rb → confirmation.rb} +11 -9
  16. data/lib/ittybit/types/confirmation_response.rb +20 -7
  17. data/lib/ittybit/types/file.rb +64 -68
  18. data/lib/ittybit/types/file_kind.rb +0 -1
  19. data/lib/ittybit/types/file_list_response.rb +15 -2
  20. data/lib/ittybit/types/file_object.rb +0 -1
  21. data/lib/ittybit/types/file_response.rb +15 -2
  22. data/lib/ittybit/types/file_status.rb +0 -1
  23. data/lib/ittybit/types/links.rb +4 -4
  24. data/lib/ittybit/types/links_list.rb +17 -32
  25. data/lib/ittybit/types/media.rb +34 -56
  26. data/lib/ittybit/types/media_kind.rb +0 -1
  27. data/lib/ittybit/types/media_list_response.rb +15 -2
  28. data/lib/ittybit/types/media_response.rb +15 -2
  29. data/lib/ittybit/types/media_source.rb +52 -53
  30. data/lib/ittybit/types/media_source_kind.rb +0 -1
  31. data/lib/ittybit/types/media_source_object.rb +0 -1
  32. data/lib/ittybit/types/media_source_orientation.rb +9 -0
  33. data/lib/ittybit/types/media_source_status.rb +0 -1
  34. data/lib/ittybit/types/meta_list.rb +40 -15
  35. data/lib/ittybit/types/meta_list_type.rb +8 -0
  36. data/lib/ittybit/types/signature.rb +14 -14
  37. data/lib/ittybit/types/signature_response.rb +15 -2
  38. data/lib/ittybit/types/task.rb +30 -50
  39. data/lib/ittybit/types/task_list_response.rb +15 -2
  40. data/lib/ittybit/types/task_response.rb +15 -2
  41. data/lib/ittybit/types/task_status.rb +0 -1
  42. data/lib/ittybit/types/task_summary.rb +20 -20
  43. data/lib/ittybit/types/task_summary_kind.rb +9 -13
  44. data/lib/ittybit/types/task_summary_status.rb +0 -1
  45. data/lib/ittybit/types/workflow_task_step.rb +22 -55
  46. data/lib/ittybit/types/workflow_task_step_kind.rb +8 -14
  47. data/lib/ittybit/types/{error_response.rb → workflow_task_step_next_item.rb} +21 -28
  48. data/lib/ittybit.rb +2 -2
  49. data/lib/requests.rb +8 -8
  50. data/lib/types_export.rb +6 -11
  51. metadata +8 -13
  52. data/lib/ittybit/automations/types/automations_update_request_trigger.rb +0 -75
  53. data/lib/ittybit/files/types/files_delete_response.rb +0 -89
  54. data/lib/ittybit/files/types/files_delete_response_data.rb +0 -60
  55. data/lib/ittybit/tasks/types/tasks_create_request_kind.rb +0 -22
  56. data/lib/ittybit/tasks/types/tasks_list_request_kind.rb +0 -26
  57. data/lib/ittybit/tasks/types/tasks_list_request_status.rb +0 -16
  58. data/lib/ittybit/types/automation_trigger_conditions_item.rb +0 -65
  59. 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 ConfirmationResponseData
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::ConfirmationResponseData]
21
- def initialize(message:, additional_properties: nil)
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 ConfirmationResponseData
29
+ # Deserialize a JSON object to an instance of Confirmation
28
30
  #
29
31
  # @param json_object [String]
30
- # @return [Ittybit::ConfirmationResponseData]
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 ConfirmationResponseData to a JSON object
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.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
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 "confirmation_response_data"
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::ConfirmationResponseData]
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::ConfirmationResponseData]
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::ConfirmationResponseData.from_json(json_object: data)
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::ConfirmationResponseData.validate_raw(obj: obj.data)
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
@@ -9,71 +9,69 @@ require "json"
9
9
 
10
10
  module Ittybit
11
11
  class File
12
- # @return [String] Unique identifier for the file.
12
+ # @return [String]
13
13
  attr_reader :id
14
- # @return [String] Identifier for the parent media object.
14
+ # @return [String]
15
15
  attr_reader :media_id
16
- # @return [Ittybit::FileObject] Object type
16
+ # @return [Ittybit::FileObject]
17
17
  attr_reader :object
18
- # @return [Ittybit::FileKind] The general type of media.
18
+ # @return [Ittybit::FileKind]
19
19
  attr_reader :kind
20
- # @return [String] MIME type.
20
+ # @return [String]
21
21
  attr_reader :type
22
- # @return [String] Codec of the file.
22
+ # @return [String]
23
23
  attr_reader :codec
24
- # @return [String] Container of the file.
24
+ # @return [String]
25
25
  attr_reader :container
26
- # @return [Integer] Width in pixels (for image/video).
26
+ # @return [Integer]
27
27
  attr_reader :width
28
- # @return [Integer] Height in pixels (for image/video).
28
+ # @return [Integer]
29
29
  attr_reader :height
30
- # @return [String] Orientation of the file.
30
+ # @return [String]
31
31
  attr_reader :orientation
32
- # @return [Float] Rotation value for image files with embedded EXIF data.
32
+ # @return [Float]
33
33
  attr_reader :rotation
34
- # @return [Boolean] Indicates if the file has alpha channel.
34
+ # @return [Boolean]
35
35
  attr_reader :transparency
36
- # @return [Boolean] Indicates if the file is animated (image only).
36
+ # @return [Boolean]
37
37
  attr_reader :animated
38
- # @return [Integer] Number of frames in the file.
38
+ # @return [Integer]
39
39
  attr_reader :frames
40
- # @return [Float] Duration in seconds (for audio/video).
40
+ # @return [Float]
41
41
  attr_reader :duration
42
- # @return [Float] Frames per second (for video).
42
+ # @return [Float]
43
43
  attr_reader :fps
44
- # @return [Integer] File size in bytes.
44
+ # @return [Integer]
45
45
  attr_reader :filesize
46
- # @return [Integer] Bitrate for audio/video files.
46
+ # @return [Integer]
47
47
  attr_reader :bitrate
48
- # @return [String] Language code (e.g., en, es, fr).
48
+ # @return [String]
49
49
  attr_reader :language
50
- # @return [String] Label to be used by players (tracks only).
50
+ # @return [String]
51
51
  attr_reader :label
52
- # @return [String] Optional reference value. If set, the file URL will be included in the parent
53
- # media `urls` object.
52
+ # @return [String]
54
53
  attr_reader :ref
55
- # @return [String] The folder path where the file is stored.
54
+ # @return [String]
56
55
  attr_reader :folder
57
- # @return [String] The name of the file.
56
+ # @return [String]
58
57
  attr_reader :filename
59
- # @return [String] Publicly accessible URL for the file.
58
+ # @return [String]
60
59
  attr_reader :url
61
- # @return [String] Base64 encoded placeholder image for the file.
60
+ # @return [String]
62
61
  attr_reader :placeholder
63
- # @return [String] Dominant background color hex code.
62
+ # @return [String]
64
63
  attr_reader :background
65
- # @return [Hash{String => Object}] User-defined key-value metadata.
64
+ # @return [Hash{String => Object}]
66
65
  attr_reader :metadata
67
- # @return [Boolean] Indicates this is the original file rather than a variant.
66
+ # @return [Boolean]
68
67
  attr_reader :original
69
- # @return [String] ID of the entity (e.g., task, automation, or upload request) that created this
70
- # file.
68
+ # @return [String]
71
69
  attr_reader :created_by
72
- # @return [DateTime] Timestamp when the file record was created.
70
+ # @return [DateTime]
73
71
  attr_reader :created
74
- # @return [DateTime] Timestamp when the file record was last updated.
72
+ # @return [DateTime]
75
73
  attr_reader :updated
76
- # @return [Ittybit::FileStatus] Processing status of the file.
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] Unique identifier for the file.
87
- # @param media_id [String] Identifier for the parent media object.
88
- # @param object [Ittybit::FileObject] Object type
89
- # @param kind [Ittybit::FileKind] The general type of media.
90
- # @param type [String] MIME type.
91
- # @param codec [String] Codec of the file.
92
- # @param container [String] Container of the file.
93
- # @param width [Integer] Width in pixels (for image/video).
94
- # @param height [Integer] Height in pixels (for image/video).
95
- # @param orientation [String] Orientation of the file.
96
- # @param rotation [Float] Rotation value for image files with embedded EXIF data.
97
- # @param transparency [Boolean] Indicates if the file has alpha channel.
98
- # @param animated [Boolean] Indicates if the file is animated (image only).
99
- # @param frames [Integer] Number of frames in the file.
100
- # @param duration [Float] Duration in seconds (for audio/video).
101
- # @param fps [Float] Frames per second (for video).
102
- # @param filesize [Integer] File size in bytes.
103
- # @param bitrate [Integer] Bitrate for audio/video files.
104
- # @param language [String] Language code (e.g., en, es, fr).
105
- # @param label [String] Label to be used by players (tracks only).
106
- # @param ref [String] Optional reference value. If set, the file URL will be included in the parent
107
- # media `urls` object.
108
- # @param folder [String] The folder path where the file is stored.
109
- # @param filename [String] The name of the file.
110
- # @param url [String] Publicly accessible URL for the file.
111
- # @param placeholder [String] Base64 encoded placeholder image for the file.
112
- # @param background [String] Dominant background color hex code.
113
- # @param metadata [Hash{String => Object}] User-defined key-value metadata.
114
- # @param original [Boolean] Indicates this is the original file rather than a variant.
115
- # @param created_by [String] ID of the entity (e.g., task, automation, or upload request) that created this
116
- # file.
117
- # @param created [DateTime] Timestamp when the file record was created.
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,
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ittybit
4
- # The general type of media.
5
4
  class FileKind
6
5
  VIDEO = "video"
7
6
  IMAGE = "image"
@@ -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
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ittybit
4
- # Object type
5
4
  class FileObject
6
5
  SOURCE = "source"
7
6
  TRACK = "track"
@@ -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
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ittybit
4
- # Processing status of the file.
5
4
  class FileStatus
6
5
  WAITING = "waiting"
7
6
  PROCESSING = "processing"
@@ -5,9 +5,9 @@ require "json"
5
5
 
6
6
  module Ittybit
7
7
  class Links
8
- # @return [String] The absolute URL of the current request, potentially including query parameters.
8
+ # @return [String]
9
9
  attr_reader :self_
10
- # @return [String] URL for the parent resource.
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] The absolute URL of the current request, potentially including query parameters.
21
- # @param parent [String] URL for the parent resource.
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] The absolute URL of the current request, potentially including query parameters.
8
+ # @return [String]
9
9
  attr_reader :self_
10
- # @return [String] URL for the next page of results.
10
+ # @return [String]
11
+ attr_reader :first
12
+ # @return [String]
11
13
  attr_reader :next_
12
- # @return [String] URL for the previous page of results.
14
+ # @return [String]
13
15
  attr_reader :prev
14
- # @return [String] URL for the parent resource.
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] The absolute URL of the current request, potentially including query parameters.
29
- # @param next_ [String] URL for the next page of results.
30
- # @param prev [String] URL for the previous page of results.
31
- # @param parent [String] URL for the parent resource.
32
- # @param first [String] URL for the first page of results.
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, next_: OMIT, prev: OMIT, parent: OMIT, first: OMIT, last: 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