class OCI::LoadBalancer::Models::UpdateListenerDetails

The configuration details for updating a listener.

Attributes

connection_configuration[RW]

@return [OCI::LoadBalancer::Models::ConnectionConfiguration]

default_backend_set_name[RW]

[Required] The name of the associated backend set.

Example: `example_backend_set`

@return [String]

hostname_names[RW]

An array of hostname resource names. @return [Array<String>]

path_route_set_name[RW]

Deprecated. Please use `routingPolicies` instead.

The name of the set of path-based routing rules, {PathRouteSet}, applied to this listener's traffic.

Example: `example_path_route_set`

@return [String]

port[RW]

[Required] The communication port for the listener.

Example: `80`

@return [Integer]

protocol[RW]

[Required] The protocol on which the listener accepts connection requests. To get a list of valid protocols, use the {#list_protocols list_protocols} operation.

Example: `HTTP`

@return [String]

routing_policy_name[RW]

The name of the routing policy applied to this listener's traffic.

Example: `example_routing_policy`

@return [String]

rule_set_names[RW]

The names of the {RuleSet} to apply to the listener.

Example: ["example_rule_set"]

@return [Array<String>]

ssl_configuration[RW]

@return [OCI::LoadBalancer::Models::SSLConfigurationDetails]

Public Class Methods

attribute_map() click to toggle source

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

# File lib/oci/load_balancer/models/update_listener_details.rb, line 68
def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'default_backend_set_name': :'defaultBackendSetName',
    'port': :'port',
    'protocol': :'protocol',
    'hostname_names': :'hostnameNames',
    'path_route_set_name': :'pathRouteSetName',
    'routing_policy_name': :'routingPolicyName',
    'ssl_configuration': :'sslConfiguration',
    'connection_configuration': :'connectionConfiguration',
    'rule_set_names': :'ruleSetNames'
    # rubocop:enable Style/SymbolLiteral
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :default_backend_set_name The value to assign to the {#default_backend_set_name} property @option attributes [Integer] :port The value to assign to the {#port} property @option attributes [String] :protocol The value to assign to the {#protocol} property @option attributes [Array<String>] :hostname_names The value to assign to the {#hostname_names} property @option attributes [String] :path_route_set_name The value to assign to the {#path_route_set_name} property @option attributes [String] :routing_policy_name The value to assign to the {#routing_policy_name} property @option attributes [OCI::LoadBalancer::Models::SSLConfigurationDetails] :ssl_configuration The value to assign to the {#ssl_configuration} property @option attributes [OCI::LoadBalancer::Models::ConnectionConfiguration] :connection_configuration The value to assign to the {#connection_configuration} property @option attributes [Array<String>] :rule_set_names The value to assign to the {#rule_set_names} property

# File lib/oci/load_balancer/models/update_listener_details.rb, line 116
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

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

  self.default_backend_set_name = attributes[:'defaultBackendSetName'] if attributes[:'defaultBackendSetName']

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

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

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

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

  self.hostname_names = attributes[:'hostnameNames'] if attributes[:'hostnameNames']

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

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

  self.path_route_set_name = attributes[:'pathRouteSetName'] if attributes[:'pathRouteSetName']

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

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

  self.routing_policy_name = attributes[:'routingPolicyName'] if attributes[:'routingPolicyName']

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

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

  self.ssl_configuration = attributes[:'sslConfiguration'] if attributes[:'sslConfiguration']

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

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

  self.connection_configuration = attributes[:'connectionConfiguration'] if attributes[:'connectionConfiguration']

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

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

  self.rule_set_names = attributes[:'ruleSetNames'] if attributes[:'ruleSetNames']

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

  self.rule_set_names = attributes[:'rule_set_names'] if attributes[:'rule_set_names']
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/oci/load_balancer/models/update_listener_details.rb, line 85
def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'default_backend_set_name': :'String',
    'port': :'Integer',
    'protocol': :'String',
    'hostname_names': :'Array<String>',
    'path_route_set_name': :'String',
    'routing_policy_name': :'String',
    'ssl_configuration': :'OCI::LoadBalancer::Models::SSLConfigurationDetails',
    'connection_configuration': :'OCI::LoadBalancer::Models::ConnectionConfiguration',
    'rule_set_names': :'Array<String>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Public Instance Methods

==(other) click to toggle source

Checks equality by comparing each attribute. @param [Object] other the other object to be compared

# File lib/oci/load_balancer/models/update_listener_details.rb, line 176
def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    default_backend_set_name == other.default_backend_set_name &&
    port == other.port &&
    protocol == other.protocol &&
    hostname_names == other.hostname_names &&
    path_route_set_name == other.path_route_set_name &&
    routing_policy_name == other.routing_policy_name &&
    ssl_configuration == other.ssl_configuration &&
    connection_configuration == other.connection_configuration &&
    rule_set_names == other.rule_set_names
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/oci/load_balancer/models/update_listener_details.rb, line 214
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) click to toggle source

@see the `==` method @param [Object] other the other object to be compared

# File lib/oci/load_balancer/models/update_listener_details.rb, line 194
def eql?(other)
  self == other
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/oci/load_balancer/models/update_listener_details.rb, line 203
def hash
  [default_backend_set_name, port, protocol, hostname_names, path_route_set_name, routing_policy_name, ssl_configuration, connection_configuration, rule_set_names].hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/oci/load_balancer/models/update_listener_details.rb, line 247
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_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/oci/load_balancer/models/update_listener_details.rb, line 241
def to_s
  to_hash.to_s
end

Private Instance Methods

_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/oci/load_balancer/models/update_listener_details.rb, line 264
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end