Class: Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyEventsQueryResults
- Inherits:
-
Object
- Object
- Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyEventsQueryResults
- Includes:
- MsRest::JSONable, MsRestAzure
- Defined in:
- lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb
Overview
Query results.
Instance Attribute Summary collapse
-
#next_method ⇒ Object
return [Proc] with next page method call.
-
#odatacontext ⇒ String
type information based on metadata.
-
#odatacount ⇒ Integer
event records returned.
-
#odatanext_link ⇒ String
Odata next link; URL to get the next set of results.
-
#value ⇒ Array<PolicyEvent>
Query results.
Class Method Summary collapse
-
.mapper ⇒ Object
Mapper for PolicyEventsQueryResults class as Ruby Hash.
Instance Method Summary collapse
-
#get_all_items ⇒ Array<PolicyEvent>
Gets the rest of the items for the request, enabling auto-pagination.
-
#get_next_page ⇒ PolicyEventsQueryResults
Gets the next page of results.
Instance Attribute Details
#next_method ⇒ Object
return [Proc] with next page method call.
31 32 33 |
# File 'lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb', line 31 def next_method @next_method end |
#odatacontext ⇒ String
type information based on metadata.
18 19 20 |
# File 'lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb', line 18 def odatacontext @odatacontext end |
#odatacount ⇒ Integer
event records returned.
22 23 24 |
# File 'lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb', line 22 def odatacount @odatacount end |
#odatanext_link ⇒ String
Returns Odata next link; URL to get the next set of results.
25 26 27 |
# File 'lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb', line 25 def odatanext_link @odatanext_link end |
#value ⇒ Array<PolicyEvent>
Returns Query results.
28 29 30 |
# File 'lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb', line 28 def value @value end |
Class Method Details
.mapper ⇒ Object
Mapper for PolicyEventsQueryResults class as Ruby Hash. This will be used for serialization/deserialization.
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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb', line 66 def self.mapper() { client_side_validation: true, required: false, serialized_name: 'PolicyEventsQueryResults', type: { name: 'Composite', class_name: 'PolicyEventsQueryResults', model_properties: { odatacontext: { client_side_validation: true, required: false, serialized_name: '@odata\\.context', type: { name: 'String' } }, odatacount: { client_side_validation: true, required: false, serialized_name: '@odata\\.count', constraints: { InclusiveMinimum: 0 }, type: { name: 'Number' } }, odatanext_link: { client_side_validation: true, required: false, serialized_name: '@odata\\.nextLink', type: { name: 'String' } }, value: { client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'PolicyEventElementType', type: { name: 'Composite', class_name: 'PolicyEvent' } } } } } } } end |
Instance Method Details
#get_all_items ⇒ Array<PolicyEvent>
Gets the rest of the items for the request, enabling auto-pagination.
38 39 40 41 42 43 44 45 46 |
# File 'lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb', line 38 def get_all_items items = @value page = self while page.odatanext_link != nil && !page.odatanext_link.strip.empty? do page = page.get_next_page items.concat(page.value) end items end |
#get_next_page ⇒ PolicyEventsQueryResults
Gets the next page of results.
53 54 55 56 57 58 59 60 |
# File 'lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb', line 53 def get_next_page response = @next_method.call(@odatanext_link).value! unless @next_method.nil? unless response.nil? @odatanext_link = response.body.odatanext_link @value = response.body.value self end end |