rippling_api/
custom_object_records.rs

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
427
428
429
430
431
432
433
434
use anyhow::Result;

use crate::Client;
#[derive(Clone, Debug)]
pub struct CustomObjectRecords {
    pub client: Client,
}

impl CustomObjectRecords {
    #[doc(hidden)]
    pub fn new(client: Client) -> Self {
        Self { client }
    }

    #[doc = "List custom object records\n\nA List of custom object records\n- Requires: `API Tier 1`\n\n**Parameters:**\n\n- `cursor: Option<String>`\n- `custom_object_api_name: &'astr` (required)\n\n```rust,no_run\nuse futures_util::TryStreamExt;\nasync fn example_custom_object_records_list_custom_objects_custom_object_api_name_records_stream(\n) -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    let mut custom_object_records = client.custom_object_records();\n    let mut stream = custom_object_records\n        .list_custom_objects_custom_object_api_name_records_stream(\"some-string\");\n    loop {\n        match stream.try_next().await {\n            Ok(Some(item)) => {\n                println!(\"{:?}\", item);\n            }\n            Ok(None) => {\n                break;\n            }\n            Err(err) => {\n                return Err(err.into());\n            }\n        }\n    }\n\n    Ok(())\n}\n```"]
    #[tracing::instrument]
    pub async fn list_custom_objects_custom_object_api_name_records<'a>(
        &'a self,
        cursor: Option<String>,
        custom_object_api_name: &'a str,
    ) -> Result<
        crate::types::ListCustomObjectsCustomObjectApiNameRecordsResponse,
        crate::types::error::Error,
    > {
        let mut req = self.client.client.request(
            http::Method::GET,
            format!(
                "{}/{}",
                self.client.base_url,
                "custom-objects/{custom_object_api_name}/records"
                    .replace("{custom_object_api_name}", custom_object_api_name)
            ),
        );
        req = req.bearer_auth(&self.client.token);
        let mut query_params = vec![];
        if let Some(p) = cursor {
            query_params.push(("cursor", p));
        }

        req = req.query(&query_params);
        let resp = req.send().await?;
        let status = resp.status();
        if status.is_success() {
            let text = resp.text().await.unwrap_or_default();
            serde_json::from_str(&text).map_err(|err| {
                crate::types::error::Error::from_serde_error(
                    format_serde_error::SerdeError::new(text.to_string(), err),
                    status,
                )
            })
        } else {
            let text = resp.text().await.unwrap_or_default();
            Err(crate::types::error::Error::Server {
                body: text.to_string(),
                status,
            })
        }
    }

    #[doc = "List custom object records\n\nA List of custom object records\n- Requires: `API Tier 1`\n\n**Parameters:**\n\n- `cursor: Option<String>`\n- `custom_object_api_name: &'astr` (required)\n\n```rust,no_run\nuse futures_util::TryStreamExt;\nasync fn example_custom_object_records_list_custom_objects_custom_object_api_name_records_stream(\n) -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    let mut custom_object_records = client.custom_object_records();\n    let mut stream = custom_object_records\n        .list_custom_objects_custom_object_api_name_records_stream(\"some-string\");\n    loop {\n        match stream.try_next().await {\n            Ok(Some(item)) => {\n                println!(\"{:?}\", item);\n            }\n            Ok(None) => {\n                break;\n            }\n            Err(err) => {\n                return Err(err.into());\n            }\n        }\n    }\n\n    Ok(())\n}\n```"]
    #[tracing::instrument]
    #[cfg(not(feature = "js"))]
    pub fn list_custom_objects_custom_object_api_name_records_stream<'a>(
        &'a self,
        custom_object_api_name: &'a str,
    ) -> impl futures::Stream<Item = Result<crate::types::Results, crate::types::error::Error>>
           + Unpin
           + '_ {
        use futures::{StreamExt, TryFutureExt, TryStreamExt};

        use crate::types::paginate::Pagination;
        self . list_custom_objects_custom_object_api_name_records (None , custom_object_api_name) . map_ok (move | result | { let items = futures :: stream :: iter (result . items () . into_iter () . map (Ok)) ; let next_pages = futures :: stream :: try_unfold ((None , result) , move | (prev_page_token , new_result) | async move { if new_result . has_more_pages () && ! new_result . items () . is_empty () && prev_page_token != new_result . next_page_token () { async { let mut req = self . client . client . request (http :: Method :: GET , format ! ("{}/{}" , self . client . base_url , "custom-objects/{custom_object_api_name}/records" . replace ("{custom_object_api_name}" , custom_object_api_name)) ,) ; req = req . bearer_auth (& self . client . token) ; let mut request = req . build () ? ; request = new_result . next_page (request) ? ; let resp = self . client . client . execute (request) . await ? ; let status = resp . status () ; if status . is_success () { let text = resp . text () . await . unwrap_or_default () ; serde_json :: from_str (& text) . map_err (| err | crate :: types :: error :: Error :: from_serde_error (format_serde_error :: SerdeError :: new (text . to_string () , err) , status)) } else { let text = resp . text () . await . unwrap_or_default () ; Err (crate :: types :: error :: Error :: Server { body : text . to_string () , status }) } } . map_ok (| result : crate :: types :: ListCustomObjectsCustomObjectApiNameRecordsResponse | { Some ((futures :: stream :: iter (result . items () . into_iter () . map (Ok) ,) , (new_result . next_page_token () , result) ,)) }) . await } else { Ok (None) } }) . try_flatten () ; items . chain (next_pages) }) . try_flatten_stream () . boxed ()
    }

    #[doc = "Create a new custom object record\n\nCreate a new custom object record\n\n**Parameters:**\n\n- `custom_object_api_name: &'astr` (required)\n\n```rust,no_run\nasync fn example_custom_object_records_create_custom_objects_custom_object_api_name_records(\n) -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    let result: rippling_api::types::CreateCustomObjectsCustomObjectApiNameRecordsResponse = client\n        .custom_object_records()\n        .create_custom_objects_custom_object_api_name_records(\n            \"some-string\",\n            &rippling_api::types::CreateCustomObjectsCustomObjectApiNameRecordsRequestBody {\n                name: Some(\"some-string\".to_string()),\n                field_api_name: Some(\"some-string\".to_string()),\n            },\n        )\n        .await?;\n    println!(\"{:?}\", result);\n    Ok(())\n}\n```"]
    #[tracing::instrument]
    pub async fn create_custom_objects_custom_object_api_name_records<'a>(
        &'a self,
        custom_object_api_name: &'a str,
        body: &crate::types::CreateCustomObjectsCustomObjectApiNameRecordsRequestBody,
    ) -> Result<
        crate::types::CreateCustomObjectsCustomObjectApiNameRecordsResponse,
        crate::types::error::Error,
    > {
        let mut req = self.client.client.request(
            http::Method::POST,
            format!(
                "{}/{}",
                self.client.base_url,
                "custom-objects/{custom_object_api_name}/records"
                    .replace("{custom_object_api_name}", custom_object_api_name)
            ),
        );
        req = req.bearer_auth(&self.client.token);
        req = req.json(body);
        let resp = req.send().await?;
        let status = resp.status();
        if status.is_success() {
            let text = resp.text().await.unwrap_or_default();
            serde_json::from_str(&text).map_err(|err| {
                crate::types::error::Error::from_serde_error(
                    format_serde_error::SerdeError::new(text.to_string(), err),
                    status,
                )
            })
        } else {
            let text = resp.text().await.unwrap_or_default();
            Err(crate::types::error::Error::Server {
                body: text.to_string(),
                status,
            })
        }
    }

    #[doc = "List custom object records by query\n\nA List of custom object records filtered by querying\n\n**Parameters:**\n\n- `cursor: Option<String>`\n- `custom_object_api_name: &'astr` (required)\n\n```rust,no_run\nasync fn example_custom_object_records_list_by_query_custom_objects_custom_object_api_name_records(\n) -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    let result: rippling_api::types::ListByQueryCustomObjectsCustomObjectApiNameRecordsResponse = client\n        .custom_object_records()\n        .list_by_query_custom_objects_custom_object_api_name_records(\n            Some(\"some-string\".to_string()),\n            \"some-string\",\n            &rippling_api::types::ListByQueryCustomObjectsCustomObjectApiNameRecordsRequestBody {\n                query: Some(\"some-string\".to_string()),\n                limit: Some(4 as i64),\n                cursor: Some(\"some-string\".to_string()),\n            },\n        )\n        .await?;\n    println!(\"{:?}\", result);\n    Ok(())\n}\n```"]
    #[tracing::instrument]
    pub async fn list_by_query_custom_objects_custom_object_api_name_records<'a>(
        &'a self,
        cursor: Option<String>,
        custom_object_api_name: &'a str,
        body: &crate::types::ListByQueryCustomObjectsCustomObjectApiNameRecordsRequestBody,
    ) -> Result<
        crate::types::ListByQueryCustomObjectsCustomObjectApiNameRecordsResponse,
        crate::types::error::Error,
    > {
        let mut req = self.client.client.request(
            http::Method::POST,
            format!(
                "{}/{}",
                self.client.base_url,
                "custom-objects/{custom_object_api_name}/records/query"
                    .replace("{custom_object_api_name}", custom_object_api_name)
            ),
        );
        req = req.bearer_auth(&self.client.token);
        let mut query_params = vec![];
        if let Some(p) = cursor {
            query_params.push(("cursor", p));
        }

        req = req.query(&query_params);
        req = req.json(body);
        let resp = req.send().await?;
        let status = resp.status();
        if status.is_success() {
            let text = resp.text().await.unwrap_or_default();
            serde_json::from_str(&text).map_err(|err| {
                crate::types::error::Error::from_serde_error(
                    format_serde_error::SerdeError::new(text.to_string(), err),
                    status,
                )
            })
        } else {
            let text = resp.text().await.unwrap_or_default();
            Err(crate::types::error::Error::Server {
                body: text.to_string(),
                status,
            })
        }
    }

    #[doc = "Retrieve a specific custom object record\n\nRetrieve a specific custom object \
             record\n\n**Parameters:**\n\n- `codr_id: &'astr` (required)\n- \
             `custom_object_api_name: &'astr` (required)\n\n```rust,no_run\nasync fn \
             example_custom_object_records_get_custom_objects_custom_object_api_name_records(\n) \
             -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    \
             let result: rippling_api::types::GetCustomObjectsCustomObjectApiNameRecordsResponse = \
             client\n        .custom_object_records()\n        \
             .get_custom_objects_custom_object_api_name_records(\"some-string\", \
             \"some-string\")\n        .await?;\n    println!(\"{:?}\", result);\n    \
             Ok(())\n}\n```"]
    #[tracing::instrument]
    pub async fn get_custom_objects_custom_object_api_name_records<'a>(
        &'a self,
        codr_id: &'a str,
        custom_object_api_name: &'a str,
    ) -> Result<
        crate::types::GetCustomObjectsCustomObjectApiNameRecordsResponse,
        crate::types::error::Error,
    > {
        let mut req = self.client.client.request(
            http::Method::GET,
            format!(
                "{}/{}",
                self.client.base_url,
                "custom-objects/{custom_object_api_name}/records/{codr_id}"
                    .replace("{codr_id}", codr_id)
                    .replace("{custom_object_api_name}", custom_object_api_name)
            ),
        );
        req = req.bearer_auth(&self.client.token);
        let resp = req.send().await?;
        let status = resp.status();
        if status.is_success() {
            let text = resp.text().await.unwrap_or_default();
            serde_json::from_str(&text).map_err(|err| {
                crate::types::error::Error::from_serde_error(
                    format_serde_error::SerdeError::new(text.to_string(), err),
                    status,
                )
            })
        } else {
            let text = resp.text().await.unwrap_or_default();
            Err(crate::types::error::Error::Server {
                body: text.to_string(),
                status,
            })
        }
    }

    #[doc = "Delete a custom object record\n\n**Parameters:**\n\n- `codr_id: &'astr` (required)\n- `custom_object_api_name: &'astr` (required)\n\n```rust,no_run\nasync fn example_custom_object_records_delete_custom_objects_custom_object_api_name_records(\n) -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    client\n        .custom_object_records()\n        .delete_custom_objects_custom_object_api_name_records(\"some-string\", \"some-string\")\n        .await?;\n    Ok(())\n}\n```"]
    #[tracing::instrument]
    pub async fn delete_custom_objects_custom_object_api_name_records<'a>(
        &'a self,
        codr_id: &'a str,
        custom_object_api_name: &'a str,
    ) -> Result<(), crate::types::error::Error> {
        let mut req = self.client.client.request(
            http::Method::DELETE,
            format!(
                "{}/{}",
                self.client.base_url,
                "custom-objects/{custom_object_api_name}/records/{codr_id}"
                    .replace("{codr_id}", codr_id)
                    .replace("{custom_object_api_name}", custom_object_api_name)
            ),
        );
        req = req.bearer_auth(&self.client.token);
        let resp = req.send().await?;
        let status = resp.status();
        if status.is_success() {
            Ok(())
        } else {
            let text = resp.text().await.unwrap_or_default();
            Err(crate::types::error::Error::Server {
                body: text.to_string(),
                status,
            })
        }
    }

    #[doc = "Update a custom object record\n\nUpdated a specific custom object record\n\n**Parameters:**\n\n- `codr_id: &'astr` (required)\n- `custom_object_api_name: &'astr` (required)\n\n```rust,no_run\nasync fn example_custom_object_records_update_custom_objects_custom_object_api_name_records(\n) -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    let result: rippling_api::types::UpdateCustomObjectsCustomObjectApiNameRecordsResponse = client\n        .custom_object_records()\n        .update_custom_objects_custom_object_api_name_records(\n            \"some-string\",\n            \"some-string\",\n            &rippling_api::types::UpdateCustomObjectsCustomObjectApiNameRecordsRequestBody {\n                name: Some(\"some-string\".to_string()),\n                field_api_name: Some(\"some-string\".to_string()),\n            },\n        )\n        .await?;\n    println!(\"{:?}\", result);\n    Ok(())\n}\n```"]
    #[tracing::instrument]
    pub async fn update_custom_objects_custom_object_api_name_records<'a>(
        &'a self,
        codr_id: &'a str,
        custom_object_api_name: &'a str,
        body: &crate::types::UpdateCustomObjectsCustomObjectApiNameRecordsRequestBody,
    ) -> Result<
        crate::types::UpdateCustomObjectsCustomObjectApiNameRecordsResponse,
        crate::types::error::Error,
    > {
        let mut req = self.client.client.request(
            http::Method::PATCH,
            format!(
                "{}/{}",
                self.client.base_url,
                "custom-objects/{custom_object_api_name}/records/{codr_id}"
                    .replace("{codr_id}", codr_id)
                    .replace("{custom_object_api_name}", custom_object_api_name)
            ),
        );
        req = req.bearer_auth(&self.client.token);
        req = req.json(body);
        let resp = req.send().await?;
        let status = resp.status();
        if status.is_success() {
            let text = resp.text().await.unwrap_or_default();
            serde_json::from_str(&text).map_err(|err| {
                crate::types::error::Error::from_serde_error(
                    format_serde_error::SerdeError::new(text.to_string(), err),
                    status,
                )
            })
        } else {
            let text = resp.text().await.unwrap_or_default();
            Err(crate::types::error::Error::Server {
                body: text.to_string(),
                status,
            })
        }
    }

    #[doc = "Retrieve a specific custom object record by its external_id\n\nRetrieve a specific custom object record by its external_id\n\n**Parameters:**\n\n- `custom_object_api_name: &'astr` (required)\n- `external_id: &'astr` (required)\n\n```rust,no_run\nasync fn example_custom_object_records_get_custom_objects_custom_object_api_name_records_by_external_id(\n) -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    let result: rippling_api::types::GetCustomObjectsCustomObjectApiNameRecordsByExternalIdResponse =\n        client\n            .custom_object_records()\n            .get_custom_objects_custom_object_api_name_records_by_external_id(\n                \"some-string\",\n                \"some-string\",\n            )\n            .await?;\n    println!(\"{:?}\", result);\n    Ok(())\n}\n```"]
    #[tracing::instrument]
    pub async fn get_custom_objects_custom_object_api_name_records_by_external_id<'a>(
        &'a self,
        custom_object_api_name: &'a str,
        external_id: &'a str,
    ) -> Result<
        crate::types::GetCustomObjectsCustomObjectApiNameRecordsByExternalIdResponse,
        crate::types::error::Error,
    > {
        let mut req = self.client.client.request(
            http::Method::GET,
            format!(
                "{}/{}",
                self.client.base_url,
                "custom-objects/{custom_object_api_name}/records/external_id/{external_id}"
                    .replace("{custom_object_api_name}", custom_object_api_name)
                    .replace("{external_id}", external_id)
            ),
        );
        req = req.bearer_auth(&self.client.token);
        let resp = req.send().await?;
        let status = resp.status();
        if status.is_success() {
            let text = resp.text().await.unwrap_or_default();
            serde_json::from_str(&text).map_err(|err| {
                crate::types::error::Error::from_serde_error(
                    format_serde_error::SerdeError::new(text.to_string(), err),
                    status,
                )
            })
        } else {
            let text = resp.text().await.unwrap_or_default();
            Err(crate::types::error::Error::Server {
                body: text.to_string(),
                status,
            })
        }
    }

    #[doc = "Bulk Create custom object records\n\nbulk create new custom object records\n\n**Parameters:**\n\n- `custom_object_api_name: &'astr` (required)\n\n```rust,no_run\nasync fn example_custom_object_records_bulk_create_custom_objects_custom_object_api_name_records(\n) -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    let result: Vec<rippling_api::types::BulkCreateCustomObjectsCustomObjectApiNameRecordsResponse> =\n        client\n            .custom_object_records()\n            .bulk_create_custom_objects_custom_object_api_name_records(\n                \"some-string\",\n                &rippling_api::types::BulkCreateCustomObjectsCustomObjectApiNameRecordsRequestBody {\n                    rows_to_write: Some(vec![rippling_api::types::RowsToWrite {\n                        name: Some(\"some-string\".to_string()),\n                        field_api_name: Some(\"some-string\".to_string()),\n                    }]),\n                    all_or_nothing: Some(false),\n                },\n            )\n            .await?;\n    println!(\"{:?}\", result);\n    Ok(())\n}\n```"]
    #[tracing::instrument]
    pub async fn bulk_create_custom_objects_custom_object_api_name_records<'a>(
        &'a self,
        custom_object_api_name: &'a str,
        body: &crate::types::BulkCreateCustomObjectsCustomObjectApiNameRecordsRequestBody,
    ) -> Result<
        Vec<crate::types::BulkCreateCustomObjectsCustomObjectApiNameRecordsResponse>,
        crate::types::error::Error,
    > {
        let mut req = self.client.client.request(
            http::Method::POST,
            format!(
                "{}/{}",
                self.client.base_url,
                "custom-objects/{custom_object_api_name}/records/bulk"
                    .replace("{custom_object_api_name}", custom_object_api_name)
            ),
        );
        req = req.bearer_auth(&self.client.token);
        req = req.json(body);
        let resp = req.send().await?;
        let status = resp.status();
        if status.is_success() {
            let text = resp.text().await.unwrap_or_default();
            serde_json::from_str(&text).map_err(|err| {
                crate::types::error::Error::from_serde_error(
                    format_serde_error::SerdeError::new(text.to_string(), err),
                    status,
                )
            })
        } else {
            let text = resp.text().await.unwrap_or_default();
            Err(crate::types::error::Error::Server {
                body: text.to_string(),
                status,
            })
        }
    }

    #[doc = "bulk delete custom object records\n\nBulk Delete custom object records\n\n**Parameters:**\n\n- `custom_object_api_name: &'astr` (required)\n\n```rust,no_run\nasync fn example_custom_object_records_bulk_delete_custom_objects_custom_object_api_name_records(\n) -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    client\n        .custom_object_records()\n        .bulk_delete_custom_objects_custom_object_api_name_records(\n            \"some-string\",\n            &rippling_api::types::BulkDeleteCustomObjectsCustomObjectApiNameRecordsRequestBody {\n                rows_to_delete: Some(\"some-string\".to_string()),\n                all_or_nothing: Some(false),\n            },\n        )\n        .await?;\n    Ok(())\n}\n```"]
    #[tracing::instrument]
    pub async fn bulk_delete_custom_objects_custom_object_api_name_records<'a>(
        &'a self,
        custom_object_api_name: &'a str,
        body: &crate::types::BulkDeleteCustomObjectsCustomObjectApiNameRecordsRequestBody,
    ) -> Result<(), crate::types::error::Error> {
        let mut req = self.client.client.request(
            http::Method::DELETE,
            format!(
                "{}/{}",
                self.client.base_url,
                "custom-objects/{custom_object_api_name}/records/bulk"
                    .replace("{custom_object_api_name}", custom_object_api_name)
            ),
        );
        req = req.bearer_auth(&self.client.token);
        req = req.json(body);
        let resp = req.send().await?;
        let status = resp.status();
        if status.is_success() {
            Ok(())
        } else {
            let text = resp.text().await.unwrap_or_default();
            Err(crate::types::error::Error::Server {
                body: text.to_string(),
                status,
            })
        }
    }

    #[doc = "Bulk Update custom object records\n\nBulk Updated a specific custom object records\n\n**Parameters:**\n\n- `custom_object_api_name: &'astr` (required)\n\n```rust,no_run\nasync fn example_custom_object_records_bulk_update_custom_objects_custom_object_api_name_records(\n) -> anyhow::Result<()> {\n    let client = rippling_api::Client::new_from_env();\n    let result: Vec<rippling_api::types::BulkUpdateCustomObjectsCustomObjectApiNameRecordsResponse> =\n        client\n            .custom_object_records()\n            .bulk_update_custom_objects_custom_object_api_name_records(\n                \"some-string\",\n                &rippling_api::types::BulkUpdateCustomObjectsCustomObjectApiNameRecordsRequestBody {\n                    rows_to_update: Some(vec![rippling_api::types::RowsToUpdate {\n                        name: Some(\"some-string\".to_string()),\n                        field_api_name: Some(\"some-string\".to_string()),\n                    }]),\n                    all_or_nothing: Some(false),\n                },\n            )\n            .await?;\n    println!(\"{:?}\", result);\n    Ok(())\n}\n```"]
    #[tracing::instrument]
    pub async fn bulk_update_custom_objects_custom_object_api_name_records<'a>(
        &'a self,
        custom_object_api_name: &'a str,
        body: &crate::types::BulkUpdateCustomObjectsCustomObjectApiNameRecordsRequestBody,
    ) -> Result<
        Vec<crate::types::BulkUpdateCustomObjectsCustomObjectApiNameRecordsResponse>,
        crate::types::error::Error,
    > {
        let mut req = self.client.client.request(
            http::Method::PATCH,
            format!(
                "{}/{}",
                self.client.base_url,
                "custom-objects/{custom_object_api_name}/records/bulk"
                    .replace("{custom_object_api_name}", custom_object_api_name)
            ),
        );
        req = req.bearer_auth(&self.client.token);
        req = req.json(body);
        let resp = req.send().await?;
        let status = resp.status();
        if status.is_success() {
            let text = resp.text().await.unwrap_or_default();
            serde_json::from_str(&text).map_err(|err| {
                crate::types::error::Error::from_serde_error(
                    format_serde_error::SerdeError::new(text.to_string(), err),
                    status,
                )
            })
        } else {
            let text = resp.text().await.unwrap_or_default();
            Err(crate::types::error::Error::Server {
                body: text.to_string(),
                status,
            })
        }
    }
}