
# This file is automatically generated by puppet-swagger-generator and
# any manual changes are likely to be clobbered when the files
# are regenerated.

require_relative '../../../puppet_x/puppetlabs/kubernetes/provider'

Puppet::Type.type(:kubernetes_list_meta).provide(:swagger, :parent => PuppetX::Puppetlabs::Kubernetes::Provider) do

  mk_resource_methods

  def self.instance_to_hash(instance)
    {
    ensure: :present,
    name: instance.metadata.name,
    
      
        
        self_link: instance.selfLink.respond_to?(:to_hash) ? instance.selfLink.to_hash : instance.selfLink,
        
      
    
      
        
        resource_version: instance.resourceVersion.respond_to?(:to_hash) ? instance.resourceVersion.to_hash : instance.resourceVersion,
        
      
    
      
        
        continue: instance.continue.respond_to?(:to_hash) ? instance.continue.to_hash : instance.continue,
        
      
    
    object: instance,
    }
  end

  def create
    Puppet.info("Creating kubernetes_list_meta #{name}")
    create_instance_of('list_meta', name, build_params)
  end

  def flush
   unless @property_hash.empty?
     unless resource[:ensure] == :absent
        flush_instance_of('list_meta', name, @property_hash[:object], build_params)
      end
    end
  end

  def destroy
    Puppet.info("Deleting kubernetes_list_meta #{name}")
    destroy_instance_of('list_meta', name)
    @property_hash[:ensure] = :absent
  end

  private
  def self.list_instances
    list_instances_of('list_meta')
  end

  def build_params
    params = {
    
      
        selfLink: resource[:self_link],
      
    
      
        resourceVersion: resource[:resource_version],
      
    
      
        continue: resource[:continue],
      
    
    }
    params.delete_if { |key, value| value.nil? }
    params
  end
end
