1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
//! Salesforce REST API
//!
//! This crate provides a Rust client for interacting with the Salesforce REST API. It allows you to
//! perform CRUD operations on Salesforce objects, query data, and more.
//!
//! ## Supported Endpoint
//!
//! - [**/services/data/vXX.X/sobjects**](crate::rest_api::sobjects), CRUD operations on a single Salesforce object
//! - [**/services/data/vXX.X/composite/sobjects**](crate::rest_api::composite), CRUD operations for up to 200 Salesforce objects
//! - [**/services/data/vXX.X/search**](crate::rest_api::search), SOSL search operations on Salesforce objects
//! - [**/services/data/vXX.X/services**](crate::rest_api::services), system information and metadata
//! - [**/services/data/vXX.X/query**](crate::rest_api::query), retrieving up to 2,000 records
//! - [**/services/data/vXX.X/userPassword**](crate::rest_api::user_password), user password client
//!
//! ## Reference
//! https://developer.salesforce.com/docs/platform/api-rest/guide/resources-list.html
//!
//! - [Headers](crate::rest_api::builder::headers)
//! - [Assignment Rule Header](crate::rest_api::builder::headers::assignment_rule_header)
//! - [Call Options Header](crate::rest_api::builder::headers::call_options_header)
//! - Compression Headers
//! - [Conditional Request Headers](crate::rest_api::builder::headers::conditional_request_headers)
//! - [Duplicate Rule Header](crate::rest_api::builder::headers::duplicate_rule_header)
//! - [Limit Info Header](crate::rest_api::builder::headers::limit_info_header)
//! - [MRU Header](crate::rest_api::builder::headers::mru_header)
//! - [Package Version Header](crate::rest_api::builder::headers::package_version_header)
//! - [Query Options Header](crate::rest_api::builder::headers::query_options_header)
//! - Warning Header
//!
//! - [Versions](crate::rest_api::RestApi::versions)
//! - Resources by Version
//! - Limits
//! - [Describe Global](crate::rest_api::builder::sobjects::SObjectsBuilder::describe_global)
//! - sObject Basic Information
//! - [Get Object Metadata Using sObject Basic Information](crate::rest_api::builder::sobjects::SObjectsBuilder::basic_info)
//! - [Create Records Using sObject Basic Information](crate::rest_api::builder::sobjects::SObjectsBuilder::create)
//! - [sObject Desribe](crate::rest_api::builder::sobjects::SObjectsBuilder::describe)
//! - [sObject Get Deleted](crate::rest_api::builder::sobjects::SObjectsBuilder::deleted)
//! - [sObject Get Updated](crate::rest_api::builder::sobjects::SObjectsBuilder::updated)
//! - sObject Named Layouts
//! - sObject Rows
//! - [Get Records Using sObject Rows](crate::rest_api::builder::sobjects::SObjectsBuilder::get_by_id)
//! - [Update Records Using sObject Rows](crate::rest_api::builder::sobjects::SObjectsBuilder::update)
//! - [Delete Records Using sObject Rows](crate::rest_api::builder::sobjects::SObjectsBuilder::delete)
//! - sObject Rows by External ID
//! - [Get Records Using sObject Rows by External ID](crate::rest_api::builder::sobjects::SObjectsBuilder::get_by_ext_id)
//! - Create Records Using sObject Rows by External ID
//! - [Upsert Records Using sObject Rows by External ID](crate::rest_api::builder::sobjects::SObjectsBuilder::upsert_by_ext_id)
//! - Delete Records Using sObject Rows by External ID
//! - Return Headers Using sObject Rows by External ID
//! - sObject Blob Get
//! - sObject ApprovalLayouts
//! - Get Approval Layouts
//! - Return Headers for Approval Layouts
//! - sObject Single Approval Process
//! - Get a Layout for a Single Approval Process on a Specified Objec
//! - Return Headers for a Single Approval Process on a Specified Object
//! - sObject CompactLayouts
//! - Get Compact Layouts Using sObject CompactLayouts
//! - Return Headers Using sObject CompactLayouts
//! - sObject Layouts
//! - Get Layouts and Descriptions for a Specified Object
//! - Return Layout Headers for a Specified Object
//! - sObject Layouts for an Object With Multiple Record Types
//! - Get Layouts and Descriptions for an Object With Multiple Record Types
//! - Return Layout Headers for an Object With Multiple Record Types
//! - sObject Global Publisher Layouts
//! - Get Global Publisher Layouts and Descriptions
//! - Return Headers for All Global Publisher Layouts
//! - sObject PlatformAction
//! - sObject Quick Actions
//! - Return Headers Using sObject Quick Actions
//! - sObject Specific Quick Actions
//! - Get Specific sObject Quick Actions
//! - Create Records Using Specific sObject Quick Actions
//! - Return Headers Using Specific sObject Quick Actions
//! - sObject Quick Action Details
//! - Get sObject Quick Action Details
//! - Return Headers Using sObject Quick Action Details
//! - sObject Quick Action Default Values
//! - Get sObject Quick Action Default Values
//! - Return Headers Using sObject Quick Action Default Values
//! - sObject Quick Action Default Values by ID
//! - Get sObject Quick Action Default Values by ID
//! - Return Headers Using sObject Quick Action Default Values by ID
//! - sObject Relationships
//! - Get Records Using sObject Relationships
//! - Update Records Using sObject Relationships
//! - Delete Records Using sObject Relationships
//! - sObjects Suggested Articles
//! - sObjects Suggested Articles by ID
//! - sObject User Password
//! - [Get User Password Expiration Status](crate::rest_api::RestApi::is_user_password_expired)
//! - [Set User Password](crate::rest_api::RestApi::set_user_password)
//! - [Reset User Password](crate::rest_api::RestApi::reset_user_password)
//! - Return Headers Using sObject User Password
//! - sObject Self-Service User Password
//! - Get Self-Service User Password Expiration Status
//! - Set Self-Service User Password
//! - Reset Self-Service User Password
//! - Return Headers Using sObject Self-Service User Password
//! - Platform Event Schema by Event Name
//! - Platform Event Schema by Schema ID
//! - Get AppMenu Types
//! - AppMenu Items
//! - Get AppMenu Items
//! - Return Headers of App Menu Item Requests
//! - AppMenu Mobile Items
//! - Get AppMenu Mobile Items
//! - Return Headers of AppMenu Mobile Item Requests
//! - Compact Layouts
//! - ConsenT
//! - Compile Consent Settings
//! - Compile Multiple Types of Consent Settings
//! - Use the Consent API with Data 360
//! - Consent Write
//! - Embedded Service Configuration Describe
//! - Get Embedded Service Configuration
//! - Return Headers for Embedded Service Configuration
//! - Invocable Actions
//! - Get Invocable Actions
//! - Return HTTP Headers for Invocable Actions
//! - Invocable Actions Custom
//! - Deploy Data Kit Components by Using Deploy Data Kit Components Flow
//! - Get Custom Invocable Actions
//! - Return HTTP Headers for Custom Invocable Actions
//! - Invocable Actions Standard
//! - Get Standard Invocable Actions
//! - Return HTTP Headers for Standard Invocable Actions
//! - List View Basic Information
//! - List View Describe
//! - List View Results
//! - List Views for an Object
//! - Named Query APIs for SOQL Queries
//! - Create Named Query APIs in Setup
//! - Create Named Query APIs in VS Code
//! - Named Query API
//! - Support Knowledge with REST API
//! - Data Category Groups
//! - Data Category Detail
//! - Articles List
//! - Articles Details
//! - Parameterized Search
//! - Search with Parameters in the URI
//! - Search with Parameters in the Request Body
//! - Portability
//! - Compile Data for a Portability Request
//! - Get the Status of Your Portability Request
//! - Process Approvals
//! - Get Process Approvals
//! - Submit, Approve, or Reject Process Approvals
//! - Return HTTP Headers for Process Approvals
//! - Process Rules
//! - Get Process Rules
//! - Trigger Process Rules
//! - Return HTTP Headers for Process Rules
//! - Process Rule for an sObject
//! - Get a Process Rule for an sObject
//! - Trigger a Process Rule for an sObject
//! - Return HTTP Headers for a Process Rule of an sObject
//! - Process Rule List for an sObject
//! - Get Process Rules for an sObject
//! - Return HTTP Headers for Process Rules of an sObject
//! - Product Schedules
//! - Get Product Schedules
//! - Create Product Schedules
//! - Delete Product Schedules
//! - [Query](crate::rest_api::builder::RestApiBuilder::query)
//! - Data Cloud Query Profile Parameters
//! - [Query More Results](crate::rest_api::builder::query::query_response::QueryResponse::send_query_more)
//! - [QueryAll](crate::rest_api::builder::query::QueryBuilder::all)
//! - [QueryAll](crate::rest_api::builder::query::QueryBuilder::all) [More Results](crate::rest_api::builder::query::query_response::QueryResponse::send_query_more)
//! - Query Performance Feedback (Beta)
//! - Quick Actions
//! - Get Quick Actions
//! - Create Records Using Quick Actions
//! - Return Headers of Quick Actions
//! - Recent List Views
//! - Recently Viewed Items
//! - Record Count
//! - Record Count Response Body
//! - sObject Relevant Items
//! - Get Knowledge Language Settings
//! - [Search](crate::rest_api::builder::RestApiBuilder::sosl)
//! - Search Scope and Order
//! - Search Result Layouts
//! - Lightning Toggle Metrics
//! - Lightning Usage by App Type
//! - Lightning Usage by Browser
//! - Lightning Usage by Page
//! - Lightning Usage by FlexiPage
//! - Lightning Exit by Page Metrics
//! - Salesforce Scheduler Resources
//! - Scheduling
//! - Get Appointment Slots
//! - Get Appointment Candidates
//! - Request Bodies
//! - Work Type
//! - Skill Requirement
//! - Response Bodies
//! - Time Slot
//! - Candidates
//! - Search for Records Suggested by Autocomplete and Instant Results
//! - Search Suggested Article Title Matches
//! - Search Suggested Queries
//! - Salesforce Surveys Translation Resources
//! - Add or Change the Translation of a Survey Field
//! - Add or Update the Translated Value of Multiple Survey Fields in One or More Languages
//! - Delete the Translated Value of a Survey Field
//! - Delete the Translated Value of Multiple Survey Fields in One or More Languages
//! - Get Translated Value of a Survey Field
//! - Get the Translated Values of Multiple Survey Fields in One or More Languages
//! - Tabs
//! - Get Tabs
//! - Return Headers Using Tabs
//! - Themes
//! - Composite
//! - Send Multiple Requests Using Composite
//! - Composite Request Body
//! - Composite Response Body
//! - Composite Subrequest Result
//! - Get a List of Composite Resources
//! - Composite Graph
//! - Composite Subrequest
//! - [Composite Graph Limits](https://developer.salesforce.com/docs/platform/api-rest/guide/resources-composite-graph-limits.html)
//! - Composite Batch
//! - Batch Request Body
//! - Batch Response Body
//! - SObject Tree
//! - sObject Tree Request Body
//! - sObject Tree Response Body
//! - sObject Collections
//! - [Create Records Using sObject Collections](crate::rest_api::builder::composite::sobject_collections::SObjectCollectionsBuilder::create)
//! - [Get Records Using sObject Collections](crate::rest_api::builder::composite::sobject_collections::SObjectCollectionsBuilder::get_by_ids)
//! - Get Records With a Request Body Using sObject Collections
//! - Update Records Using sObject Collections
//! - Upsert Records Using sObject Collections
//! - Delete Records Using sObject Collections
use crateErrorResponse;
use crateClient;
use crateDEFAULT_API_VERSION;
use crateError;
use trace;
use Response;
use SalesforceCredentials;
use Serialize;
use DeserializeOwned;
use HashMap;
use Debug;
/// A `RestApi` struct that represents the core component for interacting with a RESTful API.
///
/// This struct contains a `client` field, which is an instance of the `Client` type
/// used to make HTTP requests to the API. The `RestApi` struct is derived with the
/// `Default` trait, allowing it to be instantiated with default values.
///
/// # Fields
/// - `client` (`Client`):
/// A structure responsible for handling HTTP interactions with the API.
/// This field has module-level visibility (`pub(crate)`), restricting its accessibility
/// to the current crate.
///
/// Note: To use the `RestApi` struct effectively, ensure all required components
/// of the `Client` type are configured appropriately.