Class: Azure::PolicyInsights::Profiles::Latest::Mgmt::PolicyInsightsManagementClass

Inherits:
Object
  • Object
show all
Defined in:
lib/profiles/latest/modules/policyinsights_profile_module.rb

Overview

PolicyInsightsManagementClass

Direct Known Subclasses

Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ PolicyInsightsManagementClass

Returns a new instance of PolicyInsightsManagementClass.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 65

def initialize(options = {})
  if options.is_a?(Hash) && options.length == 0
    @options = setup_default_options
  else
    @options = options
  end

  reset!(options)

  @configurable = self
  @base_url = options[:base_url].nil? ? nil:options[:base_url]
  @options = options[:options].nil? ? nil:options[:options]

  @client_0 = Azure::PolicyInsights::Mgmt::V2019_10_01::PolicyInsightsClient.new(configurable.credentials, base_url, options)
  if(@client_0.respond_to?(:subscription_id))
    @client_0.subscription_id = configurable.subscription_id
  end
  add_telemetry(@client_0)
  @policy_events = @client_0.policy_events
   = @client_0.

  @client_1 = Azure::PolicyInsights::Mgmt::V2019_07_01::PolicyInsightsClient.new(configurable.credentials, base_url, options)
  if(@client_1.respond_to?(:subscription_id))
    @client_1.subscription_id = configurable.subscription_id
  end
  add_telemetry(@client_1)

  @client_2 = Azure::PolicyInsights::Mgmt::V2018_07_01_preview::PolicyInsightsClient.new(configurable.credentials, base_url, options)
  if(@client_2.respond_to?(:subscription_id))
    @client_2.subscription_id = configurable.subscription_id
  end
  add_telemetry(@client_2)
  @policy_tracked_resources = @client_2.policy_tracked_resources
  @remediations = @client_2.remediations
  @policy_states = @client_2.policy_states
  @operations = @client_2.operations

  @model_classes = ModelClasses.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



110
111
112
113
114
115
116
117
118
119
120
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 110

def method_missing(method, *args)
  if @client_2.respond_to?method
    @client_2.send(method, *args)
  elsif @client_1.respond_to?method
    @client_1.send(method, *args)
  elsif @client_0.respond_to?method
    @client_0.send(method, *args)
  else
    super
  end
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



63
64
65
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 63

def base_url
  @base_url
end

#configurableObject (readonly)

Returns the value of attribute configurable.



63
64
65
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 63

def configurable
  @configurable
end

#model_classesObject (readonly)

Returns the value of attribute model_classes.



63
64
65
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 63

def model_classes
  @model_classes
end

#operationsObject (readonly)

Returns the value of attribute operations.



63
64
65
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 63

def operations
  @operations
end

#optionsObject (readonly)

Returns the value of attribute options.



63
64
65
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 63

def options
  @options
end

#policy_eventsObject (readonly)

Returns the value of attribute policy_events.



63
64
65
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 63

def policy_events
  @policy_events
end

#policy_metadata_operationsObject (readonly)

Returns the value of attribute policy_metadata_operations.



63
64
65
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 63

def 
  
end

#policy_statesObject (readonly)

Returns the value of attribute policy_states.



63
64
65
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 63

def policy_states
  @policy_states
end

#policy_tracked_resourcesObject (readonly)

Returns the value of attribute policy_tracked_resources.



63
64
65
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 63

def policy_tracked_resources
  @policy_tracked_resources
end

#remediationsObject (readonly)

Returns the value of attribute remediations.



63
64
65
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 63

def remediations
  @remediations
end

Instance Method Details

#add_telemetry(client) ⇒ Object



105
106
107
108
# File 'lib/profiles/latest/modules/policyinsights_profile_module.rb', line 105

def add_telemetry(client)
  profile_information = 'Profiles/Latest/PolicyInsights/Mgmt'
  client.add_user_agent_information(profile_information)
end