class Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyEventsQueryResults

Query results.

Attributes

next_method[RW]

return [Proc] with next page method call.

odatacontext[RW]

@return [String] OData context string; used by OData clients to resolve type information based on metadata.

odatacount[RW]

@return [Integer] OData entity count; represents the number of policy event records returned.

value[RW]

@return [Array<PolicyEvent>] Query results.

Private Class Methods

mapper() click to toggle source

Mapper for PolicyEventsQueryResults class as Ruby Hash. This will be used for serialization/deserialization.

# 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

Private Instance Methods

get_all_items() click to toggle source

Gets the rest of the items for the request, enabling auto-pagination.

@return [Array<PolicyEvent>] operation results.

# 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() click to toggle source

Gets the next page of results.

@return [PolicyEventsQueryResults] with next page content.

# 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