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
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
use anyhow::Result;

use crate::Client;

pub struct IdentityProviders {
    pub client: Client,
}

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

    /**
     * List Identity Providers.
     *
     * This function performs a `GET` to the `/api/v1/idps` endpoint.
     *
     * Enumerates IdPs in your organization with pagination. A subset of IdPs can be returned that match a supported filter expression or query.
     *
     * **Parameters:**
     *
     * * `q: &str` -- Searches the name property of IdPs for matching value.
     * * `after: &str` -- Specifies the pagination cursor for the next page of IdPs.
     * * `limit: i64` -- Specifies the number of IdP results in a page.
     * * `type_: &str` -- Filters IdPs by type.
     */
    pub async fn list(
        &self,
        q: &str,
        after: &str,
        limit: i64,
        type_: &str,
    ) -> Result<Vec<crate::types::IdentityProvider>> {
        let mut query_args: Vec<(String, String)> = Default::default();
        if !after.is_empty() {
            query_args.push(("after".to_string(), after.to_string()));
        }
        if limit > 0 {
            query_args.push(("limit".to_string(), limit.to_string()));
        }
        if !q.is_empty() {
            query_args.push(("q".to_string(), q.to_string()));
        }
        if !type_.is_empty() {
            query_args.push(("type".to_string(), type_.to_string()));
        }
        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
        let url = format!("/api/v1/idps?{}", query_);

        self.client.get(&url, None).await
    }

    /**
     * List Identity Providers.
     *
     * This function performs a `GET` to the `/api/v1/idps` endpoint.
     *
     * As opposed to `list`, this function returns all the pages of the request at once.
     *
     * Enumerates IdPs in your organization with pagination. A subset of IdPs can be returned that match a supported filter expression or query.
     */
    pub async fn list_all(
        &self,
        q: &str,
        type_: &str,
    ) -> Result<Vec<crate::types::IdentityProvider>> {
        let mut query_args: Vec<(String, String)> = Default::default();
        if !q.is_empty() {
            query_args.push(("q".to_string(), q.to_string()));
        }
        if !type_.is_empty() {
            query_args.push(("type".to_string(), type_.to_string()));
        }
        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
        let url = format!("/api/v1/idps?{}", query_);

        self.client.get_all_pages(&url, None).await
    }

    /**
     * Add Identity Provider.
     *
     * This function performs a `POST` to the `/api/v1/idps` endpoint.
     *
     * Adds a new IdP to your organization.
     */
    pub async fn create(
        &self,
        body: &crate::types::IdentityProvider,
    ) -> Result<crate::types::IdentityProvider> {
        let url = "/api/v1/idps".to_string();
        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * List Keys.
     *
     * This function performs a `GET` to the `/api/v1/idps/credentials/keys` endpoint.
     *
     * Enumerates IdP key credentials.
     *
     * **Parameters:**
     *
     * * `after: &str` -- Specifies the pagination cursor for the next page of keys.
     * * `limit: i64` -- Specifies the number of key results in a page.
     */
    pub async fn list_keys(
        &self,
        after: &str,
        limit: i64,
    ) -> Result<Vec<crate::types::JsonWebKey>> {
        let mut query_args: Vec<(String, String)> = Default::default();
        if !after.is_empty() {
            query_args.push(("after".to_string(), after.to_string()));
        }
        if limit > 0 {
            query_args.push(("limit".to_string(), limit.to_string()));
        }
        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
        let url = format!("/api/v1/idps/credentials/keys?{}", query_);

        self.client.get(&url, None).await
    }

    /**
     * List Keys.
     *
     * This function performs a `GET` to the `/api/v1/idps/credentials/keys` endpoint.
     *
     * As opposed to `list_keys`, this function returns all the pages of the request at once.
     *
     * Enumerates IdP key credentials.
     */
    pub async fn list_all_keys(&self) -> Result<Vec<crate::types::JsonWebKey>> {
        let url = "/api/v1/idps/credentials/keys".to_string();
        self.client.get_all_pages(&url, None).await
    }

    /**
     * Add X.509 Certificate Public Key.
     *
     * This function performs a `POST` to the `/api/v1/idps/credentials/keys` endpoint.
     *
     * Adds a new X.509 certificate credential to the IdP key store.
     */
    pub async fn create_key(
        &self,
        body: &crate::types::JsonWebKey,
    ) -> Result<crate::types::JsonWebKey> {
        let url = "/api/v1/idps/credentials/keys".to_string();
        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * Get Key.
     *
     * This function performs a `GET` to the `/api/v1/idps/credentials/keys/{keyId}` endpoint.
     *
     * Gets a specific IdP Key Credential by `kid`
     *
     * **Parameters:**
     *
     * * `key_id: &str`
     */
    pub async fn get_key(&self, key_id: &str) -> Result<crate::types::JsonWebKey> {
        let url = format!(
            "/api/v1/idps/credentials/keys/{}",
            crate::progenitor_support::encode_path(&key_id.to_string()),
        );

        self.client.get(&url, None).await
    }

    /**
     * Delete Key.
     *
     * This function performs a `DELETE` to the `/api/v1/idps/credentials/keys/{keyId}` endpoint.
     *
     * Deletes a specific IdP Key Credential by `kid` if it is not currently being used by an Active or Inactive IdP.
     *
     * **Parameters:**
     *
     * * `key_id: &str`
     */
    pub async fn delete_key(&self, key_id: &str) -> Result<()> {
        let url = format!(
            "/api/v1/idps/credentials/keys/{}",
            crate::progenitor_support::encode_path(&key_id.to_string()),
        );

        self.client.delete(&url, None).await
    }

    /**
     * Get Identity Provider.
     *
     * This function performs a `GET` to the `/api/v1/idps/{idpId}` endpoint.
     *
     * Fetches an IdP by `id`.
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     */
    pub async fn get(&self, idp_id: &str) -> Result<crate::types::IdentityProvider> {
        let url = format!(
            "/api/v1/idps/{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client.get(&url, None).await
    }

    /**
     * Update Identity Provider.
     *
     * This function performs a `PUT` to the `/api/v1/idps/{idpId}` endpoint.
     *
     * Updates the configuration for an IdP.
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     */
    pub async fn update(
        &self,
        idp_id: &str,
        body: &crate::types::IdentityProvider,
    ) -> Result<crate::types::IdentityProvider> {
        let url = format!(
            "/api/v1/idps/{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client
            .put(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * Delete Identity Provider.
     *
     * This function performs a `DELETE` to the `/api/v1/idps/{idpId}` endpoint.
     *
     * Removes an IdP from your organization.
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     */
    pub async fn delete(&self, idp_id: &str) -> Result<()> {
        let url = format!(
            "/api/v1/idps/{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client.delete(&url, None).await
    }

    /**
     * List Certificate Signing Requests for IdP.
     *
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/credentials/csrs` endpoint.
     *
     * Enumerates Certificate Signing Requests for an IdP
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     */
    pub async fn list_csrs_fors(&self, idp_id: &str) -> Result<Vec<crate::types::Csr>> {
        let url = format!(
            "/api/v1/idps/{}/credentials/csrs",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client.get(&url, None).await
    }

    /**
     * List Certificate Signing Requests for IdP.
     *
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/credentials/csrs` endpoint.
     *
     * As opposed to `list_csrs_for`, this function returns all the pages of the request at once.
     *
     * Enumerates Certificate Signing Requests for an IdP
     */
    pub async fn list_all_csrs_fors(&self, idp_id: &str) -> Result<Vec<crate::types::Csr>> {
        let url = format!(
            "/api/v1/idps/{}/credentials/csrs",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client.get_all_pages(&url, None).await
    }

    /**
     * Generate Certificate Signing Request for IdP.
     *
     * This function performs a `POST` to the `/api/v1/idps/{idpId}/credentials/csrs` endpoint.
     *
     * Generates a new key pair and returns a Certificate Signing Request for it.
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     */
    pub async fn generate_csr_for(
        &self,
        idp_id: &str,
        body: &crate::types::CsrMetadata,
    ) -> Result<crate::types::Csr> {
        let url = format!(
            "/api/v1/idps/{}/credentials/csrs",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/credentials/csrs/{csrId}` endpoint.
     *
     * Gets a specific Certificate Signing Request model by id
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     * * `csr_id: &str`
     */
    pub async fn get_csr_for(&self, idp_id: &str, csr_id: &str) -> Result<crate::types::Csr> {
        let url = format!(
            "/api/v1/idps/{}/credentials/csrs/{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            crate::progenitor_support::encode_path(&csr_id.to_string()),
        );

        self.client.get(&url, None).await
    }

    /**
     * This function performs a `DELETE` to the `/api/v1/idps/{idpId}/credentials/csrs/{csrId}` endpoint.
     *
     * Revoke a Certificate Signing Request and delete the key pair from the IdP
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     * * `csr_id: &str`
     */
    pub async fn revoke_csr_for(&self, idp_id: &str, csr_id: &str) -> Result<()> {
        let url = format!(
            "/api/v1/idps/{}/credentials/csrs/{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            crate::progenitor_support::encode_path(&csr_id.to_string()),
        );

        self.client.delete(&url, None).await
    }

    /**
     * This function performs a `POST` to the `/api/v1/idps/{idpId}/credentials/csrs/{csrId}/lifecycle/publish` endpoint.
     *
     * Update the Certificate Signing Request with a signed X.509 certificate and add it into the signing key credentials for the IdP.
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     * * `csr_id: &str`
     */
    pub async fn post_idp_credentials_csr_lifecycle_publish(
        &self,
        idp_id: &str,
        csr_id: &str,
    ) -> Result<crate::types::JsonWebKey> {
        let url = format!(
            "/api/v1/idps/{}/credentials/csrs/{}/lifecycle/publish",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            crate::progenitor_support::encode_path(&csr_id.to_string()),
        );

        self.client.post(&url, None).await
    }

    /**
     * List Signing Key Credentials for IdP.
     *
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/credentials/keys` endpoint.
     *
     * Enumerates signing key credentials for an IdP
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     */
    pub async fn list_signing_keys(&self, idp_id: &str) -> Result<Vec<crate::types::JsonWebKey>> {
        let url = format!(
            "/api/v1/idps/{}/credentials/keys",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client.get(&url, None).await
    }

    /**
     * List Signing Key Credentials for IdP.
     *
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/credentials/keys` endpoint.
     *
     * As opposed to `list_signing_keys`, this function returns all the pages of the request at once.
     *
     * Enumerates signing key credentials for an IdP
     */
    pub async fn list_all_signing_keys(
        &self,
        idp_id: &str,
    ) -> Result<Vec<crate::types::JsonWebKey>> {
        let url = format!(
            "/api/v1/idps/{}/credentials/keys",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client.get_all_pages(&url, None).await
    }

    /**
     * Generate New IdP Signing Key Credential.
     *
     * This function performs a `POST` to the `/api/v1/idps/{idpId}/credentials/keys/generate` endpoint.
     *
     * Generates a new X.509 certificate for an IdP signing key credential to be used for signing assertions sent to the IdP
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     * * `validity_years: i64` -- expiry of the IdP Key Credential.
     */
    pub async fn generate_signing_key(
        &self,
        idp_id: &str,
        validity_years: i64,
    ) -> Result<crate::types::JsonWebKey> {
        let mut query_args: Vec<(String, String)> = Default::default();
        if validity_years > 0 {
            query_args.push(("validityYears".to_string(), validity_years.to_string()));
        }
        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
        let url = format!(
            "/api/v1/idps/{}/credentials/keys/generate?{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            query_
        );

        self.client.post(&url, None).await
    }

    /**
     * Get Signing Key Credential for IdP.
     *
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/credentials/keys/{keyId}` endpoint.
     *
     * Gets a specific IdP Key Credential by `kid`
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     * * `key_id: &str`
     */
    pub async fn get_signing_key(
        &self,
        idp_id: &str,
        key_id: &str,
    ) -> Result<crate::types::JsonWebKey> {
        let url = format!(
            "/api/v1/idps/{}/credentials/keys/{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            crate::progenitor_support::encode_path(&key_id.to_string()),
        );

        self.client.get(&url, None).await
    }

    /**
     * Clone Signing Key Credential for IdP.
     *
     * This function performs a `POST` to the `/api/v1/idps/{idpId}/credentials/keys/{keyId}/clone` endpoint.
     *
     * Clones a X.509 certificate for an IdP signing key credential from a source IdP to target IdP
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     * * `key_id: &str`
     * * `target_idp_id: &str`
     */
    pub async fn clone_key(
        &self,
        idp_id: &str,
        key_id: &str,
        target_idp_id: &str,
    ) -> Result<crate::types::JsonWebKey> {
        let mut query_args: Vec<(String, String)> = Default::default();
        if !target_idp_id.is_empty() {
            query_args.push(("targetIdpId".to_string(), target_idp_id.to_string()));
        }
        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
        let url = format!(
            "/api/v1/idps/{}/credentials/keys/{}/clone?{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            crate::progenitor_support::encode_path(&key_id.to_string()),
            query_
        );

        self.client.post(&url, None).await
    }

    /**
     * Activate Identity Provider.
     *
     * This function performs a `POST` to the `/api/v1/idps/{idpId}/lifecycle/activate` endpoint.
     *
     * Activates an inactive IdP.
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     */
    pub async fn activate(&self, idp_id: &str) -> Result<crate::types::IdentityProvider> {
        let url = format!(
            "/api/v1/idps/{}/lifecycle/activate",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client.post(&url, None).await
    }

    /**
     * Deactivate Identity Provider.
     *
     * This function performs a `POST` to the `/api/v1/idps/{idpId}/lifecycle/deactivate` endpoint.
     *
     * Deactivates an active IdP.
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     */
    pub async fn deactivate(&self, idp_id: &str) -> Result<crate::types::IdentityProvider> {
        let url = format!(
            "/api/v1/idps/{}/lifecycle/deactivate",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client.post(&url, None).await
    }

    /**
     * Find Users.
     *
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/users` endpoint.
     *
     * Find all the users linked to an identity provider
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     */
    pub async fn list_application_users(
        &self,
        idp_id: &str,
    ) -> Result<Vec<crate::types::IdentityProviderApplicationUser>> {
        let url = format!(
            "/api/v1/idps/{}/users",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client.get(&url, None).await
    }

    /**
     * Find Users.
     *
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/users` endpoint.
     *
     * As opposed to `list_application_users`, this function returns all the pages of the request at once.
     *
     * Find all the users linked to an identity provider
     */
    pub async fn list_all_application_users(
        &self,
        idp_id: &str,
    ) -> Result<Vec<crate::types::IdentityProviderApplicationUser>> {
        let url = format!(
            "/api/v1/idps/{}/users",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
        );

        self.client.get_all_pages(&url, None).await
    }

    /**
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/users/{userId}` endpoint.
     *
     * Fetches a linked IdP user by ID
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     * * `user_id: &str`
     */
    pub async fn get_application_user(
        &self,
        idp_id: &str,
        user_id: &str,
    ) -> Result<crate::types::IdentityProviderApplicationUser> {
        let url = format!(
            "/api/v1/idps/{}/users/{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            crate::progenitor_support::encode_path(&user_id.to_string()),
        );

        self.client.get(&url, None).await
    }

    /**
     * Link a user to a Social IdP without a transaction.
     *
     * This function performs a `POST` to the `/api/v1/idps/{idpId}/users/{userId}` endpoint.
     *
     * Links an Okta user to an existing Social Identity Provider. This does not support the SAML2 Identity Provider Type
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     * * `user_id: &str`
     */
    pub async fn link_user(
        &self,
        idp_id: &str,
        user_id: &str,
        body: &crate::types::UserIdentityProviderLinkRequest,
    ) -> Result<crate::types::IdentityProviderApplicationUser> {
        let url = format!(
            "/api/v1/idps/{}/users/{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            crate::progenitor_support::encode_path(&user_id.to_string()),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * Unlink User from IdP.
     *
     * This function performs a `DELETE` to the `/api/v1/idps/{idpId}/users/{userId}` endpoint.
     *
     * Removes the link between the Okta user and the IdP user.
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     * * `user_id: &str`
     */
    pub async fn unlink_user_from(&self, idp_id: &str, user_id: &str) -> Result<()> {
        let url = format!(
            "/api/v1/idps/{}/users/{}",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            crate::progenitor_support::encode_path(&user_id.to_string()),
        );

        self.client.delete(&url, None).await
    }

    /**
     * Social Authentication Token Operation.
     *
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/users/{userId}/credentials/tokens` endpoint.
     *
     * Fetches the tokens minted by the Social Authentication Provider when the user authenticates with Okta via Social Auth.
     *
     * **Parameters:**
     *
     * * `idp_id: &str`
     * * `user_id: &str`
     */
    pub async fn list_social_auth_tokens(
        &self,
        idp_id: &str,
        user_id: &str,
    ) -> Result<Vec<crate::types::SocialAuthToken>> {
        let url = format!(
            "/api/v1/idps/{}/users/{}/credentials/tokens",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            crate::progenitor_support::encode_path(&user_id.to_string()),
        );

        self.client.get(&url, None).await
    }

    /**
     * Social Authentication Token Operation.
     *
     * This function performs a `GET` to the `/api/v1/idps/{idpId}/users/{userId}/credentials/tokens` endpoint.
     *
     * As opposed to `list_social_auth_tokens`, this function returns all the pages of the request at once.
     *
     * Fetches the tokens minted by the Social Authentication Provider when the user authenticates with Okta via Social Auth.
     */
    pub async fn list_all_social_auth_tokens(
        &self,
        idp_id: &str,
        user_id: &str,
    ) -> Result<Vec<crate::types::SocialAuthToken>> {
        let url = format!(
            "/api/v1/idps/{}/users/{}/credentials/tokens",
            crate::progenitor_support::encode_path(&idp_id.to_string()),
            crate::progenitor_support::encode_path(&user_id.to_string()),
        );

        self.client.get_all_pages(&url, None).await
    }
}