Class: Zernio::BusinessAgentConnectorInput

Inherits:
ApiModelBase show all
Defined in:
lib/zernio-sdk/models/business_agent_connector_input.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ BusinessAgentConnectorInput

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
149
150
151
152
153
154
155
156
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 105

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::BusinessAgentConnectorInput` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::BusinessAgentConnectorInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  else
    self.name = nil
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.key?(:'base_url')
    self.base_url = attributes[:'base_url']
  else
    self.base_url = nil
  end

  if attributes.key?(:'connector_protocol')
    self.connector_protocol = attributes[:'connector_protocol']
  end

  if attributes.key?(:'auth_type')
    self.auth_type = attributes[:'auth_type']
  else
    self.auth_type = nil
  end

  if attributes.key?(:'auth_config')
    self.auth_config = attributes[:'auth_config']
  end

  if attributes.key?(:'user_auth_injection_config')
    self.user_auth_injection_config = attributes[:'user_auth_injection_config']
  end

  if attributes.key?(:'requires_certificate')
    self.requires_certificate = attributes[:'requires_certificate']
  end
end

Instance Attribute Details

#auth_configObject

Returns the value of attribute auth_config.



31
32
33
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 31

def auth_config
  @auth_config
end

#auth_typeObject

Returns the value of attribute auth_type.



29
30
31
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 29

def auth_type
  @auth_type
end

#base_urlObject

Public HTTPS URL reachable from Meta.



25
26
27
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 25

def base_url
  @base_url
end

#connector_protocolObject

Returns the value of attribute connector_protocol.



27
28
29
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 27

def connector_protocol
  @connector_protocol
end

#descriptionObject

Tell the agent what the service provides.



22
23
24
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 22

def description
  @description
end

#nameObject

Unique per number.



19
20
21
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 19

def name
  @name
end

#requires_certificateObject

Returns the value of attribute requires_certificate.



35
36
37
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 35

def requires_certificate
  @requires_certificate
end

#user_auth_injection_configObject

Returns the value of attribute user_auth_injection_config.



33
34
35
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 33

def user_auth_injection_config
  @user_auth_injection_config
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



74
75
76
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 74

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



79
80
81
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 79

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 60

def self.attribute_map
  {
    :'name' => :'name',
    :'description' => :'description',
    :'base_url' => :'base_url',
    :'connector_protocol' => :'connector_protocol',
    :'auth_type' => :'auth_type',
    :'auth_config' => :'auth_config',
    :'user_auth_injection_config' => :'user_auth_injection_config',
    :'requires_certificate' => :'requires_certificate'
  }
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



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 250

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



98
99
100
101
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 98

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 84

def self.openapi_types
  {
    :'name' => :'String',
    :'description' => :'String',
    :'base_url' => :'String',
    :'connector_protocol' => :'String',
    :'auth_type' => :'String',
    :'auth_config' => :'BusinessAgentConnectorInputAuthConfig',
    :'user_auth_injection_config' => :'BusinessAgentConnectorInputUserAuthInjectionConfig',
    :'requires_certificate' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 222

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      name == o.name &&
      description == o.description &&
      base_url == o.base_url &&
      connector_protocol == o.connector_protocol &&
      auth_type == o.auth_type &&
      auth_config == o.auth_config &&
      user_auth_injection_config == o.user_auth_injection_config &&
      requires_certificate == o.requires_certificate
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


237
238
239
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 237

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



243
244
245
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 243

def hash
  [name, description, base_url, connector_protocol, auth_type, auth_config, user_auth_injection_config, requires_certificate].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 160

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  if @base_url.nil?
    invalid_properties.push('invalid value for "base_url", base_url cannot be nil.')
  end

  if @auth_type.nil?
    invalid_properties.push('invalid value for "auth_type", auth_type cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 272

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



180
181
182
183
184
185
186
187
188
# File 'lib/zernio-sdk/models/business_agent_connector_input.rb', line 180

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @name.nil?
  return false if @base_url.nil?
  return false if @auth_type.nil?
  auth_type_validator = EnumAttributeValidator.new('String', ["OAUTH2_CLIENT_CREDENTIALS", "API_KEY", "NONE"])
  return false unless auth_type_validator.valid?(@auth_type)
  true
end