Class: OCI::Email::Models::EmailOutboundIpSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/email/models/email_outbound_ip_summary.rb

Overview

Summary of the Outbound IP address assigned to the tenancy.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_DRAINING = 'DRAINING'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ASSIGNMENT_STATE_ENUM =
[
  ASSIGNMENT_STATE_AVAILABLE = 'AVAILABLE'.freeze,
  ASSIGNMENT_STATE_ASSIGNED = 'ASSIGNED'.freeze,
  ASSIGNMENT_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EmailOutboundIpSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :outbound_ip (String)

    The value to assign to the #outbound_ip property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :lifecycle_details (String)

    The value to assign to the #lifecycle_details property

  • :assignment_state (String)

    The value to assign to the #assignment_state property

  • :time_unassigned (DateTime)

    The value to assign to the #time_unassigned property



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
116
117
118
119
120
121
122
123
124
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 89

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.outbound_ip = attributes[:'outboundIp'] if attributes[:'outboundIp']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

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

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

  self.assignment_state = attributes[:'assignmentState'] if attributes[:'assignmentState']

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

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

  self.time_unassigned = attributes[:'timeUnassigned'] if attributes[:'timeUnassigned']

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

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

Instance Attribute Details

#assignment_stateString

[Required] The assignment state of the public IP address.

Returns:

  • (String)


42
43
44
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 42

def assignment_state
  @assignment_state
end

#lifecycle_detailsString

A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in 'DRAINING' state.

Returns:

  • (String)


38
39
40
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 38

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

The current state of the Email Outbound Public IP.

Returns:

  • (String)


32
33
34
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 32

def lifecycle_state
  @lifecycle_state
end

#outbound_ipString

[Required] The public IP address assigned to the tenancy.

Returns:

  • (String)


28
29
30
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 28

def outbound_ip
  @outbound_ip
end

#time_unassignedDateTime

The time IP was removed from IP Pool. Times are expressed in RFC 3339 timestamp format, "YYYY-MM-ddThh:mmZ". Example: 2021-02-12T22:47:12.613Z

Returns:

  • (DateTime)


50
51
52
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 50

def time_unassigned
  @time_unassigned
end

Class Method Details

.attribute_mapObject

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



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 53

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'outbound_ip': :'outboundIp',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'assignment_state': :'assignmentState',
    'time_unassigned': :'timeUnassigned'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



66
67
68
69
70
71
72
73
74
75
76
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 66

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'outbound_ip': :'String',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'assignment_state': :'String',
    'time_unassigned': :'DateTime'
    # 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



159
160
161
162
163
164
165
166
167
168
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 159

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

  self.class == other.class &&
    outbound_ip == other.outbound_ip &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    assignment_state == other.assignment_state &&
    time_unassigned == other.time_unassigned
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



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 193

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


173
174
175
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 173

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



182
183
184
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 182

def hash
  [outbound_ip, lifecycle_state, lifecycle_details, assignment_state, time_unassigned].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



226
227
228
229
230
231
232
233
234
235
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 226

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



220
221
222
# File 'lib/oci/email/models/email_outbound_ip_summary.rb', line 220

def to_s
  to_hash.to_s
end