Module: PactasItero::Api::Contracts

Included in:
PactasItero::Api
Defined in:
lib/pactas_itero/api/contracts.rb

Instance Method Summary collapse

Instance Method Details

#contract(contract_id, options = {}) ⇒ Object



26
27
28
29
# File 'lib/pactas_itero/api/contracts.rb', line 26

def contract(contract_id, options = {})
  options = options.camelize_keys
  get "api/v1/contracts/#{contract_id}", options
end

#contract_cancellation_preview(contract_id, options = {}) ⇒ Object



31
32
33
34
# File 'lib/pactas_itero/api/contracts.rb', line 31

def contract_cancellation_preview(contract_id, options = {})
  options = options.camelize_keys
  get "api/v1/contracts/#{contract_id}/cancellationPreview", options
end

#contract_changes(contract_id, options = {}) ⇒ Object



11
12
13
14
# File 'lib/pactas_itero/api/contracts.rb', line 11

def contract_changes(contract_id, options = {})
  options = options.camelize_keys
  get "api/v1/contractChanges", options.merge(contractId: contract_id)
end

#contract_metered_usage(contract_id, options = {}) ⇒ Object



46
47
48
49
# File 'lib/pactas_itero/api/contracts.rb', line 46

def contract_metered_usage(contract_id, options = {})
  options = options.camelize_keys
  post "api/v1/contracts/#{contract_id}/usage", options
end

#contracts(options = {}) ⇒ Object



16
17
18
19
# File 'lib/pactas_itero/api/contracts.rb', line 16

def contracts(options = {})
  options = options.camelize_keys
  get "api/v1/contracts", options
end

#customer_contracts(customer_id, options = {}) ⇒ Object



6
7
8
9
# File 'lib/pactas_itero/api/contracts.rb', line 6

def customer_contracts(customer_id, options = {})
  options = options.camelize_keys
  get "api/v1/customers/#{customer_id}/contracts", options
end

#get_self_service_token_for_contract(contract_id, options = {}) ⇒ Object



36
37
38
39
# File 'lib/pactas_itero/api/contracts.rb', line 36

def get_self_service_token_for_contract(contract_id, options = {})
  options = options.camelize_keys
  get "api/v1/contracts/#{contract_id}/SelfServiceToken", options
end

#terminate_contract(contract_id, options = {}) ⇒ Object



41
42
43
44
# File 'lib/pactas_itero/api/contracts.rb', line 41

def terminate_contract(contract_id, options = {})
  options = options.camelize_keys
  post "api/v1/contracts/#{contract_id}/end", options
end

#update_contract(contract_id, options = {}) ⇒ Object



21
22
23
24
# File 'lib/pactas_itero/api/contracts.rb', line 21

def update_contract(contract_id, options = {})
  options = options.camelize_keys
  patch "api/v1/contracts/#{contract_id}", options
end