telnyx 5.151.0 → 5.153.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -533
  3. data/README.md +1 -1
  4. data/lib/telnyx/internal/cursor_flat_pagination.rb +106 -0
  5. data/lib/telnyx/models/advanced_order_create_params.rb +1 -86
  6. data/lib/telnyx/models/advanced_order_update_requirement_group_params.rb +1 -88
  7. data/lib/telnyx/models/dir/email_verification_status_wrapped.rb +82 -0
  8. data/lib/telnyx/models/dir/reference.rb +125 -0
  9. data/lib/telnyx/models/dir/reference_create_params.rb +43 -0
  10. data/lib/telnyx/models/dir/reference_input.rb +74 -0
  11. data/lib/telnyx/models/dir/reference_list.rb +18 -0
  12. data/lib/telnyx/models/dir/reference_list_params.rb +22 -0
  13. data/lib/telnyx/models/dir/reference_update_params.rb +103 -0
  14. data/lib/telnyx/models/dir/reference_update_response.rb +23 -0
  15. data/lib/telnyx/models/dir/verify_email_confirm_params.rb +31 -0
  16. data/lib/telnyx/models/dir/verify_email_create_params.rb +22 -0
  17. data/lib/telnyx/models/dir/verify_email_list_params.rb +22 -0
  18. data/lib/telnyx/models/dir_update_infringement_params.rb +6 -2
  19. data/lib/telnyx/models/enterprises/dir_create_params.rb +10 -10
  20. data/lib/telnyx/models/storage/kv_create_params.rb +24 -0
  21. data/lib/telnyx/models/storage/kv_delete_params.rb +22 -0
  22. data/lib/telnyx/models/storage/kv_list_params.rb +32 -0
  23. data/lib/telnyx/models/storage/kv_namespace.rb +75 -0
  24. data/lib/telnyx/models/storage/kv_namespace_response_wrapper.rb +18 -0
  25. data/lib/telnyx/models/storage/kv_retrieve_params.rb +22 -0
  26. data/lib/telnyx/models/storage/kvs/key_delete_params.rb +30 -0
  27. data/lib/telnyx/models/storage/kvs/key_list_params.rb +49 -0
  28. data/lib/telnyx/models/storage/kvs/key_list_response.rb +35 -0
  29. data/lib/telnyx/models/storage/kvs/key_retrieve_params.rb +30 -0
  30. data/lib/telnyx/models/storage/kvs/key_update_params.rb +53 -0
  31. data/lib/telnyx/models/uac_inbound.rb +25 -1
  32. data/lib/telnyx/models/uac_inbound_request.rb +25 -1
  33. data/lib/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_params.rb +31 -0
  34. data/lib/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_response.rb +54 -0
  35. data/lib/telnyx/resources/dir/references.rb +139 -0
  36. data/lib/telnyx/resources/dir/verify_email.rb +91 -0
  37. data/lib/telnyx/resources/dir.rb +17 -1
  38. data/lib/telnyx/resources/documents.rb +1 -1
  39. data/lib/telnyx/resources/enterprises/dir.rb +3 -3
  40. data/lib/telnyx/resources/storage/kvs/keys.rb +155 -0
  41. data/lib/telnyx/resources/storage/kvs.rb +115 -0
  42. data/lib/telnyx/resources/storage.rb +5 -0
  43. data/lib/telnyx/resources/whatsapp/phone_numbers.rb +27 -0
  44. data/lib/telnyx/version.rb +1 -1
  45. data/lib/telnyx.rb +29 -2
  46. data/rbi/telnyx/internal/cursor_flat_pagination.rbi +48 -0
  47. data/rbi/telnyx/models/advanced_order_create_params.rbi +4 -198
  48. data/rbi/telnyx/models/advanced_order_update_requirement_group_params.rbi +2 -219
  49. data/rbi/telnyx/models/ai/assistant_get_texml_response.rbi +1 -1
  50. data/rbi/telnyx/models/ai/assistants/instruction_enhance_response.rbi +1 -1
  51. data/rbi/telnyx/models/dir/email_verification_status_wrapped.rbi +184 -0
  52. data/rbi/telnyx/models/dir/reference.rbi +162 -0
  53. data/rbi/telnyx/models/dir/reference_create_params.rbi +66 -0
  54. data/rbi/telnyx/models/dir/reference_input.rbi +93 -0
  55. data/rbi/telnyx/models/dir/reference_list.rbi +29 -0
  56. data/rbi/telnyx/models/dir/reference_list_params.rbi +37 -0
  57. data/rbi/telnyx/models/dir/reference_update_params.rbi +154 -0
  58. data/rbi/telnyx/models/dir/reference_update_response.rbi +39 -0
  59. data/rbi/telnyx/models/dir/verify_email_confirm_params.rbi +54 -0
  60. data/rbi/telnyx/models/dir/verify_email_create_params.rbi +40 -0
  61. data/rbi/telnyx/models/dir/verify_email_list_params.rbi +37 -0
  62. data/rbi/telnyx/models/dir_update_infringement_params.rbi +4 -2
  63. data/rbi/telnyx/models/enterprises/dir_create_params.rbi +10 -13
  64. data/rbi/telnyx/models/messaging_profiles/autoresp_config_delete_response.rbi +1 -1
  65. data/rbi/telnyx/models/storage/kv_create_params.rbi +42 -0
  66. data/rbi/telnyx/models/storage/kv_delete_params.rbi +37 -0
  67. data/rbi/telnyx/models/storage/kv_list_params.rbi +59 -0
  68. data/rbi/telnyx/models/storage/kv_namespace.rbi +131 -0
  69. data/rbi/telnyx/models/storage/kv_namespace_response_wrapper.rbi +35 -0
  70. data/rbi/telnyx/models/storage/kv_retrieve_params.rbi +37 -0
  71. data/rbi/telnyx/models/storage/kvs/key_delete_params.rbi +50 -0
  72. data/rbi/telnyx/models/storage/kvs/key_list_params.rbi +81 -0
  73. data/rbi/telnyx/models/storage/kvs/key_list_response.rbi +59 -0
  74. data/rbi/telnyx/models/storage/kvs/key_retrieve_params.rbi +50 -0
  75. data/rbi/telnyx/models/storage/kvs/key_update_params.rbi +77 -0
  76. data/rbi/telnyx/models/sub_number_orders_report_download_response.rbi +1 -1
  77. data/rbi/telnyx/models/telephony_credential_create_token_response.rbi +1 -1
  78. data/rbi/telnyx/models/uac_inbound.rbi +36 -0
  79. data/rbi/telnyx/models/uac_inbound_request.rbi +39 -0
  80. data/rbi/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_params.rbi +54 -0
  81. data/rbi/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_response.rbi +125 -0
  82. data/rbi/telnyx/models/wireguard_peer_retrieve_config_response.rbi +1 -1
  83. data/rbi/telnyx/resources/dir/references.rbi +114 -0
  84. data/rbi/telnyx/resources/dir/verify_email.rbi +70 -0
  85. data/rbi/telnyx/resources/dir.rbi +13 -1
  86. data/rbi/telnyx/resources/enterprises/dir.rbi +4 -4
  87. data/rbi/telnyx/resources/storage/kvs/keys.rbi +122 -0
  88. data/rbi/telnyx/resources/storage/kvs.rbi +87 -0
  89. data/rbi/telnyx/resources/storage.rbi +4 -0
  90. data/rbi/telnyx/resources/whatsapp/phone_numbers.rbi +21 -0
  91. data/sig/telnyx/internal/cursor_flat_pagination.rbs +28 -0
  92. data/sig/telnyx/models/advanced_order_create_params.rbs +3 -99
  93. data/sig/telnyx/models/advanced_order_update_requirement_group_params.rbs +3 -94
  94. data/sig/telnyx/models/dir/email_verification_status_wrapped.rbs +69 -0
  95. data/sig/telnyx/models/dir/reference.rbs +88 -0
  96. data/sig/telnyx/models/dir/reference_create_params.rbs +38 -0
  97. data/sig/telnyx/models/dir/reference_input.rbs +52 -0
  98. data/sig/telnyx/models/dir/reference_list.rbs +15 -0
  99. data/sig/telnyx/models/dir/reference_list_params.rbs +25 -0
  100. data/sig/telnyx/models/dir/reference_update_params.rbs +92 -0
  101. data/sig/telnyx/models/dir/reference_update_response.rbs +15 -0
  102. data/sig/telnyx/models/dir/verify_email_confirm_params.rbs +30 -0
  103. data/sig/telnyx/models/dir/verify_email_create_params.rbs +25 -0
  104. data/sig/telnyx/models/dir/verify_email_list_params.rbs +25 -0
  105. data/sig/telnyx/models/enterprises/dir_create_params.rbs +5 -7
  106. data/sig/telnyx/models/storage/kv_create_params.rbs +25 -0
  107. data/sig/telnyx/models/storage/kv_delete_params.rbs +22 -0
  108. data/sig/telnyx/models/storage/kv_list_params.rbs +34 -0
  109. data/sig/telnyx/models/storage/kv_namespace.rbs +80 -0
  110. data/sig/telnyx/models/storage/kv_namespace_response_wrapper.rbs +20 -0
  111. data/sig/telnyx/models/storage/kv_retrieve_params.rbs +22 -0
  112. data/sig/telnyx/models/storage/kvs/key_delete_params.rbs +32 -0
  113. data/sig/telnyx/models/storage/kvs/key_list_params.rbs +46 -0
  114. data/sig/telnyx/models/storage/kvs/key_list_response.rbs +32 -0
  115. data/sig/telnyx/models/storage/kvs/key_retrieve_params.rbs +32 -0
  116. data/sig/telnyx/models/storage/kvs/key_update_params.rbs +47 -0
  117. data/sig/telnyx/models/uac_inbound.rbs +21 -0
  118. data/sig/telnyx/models/uac_inbound_request.rbs +21 -0
  119. data/sig/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_params.rbs +30 -0
  120. data/sig/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_response.rbs +66 -0
  121. data/sig/telnyx/resources/dir/references.rbs +35 -0
  122. data/sig/telnyx/resources/dir/verify_email.rbs +25 -0
  123. data/sig/telnyx/resources/dir.rbs +4 -0
  124. data/sig/telnyx/resources/enterprises/dir.rbs +1 -1
  125. data/sig/telnyx/resources/storage/kvs/keys.rbs +39 -0
  126. data/sig/telnyx/resources/storage/kvs.rbs +32 -0
  127. data/sig/telnyx/resources/storage.rbs +2 -0
  128. data/sig/telnyx/resources/whatsapp/phone_numbers.rbs +6 -0
  129. metadata +89 -2
@@ -0,0 +1,106 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Internal
5
+ # @generic Elem
6
+ #
7
+ # @example
8
+ # if cursor_flat_pagination.has_next?
9
+ # cursor_flat_pagination = cursor_flat_pagination.next_page
10
+ # end
11
+ #
12
+ # @example
13
+ # cursor_flat_pagination.auto_paging_each do |key|
14
+ # puts(key)
15
+ # end
16
+ class CursorFlatPagination
17
+ include Telnyx::Internal::Type::BasePage
18
+
19
+ # @return [Array<generic<Elem>>, nil]
20
+ attr_accessor :data
21
+
22
+ # @return [Meta]
23
+ attr_accessor :meta
24
+
25
+ # @return [Boolean]
26
+ def next_page?
27
+ !data.to_a.empty? && !meta&.cursor.to_s.empty?
28
+ end
29
+
30
+ # @raise [Telnyx::HTTP::Error]
31
+ # @return [self]
32
+ def next_page
33
+ unless next_page?
34
+ message = "No more pages available. Please check #next_page? before calling ##{__method__}"
35
+ raise RuntimeError.new(message)
36
+ end
37
+
38
+ req = Telnyx::Internal::Util.deep_merge(@req, {query: {cursor: meta&.cursor}})
39
+ @client.request(req)
40
+ end
41
+
42
+ # @param blk [Proc]
43
+ #
44
+ # @yieldparam [generic<Elem>]
45
+ def auto_paging_each(&blk)
46
+ unless block_given?
47
+ raise ArgumentError.new("A block must be given to ##{__method__}")
48
+ end
49
+
50
+ page = self
51
+ loop do
52
+ page.data&.each(&blk)
53
+
54
+ break unless page.next_page?
55
+ page = page.next_page
56
+ end
57
+ end
58
+
59
+ # @api private
60
+ #
61
+ # @param client [Telnyx::Internal::Transport::BaseClient]
62
+ # @param req [Hash{Symbol=>Object}]
63
+ # @param headers [Hash{String=>String}]
64
+ # @param page_data [Hash{Symbol=>Object}]
65
+ def initialize(client:, req:, headers:, page_data:)
66
+ super
67
+
68
+ case page_data
69
+ in {data: Array => data}
70
+ @data = data.map { Telnyx::Internal::Type::Converter.coerce(@model, _1) }
71
+ else
72
+ end
73
+ case page_data
74
+ in {meta: Hash | nil => meta}
75
+ @meta = Telnyx::Internal::Type::Converter.coerce(Telnyx::Internal::CursorFlatPagination::Meta, meta)
76
+ else
77
+ end
78
+ end
79
+
80
+ # @api private
81
+ #
82
+ # @return [String]
83
+ def inspect
84
+ model = Telnyx::Internal::Type::Converter.inspect(@model, depth: 1)
85
+
86
+ "#<#{self.class}[#{model}]:0x#{object_id.to_s(16)}>"
87
+ end
88
+
89
+ class Meta < Telnyx::Internal::Type::BaseModel
90
+ # @!attribute cursor
91
+ #
92
+ # @return [String, nil]
93
+ optional :cursor, String
94
+
95
+ # @!attribute has_more
96
+ #
97
+ # @return [Boolean, nil]
98
+ optional :has_more, Telnyx::Internal::Type::Boolean
99
+
100
+ # @!method initialize(cursor: nil, has_more: nil)
101
+ # @param cursor [String]
102
+ # @param has_more [Boolean]
103
+ end
104
+ end
105
+ end
106
+ end
@@ -7,93 +7,8 @@ module Telnyx
7
7
  extend Telnyx::Internal::Type::RequestParameters::Converter
8
8
  include Telnyx::Internal::Type::RequestParameters
9
9
 
10
- # @!attribute area_code
11
- #
12
- # @return [String, nil]
13
- optional :area_code, String
14
-
15
- # @!attribute comments
16
- #
17
- # @return [String, nil]
18
- optional :comments, String
19
-
20
- # @!attribute country_code
21
- #
22
- # @return [String, nil]
23
- optional :country_code, String
24
-
25
- # @!attribute customer_reference
26
- #
27
- # @return [String, nil]
28
- optional :customer_reference, String
29
-
30
- # @!attribute features
31
- #
32
- # @return [Array<Symbol, Telnyx::Models::AdvancedOrderCreateParams::Feature>, nil]
33
- optional :features,
34
- -> { Telnyx::Internal::Type::ArrayOf[enum: Telnyx::AdvancedOrderCreateParams::Feature] }
35
-
36
- # @!attribute phone_number_type
37
- #
38
- # @return [Symbol, Telnyx::Models::AdvancedOrderCreateParams::PhoneNumberType, nil]
39
- optional :phone_number_type, enum: -> { Telnyx::AdvancedOrderCreateParams::PhoneNumberType }
40
-
41
- # @!attribute quantity
42
- #
43
- # @return [Integer, nil]
44
- optional :quantity, Integer
45
-
46
- # @!attribute requirement_group_id
47
- # The ID of the requirement group to associate with this advanced order
48
- #
49
- # @return [String, nil]
50
- optional :requirement_group_id, String
51
-
52
- # @!method initialize(area_code: nil, comments: nil, country_code: nil, customer_reference: nil, features: nil, phone_number_type: nil, quantity: nil, requirement_group_id: nil, request_options: {})
53
- # @param area_code [String]
54
- #
55
- # @param comments [String]
56
- #
57
- # @param country_code [String]
58
- #
59
- # @param customer_reference [String]
60
- #
61
- # @param features [Array<Symbol, Telnyx::Models::AdvancedOrderCreateParams::Feature>]
62
- #
63
- # @param phone_number_type [Symbol, Telnyx::Models::AdvancedOrderCreateParams::PhoneNumberType]
64
- #
65
- # @param quantity [Integer]
66
- #
67
- # @param requirement_group_id [String] The ID of the requirement group to associate with this advanced order
68
- #
10
+ # @!method initialize(request_options: {})
69
11
  # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
70
-
71
- module Feature
72
- extend Telnyx::Internal::Type::Enum
73
-
74
- SMS = :sms
75
- MMS = :mms
76
- VOICE = :voice
77
- FAX = :fax
78
- EMERGENCY = :emergency
79
-
80
- # @!method self.values
81
- # @return [Array<Symbol>]
82
- end
83
-
84
- module PhoneNumberType
85
- extend Telnyx::Internal::Type::Enum
86
-
87
- LOCAL = :local
88
- MOBILE = :mobile
89
- TOLL_FREE = :toll_free
90
- SHARED_COST = :shared_cost
91
- NATIONAL = :national
92
- LANDLINE = :landline
93
-
94
- # @!method self.values
95
- # @return [Array<Symbol>]
96
- end
97
12
  end
98
13
  end
99
14
  end
@@ -12,96 +12,9 @@ module Telnyx
12
12
  # @return [String]
13
13
  required :advanced_order_id, String
14
14
 
15
- # @!attribute area_code
16
- #
17
- # @return [String, nil]
18
- optional :area_code, String
19
-
20
- # @!attribute comments
21
- #
22
- # @return [String, nil]
23
- optional :comments, String
24
-
25
- # @!attribute country_code
26
- #
27
- # @return [String, nil]
28
- optional :country_code, String
29
-
30
- # @!attribute customer_reference
31
- #
32
- # @return [String, nil]
33
- optional :customer_reference, String
34
-
35
- # @!attribute features
36
- #
37
- # @return [Array<Symbol, Telnyx::Models::AdvancedOrderUpdateRequirementGroupParams::Feature>, nil]
38
- optional :features,
39
- -> { Telnyx::Internal::Type::ArrayOf[enum: Telnyx::AdvancedOrderUpdateRequirementGroupParams::Feature] }
40
-
41
- # @!attribute phone_number_type
42
- #
43
- # @return [Symbol, Telnyx::Models::AdvancedOrderUpdateRequirementGroupParams::PhoneNumberType, nil]
44
- optional :phone_number_type,
45
- enum: -> { Telnyx::AdvancedOrderUpdateRequirementGroupParams::PhoneNumberType }
46
-
47
- # @!attribute quantity
48
- #
49
- # @return [Integer, nil]
50
- optional :quantity, Integer
51
-
52
- # @!attribute requirement_group_id
53
- # The ID of the requirement group to associate with this advanced order
54
- #
55
- # @return [String, nil]
56
- optional :requirement_group_id, String
57
-
58
- # @!method initialize(advanced_order_id:, area_code: nil, comments: nil, country_code: nil, customer_reference: nil, features: nil, phone_number_type: nil, quantity: nil, requirement_group_id: nil, request_options: {})
15
+ # @!method initialize(advanced_order_id:, request_options: {})
59
16
  # @param advanced_order_id [String]
60
- #
61
- # @param area_code [String]
62
- #
63
- # @param comments [String]
64
- #
65
- # @param country_code [String]
66
- #
67
- # @param customer_reference [String]
68
- #
69
- # @param features [Array<Symbol, Telnyx::Models::AdvancedOrderUpdateRequirementGroupParams::Feature>]
70
- #
71
- # @param phone_number_type [Symbol, Telnyx::Models::AdvancedOrderUpdateRequirementGroupParams::PhoneNumberType]
72
- #
73
- # @param quantity [Integer]
74
- #
75
- # @param requirement_group_id [String] The ID of the requirement group to associate with this advanced order
76
- #
77
17
  # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
78
-
79
- module Feature
80
- extend Telnyx::Internal::Type::Enum
81
-
82
- SMS = :sms
83
- MMS = :mms
84
- VOICE = :voice
85
- FAX = :fax
86
- EMERGENCY = :emergency
87
-
88
- # @!method self.values
89
- # @return [Array<Symbol>]
90
- end
91
-
92
- module PhoneNumberType
93
- extend Telnyx::Internal::Type::Enum
94
-
95
- LOCAL = :local
96
- MOBILE = :mobile
97
- TOLL_FREE = :toll_free
98
- SHARED_COST = :shared_cost
99
- NATIONAL = :national
100
- LANDLINE = :landline
101
-
102
- # @!method self.values
103
- # @return [Array<Symbol>]
104
- end
105
18
  end
106
19
  end
107
20
  end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Dir
6
+ # @see Telnyx::Resources::Dir::VerifyEmail#create
7
+ class EmailVerificationStatusWrapped < Telnyx::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ # Verification state for a DIR's authorizer email.
10
+ #
11
+ # @return [Telnyx::Models::Dir::EmailVerificationStatusWrapped::Data]
12
+ required :data, -> { Telnyx::Dir::EmailVerificationStatusWrapped::Data }
13
+
14
+ # @!method initialize(data:)
15
+ # @param data [Telnyx::Models::Dir::EmailVerificationStatusWrapped::Data] Verification state for a DIR's authorizer email.
16
+
17
+ # @see Telnyx::Models::Dir::EmailVerificationStatusWrapped#data
18
+ class Data < Telnyx::Internal::Type::BaseModel
19
+ # @!attribute email_verified
20
+ # Whether the DIR's authorizer email has been confirmed.
21
+ #
22
+ # @return [Boolean]
23
+ required :email_verified, Telnyx::Internal::Type::Boolean
24
+
25
+ # @!attribute status
26
+ # `sent` after a code is emailed; `verified` after a successful confirm;
27
+ # `unverified` when no verification is in progress.
28
+ #
29
+ # @return [Symbol, Telnyx::Models::Dir::EmailVerificationStatusWrapped::Data::Status]
30
+ required :status, enum: -> { Telnyx::Dir::EmailVerificationStatusWrapped::Data::Status }
31
+
32
+ response_only do
33
+ # @!attribute record_type
34
+ # Always `email_verification`.
35
+ #
36
+ # @return [Symbol, Telnyx::Models::Dir::EmailVerificationStatusWrapped::Data::RecordType]
37
+ required :record_type, enum: -> { Telnyx::Dir::EmailVerificationStatusWrapped::Data::RecordType }
38
+ end
39
+
40
+ # @!method initialize(email_verified:, record_type:, status:)
41
+ # Some parameter documentations has been truncated, see
42
+ # {Telnyx::Models::Dir::EmailVerificationStatusWrapped::Data} for more details.
43
+ #
44
+ # Verification state for a DIR's authorizer email.
45
+ #
46
+ # @param email_verified [Boolean] Whether the DIR's authorizer email has been confirmed.
47
+ #
48
+ # @param record_type [Symbol, Telnyx::Models::Dir::EmailVerificationStatusWrapped::Data::RecordType] Always `email_verification`.
49
+ #
50
+ # @param status [Symbol, Telnyx::Models::Dir::EmailVerificationStatusWrapped::Data::Status] `sent` after a code is emailed; `verified` after a successful confirm; `unverifi
51
+
52
+ # Always `email_verification`.
53
+ #
54
+ # @see Telnyx::Models::Dir::EmailVerificationStatusWrapped::Data#record_type
55
+ module RecordType
56
+ extend Telnyx::Internal::Type::Enum
57
+
58
+ EMAIL_VERIFICATION = :email_verification
59
+
60
+ # @!method self.values
61
+ # @return [Array<Symbol>]
62
+ end
63
+
64
+ # `sent` after a code is emailed; `verified` after a successful confirm;
65
+ # `unverified` when no verification is in progress.
66
+ #
67
+ # @see Telnyx::Models::Dir::EmailVerificationStatusWrapped::Data#status
68
+ module Status
69
+ extend Telnyx::Internal::Type::Enum
70
+
71
+ SENT = :sent
72
+ VERIFIED = :verified
73
+ UNVERIFIED = :unverified
74
+
75
+ # @!method self.values
76
+ # @return [Array<Symbol>]
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,125 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Dir
6
+ class Reference < Telnyx::Internal::Type::BaseModel
7
+ # @!attribute full_name
8
+ # Full name of the reference contact.
9
+ #
10
+ # @return [String]
11
+ required :full_name, String
12
+
13
+ # @!attribute phone_e164
14
+ # Reference phone number in E.164 format.
15
+ #
16
+ # @return [String]
17
+ required :phone_e164, String
18
+
19
+ # @!attribute ref_type
20
+ # Whether this is a business reference or the financial reference.
21
+ #
22
+ # @return [Symbol, Telnyx::Models::Dir::Reference::RefType]
23
+ required :ref_type, enum: -> { Telnyx::Dir::Reference::RefType }
24
+
25
+ # @!attribute slot
26
+ # Position within the reference type. Business references occupy slots 0 and 1;
27
+ # the financial reference occupies slot 0.
28
+ #
29
+ # @return [Integer]
30
+ required :slot, Integer
31
+
32
+ # @!attribute timezone
33
+ # IANA timezone id for the reference. Calls are only placed within the reference's
34
+ # local 8am-9pm window.
35
+ #
36
+ # @return [String]
37
+ required :timezone, String
38
+
39
+ # @!attribute email
40
+ # Reference contact email address.
41
+ #
42
+ # @return [String, nil]
43
+ optional :email, String, nil?: true
44
+
45
+ # @!attribute job_title
46
+ # Job title of the reference contact.
47
+ #
48
+ # @return [String, nil]
49
+ optional :job_title, String, nil?: true
50
+
51
+ # @!attribute organization
52
+ # Organization the reference contact belongs to.
53
+ #
54
+ # @return [String, nil]
55
+ optional :organization, String, nil?: true
56
+
57
+ # @!attribute relationship_to_registrant
58
+ # How the reference contact is related to the registering business.
59
+ #
60
+ # @return [String, nil]
61
+ optional :relationship_to_registrant, String, nil?: true
62
+
63
+ response_only do
64
+ # @!attribute record_type
65
+ # Always `dir_reference`.
66
+ #
67
+ # @return [Symbol, Telnyx::Models::Dir::Reference::RecordType]
68
+ required :record_type, enum: -> { Telnyx::Dir::Reference::RecordType }
69
+ end
70
+
71
+ # @!method initialize(full_name:, phone_e164:, record_type:, ref_type:, slot:, timezone:, email: nil, job_title: nil, organization: nil, relationship_to_registrant: nil)
72
+ # Some parameter documentations has been truncated, see
73
+ # {Telnyx::Models::Dir::Reference} for more details.
74
+ #
75
+ # A reference (business or financial) on a DIR, in the customer-facing shape. No
76
+ # internal identifiers are exposed.
77
+ #
78
+ # @param full_name [String] Full name of the reference contact.
79
+ #
80
+ # @param phone_e164 [String] Reference phone number in E.164 format.
81
+ #
82
+ # @param record_type [Symbol, Telnyx::Models::Dir::Reference::RecordType] Always `dir_reference`.
83
+ #
84
+ # @param ref_type [Symbol, Telnyx::Models::Dir::Reference::RefType] Whether this is a business reference or the financial reference.
85
+ #
86
+ # @param slot [Integer] Position within the reference type. Business references occupy slots 0 and 1; th
87
+ #
88
+ # @param timezone [String] IANA timezone id for the reference. Calls are only placed within the reference's
89
+ #
90
+ # @param email [String, nil] Reference contact email address.
91
+ #
92
+ # @param job_title [String, nil] Job title of the reference contact.
93
+ #
94
+ # @param organization [String, nil] Organization the reference contact belongs to.
95
+ #
96
+ # @param relationship_to_registrant [String, nil] How the reference contact is related to the registering business.
97
+
98
+ # Always `dir_reference`.
99
+ #
100
+ # @see Telnyx::Models::Dir::Reference#record_type
101
+ module RecordType
102
+ extend Telnyx::Internal::Type::Enum
103
+
104
+ DIR_REFERENCE = :dir_reference
105
+
106
+ # @!method self.values
107
+ # @return [Array<Symbol>]
108
+ end
109
+
110
+ # Whether this is a business reference or the financial reference.
111
+ #
112
+ # @see Telnyx::Models::Dir::Reference#ref_type
113
+ module RefType
114
+ extend Telnyx::Internal::Type::Enum
115
+
116
+ BUSINESS = :business
117
+ FINANCIAL = :financial
118
+
119
+ # @!method self.values
120
+ # @return [Array<Symbol>]
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Dir
6
+ # @see Telnyx::Resources::Dir::References#create
7
+ class ReferenceCreateParams < Telnyx::Internal::Type::BaseModel
8
+ extend Telnyx::Internal::Type::RequestParameters::Converter
9
+ include Telnyx::Internal::Type::RequestParameters
10
+
11
+ # @!attribute dir_id
12
+ #
13
+ # @return [String]
14
+ required :dir_id, String
15
+
16
+ # @!attribute business_references
17
+ # Exactly two business references.
18
+ #
19
+ # @return [Array<Telnyx::Models::Dir::ReferenceInput>]
20
+ required :business_references, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Dir::ReferenceInput] }
21
+
22
+ # @!attribute financial_reference
23
+ # One reference supplied at submit. The reference type is implied by the field
24
+ # that carries it (business_references vs financial_reference).
25
+ #
26
+ # @return [Telnyx::Models::Dir::ReferenceInput]
27
+ required :financial_reference, -> { Telnyx::Dir::ReferenceInput }
28
+
29
+ # @!method initialize(dir_id:, business_references:, financial_reference:, request_options: {})
30
+ # Some parameter documentations has been truncated, see
31
+ # {Telnyx::Models::Dir::ReferenceCreateParams} for more details.
32
+ #
33
+ # @param dir_id [String]
34
+ #
35
+ # @param business_references [Array<Telnyx::Models::Dir::ReferenceInput>] Exactly two business references.
36
+ #
37
+ # @param financial_reference [Telnyx::Models::Dir::ReferenceInput] One reference supplied at submit. The reference type is implied by the field tha
38
+ #
39
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Dir
6
+ class ReferenceInput < Telnyx::Internal::Type::BaseModel
7
+ # @!attribute email
8
+ # Reference contact email address. Required: the reference is emailed scheduling
9
+ # and dial-in notices.
10
+ #
11
+ # @return [String]
12
+ required :email, String
13
+
14
+ # @!attribute full_name
15
+ # Full name of the reference contact.
16
+ #
17
+ # @return [String]
18
+ required :full_name, String
19
+
20
+ # @!attribute phone_e164
21
+ # Reference phone number in E.164 format, e.g. +14155550123.
22
+ #
23
+ # @return [String]
24
+ required :phone_e164, String
25
+
26
+ # @!attribute timezone
27
+ # IANA timezone id for the reference (e.g. America/New_York). Required: calls are
28
+ # only placed within the reference's local 8am-9pm window.
29
+ #
30
+ # @return [String]
31
+ required :timezone, String
32
+
33
+ # @!attribute job_title
34
+ # Job title of the reference contact.
35
+ #
36
+ # @return [String, nil]
37
+ optional :job_title, String, nil?: true
38
+
39
+ # @!attribute organization
40
+ # Organization the reference contact belongs to.
41
+ #
42
+ # @return [String, nil]
43
+ optional :organization, String, nil?: true
44
+
45
+ # @!attribute relationship_to_registrant
46
+ # How the reference contact is related to the registering business.
47
+ #
48
+ # @return [String, nil]
49
+ optional :relationship_to_registrant, String, nil?: true
50
+
51
+ # @!method initialize(email:, full_name:, phone_e164:, timezone:, job_title: nil, organization: nil, relationship_to_registrant: nil)
52
+ # Some parameter documentations has been truncated, see
53
+ # {Telnyx::Models::Dir::ReferenceInput} for more details.
54
+ #
55
+ # One reference supplied at submit. The reference type is implied by the field
56
+ # that carries it (business_references vs financial_reference).
57
+ #
58
+ # @param email [String] Reference contact email address. Required: the reference is emailed scheduling a
59
+ #
60
+ # @param full_name [String] Full name of the reference contact.
61
+ #
62
+ # @param phone_e164 [String] Reference phone number in E.164 format, e.g. +14155550123.
63
+ #
64
+ # @param timezone [String] IANA timezone id for the reference (e.g. America/New_York). Required: calls are
65
+ #
66
+ # @param job_title [String, nil] Job title of the reference contact.
67
+ #
68
+ # @param organization [String, nil] Organization the reference contact belongs to.
69
+ #
70
+ # @param relationship_to_registrant [String, nil] How the reference contact is related to the registering business.
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Dir
6
+ # @see Telnyx::Resources::Dir::References#create
7
+ class ReferenceList < Telnyx::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ #
10
+ # @return [Array<Telnyx::Models::Dir::Reference>]
11
+ required :data, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Dir::Reference] }
12
+
13
+ # @!method initialize(data:)
14
+ # @param data [Array<Telnyx::Models::Dir::Reference>]
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Dir
6
+ # @see Telnyx::Resources::Dir::References#list
7
+ class ReferenceListParams < Telnyx::Internal::Type::BaseModel
8
+ extend Telnyx::Internal::Type::RequestParameters::Converter
9
+ include Telnyx::Internal::Type::RequestParameters
10
+
11
+ # @!attribute dir_id
12
+ #
13
+ # @return [String]
14
+ required :dir_id, String
15
+
16
+ # @!method initialize(dir_id:, request_options: {})
17
+ # @param dir_id [String]
18
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end