Class: OCI::Waas::Models::Captcha
- Inherits:
-
Object
- Object
- OCI::Waas::Models::Captcha
- Defined in:
- lib/oci/waas/models/captcha.rb
Overview
The settings of the CAPTCHA challenge. If a specific URL should be accessed only by a human, a CAPTCHA challenge can be placed at the URL to protect the web application from bots.
Warning: Oracle recommends that you avoid using any confidential information when you supply string values using the API.
Instance Attribute Summary collapse
-
#failure_message ⇒ String
[Required] The text to show when incorrect CAPTCHA text is entered.
-
#footer_text ⇒ String
The text to show in the footer when showing a CAPTCHA challenge.
-
#header_text ⇒ String
The text to show in the header when showing a CAPTCHA challenge.
-
#session_expiration_in_seconds ⇒ Integer
[Required] The amount of time before the CAPTCHA expires, in seconds.
-
#submit_label ⇒ String
[Required] The text to show on the label of the CAPTCHA challenge submit button.
-
#title ⇒ String
[Required] The title used when displaying a CAPTCHA challenge.
-
#url ⇒ String
[Required] The unique URL path at which to show the CAPTCHA challenge.
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 = {}) ⇒ Captcha
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 = {}) ⇒ Captcha
Initializes the object
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/oci/waas/models/captcha.rb', line 82 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.url = attributes[:'url'] if attributes[:'url'] self.session_expiration_in_seconds = attributes[:'sessionExpirationInSeconds'] if attributes[:'sessionExpirationInSeconds'] raise 'You cannot provide both :sessionExpirationInSeconds and :session_expiration_in_seconds' if attributes.key?(:'sessionExpirationInSeconds') && attributes.key?(:'session_expiration_in_seconds') self.session_expiration_in_seconds = attributes[:'session_expiration_in_seconds'] if attributes[:'session_expiration_in_seconds'] self.title = attributes[:'title'] if attributes[:'title'] self.header_text = attributes[:'headerText'] if attributes[:'headerText'] raise 'You cannot provide both :headerText and :header_text' if attributes.key?(:'headerText') && attributes.key?(:'header_text') self.header_text = attributes[:'header_text'] if attributes[:'header_text'] self. = attributes[:'footerText'] if attributes[:'footerText'] raise 'You cannot provide both :footerText and :footer_text' if attributes.key?(:'footerText') && attributes.key?(:'footer_text') self. = attributes[:'footer_text'] if attributes[:'footer_text'] self. = attributes[:'failureMessage'] if attributes[:'failureMessage'] raise 'You cannot provide both :failureMessage and :failure_message' if attributes.key?(:'failureMessage') && attributes.key?(:'failure_message') self. = attributes[:'failure_message'] if attributes[:'failure_message'] self.submit_label = attributes[:'submitLabel'] if attributes[:'submitLabel'] raise 'You cannot provide both :submitLabel and :submit_label' if attributes.key?(:'submitLabel') && attributes.key?(:'submit_label') self.submit_label = attributes[:'submit_label'] if attributes[:'submit_label'] end |
Instance Attribute Details
#failure_message ⇒ String
[Required] The text to show when incorrect CAPTCHA text is entered. If unspecified, defaults to ‘The CAPTCHA was incorrect. Try again.`
33 34 35 |
# File 'lib/oci/waas/models/captcha.rb', line 33 def @failure_message end |
#footer_text ⇒ String
The text to show in the footer when showing a CAPTCHA challenge. If unspecified, defaults to ‘Enter the letters and numbers as they are shown in the image above.’
29 30 31 |
# File 'lib/oci/waas/models/captcha.rb', line 29 def @footer_text end |
#header_text ⇒ String
The text to show in the header when showing a CAPTCHA challenge. If unspecified, defaults to ‘We have detected an increased number of attempts to access this website. To help us keep this site secure, please let us know that you are not a robot by entering the text from the image below.’
25 26 27 |
# File 'lib/oci/waas/models/captcha.rb', line 25 def header_text @header_text end |
#session_expiration_in_seconds ⇒ Integer
[Required] The amount of time before the CAPTCHA expires, in seconds. If unspecified, defaults to ‘300`.
17 18 19 |
# File 'lib/oci/waas/models/captcha.rb', line 17 def session_expiration_in_seconds @session_expiration_in_seconds end |
#submit_label ⇒ String
[Required] The text to show on the label of the CAPTCHA challenge submit button. If unspecified, defaults to ‘Yes, I am human`.
37 38 39 |
# File 'lib/oci/waas/models/captcha.rb', line 37 def submit_label @submit_label end |
#title ⇒ String
[Required] The title used when displaying a CAPTCHA challenge. If unspecified, defaults to ‘Are you human?`
21 22 23 |
# File 'lib/oci/waas/models/captcha.rb', line 21 def title @title end |
#url ⇒ String
[Required] The unique URL path at which to show the CAPTCHA challenge.
13 14 15 |
# File 'lib/oci/waas/models/captcha.rb', line 13 def url @url end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/oci/waas/models/captcha.rb', line 40 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'url': :'url', 'session_expiration_in_seconds': :'sessionExpirationInSeconds', 'title': :'title', 'header_text': :'headerText', 'footer_text': :'footerText', 'failure_message': :'failureMessage', 'submit_label': :'submitLabel' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/oci/waas/models/captcha.rb', line 55 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'url': :'String', 'session_expiration_in_seconds': :'Integer', 'title': :'String', 'header_text': :'String', 'footer_text': :'String', 'failure_message': :'String', 'submit_label': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/oci/waas/models/captcha.rb', line 130 def ==(other) return true if equal?(other) self.class == other.class && url == other.url && session_expiration_in_seconds == other.session_expiration_in_seconds && title == other.title && header_text == other.header_text && == other. && == other. && submit_label == other.submit_label end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/oci/waas/models/captcha.rb', line 166 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
146 147 148 |
# File 'lib/oci/waas/models/captcha.rb', line 146 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
155 156 157 |
# File 'lib/oci/waas/models/captcha.rb', line 155 def hash [url, session_expiration_in_seconds, title, header_text, , , submit_label].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
199 200 201 202 203 204 205 206 207 208 |
# File 'lib/oci/waas/models/captcha.rb', line 199 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
193 194 195 |
# File 'lib/oci/waas/models/captcha.rb', line 193 def to_s to_hash.to_s end |