Class: OCI::DataSafe::Models::ReferentialRelationSummary

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

Overview

A referential relation is a resource corresponding to a database columns. It's a subresource of sensitive data model resource and is always associated with a sensitive data model.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RELATION_TYPE_ENUM =
[
  RELATION_TYPE_NONE = 'NONE'.freeze,
  RELATION_TYPE_APP_DEFINED = 'APP_DEFINED'.freeze,
  RELATION_TYPE_DB_DEFINED = 'DB_DEFINED'.freeze,
  RELATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ReferentialRelationSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 104

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

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

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

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

  self.relation_type = attributes[:'relationType'] if attributes[:'relationType']

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

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

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

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

  self.is_sensitive = attributes[:'isSensitive'] unless attributes[:'isSensitive'].nil?

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

  self.is_sensitive = attributes[:'is_sensitive'] unless attributes[:'is_sensitive'].nil?
end

Instance Attribute Details

#childOCI::DataSafe::Models::ColumnsInfo

This attribute is required.



55
56
57
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 55

def child
  @child
end

#is_sensitiveBOOLEAN

Determines if the columns present in the referential relation is present in the sensitive data model

Returns:

  • (BOOLEAN)


59
60
61
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 59

def is_sensitive
  @is_sensitive
end

#keyString

[Required] The unique key that identifies the referential relation. It's numeric and unique within a sensitive data model.

Returns:

  • (String)


32
33
34
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 32

def key
  @key
end

#lifecycle_stateString

[Required] The current state of the referential relation.

Returns:

  • (String)


36
37
38
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 36

def lifecycle_state
  @lifecycle_state
end

#parentOCI::DataSafe::Models::ColumnsInfo

This attribute is required.



51
52
53
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 51

def parent
  @parent
end

#relation_typeString

[Required] The type of referential relationship the sensitive column has with its parent. NONE indicates that the sensitive column does not have a parent. DB_DEFINED indicates that the relationship is defined in the database dictionary. APP_DEFINED indicates that the relationship is defined at the application level and not in the database dictionary.

Returns:

  • (String)


47
48
49
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 47

def relation_type
  @relation_type
end

#sensitive_data_model_idString

[Required] The OCID of the sensitive data model that contains the sensitive column.

Returns:

  • (String)


40
41
42
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 40

def sensitive_data_model_id
  @sensitive_data_model_id
end

Class Method Details

.attribute_mapObject

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



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 62

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'lifecycle_state': :'lifecycleState',
    'sensitive_data_model_id': :'sensitiveDataModelId',
    'relation_type': :'relationType',
    'parent': :'parent',
    'child': :'child',
    'is_sensitive': :'isSensitive'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 77

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'lifecycle_state': :'String',
    'sensitive_data_model_id': :'String',
    'relation_type': :'String',
    'parent': :'OCI::DataSafe::Models::ColumnsInfo',
    'child': :'OCI::DataSafe::Models::ColumnsInfo',
    'is_sensitive': :'BOOLEAN'
    # 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



174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 174

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

  self.class == other.class &&
    key == other.key &&
    lifecycle_state == other.lifecycle_state &&
    sensitive_data_model_id == other.sensitive_data_model_id &&
    relation_type == other.relation_type &&
    parent == other.parent &&
    child == other.child &&
    is_sensitive == other.is_sensitive
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



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 210

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


190
191
192
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 190

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



199
200
201
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 199

def hash
  [key, lifecycle_state, sensitive_data_model_id, relation_type, parent, child, is_sensitive].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



243
244
245
246
247
248
249
250
251
252
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 243

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



237
238
239
# File 'lib/oci/data_safe/models/referential_relation_summary.rb', line 237

def to_s
  to_hash.to_s
end