class Seatsio::SubaccountsClient

def activate(id:)

def activate(id:)
  @http_client.post("/subaccounts/#{id}/actions/activate")
end

def active

def active
  cursor status: 'active'
end

def copy_chart_to_parent(id: nil, chart_key: nil)

def copy_chart_to_parent(id: nil, chart_key: nil)
  response = @http_client.post("/subaccounts/#{id}/charts/#{chart_key}/actions/copy-to/parent")
  Chart.new(response)
end

def copy_chart_to_subaccount(from_id: nil, to_id: nil, chart_key: nil)

def copy_chart_to_subaccount(from_id: nil, to_id: nil, chart_key: nil)
  response = @http_client.post("/subaccounts/#{from_id}/charts/#{chart_key}/actions/copy-to/#{to_id}")
  Chart.new(response)
end

def create(name: nil)

def create(name: nil)
  body = {}
  body['name'] = name if name
  response = @http_client.post("subaccounts", body)
  Subaccount.new(response)
end

def cursor(status: nil)

def cursor(status: nil)
  endpoint = status ? "subaccounts/#{status}" : 'subaccounts'
  Pagination::Cursor.new(Subaccount, endpoint, @http_client)
end

def deactivate(id:)

def deactivate(id:)
  @http_client.post("/subaccounts/#{id}/actions/deactivate")
end

def inactive

def inactive
  cursor status: 'inactive'
end

def initialize(http_client)

def initialize(http_client)
  @http_client = http_client
end

def list(filter: nil)

def list(filter: nil)
  extended_cursor = cursor
  extended_cursor.set_query_param('filter', filter)
  extended_cursor
end

def regenerate_designer_key(id:)

def regenerate_designer_key(id:)
  @http_client.post("/subaccounts/#{id}/designer-key/actions/regenerate")
end

def regenerate_secret_key(id:)

def regenerate_secret_key(id:)
  @http_client.post("/subaccounts/#{id}/secret-key/actions/regenerate")
end

def retrieve(id:)

def retrieve(id:)
  response = @http_client.get("/subaccounts/#{id}")
  Subaccount.new(response)
end

def update(id:, name: nil)

def update(id:, name: nil)
  body = {}
  body['name'] = name if name
  @http_client.post("subaccounts/#{id}", body)
end