Class: Ittybit::Files::FilesCreateResponse
- Inherits:
-
Object
- Object
- Ittybit::Files::FilesCreateResponse
- Defined in:
- lib/ittybit/files/types/files_create_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #animated ⇒ Boolean readonly
- #background ⇒ String readonly
- #bitrate ⇒ Integer readonly
- #codec ⇒ String readonly
- #container ⇒ String readonly
- #created ⇒ DateTime readonly
- #created_by ⇒ String readonly
- #duration ⇒ Float readonly
- #filename ⇒ String readonly
- #filesize ⇒ Integer readonly
- #folder ⇒ String readonly
- #fps ⇒ Float readonly
- #frames ⇒ Integer readonly
- #height ⇒ Integer readonly
- #id ⇒ String readonly
- #kind ⇒ Ittybit::Files::FilesCreateResponseKind readonly
- #label ⇒ String readonly
- #language ⇒ String readonly
- #media_id ⇒ String readonly
- #metadata ⇒ Hash{String => Object} readonly
- #object ⇒ Ittybit::Files::FilesCreateResponseObject readonly
- #orientation ⇒ String readonly
- #original ⇒ Boolean readonly
- #placeholder ⇒ String readonly
- #ref ⇒ String readonly
- #rotation ⇒ Float readonly
- #status ⇒ Ittybit::Files::FilesCreateResponseStatus readonly
- #transparency ⇒ Boolean readonly
- #type ⇒ String readonly
- #updated ⇒ DateTime readonly
- #url ⇒ String readonly
- #width ⇒ Integer readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Ittybit::Files::FilesCreateResponse
Deserialize a JSON object to an instance of FilesCreateResponse.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(id:, media_id:, object:, kind:, type:, filesize:, url:, created:, updated:, status:, codec: OMIT, container: OMIT, width: OMIT, height: OMIT, orientation: OMIT, rotation: OMIT, transparency: OMIT, animated: OMIT, frames: OMIT, duration: OMIT, fps: OMIT, bitrate: OMIT, language: OMIT, label: OMIT, ref: OMIT, folder: OMIT, filename: OMIT, placeholder: OMIT, background: OMIT, metadata: OMIT, original: OMIT, created_by: OMIT, additional_properties: nil) ⇒ Ittybit::Files::FilesCreateResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of FilesCreateResponse to a JSON object.
Constructor Details
#initialize(id:, media_id:, object:, kind:, type:, filesize:, url:, created:, updated:, status:, codec: OMIT, container: OMIT, width: OMIT, height: OMIT, orientation: OMIT, rotation: OMIT, transparency: OMIT, animated: OMIT, frames: OMIT, duration: OMIT, fps: OMIT, bitrate: OMIT, language: OMIT, label: OMIT, ref: OMIT, folder: OMIT, filename: OMIT, placeholder: OMIT, background: OMIT, metadata: OMIT, original: OMIT, created_by: OMIT, additional_properties: nil) ⇒ Ittybit::Files::FilesCreateResponse
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 119 def initialize(id:, media_id:, object:, kind:, type:, filesize:, url:, created:, updated:, status:, codec: OMIT, container: OMIT, width: OMIT, height: OMIT, orientation: OMIT, rotation: OMIT, transparency: OMIT, animated: OMIT, frames: OMIT, duration: OMIT, fps: OMIT, bitrate: OMIT, language: OMIT, label: OMIT, ref: OMIT, folder: OMIT, filename: OMIT, placeholder: OMIT, background: OMIT, metadata: OMIT, original: OMIT, created_by: OMIT, additional_properties: nil) @id = id @media_id = media_id @object = object @kind = kind @type = type @codec = codec if codec != OMIT @container = container if container != OMIT @width = width if width != OMIT @height = height if height != OMIT @orientation = orientation if orientation != OMIT @rotation = rotation if rotation != OMIT @transparency = transparency if transparency != OMIT @animated = animated if animated != OMIT @frames = frames if frames != OMIT @duration = duration if duration != OMIT @fps = fps if fps != OMIT @filesize = filesize @bitrate = bitrate if bitrate != OMIT @language = language if language != OMIT @label = label if label != OMIT @ref = ref if ref != OMIT @folder = folder if folder != OMIT @filename = filename if filename != OMIT @url = url @placeholder = placeholder if placeholder != OMIT @background = background if background != OMIT = if != OMIT @original = original if original != OMIT @created_by = created_by if created_by != OMIT @created = created @updated = updated @status = status @additional_properties = additional_properties @_field_set = { "id": id, "media_id": media_id, "object": object, "kind": kind, "type": type, "codec": codec, "container": container, "width": width, "height": height, "orientation": orientation, "rotation": rotation, "transparency": transparency, "animated": animated, "frames": frames, "duration": duration, "fps": fps, "filesize": filesize, "bitrate": bitrate, "language": language, "label": label, "ref": ref, "folder": folder, "filename": filename, "url": url, "placeholder": placeholder, "background": background, "metadata": , "original": original, "created_by": created_by, "created": created, "updated": updated, "status": status }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
78 79 80 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 78 def additional_properties @additional_properties end |
#animated ⇒ Boolean (readonly)
38 39 40 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 38 def animated @animated end |
#background ⇒ String (readonly)
64 65 66 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 64 def background @background end |
#bitrate ⇒ Integer (readonly)
48 49 50 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 48 def bitrate @bitrate end |
#codec ⇒ String (readonly)
24 25 26 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 24 def codec @codec end |
#container ⇒ String (readonly)
26 27 28 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 26 def container @container end |
#created ⇒ DateTime (readonly)
72 73 74 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 72 def created @created end |
#created_by ⇒ String (readonly)
70 71 72 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 70 def created_by @created_by end |
#duration ⇒ Float (readonly)
42 43 44 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 42 def duration @duration end |
#filename ⇒ String (readonly)
58 59 60 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 58 def filename @filename end |
#filesize ⇒ Integer (readonly)
46 47 48 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 46 def filesize @filesize end |
#folder ⇒ String (readonly)
56 57 58 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 56 def folder @folder end |
#fps ⇒ Float (readonly)
44 45 46 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 44 def fps @fps end |
#frames ⇒ Integer (readonly)
40 41 42 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 40 def frames @frames end |
#height ⇒ Integer (readonly)
30 31 32 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 30 def height @height end |
#id ⇒ String (readonly)
14 15 16 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 14 def id @id end |
#kind ⇒ Ittybit::Files::FilesCreateResponseKind (readonly)
20 21 22 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 20 def kind @kind end |
#label ⇒ String (readonly)
52 53 54 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 52 def label @label end |
#language ⇒ String (readonly)
50 51 52 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 50 def language @language end |
#media_id ⇒ String (readonly)
16 17 18 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 16 def media_id @media_id end |
#metadata ⇒ Hash{String => Object} (readonly)
66 67 68 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 66 def end |
#object ⇒ Ittybit::Files::FilesCreateResponseObject (readonly)
18 19 20 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 18 def object @object end |
#orientation ⇒ String (readonly)
32 33 34 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 32 def orientation @orientation end |
#original ⇒ Boolean (readonly)
68 69 70 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 68 def original @original end |
#placeholder ⇒ String (readonly)
62 63 64 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 62 def placeholder @placeholder end |
#ref ⇒ String (readonly)
54 55 56 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 54 def ref @ref end |
#rotation ⇒ Float (readonly)
34 35 36 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 34 def rotation @rotation end |
#status ⇒ Ittybit::Files::FilesCreateResponseStatus (readonly)
76 77 78 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 76 def status @status end |
#transparency ⇒ Boolean (readonly)
36 37 38 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 36 def transparency @transparency end |
#type ⇒ String (readonly)
22 23 24 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 22 def type @type end |
#updated ⇒ DateTime (readonly)
74 75 76 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 74 def updated @updated end |
#url ⇒ String (readonly)
60 61 62 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 60 def url @url end |
#width ⇒ Integer (readonly)
28 29 30 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 28 def width @width end |
Class Method Details
.from_json(json_object:) ⇒ Ittybit::Files::FilesCreateResponse
Deserialize a JSON object to an instance of FilesCreateResponse
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 196 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] media_id = parsed_json["media_id"] object = parsed_json["object"] kind = parsed_json["kind"] type = parsed_json["type"] codec = parsed_json["codec"] container = parsed_json["container"] width = parsed_json["width"] height = parsed_json["height"] orientation = parsed_json["orientation"] rotation = parsed_json["rotation"] transparency = parsed_json["transparency"] animated = parsed_json["animated"] frames = parsed_json["frames"] duration = parsed_json["duration"] fps = parsed_json["fps"] filesize = parsed_json["filesize"] bitrate = parsed_json["bitrate"] language = parsed_json["language"] label = parsed_json["label"] ref = parsed_json["ref"] folder = parsed_json["folder"] filename = parsed_json["filename"] url = parsed_json["url"] placeholder = parsed_json["placeholder"] background = parsed_json["background"] = parsed_json["metadata"] original = parsed_json["original"] created_by = parsed_json["created_by"] created = (DateTime.parse(parsed_json["created"]) unless parsed_json["created"].nil?) updated = (DateTime.parse(parsed_json["updated"]) unless parsed_json["updated"].nil?) status = parsed_json["status"] new( id: id, media_id: media_id, object: object, kind: kind, type: type, codec: codec, container: container, width: width, height: height, orientation: orientation, rotation: rotation, transparency: transparency, animated: animated, frames: frames, duration: duration, fps: fps, filesize: filesize, bitrate: bitrate, language: language, label: label, ref: ref, folder: folder, filename: filename, url: url, placeholder: placeholder, background: background, metadata: , original: original, created_by: created_by, created: created, updated: updated, status: status, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 281 def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.media_id.is_a?(String) != false || raise("Passed value for field obj.media_id is not the expected type, validation failed.") obj.object.is_a?(Ittybit::Files::FilesCreateResponseObject) != false || raise("Passed value for field obj.object is not the expected type, validation failed.") obj.kind.is_a?(Ittybit::Files::FilesCreateResponseKind) != false || raise("Passed value for field obj.kind is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.codec&.is_a?(String) != false || raise("Passed value for field obj.codec is not the expected type, validation failed.") obj.container&.is_a?(String) != false || raise("Passed value for field obj.container is not the expected type, validation failed.") obj.width&.is_a?(Integer) != false || raise("Passed value for field obj.width is not the expected type, validation failed.") obj.height&.is_a?(Integer) != false || raise("Passed value for field obj.height is not the expected type, validation failed.") obj.orientation&.is_a?(String) != false || raise("Passed value for field obj.orientation is not the expected type, validation failed.") obj.rotation&.is_a?(Float) != false || raise("Passed value for field obj.rotation is not the expected type, validation failed.") obj.transparency&.is_a?(Boolean) != false || raise("Passed value for field obj.transparency is not the expected type, validation failed.") obj.animated&.is_a?(Boolean) != false || raise("Passed value for field obj.animated is not the expected type, validation failed.") obj.frames&.is_a?(Integer) != false || raise("Passed value for field obj.frames is not the expected type, validation failed.") obj.duration&.is_a?(Float) != false || raise("Passed value for field obj.duration is not the expected type, validation failed.") obj.fps&.is_a?(Float) != false || raise("Passed value for field obj.fps is not the expected type, validation failed.") obj.filesize.is_a?(Integer) != false || raise("Passed value for field obj.filesize is not the expected type, validation failed.") obj.bitrate&.is_a?(Integer) != false || raise("Passed value for field obj.bitrate is not the expected type, validation failed.") obj.language&.is_a?(String) != false || raise("Passed value for field obj.language is not the expected type, validation failed.") obj.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.") obj.ref&.is_a?(String) != false || raise("Passed value for field obj.ref is not the expected type, validation failed.") obj.folder&.is_a?(String) != false || raise("Passed value for field obj.folder is not the expected type, validation failed.") obj.filename&.is_a?(String) != false || raise("Passed value for field obj.filename is not the expected type, validation failed.") obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.") obj.placeholder&.is_a?(String) != false || raise("Passed value for field obj.placeholder is not the expected type, validation failed.") obj.background&.is_a?(String) != false || raise("Passed value for field obj.background is not the expected type, validation failed.") obj.&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.") obj.original&.is_a?(Boolean) != false || raise("Passed value for field obj.original is not the expected type, validation failed.") obj.created_by&.is_a?(String) != false || raise("Passed value for field obj.created_by is not the expected type, validation failed.") obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.") obj.updated.is_a?(DateTime) != false || raise("Passed value for field obj.updated is not the expected type, validation failed.") obj.status.is_a?(Ittybit::Files::FilesCreateResponseStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of FilesCreateResponse to a JSON object
271 272 273 |
# File 'lib/ittybit/files/types/files_create_response.rb', line 271 def to_json(*_args) @_field_set&.to_json end |