Class: Odesk::Api::Routers::Snapshot

Inherits:
Object
  • Object
show all
Defined in:
lib/odesk/api/routers/snapshot.rb

Overview

Snapshot

Constant Summary collapse

ENTRY_POINT =
'api'

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Snapshot

Init

Arguments:

client: (Client)


25
26
27
28
# File 'lib/odesk/api/routers/snapshot.rb', line 25

def initialize(client)
  @client = client
  @client.epoint = ENTRY_POINT 
end

Instance Method Details

#delete(company, username, ts) ⇒ Object

Delete snapshot Arguments:

company: (String)
username: (String)
ts: (String)


58
59
60
61
# File 'lib/odesk/api/routers/snapshot.rb', line 58

def delete(company, username, ts)
  $LOG.i "running " + __method__.to_s
  @client.delete '/team/v1/snapshots/' + company + '/' + username + '/' + ts
end

#delete_by_contract(contract, username, ts) ⇒ Object

Delete snapshot by specific contract Arguments:

contract: (String)
ts: (String)


88
89
90
91
# File 'lib/odesk/api/routers/snapshot.rb', line 88

def delete_by_contract(contract, username, ts)
  $LOG.i "running " + __method__.to_s
  @client.delete '/team/v2/snapshots/contracts/' + contract + '/' + ts
end

#get(company, username, ts) ⇒ Object

Get snapshot info

Arguments:

company: (String)
username: (String)
ts: (String)


36
37
38
39
# File 'lib/odesk/api/routers/snapshot.rb', line 36

def get(company, username, ts)
  $LOG.i "running " + __method__.to_s
  @client.get '/team/v1/snapshots/' + company + '/' + username + '/' + ts
end

#get_by_contract(contract, ts) ⇒ Object

Get snapshot info by specific contract

Arguments:

contract: (String)
ts: (String)


68
69
70
71
# File 'lib/odesk/api/routers/snapshot.rb', line 68

def get_by_contract(contract, ts)
  $LOG.i "running " + __method__.to_s
  @client.get '/team/v2/snapshots/contracts/' + contract + '/' + ts
end

#update(company, username, ts, params) ⇒ Object

Update snapshot

Arguments:

company: (String)
username: (String)
ts: (String)
params: (Hash)


48
49
50
51
# File 'lib/odesk/api/routers/snapshot.rb', line 48

def update(company, username, ts, params)
  $LOG.i "running " + __method__.to_s
  @client.put '/team/v1/snapshots/' + company + '/' + username + '/' + ts, params
end

#update_by_contract(contract, ts, params) ⇒ Object

Update snapshot by specific contract

Arguments:

contract: (String)
ts: (String)
params: (Hash)


79
80
81
82
# File 'lib/odesk/api/routers/snapshot.rb', line 79

def update_by_contract(contract, ts, params)
  $LOG.i "running " + __method__.to_s
  @client.put '/team/v2/snapshots/contracts/' + contract + '/' + ts, params
end