Class: OCI::DataSafe::Models::TargetOverrideCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_safe/models/target_override_collection.rb

Overview

Collection of target override summary.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TargetOverrideCollection

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



82
83
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
116
117
118
119
120
121
122
123
124
125
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 82

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

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

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

  self.targets_overriding_count = attributes[:'targetsOverridingCount'] if attributes[:'targetsOverridingCount']

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

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

  self.targets_conforming_count = attributes[:'targetsConformingCount'] if attributes[:'targetsConformingCount']

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

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

  self.targets_overriding_paid_usage_count = attributes[:'targetsOverridingPaidUsageCount'] if attributes[:'targetsOverridingPaidUsageCount']

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

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

  self.targets_overriding_online_months_count = attributes[:'targetsOverridingOnlineMonthsCount'] if attributes[:'targetsOverridingOnlineMonthsCount']

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

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

  self.targets_overriding_offline_months_count = attributes[:'targetsOverridingOfflineMonthsCount'] if attributes[:'targetsOverridingOfflineMonthsCount']

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

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

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

Instance Attribute Details

#itemsArray<OCI::DataSafe::Models::TargetOverrideSummary>

[Required] Array of target database override summary.



37
38
39
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 37

def items
  @items
end

#targets_conforming_countInteger

[Required] Number of target databases within the target database group that conform with the audit profile of the target database group.

Returns:

  • (Integer)


21
22
23
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 21

def targets_conforming_count
  @targets_conforming_count
end

#targets_countInteger

[Required] Number of target databases within the target database group.

Returns:

  • (Integer)


13
14
15
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 13

def targets_count
  @targets_count
end

#targets_overriding_countInteger

[Required] Number of target databases within the target database group that override the audit profile of the target database group.

Returns:

  • (Integer)


17
18
19
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 17

def targets_overriding_count
  @targets_overriding_count
end

#targets_overriding_offline_months_countInteger

[Required] Number of target databases within the group that override the offline retention setting of the audit profile for the target database group.

Returns:

  • (Integer)


33
34
35
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 33

def targets_overriding_offline_months_count
  @targets_overriding_offline_months_count
end

#targets_overriding_online_months_countInteger

[Required] Number of target databases within the group that override the online retention setting of the audit profile for the target database group.

Returns:

  • (Integer)


29
30
31
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 29

def targets_overriding_online_months_count
  @targets_overriding_online_months_count
end

#targets_overriding_paid_usage_countInteger

[Required] Number of target databases within the group that override the paid usage setting of the audit profile for the target database group.

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 25

def targets_overriding_paid_usage_count
  @targets_overriding_paid_usage_count
end

Class Method Details

.attribute_mapObject

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



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 40

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'targets_count': :'targetsCount',
    'targets_overriding_count': :'targetsOverridingCount',
    'targets_conforming_count': :'targetsConformingCount',
    'targets_overriding_paid_usage_count': :'targetsOverridingPaidUsageCount',
    'targets_overriding_online_months_count': :'targetsOverridingOnlineMonthsCount',
    'targets_overriding_offline_months_count': :'targetsOverridingOfflineMonthsCount',
    'items': :'items'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 55

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'targets_count': :'Integer',
    'targets_overriding_count': :'Integer',
    'targets_conforming_count': :'Integer',
    'targets_overriding_paid_usage_count': :'Integer',
    'targets_overriding_online_months_count': :'Integer',
    'targets_overriding_offline_months_count': :'Integer',
    'items': :'Array<OCI::DataSafe::Models::TargetOverrideSummary>'
    # 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



134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 134

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

  self.class == other.class &&
    targets_count == other.targets_count &&
    targets_overriding_count == other.targets_overriding_count &&
    targets_conforming_count == other.targets_conforming_count &&
    targets_overriding_paid_usage_count == other.targets_overriding_paid_usage_count &&
    targets_overriding_online_months_count == other.targets_overriding_online_months_count &&
    targets_overriding_offline_months_count == other.targets_overriding_offline_months_count &&
    items == other.items
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



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 170

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


150
151
152
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 150

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



159
160
161
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 159

def hash
  [targets_count, targets_overriding_count, targets_conforming_count, targets_overriding_paid_usage_count, targets_overriding_online_months_count, targets_overriding_offline_months_count, items].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



203
204
205
206
207
208
209
210
211
212
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 203

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



197
198
199
# File 'lib/oci/data_safe/models/target_override_collection.rb', line 197

def to_s
  to_hash.to_s
end