Class: OCI::DataLabelingService::Models::CreateDatasetDetails
- Inherits:
-
Object
- Object
- OCI::DataLabelingService::Models::CreateDatasetDetails
- 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
-
#annotation_format ⇒ String
[Required] The annotation format name required for labeling records.
-
#compartment_id ⇒ String
[Required] The OCID of the compartment of the resource.
-
#dataset_format_details ⇒ OCI::DataLabelingService::Models::DatasetFormatDetails
This attribute is required.
-
#dataset_source_details ⇒ OCI::DataLabelingService::Models::DatasetSourceDetails
This attribute is required.
-
#defined_tags ⇒ Hash<String, Hash<String, Object>>
The defined tags for this resource.
-
#description ⇒ String
A user provided description of the dataset.
-
#display_name ⇒ String
A user-friendly display name for the resource.
-
#freeform_tags ⇒ Hash<String, String>
A simple key-value pair that is applied without any predefined name, type, or scope.
- #initial_record_generation_configuration ⇒ OCI::DataLabelingService::Models::InitialRecordGenerationConfiguration
-
#label_set ⇒ OCI::DataLabelingService::Models::LabelSet
This attribute is required.
-
#labeling_instructions ⇒ String
The labeling instructions for human labelers in rich text format.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CreateDatasetDetails
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ CreateDatasetDetails
Initializes the object
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 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 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 112 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.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. = attributes[:'freeformTags'] if attributes[:'freeformTags'] raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags') self. = attributes[:'freeform_tags'] if attributes[:'freeform_tags'] self. = attributes[:'definedTags'] if attributes[:'definedTags'] raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags') self. = attributes[:'defined_tags'] if attributes[:'defined_tags'] end |
Instance Attribute Details
#annotation_format ⇒ String
[Required] The annotation format name required for labeling records.
24 25 26 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 24 def annotation_format @annotation_format end |
#compartment_id ⇒ String
[Required] The OCID of the compartment of the resource.
20 21 22 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 20 def compartment_id @compartment_id end |
#dataset_format_details ⇒ OCI::DataLabelingService::Models::DatasetFormatDetails
This attribute is required.
32 33 34 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 32 def dataset_format_details @dataset_format_details end |
#dataset_source_details ⇒ OCI::DataLabelingService::Models::DatasetSourceDetails
This attribute is required.
28 29 30 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 28 def dataset_source_details @dataset_source_details end |
#defined_tags ⇒ Hash<String, Hash<String, Object>>
The defined tags for this resource. Each key is predefined and scoped to a namespace. For example: ‘{"bar-key": "value"}`
55 56 57 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 55 def end |
#description ⇒ String
A user provided description of the dataset
16 17 18 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 16 def description @description end |
#display_name ⇒ String
A user-friendly display name for the resource.
12 13 14 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 12 def display_name @display_name end |
#freeform_tags ⇒ Hash<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: ‘"value"`
49 50 51 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 49 def end |
#initial_record_generation_configuration ⇒ OCI::DataLabelingService::Models::InitialRecordGenerationConfiguration
35 36 37 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 35 def initial_record_generation_configuration @initial_record_generation_configuration end |
#label_set ⇒ OCI::DataLabelingService::Models::LabelSet
This attribute is required.
39 40 41 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 39 def label_set @label_set end |
#labeling_instructions ⇒ String
The labeling instructions for human labelers in rich text format
43 44 45 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 43 def labeling_instructions @labeling_instructions end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 58 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', 'label_set': :'labelSet', 'labeling_instructions': :'labelingInstructions', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 77 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', '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.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 188 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 && label_set == other.label_set && labeling_instructions == other.labeling_instructions && == other. && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 228 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
208 209 210 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 208 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
217 218 219 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 217 def hash [display_name, description, compartment_id, annotation_format, dataset_source_details, dataset_format_details, initial_record_generation_configuration, label_set, labeling_instructions, , ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
261 262 263 264 265 266 267 268 269 270 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 261 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_s ⇒ String
Returns the string representation of the object
255 256 257 |
# File 'lib/oci/data_labeling_service/models/create_dataset_details.rb', line 255 def to_s to_hash.to_s end |