Class: MistApi::RemoteSyslogFileConfig
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::RemoteSyslogFileConfig
- Defined in:
- lib/mist_api/models/remote_syslog_file_config.rb
Overview
RemoteSyslogFileConfig Model.
Instance Attribute Summary collapse
-
#archive ⇒ RemoteSyslogArchive
TODO: Write general description for this method.
-
#contents ⇒ Array[RemoteSyslogContent]
TODO: Write general description for this method.
-
#enable_tls ⇒ TrueClass | FalseClass
Only if ‘protocol`==`tcp`.
-
#explicit_priority ⇒ TrueClass | FalseClass
Only if ‘protocol`==`tcp`.
-
#file ⇒ String
Only if ‘protocol`==`tcp`.
-
#match ⇒ String
Only if ‘protocol`==`tcp`.
-
#structured_data ⇒ TrueClass | FalseClass
Only if ‘protocol`==`tcp`.
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(archive = SKIP, contents = SKIP, enable_tls = SKIP, explicit_priority = SKIP, file = SKIP, match = SKIP, structured_data = SKIP) ⇒ RemoteSyslogFileConfig
constructor
A new instance of RemoteSyslogFileConfig.
-
#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(archive = SKIP, contents = SKIP, enable_tls = SKIP, explicit_priority = SKIP, file = SKIP, match = SKIP, structured_data = SKIP) ⇒ RemoteSyslogFileConfig
Returns a new instance of RemoteSyslogFileConfig.
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 71 def initialize(archive = SKIP, contents = SKIP, enable_tls = SKIP, explicit_priority = SKIP, file = SKIP, match = SKIP, structured_data = SKIP) @archive = archive unless archive == SKIP @contents = contents unless contents == SKIP @enable_tls = enable_tls unless enable_tls == SKIP @explicit_priority = explicit_priority unless explicit_priority == SKIP @file = file unless file == SKIP @match = match unless match == SKIP @structured_data = structured_data unless structured_data == SKIP end |
Instance Attribute Details
#archive ⇒ RemoteSyslogArchive
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 14 def archive @archive end |
#contents ⇒ Array[RemoteSyslogContent]
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 18 def contents @contents end |
#enable_tls ⇒ TrueClass | FalseClass
Only if ‘protocol`==`tcp`
22 23 24 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 22 def enable_tls @enable_tls end |
#explicit_priority ⇒ TrueClass | FalseClass
Only if ‘protocol`==`tcp`
26 27 28 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 26 def explicit_priority @explicit_priority end |
#file ⇒ String
Only if ‘protocol`==`tcp`
30 31 32 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 30 def file @file end |
#match ⇒ String
Only if ‘protocol`==`tcp`
34 35 36 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 34 def match @match end |
#structured_data ⇒ TrueClass | FalseClass
Only if ‘protocol`==`tcp`
38 39 40 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 38 def structured_data @structured_data end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 84 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. archive = RemoteSyslogArchive.from_hash(hash['archive']) if hash['archive'] # Parameter is an array, so we need to iterate through it contents = nil unless hash['contents'].nil? contents = [] hash['contents'].each do |structure| contents << (RemoteSyslogContent.from_hash(structure) if structure) end end contents = SKIP unless hash.key?('contents') enable_tls = hash.key?('enable_tls') ? hash['enable_tls'] : SKIP explicit_priority = hash.key?('explicit_priority') ? hash['explicit_priority'] : SKIP file = hash.key?('file') ? hash['file'] : SKIP match = hash.key?('match') ? hash['match'] : SKIP structured_data = hash.key?('structured_data') ? hash['structured_data'] : SKIP # Create object from extracted values. RemoteSyslogFileConfig.new(archive, contents, enable_tls, explicit_priority, file, match, structured_data) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['archive'] = 'archive' @_hash['contents'] = 'contents' @_hash['enable_tls'] = 'enable_tls' @_hash['explicit_priority'] = 'explicit_priority' @_hash['file'] = 'file' @_hash['match'] = 'match' @_hash['structured_data'] = 'structured_data' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 54 def self.optionals %w[ archive contents enable_tls explicit_priority file match structured_data ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
126 127 128 129 130 131 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 126 def inspect class_name = self.class.name.split('::').last "<#{class_name} archive: #{@archive.inspect}, contents: #{@contents.inspect}, enable_tls:"\ " #{@enable_tls.inspect}, explicit_priority: #{@explicit_priority.inspect}, file:"\ " #{@file.inspect}, match: #{@match.inspect}, structured_data: #{@structured_data.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
118 119 120 121 122 123 |
# File 'lib/mist_api/models/remote_syslog_file_config.rb', line 118 def to_s class_name = self.class.name.split('::').last "<#{class_name} archive: #{@archive}, contents: #{@contents}, enable_tls: #{@enable_tls},"\ " explicit_priority: #{@explicit_priority}, file: #{@file}, match: #{@match},"\ " structured_data: #{@structured_data}>" end |