Class: VisaAcceptanceMergedSpec::Profile1

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/profile1.rb

Overview

Profile1 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(name: SKIP, desination_queue: SKIP, selector_rule: SKIP, additional_properties: nil) ⇒ Profile1

Returns a new instance of Profile1.



56
57
58
59
60
61
62
63
64
65
# File 'lib/visa_acceptance_merged_spec/models/profile1.rb', line 56

def initialize(name: SKIP, desination_queue: SKIP, selector_rule: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name = name unless name == SKIP
  @desination_queue = desination_queue unless desination_queue == SKIP
  @selector_rule = selector_rule unless selector_rule == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#desination_queueString

Name of the queue where orders that are not automatically accepted are sent.

Returns:

  • (String)


25
26
27
# File 'lib/visa_acceptance_merged_spec/models/profile1.rb', line 25

def desination_queue
  @desination_queue
end

#nameString

Name of the active profile chosen by the profile selector. If no profile selector exists, the default active profile is chosen. Note By default, your default profile is the active profile, or the Profile Selector chooses the active profile. Use this field only if you want to specify the name of a different profile. The passed-in profile will then become the active profile.

Returns:

  • (String)


20
21
22
# File 'lib/visa_acceptance_merged_spec/models/profile1.rb', line 20

def name
  @name
end

#selector_ruleString

Name of the profile selector rule that chooses the profile to use for the transaction. If no profile selector exists, the value is Default Active Profile.

Returns:

  • (String)


31
32
33
# File 'lib/visa_acceptance_merged_spec/models/profile1.rb', line 31

def selector_rule
  @selector_rule
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/visa_acceptance_merged_spec/models/profile1.rb', line 68

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  desination_queue =
    hash.key?('desinationQueue') ? hash['desinationQueue'] : SKIP
  selector_rule = hash.key?('selectorRule') ? hash['selectorRule'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  Profile1.new(name: name,
               desination_queue: desination_queue,
               selector_rule: selector_rule,
               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
# File 'lib/visa_acceptance_merged_spec/models/profile1.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['desination_queue'] = 'desinationQueue'
  @_hash['selector_rule'] = 'selectorRule'
  @_hash
end

.nullablesObject

An array for nullable fields



52
53
54
# File 'lib/visa_acceptance_merged_spec/models/profile1.rb', line 52

def self.nullables
  []
end

.optionalsObject

An array for optional fields



43
44
45
46
47
48
49
# File 'lib/visa_acceptance_merged_spec/models/profile1.rb', line 43

def self.optionals
  %w[
    name
    desination_queue
    selector_rule
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



99
100
101
102
103
104
# File 'lib/visa_acceptance_merged_spec/models/profile1.rb', line 99

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name.inspect}, desination_queue: #{@desination_queue.inspect},"\
  " selector_rule: #{@selector_rule.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



92
93
94
95
96
# File 'lib/visa_acceptance_merged_spec/models/profile1.rb', line 92

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name}, desination_queue: #{@desination_queue}, selector_rule:"\
  " #{@selector_rule}, additional_properties: #{@additional_properties}>"
end