Class: OxfordFaceApi::PersonGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/oxford/face/api.rb

Instance Method Summary collapse

Constructor Details

#initializePersonGroup

Returns a new instance of PersonGroup.



222
223
224
225
# File 'lib/oxford/face/api.rb', line 222

def initialize
  raise if OxfordFaceApi.API_KEY.empty?
  @client = HttpClient.new(OxfordFaceApi.API_KEY)
end

Instance Method Details

#all(start = 1, top = 1000) ⇒ Object



258
259
260
# File 'lib/oxford/face/api.rb', line 258

def all(start = 1, top = 1000)
  @client.get("/persongroups?start=#{start}&top=#{top}")
end

#create(group_id, name, user_data = "") ⇒ Object

Create a Person Group PUT api.projectoxford.ai/face/v1.0/persongroups/personGroupId



229
230
231
232
233
234
235
# File 'lib/oxford/face/api.rb', line 229

def create(group_id, name, user_data = "")
  params = {
  name: name,
  userData: user_data
  }
  @client.put("/persongroups/#{group_id}", params)
end

#delete(group_id) ⇒ Object

FIXME Delete a Person Group DELETE api.projectoxford.ai/face/v1.0/persongroups/personGroupId



240
241
242
# File 'lib/oxford/face/api.rb', line 240

def delete(group_id)
  @client.delete("/persongroups/#{group_id}")
end

#get(group_id) ⇒ Object

Get a Person Group GET api.projectoxford.ai/face/v1.0/persongroups/personGroupId



246
247
248
# File 'lib/oxford/face/api.rb', line 246

def get(group_id)
  @client.get("/persongroups/#{group_id}")
end

#status(group_id) ⇒ Object

Get Person Group Training Status GET api.projectoxford.ai/face/v1.0/persongroups/personGroupId/training



252
253
254
# File 'lib/oxford/face/api.rb', line 252

def status(group_id)
  @client.get("/persongroups/#{group_id}/training")
end

#train(group_id) ⇒ Object

Train Person Group POST api.projectoxford.ai/face/v1.0/persongroups/personGroupId/train



264
265
266
# File 'lib/oxford/face/api.rb', line 264

def train(group_id)
  @client.post("/persongroups/#{group_id}/train")
end

#update(group_id, name, user_data) ⇒ Object

Update a Person Group PATCH api.projectoxford.ai/face/v1.0/persongroups/personGroupId



270
271
272
273
274
275
276
# File 'lib/oxford/face/api.rb', line 270

def update(group_id, name, user_data)
  params = {
  name: name,
  userData: user_data
  }
  @client.patch("/persongroups/#{group_id}", params)
end