Class: OCI::ApmSynthetics::Models::FtpMonitorConfiguration

Inherits:
MonitorConfiguration show all
Defined in:
lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb

Overview

Request configuration details for the FTP monitor type.

Constant Summary collapse

FTP_PROTOCOL_ENUM =
[
  FTP_PROTOCOL_FTP = 'FTP'.freeze,
  FTP_PROTOCOL_FTPS = 'FTPS'.freeze,
  FTP_PROTOCOL_SFTP = 'SFTP'.freeze,
  FTP_PROTOCOL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
FTP_REQUEST_TYPE_ENUM =
[
  FTP_REQUEST_TYPE_LIST = 'LIST'.freeze,
  FTP_REQUEST_TYPE_UPLOAD = 'UPLOAD'.freeze,
  FTP_REQUEST_TYPE_DOWNLOAD = 'DOWNLOAD'.freeze,
  FTP_REQUEST_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from MonitorConfiguration

MonitorConfiguration::CONFIG_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from MonitorConfiguration

#config_type, #dns_configuration, #is_failure_retried

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MonitorConfiguration

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ FtpMonitorConfiguration

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 120

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['configType'] = 'FTP_CONFIG'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.ftp_protocol = attributes[:'ftpProtocol'] if attributes[:'ftpProtocol']

  raise 'You cannot provide both :ftpProtocol and :ftp_protocol' if attributes.key?(:'ftpProtocol') && attributes.key?(:'ftp_protocol')

  self.ftp_protocol = attributes[:'ftp_protocol'] if attributes[:'ftp_protocol']

  self.ftp_request_type = attributes[:'ftpRequestType'] if attributes[:'ftpRequestType']

  raise 'You cannot provide both :ftpRequestType and :ftp_request_type' if attributes.key?(:'ftpRequestType') && attributes.key?(:'ftp_request_type')

  self.ftp_request_type = attributes[:'ftp_request_type'] if attributes[:'ftp_request_type']

  self.is_active_mode = attributes[:'isActiveMode'] unless attributes[:'isActiveMode'].nil?
  self.is_active_mode = false if is_active_mode.nil? && !attributes.key?(:'isActiveMode') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :isActiveMode and :is_active_mode' if attributes.key?(:'isActiveMode') && attributes.key?(:'is_active_mode')

  self.is_active_mode = attributes[:'is_active_mode'] unless attributes[:'is_active_mode'].nil?
  self.is_active_mode = false if is_active_mode.nil? && !attributes.key?(:'isActiveMode') && !attributes.key?(:'is_active_mode') # rubocop:disable Style/StringLiterals

  self.ftp_basic_authentication_details = attributes[:'ftpBasicAuthenticationDetails'] if attributes[:'ftpBasicAuthenticationDetails']

  raise 'You cannot provide both :ftpBasicAuthenticationDetails and :ftp_basic_authentication_details' if attributes.key?(:'ftpBasicAuthenticationDetails') && attributes.key?(:'ftp_basic_authentication_details')

  self.ftp_basic_authentication_details = attributes[:'ftp_basic_authentication_details'] if attributes[:'ftp_basic_authentication_details']

  self.download_size_limit_in_bytes = attributes[:'downloadSizeLimitInBytes'] if attributes[:'downloadSizeLimitInBytes']

  raise 'You cannot provide both :downloadSizeLimitInBytes and :download_size_limit_in_bytes' if attributes.key?(:'downloadSizeLimitInBytes') && attributes.key?(:'download_size_limit_in_bytes')

  self.download_size_limit_in_bytes = attributes[:'download_size_limit_in_bytes'] if attributes[:'download_size_limit_in_bytes']

  self.upload_file_size_in_bytes = attributes[:'uploadFileSizeInBytes'] if attributes[:'uploadFileSizeInBytes']

  raise 'You cannot provide both :uploadFileSizeInBytes and :upload_file_size_in_bytes' if attributes.key?(:'uploadFileSizeInBytes') && attributes.key?(:'upload_file_size_in_bytes')

  self.upload_file_size_in_bytes = attributes[:'upload_file_size_in_bytes'] if attributes[:'upload_file_size_in_bytes']

  self.network_configuration = attributes[:'networkConfiguration'] if attributes[:'networkConfiguration']

  raise 'You cannot provide both :networkConfiguration and :network_configuration' if attributes.key?(:'networkConfiguration') && attributes.key?(:'network_configuration')

  self.network_configuration = attributes[:'network_configuration'] if attributes[:'network_configuration']

  self.verify_response_codes = attributes[:'verifyResponseCodes'] if attributes[:'verifyResponseCodes']

  raise 'You cannot provide both :verifyResponseCodes and :verify_response_codes' if attributes.key?(:'verifyResponseCodes') && attributes.key?(:'verify_response_codes')

  self.verify_response_codes = attributes[:'verify_response_codes'] if attributes[:'verify_response_codes']

  self.verify_response_content = attributes[:'verifyResponseContent'] if attributes[:'verifyResponseContent']

  raise 'You cannot provide both :verifyResponseContent and :verify_response_content' if attributes.key?(:'verifyResponseContent') && attributes.key?(:'verify_response_content')

  self.verify_response_content = attributes[:'verify_response_content'] if attributes[:'verify_response_content']
end

Instance Attribute Details

#download_size_limit_in_bytesInteger

Download size limit in Bytes, at which to stop the transfer. Maximum download size limit is 5 MiB.

Returns:

  • (Integer)


44
45
46
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 44

def download_size_limit_in_bytes
  @download_size_limit_in_bytes
end

#ftp_basic_authentication_detailsOCI::ApmSynthetics::Models::BasicAuthenticationDetails



40
41
42
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 40

def ftp_basic_authentication_details
  @ftp_basic_authentication_details
end

#ftp_protocolString

FTP protocol type.

Returns:

  • (String)


29
30
31
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 29

def ftp_protocol
  @ftp_protocol
end

#ftp_request_typeString

FTP monitor request type.

Returns:

  • (String)


33
34
35
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 33

def ftp_request_type
  @ftp_request_type
end

#is_active_modeBOOLEAN

If enabled, Active mode will be used for the FTP connection. Not supported for SFTP protocol.

Returns:

  • (BOOLEAN)


37
38
39
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 37

def is_active_mode
  @is_active_mode
end

#network_configurationOCI::ApmSynthetics::Models::NetworkConfiguration



51
52
53
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 51

def network_configuration
  @network_configuration
end

#upload_file_size_in_bytesInteger

File upload size in Bytes, at which to stop the transfer. Maximum upload size is 5 MiB.

Returns:

  • (Integer)


48
49
50
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 48

def upload_file_size_in_bytes
  @upload_file_size_in_bytes
end

#verify_response_codesArray<String>

Expected FTP response codes. For status code range, set values such as 2xx, 3xx.

Returns:

  • (Array<String>)


55
56
57
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 55

def verify_response_codes
  @verify_response_codes
end

#verify_response_contentString

Verify response content against regular expression based string. If response content does not match the verifyResponseContent value, then it will be considered a failure.

Returns:

  • (String)


61
62
63
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 61

def verify_response_content
  @verify_response_content
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 64

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'config_type': :'configType',
    'is_failure_retried': :'isFailureRetried',
    'dns_configuration': :'dnsConfiguration',
    'ftp_protocol': :'ftpProtocol',
    'ftp_request_type': :'ftpRequestType',
    'is_active_mode': :'isActiveMode',
    'ftp_basic_authentication_details': :'ftpBasicAuthenticationDetails',
    'download_size_limit_in_bytes': :'downloadSizeLimitInBytes',
    'upload_file_size_in_bytes': :'uploadFileSizeInBytes',
    'network_configuration': :'networkConfiguration',
    'verify_response_codes': :'verifyResponseCodes',
    'verify_response_content': :'verifyResponseContent'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 84

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'config_type': :'String',
    'is_failure_retried': :'BOOLEAN',
    'dns_configuration': :'OCI::ApmSynthetics::Models::DnsConfiguration',
    'ftp_protocol': :'String',
    'ftp_request_type': :'String',
    'is_active_mode': :'BOOLEAN',
    'ftp_basic_authentication_details': :'OCI::ApmSynthetics::Models::BasicAuthenticationDetails',
    'download_size_limit_in_bytes': :'Integer',
    'upload_file_size_in_bytes': :'Integer',
    'network_configuration': :'OCI::ApmSynthetics::Models::NetworkConfiguration',
    'verify_response_codes': :'Array<String>',
    'verify_response_content': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 220

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    config_type == other.config_type &&
    is_failure_retried == other.is_failure_retried &&
    dns_configuration == other.dns_configuration &&
    ftp_protocol == other.ftp_protocol &&
    ftp_request_type == other.ftp_request_type &&
    is_active_mode == other.is_active_mode &&
    ftp_basic_authentication_details == other.ftp_basic_authentication_details &&
    download_size_limit_in_bytes == other.download_size_limit_in_bytes &&
    upload_file_size_in_bytes == other.upload_file_size_in_bytes &&
    network_configuration == other.network_configuration &&
    verify_response_codes == other.verify_response_codes &&
    verify_response_content == other.verify_response_content
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 261

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


241
242
243
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 241

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



250
251
252
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 250

def hash
  [config_type, is_failure_retried, dns_configuration, ftp_protocol, ftp_request_type, is_active_mode, ftp_basic_authentication_details, download_size_limit_in_bytes, upload_file_size_in_bytes, network_configuration, verify_response_codes, verify_response_content].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



294
295
296
297
298
299
300
301
302
303
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 294

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



288
289
290
# File 'lib/oci/apm_synthetics/models/ftp_monitor_configuration.rb', line 288

def to_s
  to_hash.to_s
end