Class: UspsApi::LabelsJsonPatchRequest

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

Overview

LabelsJsonPatchRequest Model.

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(value: SKIP) ⇒ LabelsJsonPatchRequest

Returns a new instance of LabelsJsonPatchRequest.



46
47
48
49
50
# File 'lib/usps_api/models/labels_json_patch_request.rb', line 46

def initialize(value: SKIP)
  @op = 'replace'
  @path = '/imageName'
  @value = value unless value == SKIP
end

Instance Attribute Details

#opString (readonly)

The operation to perform on the resource.

Returns:

  • (String)


14
15
16
# File 'lib/usps_api/models/labels_json_patch_request.rb', line 14

def op
  @op
end

#pathString (readonly)

The object or array location to perform the update to the resource. Must be a JSON pointer value.

Returns:

  • (String)


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

def path
  @path
end

#valueString

value of a branding patch request

Returns:

  • (String)


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

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  value = hash.key?('value') ? hash['value'] : SKIP

  # Create object from extracted values.
  LabelsJsonPatchRequest.new(value: value)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/usps_api/models/labels_json_patch_request.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['op'] = 'op'
  @_hash['path'] = 'path'
  @_hash['value'] = 'value'
  @_hash
end

.nullablesObject

An array for nullable fields



42
43
44
# File 'lib/usps_api/models/labels_json_patch_request.rb', line 42

def self.nullables
  []
end

.optionalsObject

An array for optional fields



35
36
37
38
39
# File 'lib/usps_api/models/labels_json_patch_request.rb', line 35

def self.optionals
  %w[
    value
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



70
71
72
73
# File 'lib/usps_api/models/labels_json_patch_request.rb', line 70

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} op: #{@op.inspect}, path: #{@path.inspect}, value: #{@value.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



64
65
66
67
# File 'lib/usps_api/models/labels_json_patch_request.rb', line 64

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} op: #{@op}, path: #{@path}, value: #{@value}>"
end