def create(api: nil)
      api ||= @api
      raise JSS::UnsupportedError, "Creating or editing #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows." unless creatable?
      raise AlreadyExistsError, "This #{self.class::RSRC_OBJECT_KEY} already exists. Use #update to make changes." if @in_jss
      api.post_rsrc(rest_rsrc, rest_xml) =~ %r{><id>(\d+)</id><}
      @id = Regexp.last_match(1).to_i
      @in_jss = true
      @need_to_update = false
      @rest_rsrc = "#{self.class::RSRC_BASE}/id/#{@id}"
      @id
    end
def create(api: nil)
      api ||= @api
      raise JSS::UnsupportedError, "Creating or editing #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows." unless creatable?
      raise AlreadyExistsError, "This #{self.class::RSRC_OBJECT_KEY} already exists. Use #update to make changes." if @in_jss
      api.post_rsrc(rest_rsrc, rest_xml) =~ %r{><id>(\d+)</id><}
      @id = Regexp.last_match(1).to_i
      @in_jss = true
      @need_to_update = false
      @rest_rsrc = "#{self.class::RSRC_BASE}/id/#{@id}"
      @id
    end
Variables

  Mixed-in Instance Methods

 Create a new object in the JSS.

 @param api[JSS::APIConnection] the API in which to create the object
   Defaults to the API used to instantiate this object

 @return [Integer] the jss ID of the newly created object