Class: Lipdub::Resources::Projects

Inherits:
Base
  • Object
show all
Defined in:
lib/lipdub/resources/projects.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Lipdub::Resources::Base

Instance Method Details

#list(page: 1, per_page: 20) ⇒ Hash

List all projects

Examples:

projects = client.projects.list(page: 1, per_page: 50)
# => {
#   "data" => [
#     {
#       "project_id" => 123,
#       "projects_tenant_id" => 1,
#       "projects_user_id" => 47,
#       "project_name" => "My Sample Project",
#       "user_email" => "[email protected]",
#       "created_at" => "2024-01-15T10:30:00Z",
#       "updated_at" => nil,
#       "source_language" => {
#         "language_id" => 1,
#         "name" => "English",
#         "supported" => true
#       },
#       "project_identity_type" => "single_identity",
#       "language_project_links" => []
#     }
#   ],
#   "count" => 1
# }


35
36
37
38
39
40
41
42
43
# File 'lib/lipdub/resources/projects.rb', line 35

def list(page: 1, per_page: 20)
  validate_pagination_params!(page, per_page)
  
  params = {
    page: page,
    per_page: per_page
  }
  get("/v1/projects", params)
end