Class: MistApi::IdpProfile

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

Overview

IdpProfile Model.

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(base_profile = SKIP, created_time = SKIP, id = SKIP, modified_time = SKIP, name = SKIP, org_id = SKIP, overwrites = SKIP, additional_properties = nil) ⇒ IdpProfile

Returns a new instance of IdpProfile.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/mist_api/models/idp_profile.rb', line 71

def initialize(base_profile = SKIP, created_time = SKIP, id = SKIP,
               modified_time = SKIP, name = SKIP, org_id = SKIP,
               overwrites = SKIP, additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @base_profile = base_profile unless base_profile == SKIP
  @created_time = created_time unless created_time == SKIP
  @id = id unless id == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @name = name unless name == SKIP
  @org_id = org_id unless org_id == SKIP
  @overwrites = overwrites unless overwrites == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#base_profileIdpProfileBaseProfileEnum

enum: ‘critical`, `standard`, `strict`



14
15
16
# File 'lib/mist_api/models/idp_profile.rb', line 14

def base_profile
  @base_profile
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


18
19
20
# File 'lib/mist_api/models/idp_profile.rb', line 18

def created_time
  @created_time
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


22
23
24
# File 'lib/mist_api/models/idp_profile.rb', line 22

def id
  @id
end

#modified_timeFloat

When the object has been modified for the last time, in epoch

Returns:

  • (Float)


26
27
28
# File 'lib/mist_api/models/idp_profile.rb', line 26

def modified_time
  @modified_time
end

#nameString

When the object has been modified for the last time, in epoch

Returns:

  • (String)


30
31
32
# File 'lib/mist_api/models/idp_profile.rb', line 30

def name
  @name
end

#org_idUUID | String

When the object has been modified for the last time, in epoch

Returns:

  • (UUID | String)


34
35
36
# File 'lib/mist_api/models/idp_profile.rb', line 34

def org_id
  @org_id
end

#overwritesArray[IdpProfileOverwrite]

When the object has been modified for the last time, in epoch

Returns:



38
39
40
# File 'lib/mist_api/models/idp_profile.rb', line 38

def overwrites
  @overwrites
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



88
89
90
91
92
93
94
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
# File 'lib/mist_api/models/idp_profile.rb', line 88

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  base_profile = hash.key?('base_profile') ? hash['base_profile'] : SKIP
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  # Parameter is an array, so we need to iterate through it
  overwrites = nil
  unless hash['overwrites'].nil?
    overwrites = []
    hash['overwrites'].each do |structure|
      overwrites << (IdpProfileOverwrite.from_hash(structure) if structure)
    end
  end

  overwrites = SKIP unless hash.key?('overwrites')

  # 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.
  IdpProfile.new(base_profile,
                 created_time,
                 id,
                 modified_time,
                 name,
                 org_id,
                 overwrites,
                 additional_properties)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/mist_api/models/idp_profile.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['base_profile'] = 'base_profile'
  @_hash['created_time'] = 'created_time'
  @_hash['id'] = 'id'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['org_id'] = 'org_id'
  @_hash['overwrites'] = 'overwrites'
  @_hash
end

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/mist_api/models/idp_profile.rb', line 67

def self.nullables
  []
end

.optionalsObject

An array for optional fields



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/mist_api/models/idp_profile.rb', line 54

def self.optionals
  %w[
    base_profile
    created_time
    id
    modified_time
    name
    org_id
    overwrites
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



136
137
138
139
140
141
142
# File 'lib/mist_api/models/idp_profile.rb', line 136

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} base_profile: #{@base_profile.inspect}, created_time:"\
  " #{@created_time.inspect}, id: #{@id.inspect}, modified_time: #{@modified_time.inspect},"\
  " name: #{@name.inspect}, org_id: #{@org_id.inspect}, overwrites: #{@overwrites.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



128
129
130
131
132
133
# File 'lib/mist_api/models/idp_profile.rb', line 128

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} base_profile: #{@base_profile}, created_time: #{@created_time}, id: #{@id},"\
  " modified_time: #{@modified_time}, name: #{@name}, org_id: #{@org_id}, overwrites:"\
  " #{@overwrites}, additional_properties: #{@additional_properties}>"
end