harvest-ruby-v2 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Harvest
4
+ module Resources
5
+ # @param id [Integer]
6
+ # Unique ID for the project assignment.
7
+ # @param is_active [Boolean]
8
+ # Whether the project assignment is active or archived.
9
+ # @param is_project_manager [Boolean]
10
+ # Determines if the user has Project Manager permissions for the project.
11
+ # @param use_default_rates [Boolean]
12
+ # Determines which billable rate(s) will be used on the project for this
13
+ # user when bill_by is People. When true, the project will use the user's
14
+ # default billable rates. When false, the project will use the custom rate
15
+ # defined on this user assignment.
16
+ # @param hourly_rate [decimal]
17
+ # Custom rate used when the project's bill_by is People and use_default_rates is false.
18
+ # @param budget [decimal]
19
+ # Budget used when the project's budget_by is person.
20
+ # @param created_at [DateTime]
21
+ # Date and time the project assignment was created.
22
+ # @param updated_at [DateTime]
23
+ # Date and time the project assignment was last updated.
24
+ # @param project [Struct]
25
+ # An object containing the assigned project id, name, and code.
26
+ # @param client [Struct]
27
+ # An object containing the project's client id and name.
28
+ # @param task_assignments [List]
29
+ # Array of task assignment objects associated with the project.
30
+ ProjectAssignment = Struct.new(
31
+ 'ProjectAssignment',
32
+ :id,
33
+ :is_project_manager,
34
+ :is_active,
35
+ :use_default_rates,
36
+ :budget,
37
+ :created_at,
38
+ :updated_at,
39
+ :hourly_rate,
40
+ :project,
41
+ :client,
42
+ :task_assignments,
43
+ keyword_init: true
44
+ )
45
+ end
46
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Harvest
4
+ module Resources
5
+ # @param id [Integer]
6
+ # Unique ID for the task.
7
+ # @param name [String]
8
+ # The name of the task.
9
+ # @param billable_by_default [Boolean]
10
+ # Used in determining whether default tasks should be marked billable when
11
+ # creating a new project.
12
+ # @param default_hourly_rate [decimal]
13
+ # The hourly rate to use for this task when it is added to a project.
14
+ # @param is_default [Boolean]
15
+ # Whether this task should be automatically added to future projects.
16
+ # @param is_active [Boolean]
17
+ # Whether this task is active or archived.
18
+ # @param created_at [DateTime]
19
+ # Date and time the task was created.
20
+ # @param updated_at [DateTime]
21
+ # Date and time the task was last updated.
22
+ Task = Struct.new(
23
+ 'Task',
24
+ :id,
25
+ :name,
26
+ :billable_by_default,
27
+ :default_hourly_rate,
28
+ :is_default,
29
+ :is_active,
30
+ :created_at,
31
+ :updated_at,
32
+ keyword_init: true
33
+ )
34
+ end
35
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Harvest
4
+ module Resources
5
+ # @param id [Integer]
6
+ # Unique ID for the task assignment.
7
+ # @param project [Struct]
8
+ # An object containing the id, name, and code of the associated project.
9
+ # @param task [Struct]
10
+ # An object containing the id and name of the associated task.
11
+ # @param is_active [Boolean]
12
+ # Whether the task assignment is active or archived.
13
+ # @param billable [Boolean]
14
+ # Whether the task assignment is billable or not. For example: if set to
15
+ # true, all time tracked on this project for the associated task will be
16
+ # marked as billable.
17
+ # @param hourly_rate [decimal]
18
+ # Rate used when the project's bill_by is Tasks.
19
+ # @param budget [decimal]
20
+ # Budget used when the project's budget_by is task or task_fees.
21
+ # @param created_at [DateTime]
22
+ # Date and time the task assignment was created.
23
+ # @param updated_at [DateTime]
24
+ # Date and time the task assignment was last updated.
25
+ TaskAssignment = Struct.new(
26
+ 'TaskAssignment',
27
+ :id,
28
+ :billable,
29
+ :is_active,
30
+ :created_at,
31
+ :updated_at,
32
+ :hourly_rate,
33
+ :budget,
34
+ :task,
35
+ keyword_init: true
36
+ )
37
+ end
38
+ end
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Harvest
4
+ module Resources
5
+ # @param id [Integer]
6
+ # Unique ID for the time entry.
7
+ # @param spent_date [Date]
8
+ # Date of the time entry.
9
+ # @param user [Struct]
10
+ # An object containing the id and name of the associated user.
11
+ # @param user_assignment [Struct]
12
+ # A user assignment object of the associated user.
13
+ # @param client [Struct]
14
+ # An object containing the id and name of the associated client.
15
+ # @param project [Struct]
16
+ # An object containing the id and name of the associated project.
17
+ # @param task [Struct]
18
+ # An object containing the id and name of the associated task.
19
+ # @param task_assignment [Struct]
20
+ # A task assignment object of the associated task.
21
+ # @param external_reference [Struct]
22
+ # An object containing the id, group_id, permalink, service, and
23
+ # service_icon_url of the associated external reference.
24
+ # @param invoice [Struct]
25
+ # Once the time entry has been invoiced, this field will include the
26
+ # associated invoice's id and number.
27
+ # @param hours [decimal]
28
+ # Number of (decimal time) hours tracked in this time entry.
29
+ # @param rounded_hours [decimal]
30
+ # Number of (decimal time) hours tracked in this time entry used in summary
31
+ # reports and invoices. This value is rounded according to the Time Rounding
32
+ # setting in your Preferences.
33
+ # @param notes [String]
34
+ # Notes attached to the time entry.
35
+ # @param is_locked [Boolean]
36
+ # Whether or not the time entry has been locked.
37
+ # @param locked_reason [String]
38
+ # Why the time entry has been locked.
39
+ # @param is_closed [Boolean]
40
+ # Whether or not the time entry has been approved via Timesheet Approval.
41
+ # @param is_billed [Boolean]
42
+ # Whether or not the time entry has been marked as invoiced.
43
+ # @param timer_started_at [DateTime]
44
+ # Date and time the timer was started (if tracking by duration). Use the ISO 8601 Format.
45
+ # @param started_time [Time]
46
+ # Time the time entry was started (if tracking by start/end times).
47
+ # @param ended_time [Time]
48
+ # Time the time entry was ended (if tracking by start/end times).
49
+ # @param is_running [Boolean]
50
+ # Whether or not the time entry is currently running.
51
+ # @param billable [Boolean]
52
+ # Whether or not the time entry is billable.
53
+ # @param budgeted [Boolean]
54
+ # Whether or not the time entry counts towards the project budget.
55
+ # @param billable_rate [decimal]
56
+ # The billable rate for the time entry.
57
+ # @param cost_rate [decimal]
58
+ # The cost rate for the time entry.
59
+ # @param created_at [DateTime]
60
+ # Date and time the time entry was created. Use the ISO 8601 Format.
61
+ # @param updated_at [DateTime]
62
+ # Date and time the time entry was last updated. Use the ISO 8601 Format.
63
+ TimeEntry = Struct.new(
64
+ 'TimeEntry',
65
+ :id,
66
+ :spent_date,
67
+ :user,
68
+ :user_assignment,
69
+ :client,
70
+ :project,
71
+ :task,
72
+ :task_assignment,
73
+ :external_reference,
74
+ :invoice,
75
+ :hours,
76
+ :rounded_hours,
77
+ :notes,
78
+ :is_locked,
79
+ :locked_reason,
80
+ :is_closed,
81
+ :is_billed,
82
+ :timer_started_at,
83
+ :started_time,
84
+ :ended_time,
85
+ :is_running,
86
+ :billable,
87
+ :budgeted,
88
+ :billable_rate,
89
+ :cost_rate,
90
+ :created_at,
91
+ :updated_at,
92
+ keyword_init: true
93
+ )
94
+
95
+ TimeEntryExternalReference = Struct.new(
96
+ 'TimeEntryExternalReference',
97
+ :id,
98
+ :group_id,
99
+ :permalink,
100
+ :service,
101
+ :service_icon_url,
102
+ keyword_init: true
103
+ )
104
+ end
105
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Harvest
4
+ module Resources
5
+ # @param id [Integer]
6
+ # Unique ID for the user.
7
+ # @param first_name [String]
8
+ # The first name of the user.
9
+ # @param last_name [String]
10
+ # The last name of the user.
11
+ # @param email [String]
12
+ # The email address of the user.
13
+ # @param timezone [String]
14
+ # The users timezone.
15
+ # @param has_access_to_all_future_projects [Boolean]
16
+ # Whether the user should be automatically added to future projects.
17
+ # @param is_contractor [Boolean]
18
+ # Whether the user is a contractor or an employee.
19
+ # @param is_admin [Boolean]
20
+ # Whether the user has Admin permissions.
21
+ # @param is_project_manager [Boolean]
22
+ # Whether the user has Project Manager permissions.
23
+ # @param can_see_rates [Boolean]
24
+ # Whether the user can see billable rates on projects. Only applicable to Project Managers.
25
+ # @param can_create_projects [Boolean]
26
+ # Whether the user can create projects. Only applicable to Project Managers.
27
+ # @param can_create_invoices [Boolean]
28
+ # Whether the user can create invoices. Only applicable to Project Managers.
29
+ # @param is_active [Boolean]
30
+ # Whether the user is active or archived.
31
+ # @param weekly_capacity [Integer]
32
+ # The number of hours per week this person is available to work in seconds,
33
+ # in half hour increments. For example, if a persons capacity is 35 hours,i
34
+ # the API will return 126000 seconds.
35
+ # @param default_hourly_rate [decimal]
36
+ # The billable rate to use for this user when they are added to a project.
37
+ # @param cost_rate [decimal]
38
+ # The cost rate to use for this user when calculating a projects costs vs billable amount.
39
+ # @param roles [List]
40
+ # of Strings The role names assigned to this person.
41
+ # @param avatar_url [String]
42
+ # The URL to the users avatar image.
43
+ # @param created_at [DateTime]
44
+ # Date and time the user was created.
45
+ # @param updated_at [DateTime]
46
+ # Date and time the user was last updated.
47
+ # @param name [String] combined first name and last name, only used in TimeEntry
48
+ User = Struct.new(
49
+ 'User',
50
+ :id,
51
+ :first_name,
52
+ :last_name,
53
+ :email,
54
+ :telephone,
55
+ :timezone,
56
+ :weekly_capacity,
57
+ :has_access_to_all_future_projects,
58
+ :is_contractor,
59
+ :is_admin,
60
+ :is_project_manager,
61
+ :can_see_rates,
62
+ :can_create_projects,
63
+ :can_create_invoices,
64
+ :is_active,
65
+ :calendar_integration_enabled,
66
+ :calendar_integration_source,
67
+ :created_at,
68
+ :updated_at,
69
+ :roles,
70
+ :avatar_url,
71
+ :name,
72
+ keyword_init: true
73
+ )
74
+ end
75
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Harvest
4
+ module Resources
5
+ # @param id [Integer]
6
+ # Unique ID for the user assignment.
7
+ # @param project [Struct]
8
+ # An object containing the id, name, and code of the associated project.
9
+ # @param user [Struct]
10
+ # An object containing the id and name of the associated user.
11
+ # @param is_active [Boolean]
12
+ # Whether the user assignment is active or archived.
13
+ # @param is_project_manager [Boolean]
14
+ # Determines if the user has Project Manager permissions for the project.
15
+ # @param use_default_rates [Boolean]
16
+ # Determines which billable rates will be used on the project for this user
17
+ # when bill_by is People. When true, the project will use the users
18
+ # default billable rates. When false, the project will use the custom rate
19
+ # defined on this user assignment.
20
+ # @param hourly_rate [decimal]
21
+ # Custom rate used when the projects bill_by is People and use_default_rates is false.
22
+ # @param budget [decimal]
23
+ # Budget used when the projects budget_by is person.
24
+ # @param created_at [DateTime]
25
+ # Date and time the user assignment was created.
26
+ # @param updated_at [DateTime]
27
+ # Date and time the user assignment was last updated.
28
+ UserAssignment = Struct.new(
29
+ 'UserAssignment',
30
+ :id,
31
+ :project,
32
+ :user,
33
+ :is_active,
34
+ :is_project_manager,
35
+ :use_default_rates,
36
+ :hourly_rate,
37
+ :budget,
38
+ :created_at,
39
+ :updated_at,
40
+ keyword_init: true
41
+ )
42
+ end
43
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Harvest
4
+ VERSION = '0.2.0'
5
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: harvest-ruby-v2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Craig Davis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Harvest API for v2 written in Fluent API style
14
+ email:
15
+ - craig.davis@rackspace.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".gitignore"
21
+ - ".rspec"
22
+ - ".rubocop.yml"
23
+ - ".travis.yml"
24
+ - CHANGELOG.rst
25
+ - CODE_OF_CONDUCT.md
26
+ - EXAMPLE.conf
27
+ - Gemfile
28
+ - LICENSE.txt
29
+ - Makefile
30
+ - README.md
31
+ - Rakefile
32
+ - bin/console
33
+ - bin/setup
34
+ - harvest-ruby-v2.gemspec
35
+ - lib/harvest.rb
36
+ - lib/harvest/client.rb
37
+ - lib/harvest/config.rb
38
+ - lib/harvest/creates.rb
39
+ - lib/harvest/discovers.rb
40
+ - lib/harvest/exceptions.rb
41
+ - lib/harvest/finders.rb
42
+ - lib/harvest/http/client.rb
43
+ - lib/harvest/httpclient.rb
44
+ - lib/harvest/resourcefactory.rb
45
+ - lib/harvest/resources.rb
46
+ - lib/harvest/resources/client.rb
47
+ - lib/harvest/resources/company.rb
48
+ - lib/harvest/resources/estimates.rb
49
+ - lib/harvest/resources/expenses.rb
50
+ - lib/harvest/resources/invoices.rb
51
+ - lib/harvest/resources/message.rb
52
+ - lib/harvest/resources/project.rb
53
+ - lib/harvest/resources/project_assignment.rb
54
+ - lib/harvest/resources/task.rb
55
+ - lib/harvest/resources/task_assignment.rb
56
+ - lib/harvest/resources/timeentry.rb
57
+ - lib/harvest/resources/user.rb
58
+ - lib/harvest/resources/user_assignment.rb
59
+ - lib/harvest/version.rb
60
+ homepage: https://github.com/blade2005/harvest-ruby/wiki
61
+ licenses:
62
+ - MIT
63
+ metadata:
64
+ homepage_uri: https://github.com/blade2005/harvest-ruby/wiki
65
+ source_code_uri: https://github.com/blade2005/harvest-ruby
66
+ changelog_uri: https://github.com/blade2005/harvest-ruby/blob/master/CHANGELOG.rst
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 2.3.0
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubygems_version: 3.1.2
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Fluent API Harvest Client API v2
86
+ test_files: []