@sylphx/sdk 0.32.2 → 0.32.3

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.
package/dist/notify.d.ts CHANGED
@@ -1,6 +1,24 @@
1
1
  import * as runtime from './runtime.js';
2
2
  import './common.js';
3
3
  import type * as common from './common.js';
4
+ /**
5
+ * Apply or reconcile the SAME operation after a lost response. Resupply a
6
+ * current token with the same operation id and route; readback precedes retry.
7
+ * Credentials are removed before hashing/persistence. No unattended credential
8
+ * refresh or background retry occurs; the provider continues executing calls.
9
+ */
10
+ export interface ApplyPhoneNumberRouteRequest {
11
+ /** Connected line. */
12
+ name: string;
13
+ /** Stable logical operation id. A different route needs a different id. */
14
+ operationId: string;
15
+ /** Desired voicemail settings. */
16
+ voicemail: PhoneVoicemailRoute;
17
+ /** Transient provider session; excluded from every durable command/hash. */
18
+ providerSessionToken: string;
19
+ /** Validate without provider or database mutation. */
20
+ validateOnly?: boolean;
21
+ }
4
22
  /** The request of ArchiveInboxItem. */
5
23
  export interface ArchiveInboxItemRequest {
6
24
  /** The name of the inbox item. */
@@ -82,6 +100,23 @@ export interface ChannelDelivery {
82
100
  /** Hand-off attempts so far. */
83
101
  readonly attempts?: number;
84
102
  }
103
+ /** Connect an existing owned line; no provider mutation occurs. */
104
+ export interface ConnectPhoneNumberRequest {
105
+ /** Tenant environment. */
106
+ parent: string;
107
+ /** Stable caller-chosen id; retries reuse this id. */
108
+ phoneNumberId: string;
109
+ /** Existing E.164 number. */
110
+ phoneNumber: string;
111
+ /**
112
+ * Existing provider session, held only for this synchronous request. Never
113
+ * stored, logged, included in command hashes, or refreshed. Issuer lifetime
114
+ * is provider-owned; transient custody does not assert a shorter lifetime.
115
+ */
116
+ providerSessionToken: string;
117
+ /** Validate ownership/config without creating a binding. */
118
+ validateOnly?: boolean;
119
+ }
85
120
  /** The request of CreateBroadcast. */
86
121
  export interface CreateBroadcastRequest {
87
122
  /** The parent to create in. */
@@ -520,6 +555,11 @@ export interface GetMessageTopicRequest {
520
555
  /** The name of the message topic to get. */
521
556
  name: string;
522
557
  }
558
+ /** Get a connected line's persisted observations; probe performs fresh provider reads. */
559
+ export interface GetPhoneNumberRequest {
560
+ /** Resource to read. */
561
+ name: string;
562
+ }
523
563
  /** The request of GetPreference. */
524
564
  export interface GetPreferenceRequest {
525
565
  /** The name of the preference to get. */
@@ -877,6 +917,22 @@ export interface ListMessagesResponse {
877
917
  /** The token of the next page; empty on the last page. */
878
918
  nextPageToken?: string;
879
919
  }
920
+ /** List connected lines in one environment. */
921
+ export interface ListPhoneNumbersRequest {
922
+ /** Tenant environment. */
923
+ parent: string;
924
+ /** Page size, default 50, maximum 1000. */
925
+ pageSize?: number;
926
+ /** Continuation token. */
927
+ pageToken?: string;
928
+ }
929
+ /** One page of connected lines. */
930
+ export interface ListPhoneNumbersResponse {
931
+ /** Connected lines. */
932
+ phoneNumbers?: PhoneNumber[];
933
+ /** Continuation token. */
934
+ nextPageToken?: string;
935
+ }
880
936
  /** The request of ListPreferences. */
881
937
  export interface ListPreferencesRequest {
882
938
  /** The parent to list in. */
@@ -1367,6 +1423,88 @@ export interface MessageTopic {
1367
1423
  */
1368
1424
  sendLimitWindow?: string;
1369
1425
  }
1426
+ /**
1427
+ * A connected, existing provider-managed telephone line. The provider answers
1428
+ * calls and records voicemail; Notify controls its route on demand. Connecting
1429
+ * never orders a number or changes a provider subscription.
1430
+ */
1431
+ export interface PhoneNumber {
1432
+ /** The resource name. */
1433
+ name?: string;
1434
+ /** Immutable pnum_ identifier. */
1435
+ readonly uid?: string;
1436
+ /** Resource metadata. */
1437
+ meta?: common.ResourceMeta;
1438
+ /** The connected line and desired voicemail route. */
1439
+ spec?: PhoneNumberSpec;
1440
+ /** Authoritative observations, with route application separate from incoming verification. */
1441
+ readonly status?: PhoneNumberStatus;
1442
+ }
1443
+ /** A line-scoped provider receipt, without caller identity or stored audio. */
1444
+ export interface PhoneNumberReceipt {
1445
+ /** Provider's stable call identifier, scoped to this connected line. */
1446
+ providerCallId?: string;
1447
+ /** Original provider time. A timezone-free string is not a verified timestamp. */
1448
+ providerDate?: string;
1449
+ /** Set only when the provider timestamp carries an established offset. */
1450
+ receiveTime?: string;
1451
+ /** Applied route generation attributable to this receipt, or zero. */
1452
+ generation?: string;
1453
+ /** SHA-256 of the exact provider recording bytes. */
1454
+ audioSha256?: string;
1455
+ /** Intended Notify mailbox's inbound email holding an identical attachment. */
1456
+ inboundEmail?: string;
1457
+ /** Incoming proof; never true from configuration alone. */
1458
+ verified?: boolean;
1459
+ /** Safe hash of the actual call-path configuration at observation. */
1460
+ pathDigest?: string;
1461
+ }
1462
+ /** Desired state of an existing provider-managed line. */
1463
+ export interface PhoneNumberSpec {
1464
+ /** Existing E.164 number, verified against authenticated provider inventory. */
1465
+ phoneNumber?: string;
1466
+ /** Provider adapter; currently switchboard_free. */
1467
+ provider?: string;
1468
+ /** Desired route, admitted only through applyRoute with a durable operation id. */
1469
+ voicemail?: PhoneVoicemailRoute;
1470
+ }
1471
+ /** Observed state. A stored configuration alone never verifies incoming calls. */
1472
+ export interface PhoneNumberStatus {
1473
+ /** Generation represented by these observations. */
1474
+ readonly observedGeneration?: string;
1475
+ /** Connected, RouteApplied and IncomingVerified are independent conditions. */
1476
+ readonly conditions?: common.Condition[];
1477
+ /** Opaque hash of the provider-accepted session principal; never its login name. */
1478
+ readonly providerPrincipal?: string;
1479
+ /** Immutable provider line identity. */
1480
+ readonly providerLineId?: string;
1481
+ /** Immutable provider number identity. */
1482
+ readonly providerNumberId?: string;
1483
+ /** Last provider readback, independent of desired state. */
1484
+ readonly observedVoicemail?: PhoneVoicemailRoute;
1485
+ /** Generation confirmed by provider readback. */
1486
+ readonly appliedGeneration?: string;
1487
+ /** Generation with a scoped incoming voicemail recording delivered to its intended mailbox. */
1488
+ readonly incomingVerifiedGeneration?: string;
1489
+ /** Safe error classification; never a provider body or credential. */
1490
+ readonly lastError?: string;
1491
+ /** Safe hash of the full last-observed provider call-path configuration. */
1492
+ readonly observedPathDigest?: string;
1493
+ /** Incoming-proof baseline, cleared on observed external path changes. */
1494
+ readonly appliedPathDigest?: string;
1495
+ }
1496
+ /** Only these fields are changed; existing redirects, hours and prompts survive. */
1497
+ export interface PhoneVoicemailRoute {
1498
+ /** Whether voicemail is enabled. */
1499
+ enabled?: boolean;
1500
+ /**
1501
+ * Provider wait before offering voicemail, in seconds; at most 600.
1502
+ * Forced transfer is separate provider configuration and is preserved.
1503
+ */
1504
+ delaySeconds?: number;
1505
+ /** Intended recording-delivery address. */
1506
+ emailAddress?: string;
1507
+ }
1370
1508
  /**
1371
1509
  * A Preference is a recipient's choice for one topic: which channels may carry
1372
1510
  * it. Admission honors it, and unsubscribe links write it. The id is the
@@ -1387,6 +1525,27 @@ export interface Preference {
1387
1525
  */
1388
1526
  digestInterval?: string;
1389
1527
  }
1528
+ /** Fetch current config and a bounded day-window of line-scoped incoming receipts. */
1529
+ export interface ProbePhoneNumberRequest {
1530
+ /** Connected line. */
1531
+ name: string;
1532
+ /** First provider-local calendar day, YYYY-MM-DD. */
1533
+ startDay: string;
1534
+ /** Last day inclusive; at most one day after start_day. */
1535
+ endDay: string;
1536
+ /** Transient provider session. */
1537
+ providerSessionToken: string;
1538
+ }
1539
+ /**
1540
+ * Fresh provider observations and receipts. Unknown date encoding or missing
1541
+ * identical delivered audio leaves IncomingVerified false.
1542
+ */
1543
+ export interface ProbePhoneNumberResponse {
1544
+ /** Connected line after readback. */
1545
+ phoneNumber?: PhoneNumber;
1546
+ /** Provider-backed voicemail receipts. */
1547
+ receipts?: PhoneNumberReceipt[];
1548
+ }
1390
1549
  /** Push content. */
1391
1550
  export interface PushContent {
1392
1551
  /** The title. */
@@ -1416,6 +1575,29 @@ export interface PushSender {
1416
1575
  /** The bundle id, package name, or web origin. */
1417
1576
  appKey?: string;
1418
1577
  }
1578
+ /**
1579
+ * Read provider audio for an already observed line-scoped receipt. No arbitrary
1580
+ * provider ID can be used as a lookup into another tenant or provider line.
1581
+ */
1582
+ export interface ReadPhoneNumberVoicemailRequest {
1583
+ /** Connected line. */
1584
+ name: string;
1585
+ /** Stable provider receipt id already held by this line. */
1586
+ providerCallId: string;
1587
+ /** Day window to re-establish receipt ownership. */
1588
+ startDay: string;
1589
+ /** Last day inclusive, at most one day after start_day. */
1590
+ endDay: string;
1591
+ /** Transient provider session. */
1592
+ providerSessionToken: string;
1593
+ }
1594
+ /** Audio is returned on demand and never persisted by this integration. */
1595
+ export interface ReadPhoneNumberVoicemailResponse {
1596
+ /** Exact provider recording bytes, maximum 2 MiB. */
1597
+ audio?: string;
1598
+ /** SHA-256 of those bytes. */
1599
+ audioSha256?: string;
1600
+ }
1419
1601
  /**
1420
1602
  * A Recipient is one of a customer's users, across channels: email addresses,
1421
1603
  * phone numbers, and device tokens. Dead device tokens are pruned from
@@ -1858,6 +2040,8 @@ export type SuppressionReason = 'bounce' | 'complaint' | 'carrier_opt_out' | 'un
1858
2040
  * Namespace of Sylphx Notify on `Sylphx`.
1859
2041
  */
1860
2042
  export declare class NotifyApi {
2043
+ /** The `phone_numbers` collection. */
2044
+ readonly phoneNumbers: PhoneNumbersCollection;
1861
2045
  /** The `mail_domains` collection. */
1862
2046
  readonly mailDomains: MailDomainsCollection;
1863
2047
  /** The `mail_routes` collection. */
@@ -1894,6 +2078,61 @@ export declare class NotifyApi {
1894
2078
  readonly inboundSms: InboundSmsCollection;
1895
2079
  constructor(client: runtime.Client);
1896
2080
  }
2081
+ /** `phone_numbers` of Sylphx Notify: Resource type `notify.sylphx.com/PhoneNumber`. */
2082
+ export declare class PhoneNumbersCollection {
2083
+ private readonly client;
2084
+ constructor(client: runtime.Client);
2085
+ /**
2086
+ * ConnectPhoneNumber: existing provider-managed lines; execution credentials are transient.
2087
+ *
2088
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/phone_numbers:connect` · permission `notify:write` · effect `write`
2089
+ *
2090
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
2091
+ */
2092
+ connect(request: ConnectPhoneNumberRequest): Promise<PhoneNumber>;
2093
+ /**
2094
+ * GetPhoneNumber: existing provider-managed lines; execution credentials are transient.
2095
+ *
2096
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/phone_numbers/*}` · permission `notify:read` · effect `read`
2097
+ *
2098
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
2099
+ */
2100
+ get(request: GetPhoneNumberRequest): Promise<PhoneNumber>;
2101
+ /**
2102
+ * ListPhoneNumbers: existing provider-managed lines; execution credentials are transient.
2103
+ *
2104
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/phone_numbers` · permission `notify:read` · effect `read`
2105
+ *
2106
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
2107
+ */
2108
+ list(request: ListPhoneNumbersRequest): Promise<ListPhoneNumbersResponse>;
2109
+ /** Every item of every page of `list`. */
2110
+ listAll(request: ListPhoneNumbersRequest): AsyncGenerator<PhoneNumber>;
2111
+ /**
2112
+ * ApplyPhoneNumberRoute: existing provider-managed lines; execution credentials are transient.
2113
+ *
2114
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/phone_numbers/*}:applyRoute` · permission `notify:write` · effect `write`
2115
+ *
2116
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
2117
+ */
2118
+ applyRoute(request: ApplyPhoneNumberRouteRequest): Promise<PhoneNumber>;
2119
+ /**
2120
+ * ProbePhoneNumber: existing provider-managed lines; execution credentials are transient.
2121
+ *
2122
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/phone_numbers/*}:probe` · permission `notify:write` · effect `write`
2123
+ *
2124
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
2125
+ */
2126
+ probe(request: ProbePhoneNumberRequest): Promise<ProbePhoneNumberResponse>;
2127
+ /**
2128
+ * ReadPhoneNumberVoicemail: existing provider-managed lines; execution credentials are transient.
2129
+ *
2130
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/phone_numbers/*}:readVoicemail` · permission `notify:read` · effect `read`
2131
+ *
2132
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
2133
+ */
2134
+ readVoicemail(request: ReadPhoneNumberVoicemailRequest): Promise<ReadPhoneNumberVoicemailResponse>;
2135
+ }
1897
2136
  /** `mail_domains` of Sylphx Notify: Resource type `notify.sylphx.com/EmailDomain`. */
1898
2137
  export declare class MailDomainsCollection {
1899
2138
  private readonly client;
package/dist/notify.js CHANGED
@@ -3,6 +3,12 @@
3
3
  import * as runtime from './runtime.js';
4
4
  import './common.js';
5
5
  runtime.registerSchemas({
6
+ 'sylphx.notify.v1.ApplyPhoneNumberRouteRequest': [
7
+ ['operationId', 'operation_id'],
8
+ ['voicemail', 'voicemail', 'sylphx.notify.v1.PhoneVoicemailRoute'],
9
+ ['providerSessionToken', 'provider_session_token'],
10
+ ['validateOnly', 'validate_only'],
11
+ ],
6
12
  'sylphx.notify.v1.ArchiveInboxItemRequest': [],
7
13
  'sylphx.notify.v1.Broadcast': [
8
14
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
@@ -29,6 +35,12 @@ runtime.registerSchemas({
29
35
  ['errorCode', 'error_code'],
30
36
  ['providerResponse', 'provider_response'],
31
37
  ],
38
+ 'sylphx.notify.v1.ConnectPhoneNumberRequest': [
39
+ ['phoneNumberId', 'phone_number_id'],
40
+ ['phoneNumber', 'phone_number'],
41
+ ['providerSessionToken', 'provider_session_token'],
42
+ ['validateOnly', 'validate_only'],
43
+ ],
32
44
  'sylphx.notify.v1.CreateBroadcastRequest': [
33
45
  ['broadcastId', 'broadcast_id'],
34
46
  ['broadcast', 'broadcast', 'sylphx.notify.v1.Broadcast'],
@@ -177,6 +189,7 @@ runtime.registerSchemas({
177
189
  'sylphx.notify.v1.GetMailboxRequest': [],
178
190
  'sylphx.notify.v1.GetMessageRequest': [],
179
191
  'sylphx.notify.v1.GetMessageTopicRequest': [],
192
+ 'sylphx.notify.v1.GetPhoneNumberRequest': [],
180
193
  'sylphx.notify.v1.GetPreferenceRequest': [],
181
194
  'sylphx.notify.v1.GetRecipientRequest': [],
182
195
  'sylphx.notify.v1.GetRouteRequest': [],
@@ -302,6 +315,14 @@ runtime.registerSchemas({
302
315
  ['messages', 'messages', 'sylphx.notify.v1.Message'],
303
316
  ['nextPageToken', 'next_page_token'],
304
317
  ],
318
+ 'sylphx.notify.v1.ListPhoneNumbersRequest': [
319
+ ['pageSize', 'page_size'],
320
+ ['pageToken', 'page_token'],
321
+ ],
322
+ 'sylphx.notify.v1.ListPhoneNumbersResponse': [
323
+ ['phoneNumbers', 'phone_numbers', 'sylphx.notify.v1.PhoneNumber'],
324
+ ['nextPageToken', 'next_page_token'],
325
+ ],
305
326
  'sylphx.notify.v1.ListPreferencesRequest': [
306
327
  ['pageSize', 'page_size'],
307
328
  ['pageToken', 'page_token'],
@@ -448,10 +469,53 @@ runtime.registerSchemas({
448
469
  ['sendLimitFeature', 'send_limit_feature'],
449
470
  ['sendLimitWindow', 'send_limit_window'],
450
471
  ],
472
+ 'sylphx.notify.v1.PhoneNumber': [
473
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
474
+ ['spec', 'spec', 'sylphx.notify.v1.PhoneNumberSpec'],
475
+ ['status', 'status', 'sylphx.notify.v1.PhoneNumberStatus'],
476
+ ],
477
+ 'sylphx.notify.v1.PhoneNumberReceipt': [
478
+ ['providerCallId', 'provider_call_id'],
479
+ ['providerDate', 'provider_date'],
480
+ ['receiveTime', 'receive_time'],
481
+ ['audioSha256', 'audio_sha256'],
482
+ ['inboundEmail', 'inbound_email'],
483
+ ['pathDigest', 'path_digest'],
484
+ ],
485
+ 'sylphx.notify.v1.PhoneNumberSpec': [
486
+ ['phoneNumber', 'phone_number'],
487
+ ['voicemail', 'voicemail', 'sylphx.notify.v1.PhoneVoicemailRoute'],
488
+ ],
489
+ 'sylphx.notify.v1.PhoneNumberStatus': [
490
+ ['observedGeneration', 'observed_generation'],
491
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
492
+ ['providerPrincipal', 'provider_principal'],
493
+ ['providerLineId', 'provider_line_id'],
494
+ ['providerNumberId', 'provider_number_id'],
495
+ ['observedVoicemail', 'observed_voicemail', 'sylphx.notify.v1.PhoneVoicemailRoute'],
496
+ ['appliedGeneration', 'applied_generation'],
497
+ ['incomingVerifiedGeneration', 'incoming_verified_generation'],
498
+ ['lastError', 'last_error'],
499
+ ['observedPathDigest', 'observed_path_digest'],
500
+ ['appliedPathDigest', 'applied_path_digest'],
501
+ ],
502
+ 'sylphx.notify.v1.PhoneVoicemailRoute': [
503
+ ['delaySeconds', 'delay_seconds'],
504
+ ['emailAddress', 'email_address'],
505
+ ],
451
506
  'sylphx.notify.v1.Preference': [
452
507
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
453
508
  ['digestInterval', 'digest_interval'],
454
509
  ],
510
+ 'sylphx.notify.v1.ProbePhoneNumberRequest': [
511
+ ['startDay', 'start_day'],
512
+ ['endDay', 'end_day'],
513
+ ['providerSessionToken', 'provider_session_token'],
514
+ ],
515
+ 'sylphx.notify.v1.ProbePhoneNumberResponse': [
516
+ ['phoneNumber', 'phone_number', 'sylphx.notify.v1.PhoneNumber'],
517
+ ['receipts', 'receipts', 'sylphx.notify.v1.PhoneNumberReceipt'],
518
+ ],
455
519
  'sylphx.notify.v1.PushContent': [
456
520
  ['data', 'data', undefined, 'json'],
457
521
  ],
@@ -462,6 +526,15 @@ runtime.registerSchemas({
462
526
  'sylphx.notify.v1.PushSender': [
463
527
  ['appKey', 'app_key'],
464
528
  ],
529
+ 'sylphx.notify.v1.ReadPhoneNumberVoicemailRequest': [
530
+ ['providerCallId', 'provider_call_id'],
531
+ ['startDay', 'start_day'],
532
+ ['endDay', 'end_day'],
533
+ ['providerSessionToken', 'provider_session_token'],
534
+ ],
535
+ 'sylphx.notify.v1.ReadPhoneNumberVoicemailResponse': [
536
+ ['audioSha256', 'audio_sha256'],
537
+ ],
465
538
  'sylphx.notify.v1.Recipient': [
466
539
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
467
540
  ['externalKey', 'external_key'],
@@ -630,6 +703,8 @@ runtime.registerSchemas({
630
703
  * Namespace of Sylphx Notify on `Sylphx`.
631
704
  */
632
705
  export class NotifyApi {
706
+ /** The `phone_numbers` collection. */
707
+ phoneNumbers;
633
708
  /** The `mail_domains` collection. */
634
709
  mailDomains;
635
710
  /** The `mail_routes` collection. */
@@ -665,6 +740,7 @@ export class NotifyApi {
665
740
  /** The `inbound_sms` collection. */
666
741
  inboundSms;
667
742
  constructor(client) {
743
+ this.phoneNumbers = new PhoneNumbersCollection(client);
668
744
  this.mailDomains = new MailDomainsCollection(client);
669
745
  this.mailRoutes = new MailRoutesCollection(client);
670
746
  this.senders = new SendersCollection(client);
@@ -684,6 +760,123 @@ export class NotifyApi {
684
760
  this.inboundSms = new InboundSmsCollection(client);
685
761
  }
686
762
  }
763
+ /** `phone_numbers` of Sylphx Notify: Resource type `notify.sylphx.com/PhoneNumber`. */
764
+ export class PhoneNumbersCollection {
765
+ client;
766
+ constructor(client) {
767
+ this.client = client;
768
+ }
769
+ /**
770
+ * ConnectPhoneNumber: existing provider-managed lines; execution credentials are transient.
771
+ *
772
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/phone_numbers:connect` · permission `notify:write` · effect `write`
773
+ *
774
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
775
+ */
776
+ async connect(request) {
777
+ return this.client.call({
778
+ method: 'POST',
779
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/phone_numbers:connect`,
780
+ body: runtime.omit(request, ['parent']),
781
+ bodyType: 'sylphx.notify.v1.ConnectPhoneNumberRequest',
782
+ responseType: 'sylphx.notify.v1.PhoneNumber',
783
+ mutation: true,
784
+ });
785
+ }
786
+ /**
787
+ * GetPhoneNumber: existing provider-managed lines; execution credentials are transient.
788
+ *
789
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/phone_numbers/*}` · permission `notify:read` · effect `read`
790
+ *
791
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
792
+ */
793
+ async get(request) {
794
+ return this.client.call({
795
+ method: 'GET',
796
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/phone_numbers/*', 'name')}`,
797
+ responseType: 'sylphx.notify.v1.PhoneNumber',
798
+ mutation: false,
799
+ });
800
+ }
801
+ /**
802
+ * ListPhoneNumbers: existing provider-managed lines; execution credentials are transient.
803
+ *
804
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/phone_numbers` · permission `notify:read` · effect `read`
805
+ *
806
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
807
+ */
808
+ async list(request) {
809
+ return this.client.call({
810
+ method: 'GET',
811
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/phone_numbers`,
812
+ query: { page_size: request.pageSize, page_token: request.pageToken },
813
+ responseType: 'sylphx.notify.v1.ListPhoneNumbersResponse',
814
+ mutation: false,
815
+ });
816
+ }
817
+ /** Every item of every page of `list`. */
818
+ async *listAll(request) {
819
+ let next = request;
820
+ for (;;) {
821
+ const page = await this.list(next);
822
+ yield* page.phoneNumbers ?? [];
823
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
824
+ return;
825
+ next = { ...request, pageToken: page.nextPageToken };
826
+ }
827
+ }
828
+ /**
829
+ * ApplyPhoneNumberRoute: existing provider-managed lines; execution credentials are transient.
830
+ *
831
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/phone_numbers/*}:applyRoute` · permission `notify:write` · effect `write`
832
+ *
833
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
834
+ */
835
+ async applyRoute(request) {
836
+ return this.client.call({
837
+ method: 'POST',
838
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/phone_numbers/*', 'name')}:applyRoute`,
839
+ body: runtime.omit(request, ['name']),
840
+ bodyType: 'sylphx.notify.v1.ApplyPhoneNumberRouteRequest',
841
+ responseType: 'sylphx.notify.v1.PhoneNumber',
842
+ mutation: true,
843
+ });
844
+ }
845
+ /**
846
+ * ProbePhoneNumber: existing provider-managed lines; execution credentials are transient.
847
+ *
848
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/phone_numbers/*}:probe` · permission `notify:write` · effect `write`
849
+ *
850
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
851
+ */
852
+ async probe(request) {
853
+ return this.client.call({
854
+ method: 'POST',
855
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/phone_numbers/*', 'name')}:probe`,
856
+ body: runtime.omit(request, ['name']),
857
+ bodyType: 'sylphx.notify.v1.ProbePhoneNumberRequest',
858
+ responseType: 'sylphx.notify.v1.ProbePhoneNumberResponse',
859
+ mutation: true,
860
+ });
861
+ }
862
+ /**
863
+ * ReadPhoneNumberVoicemail: existing provider-managed lines; execution credentials are transient.
864
+ *
865
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/phone_numbers/*}:readVoicemail` · permission `notify:read` · effect `read`
866
+ *
867
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
868
+ */
869
+ async readVoicemail(request) {
870
+ return this.client.call({
871
+ method: 'POST',
872
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/phone_numbers/*', 'name')}:readVoicemail`,
873
+ body: runtime.omit(request, ['name']),
874
+ bodyType: 'sylphx.notify.v1.ReadPhoneNumberVoicemailRequest',
875
+ responseType: 'sylphx.notify.v1.ReadPhoneNumberVoicemailResponse',
876
+ mutation: true,
877
+ });
878
+ }
879
+ }
687
880
  /** `mail_domains` of Sylphx Notify: Resource type `notify.sylphx.com/EmailDomain`. */
688
881
  export class MailDomainsCollection {
689
882
  client;