Class: OCI::LimitsIncrease::Models::LimitsIncreaseQuestionSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/limits_increase/models/limits_increase_question_summary.rb

Overview

A summary of properties for a question to be asked for a certain limit. Example questions include database version for some limits in Autonomous AI Database or email domain for some limits in Email Delivery. For more information, see Creating a Limit Increase Request.

Constant Summary collapse

QUESTION_TYPE_ENUM =
[
  QUESTION_TYPE_TEXT = 'TEXT'.freeze,
  QUESTION_TYPE_NUMBER = 'NUMBER'.freeze,
  QUESTION_TYPE_RADIO = 'RADIO'.freeze,
  QUESTION_TYPE_CHECKBOX = 'CHECKBOX'.freeze,
  QUESTION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LimitsIncreaseQuestionSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :service (String)

    The value to assign to the #service property

  • :limit_name (String)

    The value to assign to the #limit_name property

  • :question_text (String)

    The value to assign to the #question_text property

  • :question_type (String)

    The value to assign to the #question_type property

  • :options (Hash<String, String>)

    The value to assign to the #options property

  • :is_required (BOOLEAN)

    The value to assign to the #is_required property



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
122
123
124
125
126
127
128
129
130
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 95

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

  self.limit_name = attributes[:'limitName'] if attributes[:'limitName']

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

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

  self.question_text = attributes[:'questionText'] if attributes[:'questionText']

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

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

  self.question_type = attributes[:'questionType'] if attributes[:'questionType']

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

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

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

  self.is_required = attributes[:'isRequired'] unless attributes[:'isRequired'].nil?

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

  self.is_required = attributes[:'is_required'] unless attributes[:'is_required'].nil?
end

Instance Attribute Details

#idString

[Required] The OCID of the question.

Returns:

  • (String)


26
27
28
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 26

def id
  @id
end

#is_requiredBOOLEAN

[Required] When true, requires an answer to the question.

Returns:

  • (BOOLEAN)


50
51
52
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 50

def is_required
  @is_required
end

#limit_nameString

The name of the limit for the question (empty if the question is for the service).

Returns:

  • (String)


34
35
36
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 34

def limit_name
  @limit_name
end

#optionsHash<String, String>

Set options for the question. Applies to questions that aren't free text.

Returns:

  • (Hash<String, String>)


46
47
48
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 46

def options
  @options
end

#question_textString

[Required] The text for the question.

Returns:

  • (String)


38
39
40
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 38

def question_text
  @question_text
end

#question_typeString

[Required] The type of question.

Returns:

  • (String)


42
43
44
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 42

def question_type
  @question_type
end

#serviceString

[Required] The name of the service for the question.

Returns:

  • (String)


30
31
32
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 30

def service
  @service
end

Class Method Details

.attribute_mapObject

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



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 53

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'service': :'service',
    'limit_name': :'limitName',
    'question_text': :'questionText',
    'question_type': :'questionType',
    'options': :'options',
    'is_required': :'isRequired'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 68

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'service': :'String',
    'limit_name': :'String',
    'question_text': :'String',
    'question_type': :'String',
    'options': :'Hash<String, String>',
    'is_required': :'BOOLEAN'
    # 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



152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 152

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

  self.class == other.class &&
    id == other.id &&
    service == other.service &&
    limit_name == other.limit_name &&
    question_text == other.question_text &&
    question_type == other.question_type &&
    options == other.options &&
    is_required == other.is_required
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



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 188

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


168
169
170
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 168

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



177
178
179
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 177

def hash
  [id, service, limit_name, question_text, question_type, options, is_required].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 221

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



215
216
217
# File 'lib/oci/limits_increase/models/limits_increase_question_summary.rb', line 215

def to_s
  to_hash.to_s
end