Module: RubyLokaliseApi::Rest::TeamUserBillingDetails

Included in:
RubyLokaliseApi::Rest
Defined in:
lib/ruby_lokalise_api/rest/team_user_billing_details.rb

Instance Method Summary collapse

Instance Method Details

#create_team_user_billing_details(team_id, req_params) ⇒ RubyLokaliseApi::Resources::TeamUserBillingDetails

Creates team user billing details

Parameters:

  • team_id (String, Integer)
  • req_params (Hash, Array)

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
# File 'lib/ruby_lokalise_api/rest/team_user_billing_details.rb', line 28

def create_team_user_billing_details(team_id, req_params)
  params = { query: team_id, req: req_params }

  response = endpoint(name: 'TeamUserBillingDetails', params: params).do_post

  # We must patch content because the API does not return team_id and it's mandatory to build resource URL
  response.patch_content_with 'team_id', team_id

  resource 'TeamUserBillingDetails', response
end

#team_user_billing_details(team_id) ⇒ RubyLokaliseApi::Resources::TeamUserBillingDetails

Returns billing details for a team user



11
12
13
14
15
16
17
18
19
20
# File 'lib/ruby_lokalise_api/rest/team_user_billing_details.rb', line 11

def team_user_billing_details(team_id)
  params = { query: team_id }

  response = endpoint(name: 'TeamUserBillingDetails', params: params).do_get

  # We must patch content because the API does not return team_id and it's mandatory to build resource URLs
  response.patch_content_with 'team_id', team_id

  resource 'TeamUserBillingDetails', response
end

#update_team_user_billing_details(team_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::TeamUserBillingDetails

Updates team user billing details

Parameters:

  • team_id (String, Integer)
  • req_params (Hash) (defaults to: {})

Returns:

See Also:



45
46
47
48
49
50
51
52
53
54
# File 'lib/ruby_lokalise_api/rest/team_user_billing_details.rb', line 45

def update_team_user_billing_details(team_id, req_params = {})
  params = { query: team_id, req: req_params }

  data = endpoint(name: 'TeamUserBillingDetails', params: params).do_put

  # We must patch content because the API does not return team_id and it's mandatory to build resource URL
  data.patch_content_with 'team_id', team_id

  resource 'TeamUserBillingDetails', data
end