lockstep_sdk 2022.4.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/lib/lockstep_sdk/clients/activities_client.rb +119 -0
  3. data/lib/lockstep_sdk/clients/api_keys_client.rb +78 -0
  4. data/lib/lockstep_sdk/clients/app_enrollments_client.rb +121 -0
  5. data/lib/lockstep_sdk/clients/applications_client.rb +100 -0
  6. data/lib/lockstep_sdk/clients/attachments_client.rb +121 -0
  7. data/lib/lockstep_sdk/clients/code_definitions_client.rb +60 -0
  8. data/lib/lockstep_sdk/clients/companies_client.rb +123 -0
  9. data/lib/lockstep_sdk/clients/contacts_client.rb +90 -0
  10. data/lib/lockstep_sdk/clients/credit_memo_applied_client.rb +92 -0
  11. data/lib/lockstep_sdk/clients/currencies_client.rb +55 -0
  12. data/lib/lockstep_sdk/clients/custom_field_definitions_client.rb +94 -0
  13. data/lib/lockstep_sdk/clients/custom_field_values_client.rb +97 -0
  14. data/lib/lockstep_sdk/clients/definitions_client.rb +95 -0
  15. data/lib/lockstep_sdk/clients/emails_client.rb +108 -0
  16. data/lib/lockstep_sdk/clients/invoice_history_client.rb +56 -0
  17. data/lib/lockstep_sdk/clients/invoices_client.rb +126 -0
  18. data/lib/lockstep_sdk/clients/leads_client.rb +40 -0
  19. data/lib/lockstep_sdk/clients/notes_client.rb +84 -0
  20. data/lib/lockstep_sdk/clients/payment_applications_client.rb +92 -0
  21. data/lib/lockstep_sdk/clients/payments_client.rb +138 -0
  22. data/lib/lockstep_sdk/clients/provisioning_client.rb +56 -0
  23. data/lib/lockstep_sdk/clients/reports_client.rb +114 -0
  24. data/lib/lockstep_sdk/clients/status_client.rb +53 -0
  25. data/lib/lockstep_sdk/clients/sync_client.rb +97 -0
  26. data/lib/lockstep_sdk/clients/user_accounts_client.rb +127 -0
  27. data/lib/lockstep_sdk/clients/user_roles_client.rb +54 -0
  28. data/lib/lockstep_sdk/lockstep_api.rb +264 -0
  29. data/lib/lockstep_sdk/models/activity_model.rb +221 -0
  30. data/lib/lockstep_sdk/models/activity_stream_item_model.rb +104 -0
  31. data/lib/lockstep_sdk/models/activity_xref_model.rb +72 -0
  32. data/lib/lockstep_sdk/models/aging_model.rb +62 -0
  33. data/lib/lockstep_sdk/models/api_key_model.rb +116 -0
  34. data/lib/lockstep_sdk/models/app_enrollment_custom_field_model.rb +110 -0
  35. data/lib/lockstep_sdk/models/app_enrollment_model.rb +151 -0
  36. data/lib/lockstep_sdk/models/application_model.rb +166 -0
  37. data/lib/lockstep_sdk/models/ar_aging_header_info_model.rb +86 -0
  38. data/lib/lockstep_sdk/models/ar_header_info_model.rb +170 -0
  39. data/lib/lockstep_sdk/models/at_risk_invoice_summary_model.rb +140 -0
  40. data/lib/lockstep_sdk/models/attachment_header_info_model.rb +74 -0
  41. data/lib/lockstep_sdk/models/attachment_model.rb +122 -0
  42. data/lib/lockstep_sdk/models/bulk_currency_conversion_model.rb +56 -0
  43. data/lib/lockstep_sdk/models/cashflow_report_model.rb +74 -0
  44. data/lib/lockstep_sdk/models/code_definition_model.rb +99 -0
  45. data/lib/lockstep_sdk/models/company_model.rb +336 -0
  46. data/lib/lockstep_sdk/models/connector_info_model.rb +69 -0
  47. data/lib/lockstep_sdk/models/contact_model.rb +227 -0
  48. data/lib/lockstep_sdk/models/country_model.rb +116 -0
  49. data/lib/lockstep_sdk/models/credit_memo_applied_model.rb +150 -0
  50. data/lib/lockstep_sdk/models/credit_memo_invoice_model.rb +116 -0
  51. data/lib/lockstep_sdk/models/currency_model.rb +74 -0
  52. data/lib/lockstep_sdk/models/currency_rate_model.rb +68 -0
  53. data/lib/lockstep_sdk/models/custom_field_definition_model.rb +121 -0
  54. data/lib/lockstep_sdk/models/custom_field_value_model.rb +115 -0
  55. data/lib/lockstep_sdk/models/customer_details_model.rb +164 -0
  56. data/lib/lockstep_sdk/models/customer_details_payment_model.rb +104 -0
  57. data/lib/lockstep_sdk/models/customer_summary_model.rb +134 -0
  58. data/lib/lockstep_sdk/models/daily_sales_outstanding_report_model.rb +62 -0
  59. data/lib/lockstep_sdk/models/developer_account_submit_model.rb +62 -0
  60. data/lib/lockstep_sdk/models/email_model.rb +245 -0
  61. data/lib/lockstep_sdk/models/erp_info_data_model.rb +63 -0
  62. data/lib/lockstep_sdk/models/erp_info_model.rb +56 -0
  63. data/lib/lockstep_sdk/models/erp_model.rb +62 -0
  64. data/lib/lockstep_sdk/models/invite_data_model.rb +56 -0
  65. data/lib/lockstep_sdk/models/invite_model.rb +68 -0
  66. data/lib/lockstep_sdk/models/invite_submit_model.rb +50 -0
  67. data/lib/lockstep_sdk/models/invoice_address_model.rb +140 -0
  68. data/lib/lockstep_sdk/models/invoice_history_model.rb +238 -0
  69. data/lib/lockstep_sdk/models/invoice_line_model.rb +194 -0
  70. data/lib/lockstep_sdk/models/invoice_model.rb +325 -0
  71. data/lib/lockstep_sdk/models/invoice_payment_detail_model.rb +104 -0
  72. data/lib/lockstep_sdk/models/invoice_summary_model.rb +134 -0
  73. data/lib/lockstep_sdk/models/lead_model.rb +74 -0
  74. data/lib/lockstep_sdk/models/note_model.rb +121 -0
  75. data/lib/lockstep_sdk/models/payment_applied_model.rb +131 -0
  76. data/lib/lockstep_sdk/models/payment_detail_header_model.rb +80 -0
  77. data/lib/lockstep_sdk/models/payment_detail_model.rb +176 -0
  78. data/lib/lockstep_sdk/models/payment_model.rb +206 -0
  79. data/lib/lockstep_sdk/models/payment_summary_model.rb +128 -0
  80. data/lib/lockstep_sdk/models/provisioning_finalize_request_model.rb +74 -0
  81. data/lib/lockstep_sdk/models/provisioning_model.rb +74 -0
  82. data/lib/lockstep_sdk/models/provisioning_response_model.rb +86 -0
  83. data/lib/lockstep_sdk/models/risk_rate_model.rb +98 -0
  84. data/lib/lockstep_sdk/models/state_model.rb +62 -0
  85. data/lib/lockstep_sdk/models/status_model.rb +128 -0
  86. data/lib/lockstep_sdk/models/sync_entity_result_model.rb +74 -0
  87. data/lib/lockstep_sdk/models/sync_request_model.rb +98 -0
  88. data/lib/lockstep_sdk/models/sync_submit_model.rb +50 -0
  89. data/lib/lockstep_sdk/models/transfer_owner_model.rb +56 -0
  90. data/lib/lockstep_sdk/models/transfer_owner_submit_model.rb +50 -0
  91. data/lib/lockstep_sdk/models/user_account_model.rb +240 -0
  92. data/lib/lockstep_sdk/models/user_role_model.rb +86 -0
  93. data/lib/lockstep_sdk/version.rb +3 -0
  94. metadata +150 -0
@@ -0,0 +1,264 @@
1
+ #
2
+ # Lockstep Software Development Kit for Ruby
3
+ #
4
+ # (c) 2021-2022 Lockstep, Inc.
5
+ #
6
+ # For the full copyright and license information, please view the LICENSE
7
+ # file that was distributed with this source code.
8
+ #
9
+ # @author Ted Spence <tspence@lockstep.io>
10
+ # @author Manish Narayan B S <manish.n@lockstep.io>
11
+ # @author Rishi Rajkumar Jawahar <rjawahar@lockstep.io>
12
+ # @copyright 2021-2022 Lockstep, Inc.
13
+ # @version 2022.4.32.0
14
+ # @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
15
+ #
16
+
17
+ require 'net/http'
18
+ require 'openssl'
19
+ require 'uri'
20
+ require 'socket'
21
+
22
+ project_root = File.dirname(File.absolute_path(__FILE__))
23
+ Dir.glob(project_root + '/clients/*') {|file| require file}
24
+
25
+ module LockstepSdk
26
+ class LockstepApi
27
+
28
+ ##
29
+ # @return [String] The version number of this Lockstep API client
30
+ attr_accessor :version
31
+
32
+ ##
33
+ # @return [String] The name or URL of the environment
34
+ attr_accessor :env
35
+
36
+ ##
37
+ # @return [ActivitiesClient] Client object for Activities endpoints
38
+ attr_accessor :activities
39
+
40
+ ##
41
+ # @return [ApiKeysClient] Client object for ApiKeys endpoints
42
+ attr_accessor :api_keys
43
+
44
+ ##
45
+ # @return [AppEnrollmentsClient] Client object for AppEnrollments endpoints
46
+ attr_accessor :app_enrollments
47
+
48
+ ##
49
+ # @return [ApplicationsClient] Client object for Applications endpoints
50
+ attr_accessor :applications
51
+
52
+ ##
53
+ # @return [AttachmentsClient] Client object for Attachments endpoints
54
+ attr_accessor :attachments
55
+
56
+ ##
57
+ # @return [CodeDefinitionsClient] Client object for CodeDefinitions endpoints
58
+ attr_accessor :code_definitions
59
+
60
+ ##
61
+ # @return [CompaniesClient] Client object for Companies endpoints
62
+ attr_accessor :companies
63
+
64
+ ##
65
+ # @return [ContactsClient] Client object for Contacts endpoints
66
+ attr_accessor :contacts
67
+
68
+ ##
69
+ # @return [CreditMemoAppliedClient] Client object for CreditMemoApplied endpoints
70
+ attr_accessor :credit_memo_applied
71
+
72
+ ##
73
+ # @return [CurrenciesClient] Client object for Currencies endpoints
74
+ attr_accessor :currencies
75
+
76
+ ##
77
+ # @return [CustomFieldDefinitionsClient] Client object for CustomFieldDefinitions endpoints
78
+ attr_accessor :custom_field_definitions
79
+
80
+ ##
81
+ # @return [CustomFieldValuesClient] Client object for CustomFieldValues endpoints
82
+ attr_accessor :custom_field_values
83
+
84
+ ##
85
+ # @return [DefinitionsClient] Client object for Definitions endpoints
86
+ attr_accessor :definitions
87
+
88
+ ##
89
+ # @return [EmailsClient] Client object for Emails endpoints
90
+ attr_accessor :emails
91
+
92
+ ##
93
+ # @return [InvoiceHistoryClient] Client object for InvoiceHistory endpoints
94
+ attr_accessor :invoice_history
95
+
96
+ ##
97
+ # @return [InvoicesClient] Client object for Invoices endpoints
98
+ attr_accessor :invoices
99
+
100
+ ##
101
+ # @return [LeadsClient] Client object for Leads endpoints
102
+ attr_accessor :leads
103
+
104
+ ##
105
+ # @return [NotesClient] Client object for Notes endpoints
106
+ attr_accessor :notes
107
+
108
+ ##
109
+ # @return [PaymentApplicationsClient] Client object for PaymentApplications endpoints
110
+ attr_accessor :payment_applications
111
+
112
+ ##
113
+ # @return [PaymentsClient] Client object for Payments endpoints
114
+ attr_accessor :payments
115
+
116
+ ##
117
+ # @return [ProvisioningClient] Client object for Provisioning endpoints
118
+ attr_accessor :provisioning
119
+
120
+ ##
121
+ # @return [ReportsClient] Client object for Reports endpoints
122
+ attr_accessor :reports
123
+
124
+ ##
125
+ # @return [StatusClient] Client object for Status endpoints
126
+ attr_accessor :status
127
+
128
+ ##
129
+ # @return [SyncClient] Client object for Sync endpoints
130
+ attr_accessor :sync
131
+
132
+ ##
133
+ # @return [UserAccountsClient] Client object for UserAccounts endpoints
134
+ attr_accessor :user_accounts
135
+
136
+ ##
137
+ # @return [UserRolesClient] Client object for UserRoles endpoints
138
+ attr_accessor :user_roles
139
+
140
+
141
+ ##
142
+ # Construct a new Lockstep API client targeting the specified server.
143
+ #
144
+ # @param env [string] Either "sbx", "prd", or the URI of the server, ending in a slash (/)
145
+ def initialize(env)
146
+ @version = "2022.4.32.0"
147
+ @env = case env
148
+ when "sbx"
149
+ "https://api.sbx.lockstep.io/"
150
+ when "prd"
151
+ "https://api.lockstep.io/"
152
+ else
153
+ env
154
+ end
155
+
156
+ # Construct all the clients
157
+ @activities = ActivitiesClient.new(self)
158
+ @api_keys = ApiKeysClient.new(self)
159
+ @app_enrollments = AppEnrollmentsClient.new(self)
160
+ @applications = ApplicationsClient.new(self)
161
+ @attachments = AttachmentsClient.new(self)
162
+ @code_definitions = CodeDefinitionsClient.new(self)
163
+ @companies = CompaniesClient.new(self)
164
+ @contacts = ContactsClient.new(self)
165
+ @credit_memo_applied = CreditMemoAppliedClient.new(self)
166
+ @currencies = CurrenciesClient.new(self)
167
+ @custom_field_definitions = CustomFieldDefinitionsClient.new(self)
168
+ @custom_field_values = CustomFieldValuesClient.new(self)
169
+ @definitions = DefinitionsClient.new(self)
170
+ @emails = EmailsClient.new(self)
171
+ @invoice_history = InvoiceHistoryClient.new(self)
172
+ @invoices = InvoicesClient.new(self)
173
+ @leads = LeadsClient.new(self)
174
+ @notes = NotesClient.new(self)
175
+ @payment_applications = PaymentApplicationsClient.new(self)
176
+ @payments = PaymentsClient.new(self)
177
+ @provisioning = ProvisioningClient.new(self)
178
+ @reports = ReportsClient.new(self)
179
+ @status = StatusClient.new(self)
180
+ @sync = SyncClient.new(self)
181
+ @user_accounts = UserAccountsClient.new(self)
182
+ @user_roles = UserRolesClient.new(self)
183
+ end
184
+
185
+ ##
186
+ # Configure this API client to use API key authentication
187
+ #
188
+ # @param api_key [string] The [Lockstep Platform API key](https://developer.lockstep.io/docs/api-keys) to use for authentication
189
+ def with_api_key(api_key)
190
+ @bearer_token = nil
191
+ @api_key = api_key
192
+ end
193
+
194
+ ##
195
+ # Configure this API client to use JWT Bearer Token authentication
196
+ #
197
+ # @param bearer_token [string] The [JWT Bearer Token](https://developer.lockstep.io/docs/jwt-bearer-tokens) to use for authentication
198
+ def with_bearer_token(bearer_token)
199
+ @api_key = nil
200
+ @bearer_token = bearer_token
201
+ end
202
+
203
+ ##
204
+ # Configure this API to use an application name
205
+ #
206
+ # @param app_name [string] The name of the application
207
+ def with_app_name(app_name)
208
+ @app_name = app_name
209
+ end
210
+
211
+ ##
212
+ # Send a request to the API and return the results
213
+ #
214
+ # Sends a request to the
215
+ def request(method, path, body, params)
216
+
217
+ url = URI(@env + path)
218
+ if !params.nil?
219
+ url.query = URI.encode_www_form(params)
220
+ end
221
+
222
+ http = Net::HTTP.new(url.host, url.port)
223
+ http.use_ssl = true
224
+
225
+ request = case method
226
+ when :get
227
+ Net::HTTP::Get.new(url)
228
+ when :post
229
+ Net::HTTP::Post.new(url)
230
+ when :patch
231
+ Net::HTTP::Patch.new(url)
232
+ when :put
233
+ Net::HTTP::Put.new(url)
234
+ when :delete
235
+ Net::HTTP::Delete.new(url)
236
+ end
237
+
238
+ # Set headers and body for request
239
+ request["Accept"] = 'application/json'
240
+ request["Content-Type"] = 'application/*+json'
241
+ request["SdkType"] = 'Ruby'
242
+ request["SdkVersion"] = '2022.4.32.0'
243
+ request["MachineName"] = Socket.gethostname
244
+ request.body = body
245
+
246
+ # If there is an application name
247
+ if @app_name != nil
248
+ request["ApplicationName"] = @app_name
249
+ end
250
+
251
+ # Which authentication are we using?
252
+ if @api_key != nil
253
+ request["Api-Key"] = @api_key
254
+ end
255
+ if @bearer_token != nil
256
+ request["Authorization"] = 'Bearer ' + @bearer_token
257
+ end
258
+
259
+ # Send the request
260
+ response = http.request(request)
261
+ response.read_body
262
+ end
263
+ end
264
+ end
@@ -0,0 +1,221 @@
1
+ #
2
+ # Lockstep Software Development Kit for Ruby
3
+ #
4
+ # (c) 2021-2022 Lockstep, Inc.
5
+ #
6
+ # For the full copyright and license information, please view the LICENSE
7
+ # file that was distributed with this source code.
8
+ #
9
+ # @author Ted Spence <tspence@lockstep.io>
10
+ # @author Manish Narayan B S <manish.n@lockstep.io>
11
+ # @author Rishi Rajkumar Jawahar <rjawahar@lockstep.io>
12
+ # @copyright 2021-2022 Lockstep, Inc.
13
+ # @version 2022.4
14
+ # @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
15
+ #
16
+
17
+
18
+ require 'json'
19
+
20
+ module LockstepSdk
21
+
22
+ ##
23
+ # An Activity contains information about work being done on a specific accounting task.
24
+ # You can use Activities to track information about who has been assigned a specific task,
25
+ # the current status of the task, the name and description given for the particular task,
26
+ # the priority of the task, and any amounts collected, paid, or credited for the task.
27
+ class ActivityModel
28
+
29
+ ##
30
+ # Initialize the ActivityModel using the provided prototype
31
+ def initialize(params = {})
32
+ @activity_id = params.dig(:activity_id)
33
+ @group_key = params.dig(:group_key)
34
+ @company_id = params.dig(:company_id)
35
+ @activity_type_code = params.dig(:activity_type_code)
36
+ @activity_name = params.dig(:activity_name)
37
+ @activity_description = params.dig(:activity_description)
38
+ @activity_status = params.dig(:activity_status)
39
+ @is_open = params.dig(:is_open)
40
+ @priority = params.dig(:priority)
41
+ @user_assigned_to = params.dig(:user_assigned_to)
42
+ @date_assigned = params.dig(:date_assigned)
43
+ @date_closed = params.dig(:date_closed)
44
+ @snooze_until_date = params.dig(:snooze_until_date)
45
+ @created = params.dig(:created)
46
+ @created_user_id = params.dig(:created_user_id)
47
+ @modified = params.dig(:modified)
48
+ @modified_user_id = params.dig(:modified_user_id)
49
+ @amount_collected = params.dig(:amount_collected)
50
+ @amount_paid = params.dig(:amount_paid)
51
+ @credit_given = params.dig(:credit_given)
52
+ @is_unread = params.dig(:is_unread)
53
+ @is_archived = params.dig(:is_archived)
54
+ @company = params.dig(:company)
55
+ @user_assigned_to_name = params.dig(:user_assigned_to_name)
56
+ @attachments = params.dig(:attachments)
57
+ @notes = params.dig(:notes)
58
+ @custom_field_definitions = params.dig(:custom_field_definitions)
59
+ @custom_field_values = params.dig(:custom_field_values)
60
+ @references = params.dig(:references)
61
+ end
62
+
63
+ ##
64
+ # @return [Uuid] The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.
65
+ attr_accessor :activity_id
66
+
67
+ ##
68
+ # @return [Uuid] The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys).
69
+ attr_accessor :group_key
70
+
71
+ ##
72
+ # @return [Uuid] The ID of the company to which this activity belongs.
73
+ attr_accessor :company_id
74
+
75
+ ##
76
+ # @return [String] The type code of the activity
77
+ attr_accessor :activity_type_code
78
+
79
+ ##
80
+ # @return [String] The name of the activity. The name is a short name provided by the person who created the activity that can be displayed in a list.
81
+ attr_accessor :activity_name
82
+
83
+ ##
84
+ # @return [String] A description of the activity. This field contains more detailed text about the activity and can be lengthy.
85
+ attr_accessor :activity_description
86
+
87
+ ##
88
+ # @return [String] The status of the activity.
89
+ attr_accessor :activity_status
90
+
91
+ ##
92
+ # @return [Boolean] True if this activity is currently "open", which indicates that the activitiy is currently in progress.
93
+ attr_accessor :is_open
94
+
95
+ ##
96
+ # @return [String] The priority of the activity.
97
+ attr_accessor :priority
98
+
99
+ ##
100
+ # @return [Uuid] The ID of the user the activity is assigned to.
101
+ attr_accessor :user_assigned_to
102
+
103
+ ##
104
+ # @return [Date-time] The date the activity was assigned.
105
+ attr_accessor :date_assigned
106
+
107
+ ##
108
+ # @return [Date-time] The date the activity was closed.
109
+ attr_accessor :date_closed
110
+
111
+ ##
112
+ # @return [Date-time] If this activity has been "snoozed", this field will be non-null and will contain the date when the activity will be displayed. Until that date arrives, the activity will remain hidden.
113
+ attr_accessor :snooze_until_date
114
+
115
+ ##
116
+ # @return [Date-time] The date on which this activity was created.
117
+ attr_accessor :created
118
+
119
+ ##
120
+ # @return [Uuid] The ID of the user who created this activity.
121
+ attr_accessor :created_user_id
122
+
123
+ ##
124
+ # @return [Date-time] The date on which this activity was last modified.
125
+ attr_accessor :modified
126
+
127
+ ##
128
+ # @return [Uuid] The ID of the user who last modified this activity.
129
+ attr_accessor :modified_user_id
130
+
131
+ ##
132
+ # @return [Double] Amount collected (if any) for the activity.
133
+ attr_accessor :amount_collected
134
+
135
+ ##
136
+ # @return [Double] Amount paid (if any) for the activity.
137
+ attr_accessor :amount_paid
138
+
139
+ ##
140
+ # @return [Double] Credit given (if any) for the activity.
141
+ attr_accessor :credit_given
142
+
143
+ ##
144
+ # @return [Boolean] True if this activity is to be shown in an "unread" state. When an activity is read by a person it is assigned to, this flag is set to false.
145
+ attr_accessor :is_unread
146
+
147
+ ##
148
+ # @return [Boolean] Activities may be archived when they should be hidden from the user. When this flag is true, this activity should be hidden.
149
+ attr_accessor :is_archived
150
+
151
+ ##
152
+ # @return [CompanyModel] The company associated with the activity To retrieve this collection, specify `Company` in the "Include" parameter for your query.
153
+ attr_accessor :company
154
+
155
+ ##
156
+ # @return [String] The name of the user the activity is assigned to
157
+ attr_accessor :user_assigned_to_name
158
+
159
+ ##
160
+ # @return [AttachmentModel] All attachments attached to applied activity. To retrieve this collection, specify `Attachments` in the "Include" parameter for your query.
161
+ attr_accessor :attachments
162
+
163
+ ##
164
+ # @return [NoteModel] All notes attached to this applied activity. To retrieve this collection, specify `Notes` in the "Include" parameter for your query.
165
+ attr_accessor :notes
166
+
167
+ ##
168
+ # @return [CustomFieldDefinitionModel] All definitions attached to this applied activity. To retrieve this collection, specify `CustomFieldValues` in the "Include" parameter for your query.
169
+ attr_accessor :custom_field_definitions
170
+
171
+ ##
172
+ # @return [CustomFieldValueModel] All values attached to this activity. To retrieve this collection, specify `CustomFieldValues` in the "Include" parameter for your query.
173
+ attr_accessor :custom_field_values
174
+
175
+ ##
176
+ # @return [ActivityXRefModel] All references attached to this applied activity. To retrieve this collection, specify `References` in the "Include" parameter for your query.
177
+ attr_accessor :references
178
+
179
+ ##
180
+ # @return [object] This object as a JSON key-value structure
181
+ def as_json(options={})
182
+ {
183
+ 'activityId' => @activity_id,
184
+ 'groupKey' => @group_key,
185
+ 'companyId' => @company_id,
186
+ 'activityTypeCode' => @activity_type_code,
187
+ 'activityName' => @activity_name,
188
+ 'activityDescription' => @activity_description,
189
+ 'activityStatus' => @activity_status,
190
+ 'isOpen' => @is_open,
191
+ 'priority' => @priority,
192
+ 'userAssignedTo' => @user_assigned_to,
193
+ 'dateAssigned' => @date_assigned,
194
+ 'dateClosed' => @date_closed,
195
+ 'snoozeUntilDate' => @snooze_until_date,
196
+ 'created' => @created,
197
+ 'createdUserId' => @created_user_id,
198
+ 'modified' => @modified,
199
+ 'modifiedUserId' => @modified_user_id,
200
+ 'amountCollected' => @amount_collected,
201
+ 'amountPaid' => @amount_paid,
202
+ 'creditGiven' => @credit_given,
203
+ 'isUnread' => @is_unread,
204
+ 'isArchived' => @is_archived,
205
+ 'company' => @company,
206
+ 'userAssignedToName' => @user_assigned_to_name,
207
+ 'attachments' => @attachments,
208
+ 'notes' => @notes,
209
+ 'customFieldDefinitions' => @custom_field_definitions,
210
+ 'customFieldValues' => @custom_field_values,
211
+ 'references' => @references,
212
+ }
213
+ end
214
+
215
+ ##
216
+ # @return [String] This object converted to a JSON string
217
+ def to_json(*options)
218
+ "[#{as_json(*options).to_json(*options)}]"
219
+ end
220
+ end
221
+ end
@@ -0,0 +1,104 @@
1
+ #
2
+ # Lockstep Software Development Kit for Ruby
3
+ #
4
+ # (c) 2021-2022 Lockstep, Inc.
5
+ #
6
+ # For the full copyright and license information, please view the LICENSE
7
+ # file that was distributed with this source code.
8
+ #
9
+ # @author Ted Spence <tspence@lockstep.io>
10
+ # @author Manish Narayan B S <manish.n@lockstep.io>
11
+ # @author Rishi Rajkumar Jawahar <rjawahar@lockstep.io>
12
+ # @copyright 2021-2022 Lockstep, Inc.
13
+ # @version 2022.4
14
+ # @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
15
+ #
16
+
17
+
18
+ require 'json'
19
+
20
+ module LockstepSdk
21
+
22
+ ##
23
+ # Represents an item belonging to the activity stream.
24
+ class ActivityStreamItemModel
25
+
26
+ ##
27
+ # Initialize the ActivityStreamItemModel using the provided prototype
28
+ def initialize(params = {})
29
+ @object_key = params.dig(:object_key)
30
+ @activity_stream_type = params.dig(:activity_stream_type)
31
+ @text_value = params.dig(:text_value)
32
+ @created = params.dig(:created)
33
+ @created_user_id = params.dig(:created_user_id)
34
+ @group_key = params.dig(:group_key)
35
+ @from_email_address = params.dig(:from_email_address)
36
+ @to_email_address = params.dig(:to_email_address)
37
+ @from_contact_name = params.dig(:from_contact_name)
38
+ @to_contact_name = params.dig(:to_contact_name)
39
+ end
40
+
41
+ ##
42
+ # @return [Uuid] The object key of the activity stream item.
43
+ attr_accessor :object_key
44
+
45
+ ##
46
+ # @return [String] The type code of the activity stream item.
47
+ attr_accessor :activity_stream_type
48
+
49
+ ##
50
+ # @return [String] The text body description for this Activity Stream Item.
51
+ attr_accessor :text_value
52
+
53
+ ##
54
+ # @return [Date-time] The date on which this activity stream item was created.
55
+ attr_accessor :created
56
+
57
+ ##
58
+ # @return [Uuid] The ID of the user who created this activity.
59
+ attr_accessor :created_user_id
60
+
61
+ ##
62
+ # @return [Uuid] The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys).
63
+ attr_accessor :group_key
64
+
65
+ ##
66
+ # @return [String] The sender's email address if activity stream item is an Email.
67
+ attr_accessor :from_email_address
68
+
69
+ ##
70
+ # @return [String] The recipient's email address if activity stream item is an Email.
71
+ attr_accessor :to_email_address
72
+
73
+ ##
74
+ # @return [String] The name of the contact sending the activity otherwise null.
75
+ attr_accessor :from_contact_name
76
+
77
+ ##
78
+ # @return [String] The name of the contact sending the activity otherwise null.
79
+ attr_accessor :to_contact_name
80
+
81
+ ##
82
+ # @return [object] This object as a JSON key-value structure
83
+ def as_json(options={})
84
+ {
85
+ 'objectKey' => @object_key,
86
+ 'activityStreamType' => @activity_stream_type,
87
+ 'textValue' => @text_value,
88
+ 'created' => @created,
89
+ 'createdUserId' => @created_user_id,
90
+ 'groupKey' => @group_key,
91
+ 'fromEmailAddress' => @from_email_address,
92
+ 'toEmailAddress' => @to_email_address,
93
+ 'fromContactName' => @from_contact_name,
94
+ 'toContactName' => @to_contact_name,
95
+ }
96
+ end
97
+
98
+ ##
99
+ # @return [String] This object converted to a JSON string
100
+ def to_json(*options)
101
+ "[#{as_json(*options).to_json(*options)}]"
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,72 @@
1
+ #
2
+ # Lockstep Software Development Kit for Ruby
3
+ #
4
+ # (c) 2021-2022 Lockstep, Inc.
5
+ #
6
+ # For the full copyright and license information, please view the LICENSE
7
+ # file that was distributed with this source code.
8
+ #
9
+ # @author Ted Spence <tspence@lockstep.io>
10
+ # @author Manish Narayan B S <manish.n@lockstep.io>
11
+ # @author Rishi Rajkumar Jawahar <rjawahar@lockstep.io>
12
+ # @copyright 2021-2022 Lockstep, Inc.
13
+ # @version 2022.4
14
+ # @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
15
+ #
16
+
17
+
18
+ require 'json'
19
+
20
+ module LockstepSdk
21
+
22
+ class ActivityXRefModel
23
+
24
+ ##
25
+ # Initialize the ActivityXRefModel using the provided prototype
26
+ def initialize(params = {})
27
+ @activity_xref_id = params.dig(:activity_xref_id)
28
+ @activity_id = params.dig(:activity_id)
29
+ @group_key = params.dig(:group_key)
30
+ @table_key = params.dig(:table_key)
31
+ @object_key = params.dig(:object_key)
32
+ end
33
+
34
+ ##
35
+ # @return [Uuid] The unique ID of this record, automatically assigned by Lockstep when this is added to the Lockstep platform.
36
+ attr_accessor :activity_xref_id
37
+
38
+ ##
39
+ # @return [Uuid] The ID of the activity to which this reference belongs.
40
+ attr_accessor :activity_id
41
+
42
+ ##
43
+ # @return [Uuid] The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys).
44
+ attr_accessor :group_key
45
+
46
+ ##
47
+ # @return [String] The name of the table the activity reference is associated with
48
+ attr_accessor :table_key
49
+
50
+ ##
51
+ # @return [String] The ID of the object the activity reference is associated with
52
+ attr_accessor :object_key
53
+
54
+ ##
55
+ # @return [object] This object as a JSON key-value structure
56
+ def as_json(options={})
57
+ {
58
+ 'activityXRefId' => @activity_xref_id,
59
+ 'activityId' => @activity_id,
60
+ 'groupKey' => @group_key,
61
+ 'tableKey' => @table_key,
62
+ 'objectKey' => @object_key,
63
+ }
64
+ end
65
+
66
+ ##
67
+ # @return [String] This object converted to a JSON string
68
+ def to_json(*options)
69
+ "[#{as_json(*options).to_json(*options)}]"
70
+ end
71
+ end
72
+ end