Class: UspsApi::LabelsJsonPatchRequest1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::LabelsJsonPatchRequest1
- Defined in:
- lib/usps_api/models/labels_json_patch_request1.rb
Overview
LabelsJsonPatchRequest1 Model.
Instance Attribute Summary collapse
-
#op ⇒ String
readonly
The operation to perform on the resource.
-
#path ⇒ Path
The object or array location to perform the update to the resource.
-
#value ⇒ Object
Can be anything: string, number, array, object, etc.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(path:, value: SKIP) ⇒ LabelsJsonPatchRequest1
constructor
A new instance of LabelsJsonPatchRequest1.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(path:, value: SKIP) ⇒ LabelsJsonPatchRequest1
Returns a new instance of LabelsJsonPatchRequest1.
46 47 48 49 50 |
# File 'lib/usps_api/models/labels_json_patch_request1.rb', line 46 def initialize(path:, value: SKIP) @op = 'replace' @path = path @value = value unless value == SKIP end |
Instance Attribute Details
#op ⇒ String (readonly)
The operation to perform on the resource.
14 15 16 |
# File 'lib/usps_api/models/labels_json_patch_request1.rb', line 14 def op @op end |
#path ⇒ Path
The object or array location to perform the update to the resource. Must be a JSON pointer value.
19 20 21 |
# File 'lib/usps_api/models/labels_json_patch_request1.rb', line 19 def path @path end |
#value ⇒ Object
Can be anything: string, number, array, object, etc. (except ‘null`)
23 24 25 |
# File 'lib/usps_api/models/labels_json_patch_request1.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 62 63 |
# File 'lib/usps_api/models/labels_json_patch_request1.rb', line 53 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. path = hash.key?('path') ? hash['path'] : nil value = hash.key?('value') ? hash['value'] : SKIP # Create object from extracted values. LabelsJsonPatchRequest1.new(path: path, value: value) end |
.names ⇒ Object
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_request1.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['op'] = 'op' @_hash['path'] = 'path' @_hash['value'] = 'value' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/usps_api/models/labels_json_patch_request1.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 |
# File 'lib/usps_api/models/labels_json_patch_request1.rb', line 35 def self.optionals %w[ value ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
72 73 74 75 |
# File 'lib/usps_api/models/labels_json_patch_request1.rb', line 72 def inspect class_name = self.class.name.split('::').last "<#{class_name} op: #{@op.inspect}, path: #{@path.inspect}, value: #{@value.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
66 67 68 69 |
# File 'lib/usps_api/models/labels_json_patch_request1.rb', line 66 def to_s class_name = self.class.name.split('::').last "<#{class_name} op: #{@op}, path: #{@path}, value: #{@value}>" end |