Class: OCI::Apigateway::Models::SdkLanguageOptionalParameters

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/apigateway/models/sdk_language_optional_parameters.rb

Overview

List of additional applicable parameters for any given target language.

Constant Summary collapse

INPUT_TYPE_ENUM =
[
  INPUT_TYPE_ENUM_VALUE = 'ENUM'.freeze,
  INPUT_TYPE_EMAIL = 'EMAIL'.freeze,
  INPUT_TYPE_URI = 'URI'.freeze,
  INPUT_TYPE_STRING = 'STRING'.freeze,
  INPUT_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 = {}) ⇒ SdkLanguageOptionalParameters

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 103

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

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

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

  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.is_required = attributes[:'isRequired'] unless attributes[:'isRequired'].nil?
  self.is_required = false if is_required.nil? && !attributes.key?(:'isRequired') # rubocop:disable Style/StringLiterals

  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?
  self.is_required = false if is_required.nil? && !attributes.key?(:'isRequired') && !attributes.key?(:'is_required') # rubocop:disable Style/StringLiterals

  self.max_size = attributes[:'maxSize'] if attributes[:'maxSize']

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

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

  self.input_type = attributes[:'inputType'] if attributes[:'inputType']

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

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

  self.allowed_values = attributes[:'allowedValues'] if attributes[:'allowedValues']

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

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

Instance Attribute Details

#allowed_valuesArray<OCI::Apigateway::Models::SdkLanguageOptionalParametersAllowedValue>

List of allowed input values. Example: [{\"name\": \"name1\", \"description\": \"description1\"}, ...]



58
59
60
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 58

def allowed_values
  @allowed_values
end

#descriptionString

Description for the parameter.

Returns:

  • (String)


33
34
35
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 33

def description
  @description
end

#display_nameString

Display name of the parameter.

Returns:

  • (String)


28
29
30
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 28

def display_name
  @display_name
end

#input_typeString

The input type for this param. - Input type is ENUM when only specific list of input strings are allowed. - Input type is EMAIL when input type is an email ID. - Input type is URI when input type is an URI. - Input type is STRING in all other cases.

Returns:

  • (String)


52
53
54
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 52

def input_type
  @input_type
end

#is_requiredBOOLEAN

Information on whether the parameter is required or not.

Returns:

  • (BOOLEAN)


38
39
40
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 38

def is_required
  @is_required
end

#max_sizeFloat

Maximum size as input value for this parameter.

Returns:

  • (Float)


43
44
45
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 43

def max_size
  @max_size
end

#param_nameString

[Required] Name of the parameter.

Returns:

  • (String)


23
24
25
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 23

def param_name
  @param_name
end

Class Method Details

.attribute_mapObject

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



61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 61

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'param_name': :'paramName',
    'display_name': :'displayName',
    'description': :'description',
    'is_required': :'isRequired',
    'max_size': :'maxSize',
    'input_type': :'inputType',
    'allowed_values': :'allowedValues'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 76

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'param_name': :'String',
    'display_name': :'String',
    'description': :'String',
    'is_required': :'BOOLEAN',
    'max_size': :'Float',
    'input_type': :'String',
    'allowed_values': :'Array<OCI::Apigateway::Models::SdkLanguageOptionalParametersAllowedValue>'
    # 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



170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 170

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

  self.class == other.class &&
    param_name == other.param_name &&
    display_name == other.display_name &&
    description == other.description &&
    is_required == other.is_required &&
    max_size == other.max_size &&
    input_type == other.input_type &&
    allowed_values == other.allowed_values
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



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 206

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


186
187
188
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 186

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



195
196
197
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 195

def hash
  [param_name, display_name, description, is_required, max_size, input_type, allowed_values].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



239
240
241
242
243
244
245
246
247
248
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 239

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



233
234
235
# File 'lib/oci/apigateway/models/sdk_language_optional_parameters.rb', line 233

def to_s
  to_hash.to_s
end