Class: OCI::AiLanguage::Models::PiiEntity
- Inherits:
-
Object
- Object
- OCI::AiLanguage::Models::PiiEntity
- Defined in:
- lib/oci/ai_language/models/pii_entity.rb
Overview
PII entity object.
Instance Attribute Summary collapse
-
#id ⇒ String
Unique id of the entity.
-
#length ⇒ Integer
[Required] Length of PII entity text.
-
#offset ⇒ Integer
[Required] The number of Unicode code points preceding this entity in the submitted text.
-
#score ⇒ Float
[Required] Score or confidence for detected PII entity.
-
#text ⇒ String
[Required] Entity text like name of person, Organization and so on.
-
#type ⇒ String
[Required] Entity type supported PERSON ADDRESS AGE DATE_TIME SSN_OR_TAXPAYER EMAIL PASSPORT_NUMBER_US TELEPHONE_NUMBER DRIVER_ID_US BANK_ACCOUNT_NUMBER BANK_SWIFT BANK_ROUTING CREDIT_DEBIT_NUMBER IP_ADDRESS MAC_ADDRESS COOKIE XSRF_TOKEN AUTH_BASIC AUTH_BEARER JSON_WEB_TOKEN PRIVATE_KEY PUBLIC_KEY OCI_OCID_USER OCI_OCID_TENANCY OCI_SMTP_USERNAME OCI_OCID_REFERENCE OCI_FINGERPRINT OCI_CREDENTIAL OCI_PRE_AUTH_REQUEST OCI_STORAGE_SIGNED_URL OCI_CUSTOMER_SECRET_KEY OCI_ACCESS_KEy MEDICAL_RECORD_NUMBER HEALTH_PLAN_ID URL CERTIFICATE_NUMBER FIN GUIDs VEHICLE_LICENSE_PLATE_US VEHICLE_IDENTIFIER_US.
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 = {}) ⇒ PiiEntity
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 = {}) ⇒ PiiEntity
Initializes the object
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 116 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.id = attributes[:'id'] if attributes[:'id'] self.offset = attributes[:'offset'] if attributes[:'offset'] self.length = attributes[:'length'] if attributes[:'length'] self.text = attributes[:'text'] if attributes[:'text'] self.type = attributes[:'type'] if attributes[:'type'] self.score = attributes[:'score'] if attributes[:'score'] end |
Instance Attribute Details
#id ⇒ String
Unique id of the entity.
13 14 15 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 13 def id @id end |
#length ⇒ Integer
[Required] Length of PII entity text.
21 22 23 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 21 def length @length end |
#offset ⇒ Integer
[Required] The number of Unicode code points preceding this entity in the submitted text.
17 18 19 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 17 def offset @offset end |
#score ⇒ Float
[Required] Score or confidence for detected PII entity.
74 75 76 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 74 def score @score end |
#text ⇒ String
[Required] Entity text like name of person, Organization and so on.
25 26 27 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 25 def text @text end |
#type ⇒ String
[Required] Entity type supported PERSON ADDRESS AGE DATE_TIME SSN_OR_TAXPAYER EMAIL PASSPORT_NUMBER_US TELEPHONE_NUMBER DRIVER_ID_US BANK_ACCOUNT_NUMBER BANK_SWIFT BANK_ROUTING CREDIT_DEBIT_NUMBER IP_ADDRESS MAC_ADDRESS COOKIE XSRF_TOKEN AUTH_BASIC AUTH_BEARER JSON_WEB_TOKEN PRIVATE_KEY PUBLIC_KEY OCI_OCID_USER OCI_OCID_TENANCY OCI_SMTP_USERNAME OCI_OCID_REFERENCE OCI_FINGERPRINT OCI_CREDENTIAL OCI_PRE_AUTH_REQUEST OCI_STORAGE_SIGNED_URL OCI_CUSTOMER_SECRET_KEY OCI_ACCESS_KEy MEDICAL_RECORD_NUMBER HEALTH_PLAN_ID URL CERTIFICATE_NUMBER FIN GUIDs VEHICLE_LICENSE_PLATE_US VEHICLE_IDENTIFIER_US
70 71 72 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 70 def type @type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 77 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'offset': :'offset', 'length': :'length', 'text': :'text', 'type': :'type', 'score': :'score' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 91 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'offset': :'Integer', 'length': :'Integer', 'text': :'String', 'type': :'String', 'score': :'Float' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 142 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && offset == other.offset && length == other.length && text == other.text && type == other.type && score == other.score end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 177 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
157 158 159 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 157 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
166 167 168 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 166 def hash [id, offset, length, text, type, score].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
210 211 212 213 214 215 216 217 218 219 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 210 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
204 205 206 |
# File 'lib/oci/ai_language/models/pii_entity.rb', line 204 def to_s to_hash.to_s end |