Class: FdxV660Api::ContentTypes1

Inherits:
Object
  • Object
show all
Defined in:
lib/fdx_v660_api/models/content_types1.rb

Overview

File type of the Base64-encoded image, one of the image types application/pdf, application/zip, image/gif, image/jpeg, image/png, image/tiff

Constant Summary collapse

CONTENT_TYPES1 =
[
  # TODO: Write general description for ENUM_APPLICATIONJSON
  ENUM_APPLICATIONJSON = 'application/json'.freeze,

  # TODO: Write general description for ENUM_APPLICATIONJWT
  ENUM_APPLICATIONJWT = 'application/jwt'.freeze,

  # TODO: Write general description for ENUM_APPLICATIONPDF
  ENUM_APPLICATIONPDF = 'application/pdf'.freeze,

  # TODO: Write general description for ENUM_APPLICATIONZIP
  ENUM_APPLICATIONZIP = 'application/zip'.freeze,

  # TODO: Write general description for ENUM_IMAGEGIF
  ENUM_IMAGEGIF = 'image/gif'.freeze,

  # TODO: Write general description for ENUM_IMAGEJPEG
  ENUM_IMAGEJPEG = 'image/jpeg'.freeze,

  # TODO: Write general description for ENUM_IMAGEPNG
  ENUM_IMAGEPNG = 'image/png'.freeze,

  # TODO: Write general description for ENUM_IMAGETIFF
  ENUM_IMAGETIFF = 'image/tiff'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ENUM_APPLICATIONJSON) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/fdx_v660_api/models/content_types1.rb', line 43

def self.from_value(value, default_value = ENUM_APPLICATIONJSON)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'enum_applicationjson' then ENUM_APPLICATIONJSON
  when 'enum_applicationjwt' then ENUM_APPLICATIONJWT
  when 'enum_applicationpdf' then ENUM_APPLICATIONPDF
  when 'enum_applicationzip' then ENUM_APPLICATIONZIP
  when 'enum_imagegif' then ENUM_IMAGEGIF
  when 'enum_imagejpeg' then ENUM_IMAGEJPEG
  when 'enum_imagepng' then ENUM_IMAGEPNG
  when 'enum_imagetiff' then ENUM_IMAGETIFF
  else
    default_value
  end
end

.validate(value) ⇒ Object



37
38
39
40
41
# File 'lib/fdx_v660_api/models/content_types1.rb', line 37

def self.validate(value)
  return false if value.nil?

  true
end