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):



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

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: ‘["name1", "description": "description1", …]`



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

def allowed_values
  @allowed_values
end

#descriptionString

Description for the parameter.

Returns:

  • (String)


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

def description
  @description
end

#display_nameString

Display name of the parameter.

Returns:

  • (String)


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

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)


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

def input_type
  @input_type
end

#is_requiredBOOLEAN

Information on whether the parameter is required or not.

Returns:

  • (BOOLEAN)


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

def is_required
  @is_required
end

#max_sizeFloat

Maximum size as input value for this parameter.

Returns:

  • (Float)


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

def max_size
  @max_size
end

#param_nameString

[Required] Name of the parameter.

Returns:

  • (String)


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

def param_name
  @param_name
end

Class Method Details

.attribute_mapObject

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



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

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.



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

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



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

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



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

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


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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

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



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

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



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

def to_s
  to_hash.to_s
end