Class: OCI::DataLabelingService::Models::CreateDatasetDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_labeling_service/models/create_dataset_details.rb

Overview

Parameters needed to create a new Dataset. A Dataset allows a user to describe the data source that provides the Records and how Annotations should be applied to the Records.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateDatasetDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
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_labeling_service/models/create_dataset_details.rb', line 119

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

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

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

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

  self.annotation_format = attributes[:'annotationFormat'] if attributes[:'annotationFormat']

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

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

  self.dataset_source_details = attributes[:'datasetSourceDetails'] if attributes[:'datasetSourceDetails']

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

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

  self.dataset_format_details = attributes[:'datasetFormatDetails'] if attributes[:'datasetFormatDetails']

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

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

  self.initial_record_generation_configuration = attributes[:'initialRecordGenerationConfiguration'] if attributes[:'initialRecordGenerationConfiguration']

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

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

  self.initial_import_dataset_configuration = attributes[:'initialImportDatasetConfiguration'] if attributes[:'initialImportDatasetConfiguration']

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

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

  self.label_set = attributes[:'labelSet'] if attributes[:'labelSet']

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

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

  self.labeling_instructions = attributes[:'labelingInstructions'] if attributes[:'labelingInstructions']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

Instance Attribute Details

#annotation_formatString

[Required] The annotation format name required for labeling records.

Returns:

  • (String)


25
26
27
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 25

def annotation_format
  @annotation_format
end

#compartment_idString

[Required] The OCID of the compartment of the resource.

Returns:

  • (String)


21
22
23
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 21

def compartment_id
  @compartment_id
end

#dataset_format_detailsOCI::DataLabelingService::Models::DatasetFormatDetails

This attribute is required.



33
34
35
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 33

def dataset_format_details
  @dataset_format_details
end

#dataset_source_detailsOCI::DataLabelingService::Models::DatasetSourceDetails

This attribute is required.



29
30
31
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 29

def dataset_source_details
  @dataset_source_details
end

#defined_tagsHash<String, Hash<String, Object>>

The defined tags for this resource. Each key is predefined and scoped to a namespace. For example: {\"foo-namespace\": {\"bar-key\": \"value\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


59
60
61
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 59

def defined_tags
  @defined_tags
end

#descriptionString

A user provided description of the dataset

Returns:

  • (String)


17
18
19
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 17

def description
  @description
end

#display_nameString

A user-friendly display name for the resource.

Returns:

  • (String)


13
14
15
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 13

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


53
54
55
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 53

def freeform_tags
  @freeform_tags
end

#initial_import_dataset_configurationOCI::DataLabelingService::Models::InitialImportDatasetConfiguration



39
40
41
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 39

def initial_import_dataset_configuration
  @initial_import_dataset_configuration
end

#initial_record_generation_configurationOCI::DataLabelingService::Models::InitialRecordGenerationConfiguration



36
37
38
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 36

def initial_record_generation_configuration
  @initial_record_generation_configuration
end

#label_setOCI::DataLabelingService::Models::LabelSet

This attribute is required.



43
44
45
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 43

def label_set
  @label_set
end

#labeling_instructionsString

The labeling instructions for human labelers in rich text format

Returns:

  • (String)


47
48
49
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 47

def labeling_instructions
  @labeling_instructions
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
75
76
77
78
79
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 62

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'description': :'description',
    'compartment_id': :'compartmentId',
    'annotation_format': :'annotationFormat',
    'dataset_source_details': :'datasetSourceDetails',
    'dataset_format_details': :'datasetFormatDetails',
    'initial_record_generation_configuration': :'initialRecordGenerationConfiguration',
    'initial_import_dataset_configuration': :'initialImportDatasetConfiguration',
    'label_set': :'labelSet',
    'labeling_instructions': :'labelingInstructions',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 82

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'description': :'String',
    'compartment_id': :'String',
    'annotation_format': :'String',
    'dataset_source_details': :'OCI::DataLabelingService::Models::DatasetSourceDetails',
    'dataset_format_details': :'OCI::DataLabelingService::Models::DatasetFormatDetails',
    'initial_record_generation_configuration': :'OCI::DataLabelingService::Models::InitialRecordGenerationConfiguration',
    'initial_import_dataset_configuration': :'OCI::DataLabelingService::Models::InitialImportDatasetConfiguration',
    'label_set': :'OCI::DataLabelingService::Models::LabelSet',
    'labeling_instructions': :'String',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # 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



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 201

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

  self.class == other.class &&
    display_name == other.display_name &&
    description == other.description &&
    compartment_id == other.compartment_id &&
    annotation_format == other.annotation_format &&
    dataset_source_details == other.dataset_source_details &&
    dataset_format_details == other.dataset_format_details &&
    initial_record_generation_configuration == other.initial_record_generation_configuration &&
    initial_import_dataset_configuration == other.initial_import_dataset_configuration &&
    label_set == other.label_set &&
    labeling_instructions == other.labeling_instructions &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
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



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 242

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


222
223
224
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 222

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



231
232
233
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 231

def hash
  [display_name, description, compartment_id, annotation_format, dataset_source_details, dataset_format_details, initial_record_generation_configuration, initial_import_dataset_configuration, label_set, labeling_instructions, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



275
276
277
278
279
280
281
282
283
284
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 275

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



269
270
271
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 269

def to_s
  to_hash.to_s
end