Class: Upwork::Api::Routers::Snapshot

Inherits:
Object
  • Object
show all
Defined in:
lib/upwork/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/upwork/api/routers/snapshot.rb', line 25

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

Instance Method Details

#delete_by_contract(contract, ts) ⇒ Object

Delete snapshot by specific contract Arguments:

contract: (String)
ts: (String)


55
56
57
58
# File 'lib/upwork/api/routers/snapshot.rb', line 55

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

#get_by_contract(contract, ts) ⇒ Object

Get snapshot info by specific contract

Arguments:

contract: (String)
ts: (String)


35
36
37
38
# File 'lib/upwork/api/routers/snapshot.rb', line 35

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

#update_by_contract(contract, ts, params) ⇒ Object

Update snapshot by specific contract

Arguments:

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


46
47
48
49
# File 'lib/upwork/api/routers/snapshot.rb', line 46

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