Class: MistApi::AccountZdxConfig

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/account_zdx_config.rb

Overview

OAuth linked ZDX apps account details

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(key_id = nil, key_secret = nil, zdx_org_id = nil, cloud_name = 'zdxcloud.net', additional_properties = nil) ⇒ AccountZdxConfig

Returns a new instance of AccountZdxConfig.



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/mist_api/models/account_zdx_config.rb', line 51

def initialize(key_id = nil, key_secret = nil, zdx_org_id = nil,
               cloud_name = 'zdxcloud.net', additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @cloud_name = cloud_name unless cloud_name == SKIP
  @key_id = key_id
  @key_secret = key_secret
  @zdx_org_id = zdx_org_id
  @additional_properties = additional_properties
end

Instance Attribute Details

#cloud_nameString

ZDX cloud name. Refer help.zscaler.com/zdx/getting-started-zdx-api for ZDX cloud name

Returns:

  • (String)


15
16
17
# File 'lib/mist_api/models/account_zdx_config.rb', line 15

def cloud_name
  @cloud_name
end

#key_idString

Customer account API key ID

Returns:

  • (String)


19
20
21
# File 'lib/mist_api/models/account_zdx_config.rb', line 19

def key_id
  @key_id
end

#key_secretString

Customer account API key Secret

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/account_zdx_config.rb', line 23

def key_secret
  @key_secret
end

#zdx_org_idString

ZDX organization id

Returns:

  • (String)


27
28
29
# File 'lib/mist_api/models/account_zdx_config.rb', line 27

def zdx_org_id
  @zdx_org_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/mist_api/models/account_zdx_config.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  key_id = hash.key?('key_id') ? hash['key_id'] : nil
  key_secret = hash.key?('key_secret') ? hash['key_secret'] : nil
  zdx_org_id = hash.key?('zdx_org_id') ? hash['zdx_org_id'] : nil
  cloud_name = hash['cloud_name'] ||= 'zdxcloud.net'

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  AccountZdxConfig.new(key_id,
                       key_secret,
                       zdx_org_id,
                       cloud_name,
                       additional_properties)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/mist_api/models/account_zdx_config.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cloud_name'] = 'cloud_name'
  @_hash['key_id'] = 'key_id'
  @_hash['key_secret'] = 'key_secret'
  @_hash['zdx_org_id'] = 'zdx_org_id'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/mist_api/models/account_zdx_config.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
# File 'lib/mist_api/models/account_zdx_config.rb', line 40

def self.optionals
  %w[
    cloud_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



96
97
98
99
100
101
# File 'lib/mist_api/models/account_zdx_config.rb', line 96

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} cloud_name: #{@cloud_name.inspect}, key_id: #{@key_id.inspect}, key_secret:"\
  " #{@key_secret.inspect}, zdx_org_id: #{@zdx_org_id.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



89
90
91
92
93
# File 'lib/mist_api/models/account_zdx_config.rb', line 89

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cloud_name: #{@cloud_name}, key_id: #{@key_id}, key_secret: #{@key_secret},"\
  " zdx_org_id: #{@zdx_org_id}, additional_properties: #{@additional_properties}>"
end