Class: OCI::DataScience::Models::CloneCreateFromModelGroupVersionHistoryDetails

Inherits:
ModelGroupCloneSourceDetails show all
Defined in:
lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb

Overview

Parameters needed to cloning a model group from latest model group in model group version history.

Constant Summary

Constants inherited from ModelGroupCloneSourceDetails

ModelGroupCloneSourceDetails::MODEL_GROUP_CLONE_SOURCE_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from ModelGroupCloneSourceDetails

#model_group_clone_source_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ModelGroupCloneSourceDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ CloneCreateFromModelGroupVersionHistoryDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 55

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

  attributes['modelGroupCloneSourceType'] = 'MODEL_GROUP_VERSION_HISTORY'

  super(attributes)

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

  self.source_id = attributes[:'sourceId'] if attributes[:'sourceId']

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

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

  self.modify_model_group_details = attributes[:'modifyModelGroupDetails'] if attributes[:'modifyModelGroupDetails']

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

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

  self.patch_model_group_member_model_details = attributes[:'patchModelGroupMemberModelDetails'] if attributes[:'patchModelGroupMemberModelDetails']

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

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

Instance Attribute Details

#modify_model_group_detailsOCI::DataScience::Models::ModifyModelGroupDetails



17
18
19
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 17

def modify_model_group_details
  @modify_model_group_details
end

#patch_model_group_member_model_detailsOCI::DataScience::Models::PatchModelGroupMemberModelDetails



20
21
22
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 20

def patch_model_group_member_model_details
  @patch_model_group_member_model_details
end

#source_idString

[Required] The OCID of the model group version history.

Returns:

  • (String)


14
15
16
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 14

def source_id
  @source_id
end

Class Method Details

.attribute_mapObject

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



23
24
25
26
27
28
29
30
31
32
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 23

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'model_group_clone_source_type': :'modelGroupCloneSourceType',
    'source_id': :'sourceId',
    'modify_model_group_details': :'modifyModelGroupDetails',
    'patch_model_group_member_model_details': :'patchModelGroupMemberModelDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



35
36
37
38
39
40
41
42
43
44
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 35

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'model_group_clone_source_type': :'String',
    'source_id': :'String',
    'modify_model_group_details': :'OCI::DataScience::Models::ModifyModelGroupDetails',
    'patch_model_group_member_model_details': :'OCI::DataScience::Models::PatchModelGroupMemberModelDetails'
    # 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



91
92
93
94
95
96
97
98
99
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 91

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

  self.class == other.class &&
    model_group_clone_source_type == other.model_group_clone_source_type &&
    source_id == other.source_id &&
    modify_model_group_details == other.modify_model_group_details &&
    patch_model_group_member_model_details == other.patch_model_group_member_model_details
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



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 124

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


104
105
106
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 104

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



113
114
115
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 113

def hash
  [model_group_clone_source_type, source_id, modify_model_group_details, patch_model_group_member_model_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



157
158
159
160
161
162
163
164
165
166
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 157

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



151
152
153
# File 'lib/oci/data_science/models/clone_create_from_model_group_version_history_details.rb', line 151

def to_s
  to_hash.to_s
end