Module: Jamf::VPPable

Included in:
MacApplication, MobileDeviceApplication
Defined in:
lib/jamf/api/classic/api_objects/vppable.rb

Overview

A mix-in module to handleVPP-related data in API objects that can be assigned via VPP.

NOTE: For now we are only working with device-based VPP assignments, which are done via the scope of the VPPable object (macapp, mobdevapp, ebook)

User-based APP assignments will require the creation of a VPPAssignment class, and a VPPAssignmentScope class, since those scopes are very limited compared to ordinary scope.

To use this module, merely ‘include VPPable` when defining your subclass of Jamf::APIObject

classes doing so MUST call #add_vpp_xml(xmldoc) in their #rest_xml method

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

VPPABLE =

Mixed-in Constants

true

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#assign_vpp_device_based_licensesBoolean Also known as: vpp_device_based?

Returns:

  • (Boolean)


105
106
107
# File 'lib/jamf/api/classic/api_objects/vppable.rb', line 105

def assign_vpp_device_based_licenses
  @assign_vpp_device_based_licenses
end

#remaining_vpp_licensesInteger (readonly) Also known as: vpp_licenses_remaining

Returns:

  • (Integer)


113
114
115
# File 'lib/jamf/api/classic/api_objects/vppable.rb', line 113

def remaining_vpp_licenses
  @remaining_vpp_licenses
end

#total_vpp_licensesInteger (readonly) Also known as: vpp_licenses_total

Returns:

  • (Integer)


109
110
111
# File 'lib/jamf/api/classic/api_objects/vppable.rb', line 109

def total_vpp_licenses
  @total_vpp_licenses
end

#used_vpp_licensesInteger (readonly) Also known as: vpp_licenses_used

Returns:

  • (Integer)


117
118
119
# File 'lib/jamf/api/classic/api_objects/vppable.rb', line 117

def used_vpp_licenses
  @used_vpp_licenses
end

#vpp_admin_account_idInteger (readonly) Also known as: vpp_account_id

Returns:

  • (Integer)


101
102
103
# File 'lib/jamf/api/classic/api_objects/vppable.rb', line 101

def 
  @vpp_admin_account_id
end

#vpp_codesHash (readonly)

Returns:



98
99
100
# File 'lib/jamf/api/classic/api_objects/vppable.rb', line 98

def vpp_codes
  @vpp_codes
end

Class Method Details

.included(klass) ⇒ Object

Mixed-in Class Methods

This is a common technique to get class methods mixed in when you ‘include’ a module full of instance methods



56
57
58
# File 'lib/jamf/api/classic/api_objects/vppable.rb', line 56

def self.included(klass)
  klass.extend(ClassMethods)
end

Instance Method Details

#vpp_admin_account_nameString Also known as: vpp_account_name

Returns The name of the vpp admin acct for this object.

Returns:

  • (String)

    The name of the vpp admin acct for this object



233
234
235
236
237
# File 'lib/jamf/api/classic/api_objects/vppable.rb', line 233

def 
  return unless @vpp_admin_account_id.is_a? Integer

  Jamf::VPPAccount.map_all_ids_to(:name)[@vpp_admin_account_id]
end