Class: UspsApi::LabelBrandingImagePatchResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/usps_api/models/label_branding_image_patch_response.rb

Overview

Label Branding Image Patch Response

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(image_uuid: SKIP, image_name: SKIP, created_date_time: SKIP, image_data: SKIP) ⇒ LabelBrandingImagePatchResponse

Returns a new instance of LabelBrandingImagePatchResponse.



54
55
56
57
58
59
60
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 54

def initialize(image_uuid: SKIP, image_name: SKIP, created_date_time: SKIP,
               image_data: SKIP)
  @image_uuid = image_uuid unless image_uuid == SKIP
  @image_name = image_name unless image_name == SKIP
  @created_date_time = created_date_time unless created_date_time == SKIP
  @image_data = image_data unless image_data == SKIP
end

Instance Attribute Details

#created_date_timeDateTime

The time that the image was created.

Returns:

  • (DateTime)


23
24
25
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 23

def created_date_time
  @created_date_time
end

#image_dataString

The base64 image data associated with your image.

Returns:

  • (String)


27
28
29
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 27

def image_data
  @image_data
end

#image_nameString

The name of the image that was successfully renamed.

Returns:

  • (String)


19
20
21
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 19

def image_name
  @image_name
end

#image_uuidString

The UUID of the image that was successfully renamed.

Returns:

  • (String)


15
16
17
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 15

def image_uuid
  @image_uuid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  image_uuid = hash.key?('imageUUID') ? hash['imageUUID'] : SKIP
  image_name = hash.key?('imageName') ? hash['imageName'] : SKIP
  created_date_time = if hash.key?('createdDateTime')
                        (DateTimeHelper.from_rfc3339(hash['createdDateTime']) if hash['createdDateTime'])
                      else
                        SKIP
                      end
  image_data = hash.key?('imageData') ? hash['imageData'] : SKIP

  # Create object from extracted values.
  LabelBrandingImagePatchResponse.new(image_uuid: image_uuid,
                                      image_name: image_name,
                                      created_date_time: created_date_time,
                                      image_data: image_data)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['image_uuid'] = 'imageUUID'
  @_hash['image_name'] = 'imageName'
  @_hash['created_date_time'] = 'createdDateTime'
  @_hash['image_data'] = 'imageData'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
47
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 40

def self.optionals
  %w[
    image_uuid
    image_name
    created_date_time
    image_data
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



95
96
97
98
99
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 95

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} image_uuid: #{@image_uuid.inspect}, image_name: #{@image_name.inspect},"\
  " created_date_time: #{@created_date_time.inspect}, image_data: #{@image_data.inspect}>"
end

#to_custom_created_date_timeObject



83
84
85
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 83

def to_custom_created_date_time
  DateTimeHelper.to_rfc3339(created_date_time)
end

#to_sObject

Provides a human-readable string representation of the object.



88
89
90
91
92
# File 'lib/usps_api/models/label_branding_image_patch_response.rb', line 88

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} image_uuid: #{@image_uuid}, image_name: #{@image_name}, created_date_time:"\
  " #{@created_date_time}, image_data: #{@image_data}>"
end