Class: NewStoreApi::CreateTagRequest
- Defined in:
- lib/new_store_api/models/create_tag_request.rb
Overview
CreateTagRequest Model.
Instance Attribute Summary collapse
-
#display_name ⇒ String
The human readable tag identifier.
-
#id ⇒ String
The tag identifier.
-
#import_id ⇒ String
The import this tag is associated with, if any.
-
#store_ids ⇒ Array[String]
A list of store IDs the tag belongs to.
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(id = nil, display_name = SKIP, import_id = SKIP, store_ids = SKIP) ⇒ CreateTagRequest
constructor
A new instance of CreateTagRequest.
-
#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(id = nil, display_name = SKIP, import_id = SKIP, store_ids = SKIP) ⇒ CreateTagRequest
Returns a new instance of CreateTagRequest.
55 56 57 58 59 60 61 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 55 def initialize(id = nil, display_name = SKIP, import_id = SKIP, store_ids = SKIP) @display_name = display_name unless display_name == SKIP @id = id @import_id = import_id unless import_id == SKIP @store_ids = store_ids unless store_ids == SKIP end |
Instance Attribute Details
#display_name ⇒ String
The human readable tag identifier.
14 15 16 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 14 def display_name @display_name end |
#id ⇒ String
The tag identifier.
18 19 20 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 18 def id @id end |
#import_id ⇒ String
The import this tag is associated with, if any.
22 23 24 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 22 def import_id @import_id end |
#store_ids ⇒ Array[String]
A list of store IDs the tag belongs to. If no store ID is provided, then the tag is global and will be visible for all the stores.
27 28 29 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 27 def store_ids @store_ids end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil display_name = hash.key?('display_name') ? hash['display_name'] : SKIP import_id = hash.key?('import_id') ? hash['import_id'] : SKIP store_ids = hash.key?('store_ids') ? hash['store_ids'] : SKIP # Create object from extracted values. CreateTagRequest.new(id, display_name, import_id, store_ids) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['display_name'] = 'display_name' @_hash['id'] = 'id' @_hash['import_id'] = 'import_id' @_hash['store_ids'] = 'store_ids' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 52 53 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 49 def self.nullables %w[ import_id ] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 40 def self.optionals %w[ display_name import_id store_ids ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
88 89 90 91 92 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 88 def inspect class_name = self.class.name.split('::').last "<#{class_name} display_name: #{@display_name.inspect}, id: #{@id.inspect}, import_id:"\ " #{@import_id.inspect}, store_ids: #{@store_ids.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
81 82 83 84 85 |
# File 'lib/new_store_api/models/create_tag_request.rb', line 81 def to_s class_name = self.class.name.split('::').last "<#{class_name} display_name: #{@display_name}, id: #{@id}, import_id: #{@import_id},"\ " store_ids: #{@store_ids}>" end |