From accf794e742e1903de2a274d29b5102ffd7d2b2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Aug 2026 03:58:31 +0000 Subject: [PATCH 01/17] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0b60fcc..edddea6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 138 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-e4987140138afb7287e25f31dc8cff94c6b11975e460e0c19d54ec457d009a1b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-f94b2cae6c929ce34c51007444f7105c96b458c2cb9b07be2ce7d434adda4e66.yml openapi_spec_hash: d20e1b8d0a9a7a65dc8a21e3a151111e -config_hash: 7fca08d9dae18513f5d7451cea11e34c +config_hash: 942fad5624cf310889c6161a3b6bf725 From 0b0dda797533abebe75fea8c39c7077e5ccf01f0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Aug 2026 03:59:12 +0000 Subject: [PATCH 02/17] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index edddea6..0b60fcc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 138 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-f94b2cae6c929ce34c51007444f7105c96b458c2cb9b07be2ce7d434adda4e66.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-e4987140138afb7287e25f31dc8cff94c6b11975e460e0c19d54ec457d009a1b.yml openapi_spec_hash: d20e1b8d0a9a7a65dc8a21e3a151111e -config_hash: 942fad5624cf310889c6161a3b6bf725 +config_hash: 7fca08d9dae18513f5d7451cea11e34c From c919d2a0db7c65ce8e53dfa329b42111e0afa123 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Aug 2026 23:30:21 +0000 Subject: [PATCH 03/17] feat(api): api update --- .stats.yml | 4 ++-- lib/zavudev/resources/broadcasts.rb | 15 +++++++++------ rbi/zavudev/resources/broadcasts.rbi | 15 +++++++++------ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0b60fcc..d105c4b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 138 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-e4987140138afb7287e25f31dc8cff94c6b11975e460e0c19d54ec457d009a1b.yml -openapi_spec_hash: d20e1b8d0a9a7a65dc8a21e3a151111e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-dd62b3849e15304da4087f73928025602737e10a414c87a6c2a5fe7059b9ea37.yml +openapi_spec_hash: 5a3d5cb61a7dd5d556a9f9abd9db01d4 config_hash: 7fca08d9dae18513f5d7451cea11e34c diff --git a/lib/zavudev/resources/broadcasts.rb b/lib/zavudev/resources/broadcasts.rb index 6b551a3..f6d45c8 100644 --- a/lib/zavudev/resources/broadcasts.rb +++ b/lib/zavudev/resources/broadcasts.rb @@ -255,12 +255,15 @@ def retry_review(broadcast_id, params = {}) # Start sending the broadcast immediately or schedule for later. # - # **Verification is required to send, and there are two of them.** The team must - # have completed both identity verification (KYC) and business verification (KYB); - # passing one is not enough. Drafts can be created, edited and kept without - # either. Every send path — dashboard, API and CLI alike — enforces both, - # returning `403` with code `kyc_required` or `kyb_required` for whichever is - # outstanding. + # **Verification is required to send, except on WhatsApp.** On every channel other + # than `whatsapp`, the team must have completed both identity verification (KYC) + # and business verification (KYB); passing one is not enough. A `whatsapp` + # broadcast requires neither: it can only be built on a template, and Meta vets + # the business and the content when it approves that template, so an unapproved + # template is refused instead. `smart` is not exempt — it can route a contact to + # SMS or email. Drafts can be created, edited and kept without any check. Every + # send path — dashboard, API and CLI alike — enforces the same rule, returning + # `403` with code `kyc_required` or `kyb_required` for whichever is outstanding. # # **Review depends on the channel, and cannot be bypassed.** A draft is submitted # to automated content review here; it does not go straight out. A WhatsApp diff --git a/rbi/zavudev/resources/broadcasts.rbi b/rbi/zavudev/resources/broadcasts.rbi index cfccabe..f5ab730 100644 --- a/rbi/zavudev/resources/broadcasts.rbi +++ b/rbi/zavudev/resources/broadcasts.rbi @@ -176,12 +176,15 @@ module Zavudev # Start sending the broadcast immediately or schedule for later. # - # **Verification is required to send, and there are two of them.** The team must - # have completed both identity verification (KYC) and business verification (KYB); - # passing one is not enough. Drafts can be created, edited and kept without - # either. Every send path — dashboard, API and CLI alike — enforces both, - # returning `403` with code `kyc_required` or `kyb_required` for whichever is - # outstanding. + # **Verification is required to send, except on WhatsApp.** On every channel other + # than `whatsapp`, the team must have completed both identity verification (KYC) + # and business verification (KYB); passing one is not enough. A `whatsapp` + # broadcast requires neither: it can only be built on a template, and Meta vets + # the business and the content when it approves that template, so an unapproved + # template is refused instead. `smart` is not exempt — it can route a contact to + # SMS or email. Drafts can be created, edited and kept without any check. Every + # send path — dashboard, API and CLI alike — enforces the same rule, returning + # `403` with code `kyc_required` or `kyb_required` for whichever is outstanding. # # **Review depends on the channel, and cannot be bypassed.** A draft is submitted # to automated content review here; it does not go straight out. A WhatsApp From 8f1f6083aff8b3568b7b7841f496e6dcd7076475 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Aug 2026 23:52:11 +0000 Subject: [PATCH 04/17] feat(api): api update --- .stats.yml | 4 +- lib/zavudev/models/message_content.rb | 149 +++++++++++++- lib/zavudev/models/webhook_event.rb | 7 +- rbi/zavudev/models/message_content.rbi | 260 +++++++++++++++++++++++++ rbi/zavudev/models/webhook_event.rbi | 7 +- sig/zavudev/models/message_content.rbs | 117 +++++++++++ 6 files changed, 539 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index d105c4b..c8f40a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 138 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-dd62b3849e15304da4087f73928025602737e10a414c87a6c2a5fe7059b9ea37.yml -openapi_spec_hash: 5a3d5cb61a7dd5d556a9f9abd9db01d4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-8ead699d165bc116549ef757ace827bf39add6e0e19afdc1653f0d0282947eae.yml +openapi_spec_hash: 5a35a5dab833f4d1e6deeea795e1abf2 config_hash: 7fca08d9dae18513f5d7451cea11e34c diff --git a/lib/zavudev/models/message_content.rb b/lib/zavudev/models/message_content.rb index 52e5bb3..8e02149 100644 --- a/lib/zavudev/models/message_content.rb +++ b/lib/zavudev/models/message_content.rb @@ -120,6 +120,21 @@ class MessageContent < Zavudev::Internal::Type::BaseModel # @return [String, nil] optional :react_to_message_id, String, api_name: :reactToMessageId + # @!attribute referral + # Click-to-WhatsApp (CTWA) ad attribution: where an inbound conversation came + # from. + # + # WhatsApp only. Present on the **first inbound message** of a conversation opened + # from a Meta ad or post, and on no message after it — so store it when it arrives + # rather than expecting it again. Organic conversations never carry it. + # + # Field names are camelCased to match the rest of this API; Meta sends them as + # snake_case (`ctwa_clid`, `source_id`, ...). Fields that do not apply are + # omitted: a `post` source has no click id, and an image ad has no `videoUrl`. + # + # @return [Zavudev::Models::MessageContent::Referral, nil] + optional :referral, -> { Zavudev::MessageContent::Referral } + # @!attribute reply_to_from # Sender of the quoted message (phone number in E.164 format). # @@ -209,7 +224,7 @@ class MessageContent < Zavudev::Internal::Type::BaseModel # @return [Hash{Symbol=>String}, nil] optional :template_variables, Zavudev::Internal::Type::HashOf[String], api_name: :templateVariables - # @!method initialize(buttons: nil, contacts: nil, cta_display_text: nil, cta_header_media_url: nil, cta_header_text: nil, cta_header_type: nil, cta_url: nil, emoji: nil, filename: nil, footer_text: nil, latitude: nil, list_button: nil, location_address: nil, location_name: nil, longitude: nil, media_id: nil, media_url: nil, mime_type: nil, react_to_message_id: nil, reply_to_from: nil, reply_to_message_id: nil, reply_to_message_type: nil, reply_to_provider_message_id: nil, reply_to_text: nil, sections: nil, template_button_variables: nil, template_header_variables: nil, template_id: nil, template_variables: nil) + # @!method initialize(buttons: nil, contacts: nil, cta_display_text: nil, cta_header_media_url: nil, cta_header_text: nil, cta_header_type: nil, cta_url: nil, emoji: nil, filename: nil, footer_text: nil, latitude: nil, list_button: nil, location_address: nil, location_name: nil, longitude: nil, media_id: nil, media_url: nil, mime_type: nil, react_to_message_id: nil, referral: nil, reply_to_from: nil, reply_to_message_id: nil, reply_to_message_type: nil, reply_to_provider_message_id: nil, reply_to_text: nil, sections: nil, template_button_variables: nil, template_header_variables: nil, template_id: nil, template_variables: nil) # Some parameter documentations has been truncated, see # {Zavudev::Models::MessageContent} for more details. # @@ -253,6 +268,8 @@ class MessageContent < Zavudev::Internal::Type::BaseModel # # @param react_to_message_id [String] Message ID to react to. # + # @param referral [Zavudev::Models::MessageContent::Referral] Click-to-WhatsApp (CTWA) ad attribution: where an inbound conversation came from + # # @param reply_to_from [String] Sender of the quoted message (phone number in E.164 format). # # @param reply_to_message_id [String] Zavu message ID of the quoted message this message replies to. Present on inboun @@ -320,6 +337,136 @@ module CtaHeaderType # @return [Array] end + # @see Zavudev::Models::MessageContent#referral + class Referral < Zavudev::Internal::Type::BaseModel + # @!attribute body + # Body copy of the ad or post. + # + # @return [String, nil] + optional :body, String + + # @!attribute ctwa_clid + # Click-to-WhatsApp click identifier. This is the value Meta's Conversions API + # needs to credit a conversion back to the ad that produced the conversation. + # Present on `ad` sources; a `post` source has none. + # + # @return [String, nil] + optional :ctwa_clid, String, api_name: :ctwaClid + + # @!attribute headline + # Headline of the ad or post. + # + # @return [String, nil] + optional :headline, String + + # @!attribute image_url + # Image of the ad. Present when `mediaType` is `image`. + # + # @return [String, nil] + optional :image_url, String, api_name: :imageUrl + + # @!attribute media_type + # Type of media on the ad, when it had any. + # + # @return [Symbol, Zavudev::Models::MessageContent::Referral::MediaType, nil] + optional :media_type, enum: -> { Zavudev::MessageContent::Referral::MediaType }, api_name: :mediaType + + # @!attribute source_id + # Identifier of the ad or post that produced the click. + # + # @return [String, nil] + optional :source_id, String, api_name: :sourceId + + # @!attribute source_type + # Where the click came from. + # + # @return [Symbol, Zavudev::Models::MessageContent::Referral::SourceType, nil] + optional :source_type, + enum: -> { + Zavudev::MessageContent::Referral::SourceType + }, + api_name: :sourceType + + # @!attribute source_url + # Meta permalink to the ad or post. + # + # @return [String, nil] + optional :source_url, String, api_name: :sourceUrl + + # @!attribute thumbnail_url + # Thumbnail of the ad media. + # + # @return [String, nil] + optional :thumbnail_url, String, api_name: :thumbnailUrl + + # @!attribute video_url + # Video of the ad. Present when `mediaType` is `video`. + # + # @return [String, nil] + optional :video_url, String, api_name: :videoUrl + + # @!method initialize(body: nil, ctwa_clid: nil, headline: nil, image_url: nil, media_type: nil, source_id: nil, source_type: nil, source_url: nil, thumbnail_url: nil, video_url: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::MessageContent::Referral} for more details. + # + # Click-to-WhatsApp (CTWA) ad attribution: where an inbound conversation came + # from. + # + # WhatsApp only. Present on the **first inbound message** of a conversation opened + # from a Meta ad or post, and on no message after it — so store it when it arrives + # rather than expecting it again. Organic conversations never carry it. + # + # Field names are camelCased to match the rest of this API; Meta sends them as + # snake_case (`ctwa_clid`, `source_id`, ...). Fields that do not apply are + # omitted: a `post` source has no click id, and an image ad has no `videoUrl`. + # + # @param body [String] Body copy of the ad or post. + # + # @param ctwa_clid [String] Click-to-WhatsApp click identifier. This is the value Meta's Conversions API nee + # + # @param headline [String] Headline of the ad or post. + # + # @param image_url [String] Image of the ad. Present when `mediaType` is `image`. + # + # @param media_type [Symbol, Zavudev::Models::MessageContent::Referral::MediaType] Type of media on the ad, when it had any. + # + # @param source_id [String] Identifier of the ad or post that produced the click. + # + # @param source_type [Symbol, Zavudev::Models::MessageContent::Referral::SourceType] Where the click came from. + # + # @param source_url [String] Meta permalink to the ad or post. + # + # @param thumbnail_url [String] Thumbnail of the ad media. + # + # @param video_url [String] Video of the ad. Present when `mediaType` is `video`. + + # Type of media on the ad, when it had any. + # + # @see Zavudev::Models::MessageContent::Referral#media_type + module MediaType + extend Zavudev::Internal::Type::Enum + + IMAGE = :image + VIDEO = :video + + # @!method self.values + # @return [Array] + end + + # Where the click came from. + # + # @see Zavudev::Models::MessageContent::Referral#source_type + module SourceType + extend Zavudev::Internal::Type::Enum + + AD = :ad + POST = :post + + # @!method self.values + # @return [Array] + end + end + class Section < Zavudev::Internal::Type::BaseModel # @!attribute rows # diff --git a/lib/zavudev/models/webhook_event.rb b/lib/zavudev/models/webhook_event.rb index 9aa3c84..6535ee3 100644 --- a/lib/zavudev/models/webhook_event.rb +++ b/lib/zavudev/models/webhook_event.rb @@ -31,7 +31,12 @@ module Models # receive time in Unix milliseconds (the moment the channel received the message # from the contact — WhatsApp, Telegram, Instagram, Messenger; `null` for SMS # and email). Compare it against the top-level `timestamp` (when Zavu dispatched - # the webhook) to detect and ignore delayed deliveries. + # the webhook) to detect and ignore delayed deliveries. When the conversation + # was opened from a Click-to-WhatsApp ad or post, `data.referral` carries the ad + # attribution — including `ctwaClid`, the identifier Meta's Conversions API + # needs to credit a conversion back to that ad. WhatsApp only, and only on the + # first message of the thread: it is absent from every later message, so persist + # it when it arrives. # - `message.unsupported`: Received a message type that is not supported # # **Broadcast events:** diff --git a/rbi/zavudev/models/message_content.rbi b/rbi/zavudev/models/message_content.rbi index e41e138..c42f0f1 100644 --- a/rbi/zavudev/models/message_content.rbi +++ b/rbi/zavudev/models/message_content.rbi @@ -156,6 +156,22 @@ module Zavudev sig { params(react_to_message_id: String).void } attr_writer :react_to_message_id + # Click-to-WhatsApp (CTWA) ad attribution: where an inbound conversation came + # from. + # + # WhatsApp only. Present on the **first inbound message** of a conversation opened + # from a Meta ad or post, and on no message after it — so store it when it arrives + # rather than expecting it again. Organic conversations never carry it. + # + # Field names are camelCased to match the rest of this API; Meta sends them as + # snake_case (`ctwa_clid`, `source_id`, ...). Fields that do not apply are + # omitted: a `post` source has no click id, and an image ad has no `videoUrl`. + sig { returns(T.nilable(Zavudev::MessageContent::Referral)) } + attr_reader :referral + + sig { params(referral: Zavudev::MessageContent::Referral::OrHash).void } + attr_writer :referral + # Sender of the quoted message (phone number in E.164 format). sig { returns(T.nilable(String)) } attr_reader :reply_to_from @@ -277,6 +293,7 @@ module Zavudev media_url: String, mime_type: String, react_to_message_id: String, + referral: Zavudev::MessageContent::Referral::OrHash, reply_to_from: String, reply_to_message_id: String, reply_to_message_type: String, @@ -331,6 +348,17 @@ module Zavudev mime_type: nil, # Message ID to react to. react_to_message_id: nil, + # Click-to-WhatsApp (CTWA) ad attribution: where an inbound conversation came + # from. + # + # WhatsApp only. Present on the **first inbound message** of a conversation opened + # from a Meta ad or post, and on no message after it — so store it when it arrives + # rather than expecting it again. Organic conversations never carry it. + # + # Field names are camelCased to match the rest of this API; Meta sends them as + # snake_case (`ctwa_clid`, `source_id`, ...). Fields that do not apply are + # omitted: a `post` source has no click id, and an image ad has no `videoUrl`. + referral: nil, # Sender of the quoted message (phone number in E.164 format). reply_to_from: nil, # Zavu message ID of the quoted message this message replies to. Present on @@ -401,6 +429,7 @@ module Zavudev media_url: String, mime_type: String, react_to_message_id: String, + referral: Zavudev::MessageContent::Referral, reply_to_from: String, reply_to_message_id: String, reply_to_message_type: String, @@ -495,6 +524,237 @@ module Zavudev end end + class Referral < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Zavudev::MessageContent::Referral, Zavudev::Internal::AnyHash) + end + + # Body copy of the ad or post. + sig { returns(T.nilable(String)) } + attr_reader :body + + sig { params(body: String).void } + attr_writer :body + + # Click-to-WhatsApp click identifier. This is the value Meta's Conversions API + # needs to credit a conversion back to the ad that produced the conversation. + # Present on `ad` sources; a `post` source has none. + sig { returns(T.nilable(String)) } + attr_reader :ctwa_clid + + sig { params(ctwa_clid: String).void } + attr_writer :ctwa_clid + + # Headline of the ad or post. + sig { returns(T.nilable(String)) } + attr_reader :headline + + sig { params(headline: String).void } + attr_writer :headline + + # Image of the ad. Present when `mediaType` is `image`. + sig { returns(T.nilable(String)) } + attr_reader :image_url + + sig { params(image_url: String).void } + attr_writer :image_url + + # Type of media on the ad, when it had any. + sig do + returns( + T.nilable(Zavudev::MessageContent::Referral::MediaType::OrSymbol) + ) + end + attr_reader :media_type + + sig do + params( + media_type: Zavudev::MessageContent::Referral::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Identifier of the ad or post that produced the click. + sig { returns(T.nilable(String)) } + attr_reader :source_id + + sig { params(source_id: String).void } + attr_writer :source_id + + # Where the click came from. + sig do + returns( + T.nilable(Zavudev::MessageContent::Referral::SourceType::OrSymbol) + ) + end + attr_reader :source_type + + sig do + params( + source_type: Zavudev::MessageContent::Referral::SourceType::OrSymbol + ).void + end + attr_writer :source_type + + # Meta permalink to the ad or post. + sig { returns(T.nilable(String)) } + attr_reader :source_url + + sig { params(source_url: String).void } + attr_writer :source_url + + # Thumbnail of the ad media. + sig { returns(T.nilable(String)) } + attr_reader :thumbnail_url + + sig { params(thumbnail_url: String).void } + attr_writer :thumbnail_url + + # Video of the ad. Present when `mediaType` is `video`. + sig { returns(T.nilable(String)) } + attr_reader :video_url + + sig { params(video_url: String).void } + attr_writer :video_url + + # Click-to-WhatsApp (CTWA) ad attribution: where an inbound conversation came + # from. + # + # WhatsApp only. Present on the **first inbound message** of a conversation opened + # from a Meta ad or post, and on no message after it — so store it when it arrives + # rather than expecting it again. Organic conversations never carry it. + # + # Field names are camelCased to match the rest of this API; Meta sends them as + # snake_case (`ctwa_clid`, `source_id`, ...). Fields that do not apply are + # omitted: a `post` source has no click id, and an image ad has no `videoUrl`. + sig do + params( + body: String, + ctwa_clid: String, + headline: String, + image_url: String, + media_type: Zavudev::MessageContent::Referral::MediaType::OrSymbol, + source_id: String, + source_type: + Zavudev::MessageContent::Referral::SourceType::OrSymbol, + source_url: String, + thumbnail_url: String, + video_url: String + ).returns(T.attached_class) + end + def self.new( + # Body copy of the ad or post. + body: nil, + # Click-to-WhatsApp click identifier. This is the value Meta's Conversions API + # needs to credit a conversion back to the ad that produced the conversation. + # Present on `ad` sources; a `post` source has none. + ctwa_clid: nil, + # Headline of the ad or post. + headline: nil, + # Image of the ad. Present when `mediaType` is `image`. + image_url: nil, + # Type of media on the ad, when it had any. + media_type: nil, + # Identifier of the ad or post that produced the click. + source_id: nil, + # Where the click came from. + source_type: nil, + # Meta permalink to the ad or post. + source_url: nil, + # Thumbnail of the ad media. + thumbnail_url: nil, + # Video of the ad. Present when `mediaType` is `video`. + video_url: nil + ) + end + + sig do + override.returns( + { + body: String, + ctwa_clid: String, + headline: String, + image_url: String, + media_type: + Zavudev::MessageContent::Referral::MediaType::OrSymbol, + source_id: String, + source_type: + Zavudev::MessageContent::Referral::SourceType::OrSymbol, + source_url: String, + thumbnail_url: String, + video_url: String + } + ) + end + def to_hash + end + + # Type of media on the ad, when it had any. + module MediaType + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::MessageContent::Referral::MediaType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGE = + T.let( + :image, + Zavudev::MessageContent::Referral::MediaType::TaggedSymbol + ) + VIDEO = + T.let( + :video, + Zavudev::MessageContent::Referral::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::MessageContent::Referral::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Where the click came from. + module SourceType + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::MessageContent::Referral::SourceType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD = + T.let( + :ad, + Zavudev::MessageContent::Referral::SourceType::TaggedSymbol + ) + POST = + T.let( + :post, + Zavudev::MessageContent::Referral::SourceType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::MessageContent::Referral::SourceType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + class Section < Zavudev::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/zavudev/models/webhook_event.rbi b/rbi/zavudev/models/webhook_event.rbi index cc7439d..d558e4d 100644 --- a/rbi/zavudev/models/webhook_event.rbi +++ b/rbi/zavudev/models/webhook_event.rbi @@ -31,7 +31,12 @@ module Zavudev # receive time in Unix milliseconds (the moment the channel received the message # from the contact — WhatsApp, Telegram, Instagram, Messenger; `null` for SMS # and email). Compare it against the top-level `timestamp` (when Zavu dispatched - # the webhook) to detect and ignore delayed deliveries. + # the webhook) to detect and ignore delayed deliveries. When the conversation + # was opened from a Click-to-WhatsApp ad or post, `data.referral` carries the ad + # attribution — including `ctwaClid`, the identifier Meta's Conversions API + # needs to credit a conversion back to that ad. WhatsApp only, and only on the + # first message of the thread: it is absent from every later message, so persist + # it when it arrives. # - `message.unsupported`: Received a message type that is not supported # # **Broadcast events:** diff --git a/sig/zavudev/models/message_content.rbs b/sig/zavudev/models/message_content.rbs index f4a2e70..b7c8c69 100644 --- a/sig/zavudev/models/message_content.rbs +++ b/sig/zavudev/models/message_content.rbs @@ -21,6 +21,7 @@ module Zavudev media_url: String, mime_type: String, react_to_message_id: String, + referral: Zavudev::MessageContent::Referral, reply_to_from: String, reply_to_message_id: String, reply_to_message_type: String, @@ -116,6 +117,12 @@ module Zavudev def react_to_message_id=: (String) -> String + attr_reader referral: Zavudev::MessageContent::Referral? + + def referral=: ( + Zavudev::MessageContent::Referral + ) -> Zavudev::MessageContent::Referral + attr_reader reply_to_from: String? def reply_to_from=: (String) -> String @@ -184,6 +191,7 @@ module Zavudev ?media_url: String, ?mime_type: String, ?react_to_message_id: String, + ?referral: Zavudev::MessageContent::Referral, ?reply_to_from: String, ?reply_to_message_id: String, ?reply_to_message_type: String, @@ -216,6 +224,7 @@ module Zavudev media_url: String, mime_type: String, react_to_message_id: String, + referral: Zavudev::MessageContent::Referral, reply_to_from: String, reply_to_message_id: String, reply_to_message_type: String, @@ -269,6 +278,114 @@ module Zavudev def self?.values: -> ::Array[Zavudev::Models::MessageContent::cta_header_type] end + type referral = + { + body: String, + ctwa_clid: String, + headline: String, + image_url: String, + media_type: Zavudev::Models::MessageContent::Referral::media_type, + source_id: String, + source_type: Zavudev::Models::MessageContent::Referral::source_type, + source_url: String, + thumbnail_url: String, + video_url: String + } + + class Referral < Zavudev::Internal::Type::BaseModel + attr_reader body: String? + + def body=: (String) -> String + + attr_reader ctwa_clid: String? + + def ctwa_clid=: (String) -> String + + attr_reader headline: String? + + def headline=: (String) -> String + + attr_reader image_url: String? + + def image_url=: (String) -> String + + attr_reader media_type: Zavudev::Models::MessageContent::Referral::media_type? + + def media_type=: ( + Zavudev::Models::MessageContent::Referral::media_type + ) -> Zavudev::Models::MessageContent::Referral::media_type + + attr_reader source_id: String? + + def source_id=: (String) -> String + + attr_reader source_type: Zavudev::Models::MessageContent::Referral::source_type? + + def source_type=: ( + Zavudev::Models::MessageContent::Referral::source_type + ) -> Zavudev::Models::MessageContent::Referral::source_type + + attr_reader source_url: String? + + def source_url=: (String) -> String + + attr_reader thumbnail_url: String? + + def thumbnail_url=: (String) -> String + + attr_reader video_url: String? + + def video_url=: (String) -> String + + def initialize: ( + ?body: String, + ?ctwa_clid: String, + ?headline: String, + ?image_url: String, + ?media_type: Zavudev::Models::MessageContent::Referral::media_type, + ?source_id: String, + ?source_type: Zavudev::Models::MessageContent::Referral::source_type, + ?source_url: String, + ?thumbnail_url: String, + ?video_url: String + ) -> void + + def to_hash: -> { + body: String, + ctwa_clid: String, + headline: String, + image_url: String, + media_type: Zavudev::Models::MessageContent::Referral::media_type, + source_id: String, + source_type: Zavudev::Models::MessageContent::Referral::source_type, + source_url: String, + thumbnail_url: String, + video_url: String + } + + type media_type = :image | :video + + module MediaType + extend Zavudev::Internal::Type::Enum + + IMAGE: :image + VIDEO: :video + + def self?.values: -> ::Array[Zavudev::Models::MessageContent::Referral::media_type] + end + + type source_type = :ad | :post + + module SourceType + extend Zavudev::Internal::Type::Enum + + AD: :ad + POST: :post + + def self?.values: -> ::Array[Zavudev::Models::MessageContent::Referral::source_type] + end + end + type section = { rows: ::Array[Zavudev::MessageContent::Section::Row], title: String } From f13943f6b2ba01716bf8c81f28b298d5133bfad3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 17 Aug 2026 20:37:33 +0000 Subject: [PATCH 05/17] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c8f40a3..d1cb2f5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 138 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-8ead699d165bc116549ef757ace827bf39add6e0e19afdc1653f0d0282947eae.yml -openapi_spec_hash: 5a35a5dab833f4d1e6deeea795e1abf2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-a3e89fc19e2d04b767db8da79617311c572cc2a0273abf1f211c77999c164a71.yml +openapi_spec_hash: 920231951c3213b2a70bdddf6f4922fb config_hash: 7fca08d9dae18513f5d7451cea11e34c From 2c7373c77febad8776a26e8d41b5622346ce2f1a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 12:42:02 +0000 Subject: [PATCH 06/17] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d1cb2f5..968d7bb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 138 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-a3e89fc19e2d04b767db8da79617311c572cc2a0273abf1f211c77999c164a71.yml -openapi_spec_hash: 920231951c3213b2a70bdddf6f4922fb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-5f801823f89d92d2c00f2bc33b30aa7b127f21b5f3fb38f9278f06ce1d79b869.yml +openapi_spec_hash: d1baedab2c021ab97b4aba0030180b29 config_hash: 7fca08d9dae18513f5d7451cea11e34c From 93a3b3ead74b57e780d1b171e5051eea4d49c250 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:07:04 +0000 Subject: [PATCH 07/17] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 968d7bb..ec5b810 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 138 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-5f801823f89d92d2c00f2bc33b30aa7b127f21b5f3fb38f9278f06ce1d79b869.yml -openapi_spec_hash: d1baedab2c021ab97b4aba0030180b29 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-9acbefe4fc4908c698c1165bed491d415687f0092e9df6ffb968f92e43b11961.yml +openapi_spec_hash: 410cb45b6fa3a8a1f3da3aba50accbdc config_hash: 7fca08d9dae18513f5d7451cea11e34c From 83ed616d532968a4b64a248b6efeb870c383c417 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:24:10 +0000 Subject: [PATCH 08/17] feat(api): manual updates --- .stats.yml | 6 +- lib/zavudev.rb | 93 ++++ lib/zavudev/client.rb | 20 + lib/zavudev/models.rb | 60 +++ lib/zavudev/models/agent_create_params.rb | 278 +++++++++++ lib/zavudev/models/agent_create_response.rb | 17 + lib/zavudev/models/agent_delete_params.rb | 20 + lib/zavudev/models/agent_list_params.rb | 26 + .../models/agent_list_voices_params.rb | 22 + .../models/agent_list_voices_response.rb | 57 +++ lib/zavudev/models/agent_retrieve_params.rb | 20 + lib/zavudev/models/agent_retrieve_response.rb | 17 + .../models/agent_template_list_params.rb | 14 + .../models/agent_template_list_response.rb | 77 +++ .../models/agent_template_retrieve_params.rb | 20 + .../agent_template_retrieve_response.rb | 144 ++++++ lib/zavudev/models/agent_test_params.rb | 91 ++++ lib/zavudev/models/agent_test_response.rb | 117 +++++ lib/zavudev/models/agent_update_params.rb | 295 +++++++++++ lib/zavudev/models/agent_update_response.rb | 17 + .../models/agents/sender_connect_params.rb | 31 ++ .../models/agents/sender_connect_response.rb | 19 + .../models/agents/sender_disconnect_params.rb | 28 ++ lib/zavudev/models/call_create_params.rb | 72 +++ lib/zavudev/models/call_create_response.rb | 262 ++++++++++ lib/zavudev/models/call_hangup_params.rb | 20 + lib/zavudev/models/call_hangup_response.rb | 262 ++++++++++ lib/zavudev/models/call_list_params.rb | 95 ++++ lib/zavudev/models/call_list_response.rb | 251 ++++++++++ lib/zavudev/models/call_retrieve_params.rb | 20 + lib/zavudev/models/call_retrieve_response.rb | 262 ++++++++++ .../conversation_list_messages_params.rb | 36 ++ .../models/conversation_list_params.rb | 85 ++++ .../models/conversation_list_response.rb | 226 +++++++++ .../conversation_mark_as_read_params.rb | 20 + .../conversation_mark_as_read_response.rb | 245 +++++++++ .../models/conversation_retrieve_params.rb | 20 + .../models/conversation_retrieve_response.rb | 244 +++++++++ .../models/email_domain_create_params.rb | 22 + .../models/email_domain_create_response.rb | 134 +++++ .../models/email_domain_delete_params.rb | 20 + .../models/email_domain_list_params.rb | 14 + .../models/email_domain_list_response.rb | 132 +++++ .../models/email_domain_retrieve_params.rb | 20 + .../models/email_domain_retrieve_response.rb | 134 +++++ .../models/email_domain_verify_params.rb | 20 + .../models/email_domain_verify_response.rb | 134 +++++ .../function_list_deployments_params.rb | 26 + .../function_list_deployments_response.rb | 95 ++++ .../function_list_event_types_params.rb | 14 + .../function_list_event_types_response.rb | 16 + .../function_rollback_deployment_params.rb | 29 ++ .../function_rollback_deployment_response.rb | 137 +++++ .../functions/git_link_deploy_now_params.rb | 22 + .../functions/git_link_deploy_now_response.rb | 18 + .../models/functions/git_link_link_params.rb | 59 +++ .../functions/git_link_link_response.rb | 222 ++++++++ .../functions/git_link_retrieve_params.rb | 22 + .../functions/git_link_retrieve_response.rb | 222 ++++++++ .../functions/git_link_unlink_params.rb | 22 + .../functions/git_link_update_params.rb | 40 ++ .../functions/git_link_update_response.rb | 222 ++++++++ .../models/functions/trigger_create_params.rb | 51 ++ .../functions/trigger_create_response.rb | 120 +++++ .../models/functions/trigger_delete_params.rb | 22 + .../models/functions/trigger_list_params.rb | 22 + .../models/functions/trigger_list_response.rb | 105 ++++ .../models/functions/trigger_update_params.rb | 28 ++ .../functions/trigger_update_response.rb | 24 + .../introspect_validate_email_params.rb | 30 ++ .../introspect_validate_email_response.rb | 145 ++++++ .../models/message_list_attachments_params.rb | 20 + .../message_list_attachments_response.rb | 90 ++++ .../document_retrieve_document_params.rb | 38 ++ .../document_retrieve_document_response.rb | 22 + .../document_update_document_params.rb | 50 ++ .../document_update_document_response.rb | 22 + .../agent/tool_list_test_runs_params.rb | 36 ++ .../agent/tool_list_test_runs_response.rb | 101 ++++ .../tools/webhook_rotate_secret_params.rb | 32 ++ .../models/senders/telegram_connect_params.rb | 31 ++ .../senders/telegram_connect_response.rb | 41 ++ .../senders/telegram_disconnect_params.rb | 22 + lib/zavudev/models/template_sync_params.rb | 26 + lib/zavudev/models/template_sync_response.rb | 63 +++ lib/zavudev/models/url_escalate_params.rb | 29 ++ lib/zavudev/models/url_escalate_response.rb | 22 + lib/zavudev/resources/agent_templates.rb | 56 +++ lib/zavudev/resources/agents.rb | 253 ++++++++++ lib/zavudev/resources/agents/senders.rb | 70 +++ lib/zavudev/resources/calls.rb | 138 +++++ lib/zavudev/resources/conversations.rb | 124 +++++ lib/zavudev/resources/email_domains.rb | 113 +++++ lib/zavudev/resources/functions.rb | 82 +++ lib/zavudev/resources/functions/git_link.rb | 151 ++++++ lib/zavudev/resources/functions/triggers.rb | 116 +++++ lib/zavudev/resources/introspect.rb | 33 ++ lib/zavudev/resources/messages.rb | 24 + lib/zavudev/resources/senders.rb | 4 + .../agent/knowledge_bases/documents.rb | 71 +++ lib/zavudev/resources/senders/agent/tools.rb | 37 ++ .../resources/senders/agent/tools/webhook.rb | 47 ++ lib/zavudev/resources/senders/telegram.rb | 61 +++ lib/zavudev/resources/templates.rb | 45 ++ lib/zavudev/resources/urls.rb | 25 + rbi/zavudev/client.rbi | 15 + rbi/zavudev/models.rbi | 62 +++ rbi/zavudev/models/agent_create_params.rbi | 417 ++++++++++++++++ rbi/zavudev/models/agent_create_response.rbi | 37 ++ rbi/zavudev/models/agent_delete_params.rbi | 35 ++ rbi/zavudev/models/agent_list_params.rbi | 49 ++ .../models/agent_list_voices_params.rbi | 43 ++ .../models/agent_list_voices_response.rbi | 95 ++++ rbi/zavudev/models/agent_retrieve_params.rbi | 35 ++ .../models/agent_retrieve_response.rbi | 37 ++ .../models/agent_template_list_params.rbi | 27 + .../models/agent_template_list_response.rbi | 153 ++++++ .../models/agent_template_retrieve_params.rbi | 38 ++ .../agent_template_retrieve_response.rbi | 266 ++++++++++ rbi/zavudev/models/agent_test_params.rbi | 161 ++++++ rbi/zavudev/models/agent_test_response.rbi | 176 +++++++ rbi/zavudev/models/agent_update_params.rbi | 441 ++++++++++++++++ rbi/zavudev/models/agent_update_response.rbi | 37 ++ .../models/agents/sender_connect_params.rbi | 54 ++ .../models/agents/sender_connect_response.rbi | 39 ++ .../agents/sender_disconnect_params.rbi | 48 ++ rbi/zavudev/models/call_create_params.rbi | 112 +++++ rbi/zavudev/models/call_create_response.rbi | 466 +++++++++++++++++ rbi/zavudev/models/call_hangup_params.rbi | 35 ++ rbi/zavudev/models/call_hangup_response.rbi | 466 +++++++++++++++++ rbi/zavudev/models/call_list_params.rbi | 159 ++++++ rbi/zavudev/models/call_list_response.rbi | 405 +++++++++++++++ rbi/zavudev/models/call_retrieve_params.rbi | 35 ++ rbi/zavudev/models/call_retrieve_response.rbi | 472 ++++++++++++++++++ .../conversation_list_messages_params.rbi | 64 +++ .../models/conversation_list_params.rbi | 167 +++++++ .../models/conversation_list_response.rbi | 367 ++++++++++++++ .../conversation_mark_as_read_params.rbi | 38 ++ .../conversation_mark_as_read_response.rbi | 436 ++++++++++++++++ .../models/conversation_retrieve_params.rbi | 35 ++ .../models/conversation_retrieve_response.rbi | 436 ++++++++++++++++ .../models/email_domain_create_params.rbi | 40 ++ .../models/email_domain_create_response.rbi | 259 ++++++++++ .../models/email_domain_delete_params.rbi | 35 ++ .../models/email_domain_list_params.rbi | 27 + .../models/email_domain_list_response.rbi | 253 ++++++++++ .../models/email_domain_retrieve_params.rbi | 35 ++ .../models/email_domain_retrieve_response.rbi | 259 ++++++++++ .../models/email_domain_verify_params.rbi | 35 ++ .../models/email_domain_verify_response.rbi | 259 ++++++++++ .../function_list_deployments_params.rbi | 49 ++ .../function_list_deployments_response.rbi | 211 ++++++++ .../function_list_event_types_params.rbi | 30 ++ .../function_list_event_types_response.rbi | 26 + .../function_rollback_deployment_params.rbi | 52 ++ .../function_rollback_deployment_response.rbi | 240 +++++++++ .../functions/git_link_deploy_now_params.rbi | 40 ++ .../git_link_deploy_now_response.rbi | 28 ++ .../models/functions/git_link_link_params.rbi | 87 ++++ .../functions/git_link_link_response.rbi | 360 +++++++++++++ .../functions/git_link_retrieve_params.rbi | 40 ++ .../functions/git_link_retrieve_response.rbi | 364 ++++++++++++++ .../functions/git_link_unlink_params.rbi | 40 ++ .../functions/git_link_update_params.rbi | 70 +++ .../functions/git_link_update_response.rbi | 362 ++++++++++++++ .../functions/trigger_create_params.rbi | 75 +++ .../functions/trigger_create_response.rbi | 168 +++++++ .../functions/trigger_delete_params.rbi | 40 ++ .../models/functions/trigger_list_params.rbi | 40 ++ .../functions/trigger_list_response.rbi | 152 ++++++ .../functions/trigger_update_params.rbi | 48 ++ .../functions/trigger_update_response.rbi | 33 ++ .../introspect_validate_email_params.rbi | 60 +++ .../introspect_validate_email_response.rbi | 328 ++++++++++++ .../message_list_attachments_params.rbi | 38 ++ .../message_list_attachments_response.rbi | 136 +++++ .../document_retrieve_document_params.rbi | 57 +++ .../document_retrieve_document_response.rbi | 47 ++ .../document_update_document_params.rbi | 80 +++ .../document_update_document_response.rbi | 47 ++ .../agent/tool_list_test_runs_params.rbi | 58 +++ .../agent/tool_list_test_runs_response.rbi | 152 ++++++ .../tools/webhook_rotate_secret_params.rbi | 52 ++ .../senders/telegram_connect_params.rbi | 54 ++ .../senders/telegram_connect_response.rbi | 93 ++++ .../senders/telegram_disconnect_params.rbi | 40 ++ rbi/zavudev/models/template_sync_params.rbi | 45 ++ rbi/zavudev/models/template_sync_response.rbi | 86 ++++ rbi/zavudev/models/url_escalate_params.rbi | 49 ++ rbi/zavudev/models/url_escalate_response.rbi | 36 ++ rbi/zavudev/resources/agent_templates.rbi | 36 ++ rbi/zavudev/resources/agents.rbi | 204 ++++++++ rbi/zavudev/resources/agents/senders.rbi | 50 ++ rbi/zavudev/resources/calls.rbi | 123 +++++ rbi/zavudev/resources/conversations.rbi | 98 ++++ rbi/zavudev/resources/email_domains.rbi | 67 +++ rbi/zavudev/resources/functions.rbi | 55 ++ rbi/zavudev/resources/functions/git_link.rbi | 116 +++++ rbi/zavudev/resources/functions/triggers.rbi | 81 +++ rbi/zavudev/resources/introspect.rbi | 26 + rbi/zavudev/resources/messages.rbi | 15 + rbi/zavudev/resources/senders.rbi | 3 + .../agent/knowledge_bases/documents.rbi | 48 ++ rbi/zavudev/resources/senders/agent/tools.rbi | 25 + .../resources/senders/agent/tools/webhook.rbi | 31 ++ rbi/zavudev/resources/senders/telegram.rbi | 42 ++ rbi/zavudev/resources/templates.rbi | 35 ++ rbi/zavudev/resources/urls.rbi | 17 + sig/zavudev/client.rbs | 10 + sig/zavudev/models.rbs | 60 +++ sig/zavudev/models/agent_create_params.rbs | 234 +++++++++ sig/zavudev/models/agent_create_response.rbs | 13 + sig/zavudev/models/agent_delete_params.rbs | 23 + sig/zavudev/models/agent_list_params.rbs | 32 ++ .../models/agent_list_voices_params.rbs | 25 + .../models/agent_list_voices_response.rbs | 46 ++ sig/zavudev/models/agent_retrieve_params.rbs | 23 + .../models/agent_retrieve_response.rbs | 13 + .../models/agent_template_list_params.rbs | 15 + .../models/agent_template_list_response.rbs | 73 +++ .../models/agent_template_retrieve_params.rbs | 23 + .../agent_template_retrieve_response.rbs | 112 +++++ sig/zavudev/models/agent_test_params.rbs | 87 ++++ sig/zavudev/models/agent_test_response.rbs | 78 +++ sig/zavudev/models/agent_update_params.rbs | 259 ++++++++++ sig/zavudev/models/agent_update_response.rbs | 13 + .../models/agents/sender_connect_params.rbs | 30 ++ .../models/agents/sender_connect_response.rbs | 15 + .../agents/sender_disconnect_params.rbs | 30 ++ sig/zavudev/models/call_create_params.rbs | 61 +++ sig/zavudev/models/call_create_response.rbs | 194 +++++++ sig/zavudev/models/call_hangup_params.rbs | 23 + sig/zavudev/models/call_hangup_response.rbs | 194 +++++++ sig/zavudev/models/call_list_params.rbs | 89 ++++ sig/zavudev/models/call_list_response.rbs | 183 +++++++ sig/zavudev/models/call_retrieve_params.rbs | 23 + sig/zavudev/models/call_retrieve_response.rbs | 196 ++++++++ .../conversation_list_messages_params.rbs | 36 ++ .../models/conversation_list_params.rbs | 83 +++ .../models/conversation_list_response.rbs | 184 +++++++ .../conversation_mark_as_read_params.rbs | 23 + .../conversation_mark_as_read_response.rbs | 201 ++++++++ .../models/conversation_retrieve_params.rbs | 23 + .../models/conversation_retrieve_response.rbs | 201 ++++++++ .../models/email_domain_create_params.rbs | 23 + .../models/email_domain_create_response.rbs | 116 +++++ .../models/email_domain_delete_params.rbs | 23 + .../models/email_domain_list_params.rbs | 15 + .../models/email_domain_list_response.rbs | 116 +++++ .../models/email_domain_retrieve_params.rbs | 23 + .../models/email_domain_retrieve_response.rbs | 116 +++++ .../models/email_domain_verify_params.rbs | 23 + .../models/email_domain_verify_response.rbs | 116 +++++ .../function_list_deployments_params.rbs | 30 ++ .../function_list_deployments_response.rbs | 107 ++++ .../function_list_event_types_params.rbs | 15 + .../function_list_event_types_response.rbs | 13 + .../function_rollback_deployment_params.rbs | 28 ++ .../function_rollback_deployment_response.rbs | 117 +++++ .../functions/git_link_deploy_now_params.rbs | 25 + .../git_link_deploy_now_response.rbs | 15 + .../models/functions/git_link_link_params.rbs | 59 +++ .../functions/git_link_link_response.rbs | 159 ++++++ .../functions/git_link_retrieve_params.rbs | 25 + .../functions/git_link_retrieve_response.rbs | 159 ++++++ .../functions/git_link_unlink_params.rbs | 25 + .../functions/git_link_update_params.rbs | 47 ++ .../functions/git_link_update_response.rbs | 159 ++++++ .../functions/trigger_create_params.rbs | 45 ++ .../functions/trigger_create_response.rbs | 94 ++++ .../functions/trigger_delete_params.rbs | 25 + .../models/functions/trigger_list_params.rbs | 25 + .../functions/trigger_list_response.rbs | 84 ++++ .../functions/trigger_update_params.rbs | 30 ++ .../functions/trigger_update_response.rbs | 17 + .../introspect_validate_email_params.rbs | 32 ++ .../introspect_validate_email_response.rbs | 135 +++++ .../message_list_attachments_params.rbs | 23 + .../message_list_attachments_response.rbs | 70 +++ .../document_retrieve_document_params.rbs | 38 ++ .../document_retrieve_document_response.rbs | 22 + .../document_update_document_params.rbs | 56 +++ .../document_update_document_response.rbs | 22 + .../agent/tool_list_test_runs_params.rbs | 38 ++ .../agent/tool_list_test_runs_response.rbs | 83 +++ .../tools/webhook_rotate_secret_params.rbs | 34 ++ .../senders/telegram_connect_params.rbs | 30 ++ .../senders/telegram_connect_response.rbs | 49 ++ .../senders/telegram_disconnect_params.rbs | 25 + sig/zavudev/models/template_sync_params.rbs | 25 + sig/zavudev/models/template_sync_response.rbs | 45 ++ sig/zavudev/models/url_escalate_params.rbs | 28 ++ sig/zavudev/models/url_escalate_response.rbs | 15 + sig/zavudev/resources/agent_templates.rbs | 16 + sig/zavudev/resources/agents.rbs | 72 +++ sig/zavudev/resources/agents/senders.rbs | 21 + sig/zavudev/resources/calls.rbs | 35 ++ sig/zavudev/resources/conversations.rbs | 33 ++ sig/zavudev/resources/email_domains.rbs | 31 ++ sig/zavudev/resources/functions.rbs | 20 + sig/zavudev/resources/functions/git_link.rbs | 42 ++ sig/zavudev/resources/functions/triggers.rbs | 33 ++ sig/zavudev/resources/introspect.rbs | 6 + sig/zavudev/resources/messages.rbs | 5 + sig/zavudev/resources/senders.rbs | 2 + .../agent/knowledge_bases/documents.rbs | 16 + sig/zavudev/resources/senders/agent/tools.rbs | 9 + .../resources/senders/agent/tools/webhook.rbs | 19 + sig/zavudev/resources/senders/telegram.rbs | 20 + sig/zavudev/resources/templates.rbs | 5 + sig/zavudev/resources/urls.rbs | 6 + test/zavudev/resource_namespaces.rb | 12 + .../zavudev/resources/agent_templates_test.rb | 37 ++ test/zavudev/resources/agents/senders_test.rb | 31 ++ test/zavudev/resources/agents_test.rb | 146 ++++++ test/zavudev/resources/calls_test.rb | 90 ++++ test/zavudev/resources/conversations_test.rb | 113 +++++ test/zavudev/resources/email_domains_test.rb | 79 +++ .../resources/functions/git_link_test.rb | 85 ++++ .../resources/functions/triggers_test.rb | 67 +++ test/zavudev/resources/functions_test.rb | 50 ++ test/zavudev/resources/introspect_test.rb | 17 + test/zavudev/resources/messages_test.rb | 16 + .../agent/knowledge_bases/documents_test.rb | 42 ++ .../senders/agent/tools/webhook_test.rb | 21 + .../resources/senders/agent/tools_test.rb | 16 + .../resources/senders/telegram_test.rb | 31 ++ test/zavudev/resources/templates_test.rb | 21 + test/zavudev/resources/urls_test.rb | 18 + 329 files changed, 27144 insertions(+), 3 deletions(-) create mode 100644 lib/zavudev/models/agent_create_params.rb create mode 100644 lib/zavudev/models/agent_create_response.rb create mode 100644 lib/zavudev/models/agent_delete_params.rb create mode 100644 lib/zavudev/models/agent_list_params.rb create mode 100644 lib/zavudev/models/agent_list_voices_params.rb create mode 100644 lib/zavudev/models/agent_list_voices_response.rb create mode 100644 lib/zavudev/models/agent_retrieve_params.rb create mode 100644 lib/zavudev/models/agent_retrieve_response.rb create mode 100644 lib/zavudev/models/agent_template_list_params.rb create mode 100644 lib/zavudev/models/agent_template_list_response.rb create mode 100644 lib/zavudev/models/agent_template_retrieve_params.rb create mode 100644 lib/zavudev/models/agent_template_retrieve_response.rb create mode 100644 lib/zavudev/models/agent_test_params.rb create mode 100644 lib/zavudev/models/agent_test_response.rb create mode 100644 lib/zavudev/models/agent_update_params.rb create mode 100644 lib/zavudev/models/agent_update_response.rb create mode 100644 lib/zavudev/models/agents/sender_connect_params.rb create mode 100644 lib/zavudev/models/agents/sender_connect_response.rb create mode 100644 lib/zavudev/models/agents/sender_disconnect_params.rb create mode 100644 lib/zavudev/models/call_create_params.rb create mode 100644 lib/zavudev/models/call_create_response.rb create mode 100644 lib/zavudev/models/call_hangup_params.rb create mode 100644 lib/zavudev/models/call_hangup_response.rb create mode 100644 lib/zavudev/models/call_list_params.rb create mode 100644 lib/zavudev/models/call_list_response.rb create mode 100644 lib/zavudev/models/call_retrieve_params.rb create mode 100644 lib/zavudev/models/call_retrieve_response.rb create mode 100644 lib/zavudev/models/conversation_list_messages_params.rb create mode 100644 lib/zavudev/models/conversation_list_params.rb create mode 100644 lib/zavudev/models/conversation_list_response.rb create mode 100644 lib/zavudev/models/conversation_mark_as_read_params.rb create mode 100644 lib/zavudev/models/conversation_mark_as_read_response.rb create mode 100644 lib/zavudev/models/conversation_retrieve_params.rb create mode 100644 lib/zavudev/models/conversation_retrieve_response.rb create mode 100644 lib/zavudev/models/email_domain_create_params.rb create mode 100644 lib/zavudev/models/email_domain_create_response.rb create mode 100644 lib/zavudev/models/email_domain_delete_params.rb create mode 100644 lib/zavudev/models/email_domain_list_params.rb create mode 100644 lib/zavudev/models/email_domain_list_response.rb create mode 100644 lib/zavudev/models/email_domain_retrieve_params.rb create mode 100644 lib/zavudev/models/email_domain_retrieve_response.rb create mode 100644 lib/zavudev/models/email_domain_verify_params.rb create mode 100644 lib/zavudev/models/email_domain_verify_response.rb create mode 100644 lib/zavudev/models/function_list_deployments_params.rb create mode 100644 lib/zavudev/models/function_list_deployments_response.rb create mode 100644 lib/zavudev/models/function_list_event_types_params.rb create mode 100644 lib/zavudev/models/function_list_event_types_response.rb create mode 100644 lib/zavudev/models/function_rollback_deployment_params.rb create mode 100644 lib/zavudev/models/function_rollback_deployment_response.rb create mode 100644 lib/zavudev/models/functions/git_link_deploy_now_params.rb create mode 100644 lib/zavudev/models/functions/git_link_deploy_now_response.rb create mode 100644 lib/zavudev/models/functions/git_link_link_params.rb create mode 100644 lib/zavudev/models/functions/git_link_link_response.rb create mode 100644 lib/zavudev/models/functions/git_link_retrieve_params.rb create mode 100644 lib/zavudev/models/functions/git_link_retrieve_response.rb create mode 100644 lib/zavudev/models/functions/git_link_unlink_params.rb create mode 100644 lib/zavudev/models/functions/git_link_update_params.rb create mode 100644 lib/zavudev/models/functions/git_link_update_response.rb create mode 100644 lib/zavudev/models/functions/trigger_create_params.rb create mode 100644 lib/zavudev/models/functions/trigger_create_response.rb create mode 100644 lib/zavudev/models/functions/trigger_delete_params.rb create mode 100644 lib/zavudev/models/functions/trigger_list_params.rb create mode 100644 lib/zavudev/models/functions/trigger_list_response.rb create mode 100644 lib/zavudev/models/functions/trigger_update_params.rb create mode 100644 lib/zavudev/models/functions/trigger_update_response.rb create mode 100644 lib/zavudev/models/introspect_validate_email_params.rb create mode 100644 lib/zavudev/models/introspect_validate_email_response.rb create mode 100644 lib/zavudev/models/message_list_attachments_params.rb create mode 100644 lib/zavudev/models/message_list_attachments_response.rb create mode 100644 lib/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_params.rb create mode 100644 lib/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rb create mode 100644 lib/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rb create mode 100644 lib/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rb create mode 100644 lib/zavudev/models/senders/agent/tool_list_test_runs_params.rb create mode 100644 lib/zavudev/models/senders/agent/tool_list_test_runs_response.rb create mode 100644 lib/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rb create mode 100644 lib/zavudev/models/senders/telegram_connect_params.rb create mode 100644 lib/zavudev/models/senders/telegram_connect_response.rb create mode 100644 lib/zavudev/models/senders/telegram_disconnect_params.rb create mode 100644 lib/zavudev/models/template_sync_params.rb create mode 100644 lib/zavudev/models/template_sync_response.rb create mode 100644 lib/zavudev/models/url_escalate_params.rb create mode 100644 lib/zavudev/models/url_escalate_response.rb create mode 100644 lib/zavudev/resources/agent_templates.rb create mode 100644 lib/zavudev/resources/agents.rb create mode 100644 lib/zavudev/resources/agents/senders.rb create mode 100644 lib/zavudev/resources/calls.rb create mode 100644 lib/zavudev/resources/conversations.rb create mode 100644 lib/zavudev/resources/email_domains.rb create mode 100644 lib/zavudev/resources/functions/git_link.rb create mode 100644 lib/zavudev/resources/functions/triggers.rb create mode 100644 lib/zavudev/resources/senders/agent/tools/webhook.rb create mode 100644 lib/zavudev/resources/senders/telegram.rb create mode 100644 rbi/zavudev/models/agent_create_params.rbi create mode 100644 rbi/zavudev/models/agent_create_response.rbi create mode 100644 rbi/zavudev/models/agent_delete_params.rbi create mode 100644 rbi/zavudev/models/agent_list_params.rbi create mode 100644 rbi/zavudev/models/agent_list_voices_params.rbi create mode 100644 rbi/zavudev/models/agent_list_voices_response.rbi create mode 100644 rbi/zavudev/models/agent_retrieve_params.rbi create mode 100644 rbi/zavudev/models/agent_retrieve_response.rbi create mode 100644 rbi/zavudev/models/agent_template_list_params.rbi create mode 100644 rbi/zavudev/models/agent_template_list_response.rbi create mode 100644 rbi/zavudev/models/agent_template_retrieve_params.rbi create mode 100644 rbi/zavudev/models/agent_template_retrieve_response.rbi create mode 100644 rbi/zavudev/models/agent_test_params.rbi create mode 100644 rbi/zavudev/models/agent_test_response.rbi create mode 100644 rbi/zavudev/models/agent_update_params.rbi create mode 100644 rbi/zavudev/models/agent_update_response.rbi create mode 100644 rbi/zavudev/models/agents/sender_connect_params.rbi create mode 100644 rbi/zavudev/models/agents/sender_connect_response.rbi create mode 100644 rbi/zavudev/models/agents/sender_disconnect_params.rbi create mode 100644 rbi/zavudev/models/call_create_params.rbi create mode 100644 rbi/zavudev/models/call_create_response.rbi create mode 100644 rbi/zavudev/models/call_hangup_params.rbi create mode 100644 rbi/zavudev/models/call_hangup_response.rbi create mode 100644 rbi/zavudev/models/call_list_params.rbi create mode 100644 rbi/zavudev/models/call_list_response.rbi create mode 100644 rbi/zavudev/models/call_retrieve_params.rbi create mode 100644 rbi/zavudev/models/call_retrieve_response.rbi create mode 100644 rbi/zavudev/models/conversation_list_messages_params.rbi create mode 100644 rbi/zavudev/models/conversation_list_params.rbi create mode 100644 rbi/zavudev/models/conversation_list_response.rbi create mode 100644 rbi/zavudev/models/conversation_mark_as_read_params.rbi create mode 100644 rbi/zavudev/models/conversation_mark_as_read_response.rbi create mode 100644 rbi/zavudev/models/conversation_retrieve_params.rbi create mode 100644 rbi/zavudev/models/conversation_retrieve_response.rbi create mode 100644 rbi/zavudev/models/email_domain_create_params.rbi create mode 100644 rbi/zavudev/models/email_domain_create_response.rbi create mode 100644 rbi/zavudev/models/email_domain_delete_params.rbi create mode 100644 rbi/zavudev/models/email_domain_list_params.rbi create mode 100644 rbi/zavudev/models/email_domain_list_response.rbi create mode 100644 rbi/zavudev/models/email_domain_retrieve_params.rbi create mode 100644 rbi/zavudev/models/email_domain_retrieve_response.rbi create mode 100644 rbi/zavudev/models/email_domain_verify_params.rbi create mode 100644 rbi/zavudev/models/email_domain_verify_response.rbi create mode 100644 rbi/zavudev/models/function_list_deployments_params.rbi create mode 100644 rbi/zavudev/models/function_list_deployments_response.rbi create mode 100644 rbi/zavudev/models/function_list_event_types_params.rbi create mode 100644 rbi/zavudev/models/function_list_event_types_response.rbi create mode 100644 rbi/zavudev/models/function_rollback_deployment_params.rbi create mode 100644 rbi/zavudev/models/function_rollback_deployment_response.rbi create mode 100644 rbi/zavudev/models/functions/git_link_deploy_now_params.rbi create mode 100644 rbi/zavudev/models/functions/git_link_deploy_now_response.rbi create mode 100644 rbi/zavudev/models/functions/git_link_link_params.rbi create mode 100644 rbi/zavudev/models/functions/git_link_link_response.rbi create mode 100644 rbi/zavudev/models/functions/git_link_retrieve_params.rbi create mode 100644 rbi/zavudev/models/functions/git_link_retrieve_response.rbi create mode 100644 rbi/zavudev/models/functions/git_link_unlink_params.rbi create mode 100644 rbi/zavudev/models/functions/git_link_update_params.rbi create mode 100644 rbi/zavudev/models/functions/git_link_update_response.rbi create mode 100644 rbi/zavudev/models/functions/trigger_create_params.rbi create mode 100644 rbi/zavudev/models/functions/trigger_create_response.rbi create mode 100644 rbi/zavudev/models/functions/trigger_delete_params.rbi create mode 100644 rbi/zavudev/models/functions/trigger_list_params.rbi create mode 100644 rbi/zavudev/models/functions/trigger_list_response.rbi create mode 100644 rbi/zavudev/models/functions/trigger_update_params.rbi create mode 100644 rbi/zavudev/models/functions/trigger_update_response.rbi create mode 100644 rbi/zavudev/models/introspect_validate_email_params.rbi create mode 100644 rbi/zavudev/models/introspect_validate_email_response.rbi create mode 100644 rbi/zavudev/models/message_list_attachments_params.rbi create mode 100644 rbi/zavudev/models/message_list_attachments_response.rbi create mode 100644 rbi/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_params.rbi create mode 100644 rbi/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rbi create mode 100644 rbi/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rbi create mode 100644 rbi/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rbi create mode 100644 rbi/zavudev/models/senders/agent/tool_list_test_runs_params.rbi create mode 100644 rbi/zavudev/models/senders/agent/tool_list_test_runs_response.rbi create mode 100644 rbi/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rbi create mode 100644 rbi/zavudev/models/senders/telegram_connect_params.rbi create mode 100644 rbi/zavudev/models/senders/telegram_connect_response.rbi create mode 100644 rbi/zavudev/models/senders/telegram_disconnect_params.rbi create mode 100644 rbi/zavudev/models/template_sync_params.rbi create mode 100644 rbi/zavudev/models/template_sync_response.rbi create mode 100644 rbi/zavudev/models/url_escalate_params.rbi create mode 100644 rbi/zavudev/models/url_escalate_response.rbi create mode 100644 rbi/zavudev/resources/agent_templates.rbi create mode 100644 rbi/zavudev/resources/agents.rbi create mode 100644 rbi/zavudev/resources/agents/senders.rbi create mode 100644 rbi/zavudev/resources/calls.rbi create mode 100644 rbi/zavudev/resources/conversations.rbi create mode 100644 rbi/zavudev/resources/email_domains.rbi create mode 100644 rbi/zavudev/resources/functions/git_link.rbi create mode 100644 rbi/zavudev/resources/functions/triggers.rbi create mode 100644 rbi/zavudev/resources/senders/agent/tools/webhook.rbi create mode 100644 rbi/zavudev/resources/senders/telegram.rbi create mode 100644 sig/zavudev/models/agent_create_params.rbs create mode 100644 sig/zavudev/models/agent_create_response.rbs create mode 100644 sig/zavudev/models/agent_delete_params.rbs create mode 100644 sig/zavudev/models/agent_list_params.rbs create mode 100644 sig/zavudev/models/agent_list_voices_params.rbs create mode 100644 sig/zavudev/models/agent_list_voices_response.rbs create mode 100644 sig/zavudev/models/agent_retrieve_params.rbs create mode 100644 sig/zavudev/models/agent_retrieve_response.rbs create mode 100644 sig/zavudev/models/agent_template_list_params.rbs create mode 100644 sig/zavudev/models/agent_template_list_response.rbs create mode 100644 sig/zavudev/models/agent_template_retrieve_params.rbs create mode 100644 sig/zavudev/models/agent_template_retrieve_response.rbs create mode 100644 sig/zavudev/models/agent_test_params.rbs create mode 100644 sig/zavudev/models/agent_test_response.rbs create mode 100644 sig/zavudev/models/agent_update_params.rbs create mode 100644 sig/zavudev/models/agent_update_response.rbs create mode 100644 sig/zavudev/models/agents/sender_connect_params.rbs create mode 100644 sig/zavudev/models/agents/sender_connect_response.rbs create mode 100644 sig/zavudev/models/agents/sender_disconnect_params.rbs create mode 100644 sig/zavudev/models/call_create_params.rbs create mode 100644 sig/zavudev/models/call_create_response.rbs create mode 100644 sig/zavudev/models/call_hangup_params.rbs create mode 100644 sig/zavudev/models/call_hangup_response.rbs create mode 100644 sig/zavudev/models/call_list_params.rbs create mode 100644 sig/zavudev/models/call_list_response.rbs create mode 100644 sig/zavudev/models/call_retrieve_params.rbs create mode 100644 sig/zavudev/models/call_retrieve_response.rbs create mode 100644 sig/zavudev/models/conversation_list_messages_params.rbs create mode 100644 sig/zavudev/models/conversation_list_params.rbs create mode 100644 sig/zavudev/models/conversation_list_response.rbs create mode 100644 sig/zavudev/models/conversation_mark_as_read_params.rbs create mode 100644 sig/zavudev/models/conversation_mark_as_read_response.rbs create mode 100644 sig/zavudev/models/conversation_retrieve_params.rbs create mode 100644 sig/zavudev/models/conversation_retrieve_response.rbs create mode 100644 sig/zavudev/models/email_domain_create_params.rbs create mode 100644 sig/zavudev/models/email_domain_create_response.rbs create mode 100644 sig/zavudev/models/email_domain_delete_params.rbs create mode 100644 sig/zavudev/models/email_domain_list_params.rbs create mode 100644 sig/zavudev/models/email_domain_list_response.rbs create mode 100644 sig/zavudev/models/email_domain_retrieve_params.rbs create mode 100644 sig/zavudev/models/email_domain_retrieve_response.rbs create mode 100644 sig/zavudev/models/email_domain_verify_params.rbs create mode 100644 sig/zavudev/models/email_domain_verify_response.rbs create mode 100644 sig/zavudev/models/function_list_deployments_params.rbs create mode 100644 sig/zavudev/models/function_list_deployments_response.rbs create mode 100644 sig/zavudev/models/function_list_event_types_params.rbs create mode 100644 sig/zavudev/models/function_list_event_types_response.rbs create mode 100644 sig/zavudev/models/function_rollback_deployment_params.rbs create mode 100644 sig/zavudev/models/function_rollback_deployment_response.rbs create mode 100644 sig/zavudev/models/functions/git_link_deploy_now_params.rbs create mode 100644 sig/zavudev/models/functions/git_link_deploy_now_response.rbs create mode 100644 sig/zavudev/models/functions/git_link_link_params.rbs create mode 100644 sig/zavudev/models/functions/git_link_link_response.rbs create mode 100644 sig/zavudev/models/functions/git_link_retrieve_params.rbs create mode 100644 sig/zavudev/models/functions/git_link_retrieve_response.rbs create mode 100644 sig/zavudev/models/functions/git_link_unlink_params.rbs create mode 100644 sig/zavudev/models/functions/git_link_update_params.rbs create mode 100644 sig/zavudev/models/functions/git_link_update_response.rbs create mode 100644 sig/zavudev/models/functions/trigger_create_params.rbs create mode 100644 sig/zavudev/models/functions/trigger_create_response.rbs create mode 100644 sig/zavudev/models/functions/trigger_delete_params.rbs create mode 100644 sig/zavudev/models/functions/trigger_list_params.rbs create mode 100644 sig/zavudev/models/functions/trigger_list_response.rbs create mode 100644 sig/zavudev/models/functions/trigger_update_params.rbs create mode 100644 sig/zavudev/models/functions/trigger_update_response.rbs create mode 100644 sig/zavudev/models/introspect_validate_email_params.rbs create mode 100644 sig/zavudev/models/introspect_validate_email_response.rbs create mode 100644 sig/zavudev/models/message_list_attachments_params.rbs create mode 100644 sig/zavudev/models/message_list_attachments_response.rbs create mode 100644 sig/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_params.rbs create mode 100644 sig/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rbs create mode 100644 sig/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rbs create mode 100644 sig/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rbs create mode 100644 sig/zavudev/models/senders/agent/tool_list_test_runs_params.rbs create mode 100644 sig/zavudev/models/senders/agent/tool_list_test_runs_response.rbs create mode 100644 sig/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rbs create mode 100644 sig/zavudev/models/senders/telegram_connect_params.rbs create mode 100644 sig/zavudev/models/senders/telegram_connect_response.rbs create mode 100644 sig/zavudev/models/senders/telegram_disconnect_params.rbs create mode 100644 sig/zavudev/models/template_sync_params.rbs create mode 100644 sig/zavudev/models/template_sync_response.rbs create mode 100644 sig/zavudev/models/url_escalate_params.rbs create mode 100644 sig/zavudev/models/url_escalate_response.rbs create mode 100644 sig/zavudev/resources/agent_templates.rbs create mode 100644 sig/zavudev/resources/agents.rbs create mode 100644 sig/zavudev/resources/agents/senders.rbs create mode 100644 sig/zavudev/resources/calls.rbs create mode 100644 sig/zavudev/resources/conversations.rbs create mode 100644 sig/zavudev/resources/email_domains.rbs create mode 100644 sig/zavudev/resources/functions/git_link.rbs create mode 100644 sig/zavudev/resources/functions/triggers.rbs create mode 100644 sig/zavudev/resources/senders/agent/tools/webhook.rbs create mode 100644 sig/zavudev/resources/senders/telegram.rbs create mode 100644 test/zavudev/resources/agent_templates_test.rb create mode 100644 test/zavudev/resources/agents/senders_test.rb create mode 100644 test/zavudev/resources/agents_test.rb create mode 100644 test/zavudev/resources/calls_test.rb create mode 100644 test/zavudev/resources/conversations_test.rb create mode 100644 test/zavudev/resources/email_domains_test.rb create mode 100644 test/zavudev/resources/functions/git_link_test.rb create mode 100644 test/zavudev/resources/functions/triggers_test.rb create mode 100644 test/zavudev/resources/senders/agent/tools/webhook_test.rb create mode 100644 test/zavudev/resources/senders/telegram_test.rb diff --git a/.stats.yml b/.stats.yml index ec5b810..906e6fe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 138 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-9acbefe4fc4908c698c1165bed491d415687f0092e9df6ffb968f92e43b11961.yml +configured_endpoints: 184 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-ba782c22cc1b237327afbf2aeffb453185cec9513d918b5a0fdc7e7233320c9b.yml openapi_spec_hash: 410cb45b6fa3a8a1f3da3aba50accbdc -config_hash: 7fca08d9dae18513f5d7451cea11e34c +config_hash: 261e1b852ca7f8364e4a283a3edd350a diff --git a/lib/zavudev.rb b/lib/zavudev.rb index bdf4501..d89d2ea 100644 --- a/lib/zavudev.rb +++ b/lib/zavudev.rb @@ -61,6 +61,25 @@ require_relative "zavudev/models/address_retrieve_params" require_relative "zavudev/models/address_retrieve_response" require_relative "zavudev/models/address_status" +require_relative "zavudev/models/agent_create_params" +require_relative "zavudev/models/agent_create_response" +require_relative "zavudev/models/agent_delete_params" +require_relative "zavudev/models/agent_list_params" +require_relative "zavudev/models/agent_list_voices_params" +require_relative "zavudev/models/agent_list_voices_response" +require_relative "zavudev/models/agent_retrieve_params" +require_relative "zavudev/models/agent_retrieve_response" +require_relative "zavudev/models/agents/sender_connect_params" +require_relative "zavudev/models/agents/sender_connect_response" +require_relative "zavudev/models/agents/sender_disconnect_params" +require_relative "zavudev/models/agent_template_list_params" +require_relative "zavudev/models/agent_template_list_response" +require_relative "zavudev/models/agent_template_retrieve_params" +require_relative "zavudev/models/agent_template_retrieve_response" +require_relative "zavudev/models/agent_test_params" +require_relative "zavudev/models/agent_test_response" +require_relative "zavudev/models/agent_update_params" +require_relative "zavudev/models/agent_update_response" require_relative "zavudev/models/available_phone_number" require_relative "zavudev/models/balance_retrieve_params" require_relative "zavudev/models/balance_retrieve_response" @@ -95,6 +114,14 @@ require_relative "zavudev/models/broadcast_status" require_relative "zavudev/models/broadcast_update_params" require_relative "zavudev/models/broadcast_update_response" +require_relative "zavudev/models/call_create_params" +require_relative "zavudev/models/call_create_response" +require_relative "zavudev/models/call_hangup_params" +require_relative "zavudev/models/call_hangup_response" +require_relative "zavudev/models/call_list_params" +require_relative "zavudev/models/call_list_response" +require_relative "zavudev/models/call_retrieve_params" +require_relative "zavudev/models/call_retrieve_response" require_relative "zavudev/models/channel" require_relative "zavudev/models/contact" require_relative "zavudev/models/contact_channel" @@ -113,6 +140,22 @@ require_relative "zavudev/models/contacts/channel_update_params" require_relative "zavudev/models/contacts/channel_update_response" require_relative "zavudev/models/contact_update_params" +require_relative "zavudev/models/conversation_list_messages_params" +require_relative "zavudev/models/conversation_list_params" +require_relative "zavudev/models/conversation_list_response" +require_relative "zavudev/models/conversation_mark_as_read_params" +require_relative "zavudev/models/conversation_mark_as_read_response" +require_relative "zavudev/models/conversation_retrieve_params" +require_relative "zavudev/models/conversation_retrieve_response" +require_relative "zavudev/models/email_domain_create_params" +require_relative "zavudev/models/email_domain_create_response" +require_relative "zavudev/models/email_domain_delete_params" +require_relative "zavudev/models/email_domain_list_params" +require_relative "zavudev/models/email_domain_list_response" +require_relative "zavudev/models/email_domain_retrieve_params" +require_relative "zavudev/models/email_domain_retrieve_response" +require_relative "zavudev/models/email_domain_verify_params" +require_relative "zavudev/models/email_domain_verify_response" require_relative "zavudev/models/function_create_params" require_relative "zavudev/models/function_create_response" require_relative "zavudev/models/function_delete_params" @@ -121,17 +164,41 @@ require_relative "zavudev/models/function_deploy_response" require_relative "zavudev/models/function_get_deployment_params" require_relative "zavudev/models/function_get_deployment_response" +require_relative "zavudev/models/function_list_deployments_params" +require_relative "zavudev/models/function_list_deployments_response" +require_relative "zavudev/models/function_list_event_types_params" +require_relative "zavudev/models/function_list_event_types_response" require_relative "zavudev/models/function_retrieve_params" require_relative "zavudev/models/function_retrieve_response" +require_relative "zavudev/models/function_rollback_deployment_params" +require_relative "zavudev/models/function_rollback_deployment_response" +require_relative "zavudev/models/functions/git_link_deploy_now_params" +require_relative "zavudev/models/functions/git_link_deploy_now_response" +require_relative "zavudev/models/functions/git_link_link_params" +require_relative "zavudev/models/functions/git_link_link_response" +require_relative "zavudev/models/functions/git_link_retrieve_params" +require_relative "zavudev/models/functions/git_link_retrieve_response" +require_relative "zavudev/models/functions/git_link_unlink_params" +require_relative "zavudev/models/functions/git_link_update_params" +require_relative "zavudev/models/functions/git_link_update_response" require_relative "zavudev/models/functions/secret_list_params" require_relative "zavudev/models/functions/secret_list_response" require_relative "zavudev/models/functions/secret_set_params" require_relative "zavudev/models/functions/secret_set_response" require_relative "zavudev/models/functions/secret_unset_params" +require_relative "zavudev/models/functions/trigger_create_params" +require_relative "zavudev/models/functions/trigger_create_response" +require_relative "zavudev/models/functions/trigger_delete_params" +require_relative "zavudev/models/functions/trigger_list_params" +require_relative "zavudev/models/functions/trigger_list_response" +require_relative "zavudev/models/functions/trigger_update_params" +require_relative "zavudev/models/functions/trigger_update_response" require_relative "zavudev/models/function_tail_logs_params" require_relative "zavudev/models/function_tail_logs_response" require_relative "zavudev/models/function_update_params" require_relative "zavudev/models/function_update_response" +require_relative "zavudev/models/introspect_validate_email_params" +require_relative "zavudev/models/introspect_validate_email_response" require_relative "zavudev/models/introspect_validate_phone_params" require_relative "zavudev/models/introspect_validate_phone_response" require_relative "zavudev/models/invitation" @@ -147,6 +214,8 @@ require_relative "zavudev/models/me_retrieve_response" require_relative "zavudev/models/message" require_relative "zavudev/models/message_content" +require_relative "zavudev/models/message_list_attachments_params" +require_relative "zavudev/models/message_list_attachments_response" require_relative "zavudev/models/message_list_params" require_relative "zavudev/models/message_react_params" require_relative "zavudev/models/message_response" @@ -257,15 +326,22 @@ require_relative "zavudev/models/senders/agent/knowledge_bases/document_create_response" require_relative "zavudev/models/senders/agent/knowledge_bases/document_delete_params" require_relative "zavudev/models/senders/agent/knowledge_bases/document_list_params" +require_relative "zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_params" +require_relative "zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response" +require_relative "zavudev/models/senders/agent/knowledge_bases/document_update_document_params" +require_relative "zavudev/models/senders/agent/knowledge_bases/document_update_document_response" require_relative "zavudev/models/senders/agent/knowledge_base_update_params" require_relative "zavudev/models/senders/agent/knowledge_base_update_response" require_relative "zavudev/models/senders/agent/tool_create_params" require_relative "zavudev/models/senders/agent/tool_create_response" require_relative "zavudev/models/senders/agent/tool_delete_params" require_relative "zavudev/models/senders/agent/tool_list_params" +require_relative "zavudev/models/senders/agent/tool_list_test_runs_params" +require_relative "zavudev/models/senders/agent/tool_list_test_runs_response" require_relative "zavudev/models/senders/agent/tool_parameters" require_relative "zavudev/models/senders/agent/tool_retrieve_params" require_relative "zavudev/models/senders/agent/tool_retrieve_response" +require_relative "zavudev/models/senders/agent/tools/webhook_rotate_secret_params" require_relative "zavudev/models/senders/agent/tool_test_params" require_relative "zavudev/models/senders/agent/tool_test_response" require_relative "zavudev/models/senders/agent/tool_update_params" @@ -281,6 +357,9 @@ require_relative "zavudev/models/senders/agent_stats_params" require_relative "zavudev/models/senders/agent_update_params" require_relative "zavudev/models/senders/agent" +require_relative "zavudev/models/senders/telegram_connect_params" +require_relative "zavudev/models/senders/telegram_connect_response" +require_relative "zavudev/models/senders/telegram_disconnect_params" require_relative "zavudev/models/senders/whats_app_sync_contacts" require_relative "zavudev/models/senders/whats_app_sync_history" require_relative "zavudev/models/senders/whatsapp_sync_retrieve_params" @@ -319,6 +398,10 @@ require_relative "zavudev/models/template_list_params" require_relative "zavudev/models/template_retrieve_params" require_relative "zavudev/models/template_submit_params" +require_relative "zavudev/models/template_sync_params" +require_relative "zavudev/models/template_sync_response" +require_relative "zavudev/models/url_escalate_params" +require_relative "zavudev/models/url_escalate_response" require_relative "zavudev/models/url_list_verified_params" require_relative "zavudev/models/url_retrieve_details_params" require_relative "zavudev/models/url_retrieve_details_response" @@ -333,13 +416,21 @@ require_relative "zavudev/models/whatsapp_category" require_relative "zavudev/models" require_relative "zavudev/resources/addresses" +require_relative "zavudev/resources/agents" +require_relative "zavudev/resources/agents/senders" +require_relative "zavudev/resources/agent_templates" require_relative "zavudev/resources/balance" require_relative "zavudev/resources/broadcasts" require_relative "zavudev/resources/broadcasts/contacts" +require_relative "zavudev/resources/calls" require_relative "zavudev/resources/contacts" require_relative "zavudev/resources/contacts/channels" +require_relative "zavudev/resources/conversations" +require_relative "zavudev/resources/email_domains" require_relative "zavudev/resources/functions" +require_relative "zavudev/resources/functions/git_link" require_relative "zavudev/resources/functions/secrets" +require_relative "zavudev/resources/functions/triggers" require_relative "zavudev/resources/introspect" require_relative "zavudev/resources/invitations" require_relative "zavudev/resources/me" @@ -357,6 +448,8 @@ require_relative "zavudev/resources/senders/agent/knowledge_bases" require_relative "zavudev/resources/senders/agent/knowledge_bases/documents" require_relative "zavudev/resources/senders/agent/tools" +require_relative "zavudev/resources/senders/agent/tools/webhook" +require_relative "zavudev/resources/senders/telegram" require_relative "zavudev/resources/senders/whatsapp_sync" require_relative "zavudev/resources/sub_accounts" require_relative "zavudev/resources/sub_accounts/api_keys" diff --git a/lib/zavudev/client.rb b/lib/zavudev/client.rb index 9e0c7bd..053a799 100644 --- a/lib/zavudev/client.rb +++ b/lib/zavudev/client.rb @@ -66,6 +66,21 @@ class Client < Zavudev::Internal::Transport::BaseClient # @return [Zavudev::Resources::Functions] attr_reader :functions + # @return [Zavudev::Resources::Conversations] + attr_reader :conversations + + # @return [Zavudev::Resources::Calls] + attr_reader :calls + + # @return [Zavudev::Resources::AgentTemplates] + attr_reader :agent_templates + + # @return [Zavudev::Resources::EmailDomains] + attr_reader :email_domains + + # @return [Zavudev::Resources::Agents] + attr_reader :agents + # @api private # # @return [Hash{String=>String}] @@ -143,6 +158,11 @@ def initialize( @number_10dlc = Zavudev::Resources::Number10dlc.new(client: self) @me = Zavudev::Resources::Me.new(client: self) @functions = Zavudev::Resources::Functions.new(client: self) + @conversations = Zavudev::Resources::Conversations.new(client: self) + @calls = Zavudev::Resources::Calls.new(client: self) + @agent_templates = Zavudev::Resources::AgentTemplates.new(client: self) + @email_domains = Zavudev::Resources::EmailDomains.new(client: self) + @agents = Zavudev::Resources::Agents.new(client: self) end end end diff --git a/lib/zavudev/models.rb b/lib/zavudev/models.rb index 98f3480..ed1d04f 100644 --- a/lib/zavudev/models.rb +++ b/lib/zavudev/models.rb @@ -51,6 +51,26 @@ module Zavudev AddressStatus = Zavudev::Models::AddressStatus + AgentCreateParams = Zavudev::Models::AgentCreateParams + + AgentDeleteParams = Zavudev::Models::AgentDeleteParams + + AgentListParams = Zavudev::Models::AgentListParams + + AgentListVoicesParams = Zavudev::Models::AgentListVoicesParams + + AgentRetrieveParams = Zavudev::Models::AgentRetrieveParams + + Agents = Zavudev::Models::Agents + + AgentTemplateListParams = Zavudev::Models::AgentTemplateListParams + + AgentTemplateRetrieveParams = Zavudev::Models::AgentTemplateRetrieveParams + + AgentTestParams = Zavudev::Models::AgentTestParams + + AgentUpdateParams = Zavudev::Models::AgentUpdateParams + AvailablePhoneNumber = Zavudev::Models::AvailablePhoneNumber BalanceRetrieveParams = Zavudev::Models::BalanceRetrieveParams @@ -95,6 +115,14 @@ module Zavudev BroadcastUpdateParams = Zavudev::Models::BroadcastUpdateParams + CallCreateParams = Zavudev::Models::CallCreateParams + + CallHangupParams = Zavudev::Models::CallHangupParams + + CallListParams = Zavudev::Models::CallListParams + + CallRetrieveParams = Zavudev::Models::CallRetrieveParams + Channel = Zavudev::Models::Channel Contact = Zavudev::Models::Contact @@ -119,6 +147,24 @@ module Zavudev ContactUpdateParams = Zavudev::Models::ContactUpdateParams + ConversationListMessagesParams = Zavudev::Models::ConversationListMessagesParams + + ConversationListParams = Zavudev::Models::ConversationListParams + + ConversationMarkAsReadParams = Zavudev::Models::ConversationMarkAsReadParams + + ConversationRetrieveParams = Zavudev::Models::ConversationRetrieveParams + + EmailDomainCreateParams = Zavudev::Models::EmailDomainCreateParams + + EmailDomainDeleteParams = Zavudev::Models::EmailDomainDeleteParams + + EmailDomainListParams = Zavudev::Models::EmailDomainListParams + + EmailDomainRetrieveParams = Zavudev::Models::EmailDomainRetrieveParams + + EmailDomainVerifyParams = Zavudev::Models::EmailDomainVerifyParams + FunctionCreateParams = Zavudev::Models::FunctionCreateParams FunctionDeleteParams = Zavudev::Models::FunctionDeleteParams @@ -127,14 +173,22 @@ module Zavudev FunctionGetDeploymentParams = Zavudev::Models::FunctionGetDeploymentParams + FunctionListDeploymentsParams = Zavudev::Models::FunctionListDeploymentsParams + + FunctionListEventTypesParams = Zavudev::Models::FunctionListEventTypesParams + FunctionRetrieveParams = Zavudev::Models::FunctionRetrieveParams + FunctionRollbackDeploymentParams = Zavudev::Models::FunctionRollbackDeploymentParams + Functions = Zavudev::Models::Functions FunctionTailLogsParams = Zavudev::Models::FunctionTailLogsParams FunctionUpdateParams = Zavudev::Models::FunctionUpdateParams + IntrospectValidateEmailParams = Zavudev::Models::IntrospectValidateEmailParams + IntrospectValidatePhoneParams = Zavudev::Models::IntrospectValidatePhoneParams Invitation = Zavudev::Models::Invitation @@ -155,6 +209,8 @@ module Zavudev MessageContent = Zavudev::Models::MessageContent + MessageListAttachmentsParams = Zavudev::Models::MessageListAttachmentsParams + MessageListParams = Zavudev::Models::MessageListParams MessageReactParams = Zavudev::Models::MessageReactParams @@ -271,6 +327,10 @@ module Zavudev TemplateSubmitParams = Zavudev::Models::TemplateSubmitParams + TemplateSyncParams = Zavudev::Models::TemplateSyncParams + + URLEscalateParams = Zavudev::Models::URLEscalateParams + URLListVerifiedParams = Zavudev::Models::URLListVerifiedParams URLRetrieveDetailsParams = Zavudev::Models::URLRetrieveDetailsParams diff --git a/lib/zavudev/models/agent_create_params.rb b/lib/zavudev/models/agent_create_params.rb new file mode 100644 index 0000000..96e54d2 --- /dev/null +++ b/lib/zavudev/models/agent_create_params.rb @@ -0,0 +1,278 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#create + class AgentCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute model + # + # @return [String] + required :model, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute provider + # LLM provider for the AI agent. + # + # @return [Symbol, Zavudev::Models::Senders::AgentProvider] + required :provider, enum: -> { Zavudev::Senders::AgentProvider } + + # @!attribute system_prompt + # + # @return [String] + required :system_prompt, String, api_name: :systemPrompt + + # @!attribute context_window_messages + # + # @return [Integer, nil] + optional :context_window_messages, Integer, api_name: :contextWindowMessages + + # @!attribute include_contact_metadata + # + # @return [Boolean, nil] + optional :include_contact_metadata, Zavudev::Internal::Type::Boolean, api_name: :includeContactMetadata + + # @!attribute max_tokens + # + # @return [Integer, nil] + optional :max_tokens, Integer, api_name: :maxTokens + + # @!attribute temperature + # + # @return [Float, nil] + optional :temperature, Float + + # @!attribute trigger_on_channels + # + # @return [Array, nil] + optional :trigger_on_channels, Zavudev::Internal::Type::ArrayOf[String], api_name: :triggerOnChannels + + # @!attribute trigger_on_message_types + # + # @return [Array, nil] + optional :trigger_on_message_types, + Zavudev::Internal::Type::ArrayOf[String], + api_name: :triggerOnMessageTypes + + # @!attribute voice + # Voice Agent configuration on a sender's AI agent. Controls how the agent behaves + # on inbound and outbound phone calls through Zavu's managed voice pipeline + # (speech recognition, the agent's LLM, and speech synthesis, with real-time + # interruption handling). Requires the Voice Agents feature to be enabled for your + # team. + # + # @return [Zavudev::Models::AgentCreateParams::Voice, nil] + optional :voice, -> { Zavudev::AgentCreateParams::Voice } + + # @!method initialize(model:, name:, provider:, system_prompt:, context_window_messages: nil, include_contact_metadata: nil, max_tokens: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, voice: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::AgentCreateParams} for more details. + # + # @param model [String] + # + # @param name [String] + # + # @param provider [Symbol, Zavudev::Models::Senders::AgentProvider] LLM provider for the AI agent. + # + # @param system_prompt [String] + # + # @param context_window_messages [Integer] + # + # @param include_contact_metadata [Boolean] + # + # @param max_tokens [Integer] + # + # @param temperature [Float] + # + # @param trigger_on_channels [Array] + # + # @param trigger_on_message_types [Array] + # + # @param voice [Zavudev::Models::AgentCreateParams::Voice] Voice Agent configuration on a sender's AI agent. Controls how the agent behaves + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + + class Voice < Zavudev::Internal::Type::BaseModel + # @!attribute enabled + # Whether the agent handles voice calls. When false, the sender's number is not + # answered by the voice agent and outbound calls are rejected. + # + # @return [Boolean] + required :enabled, Zavudev::Internal::Type::Boolean + + # @!attribute greeting + # Opening line the agent speaks when the call connects. If omitted, the agent + # waits for the caller to speak first. + # + # @return [String, nil] + optional :greeting, String + + # @!attribute greetings + # Greeting per language, keyed by language code. Used when the caller's language + # differs from the one `greeting` is written in. + # + # @return [Hash{Symbol=>String}, nil] + optional :greetings, Zavudev::Internal::Type::HashOf[String] + + # @!attribute interruptible + # Whether the caller can interrupt the agent while it is speaking (barge-in). When + # true, the agent stops talking as soon as the caller starts. + # + # @return [Boolean, nil] + optional :interruptible, Zavudev::Internal::Type::Boolean + + # @!attribute language + # BCP-47 language code used for both speech recognition and speech synthesis (e.g. + # `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted. + # + # @return [String, nil] + optional :language, String + + # @!attribute max_call_duration_minutes + # Hard limit on call length in minutes. The call ends automatically when reached. + # + # @return [Integer, nil] + optional :max_call_duration_minutes, Integer, api_name: :maxCallDurationMinutes + + # @!attribute max_idle_seconds + # How long the agent waits during silence before ending the call. + # + # @return [Integer, nil] + optional :max_idle_seconds, Integer, api_name: :maxIdleSeconds + + # @!attribute model + # Model that runs the conversation, co-located in the voice network for lowest + # latency. Independent of the model used for text messaging. Derived from the + # agent's text model when omitted. + # + # @return [String, nil] + optional :model, String + + # @!attribute record_calls + # Whether the call audio is recorded. + # + # @return [Boolean, nil] + optional :record_calls, Zavudev::Internal::Type::Boolean, api_name: :recordCalls + + # @!attribute stt_model + # Speech-recognition model. Uses the default when omitted. + # + # @return [String, nil] + optional :stt_model, String, api_name: :sttModel + + # @!attribute stt_provider + # Speech-recognition provider. Uses the default when omitted. + # + # @return [String, nil] + optional :stt_provider, String, api_name: :sttProvider + + # @!attribute transfer_phone_number + # E.164 phone number the agent can transfer the call to. When set, the agent is + # given a transfer tool it can use to hand the call to a human. + # + # @return [String, nil] + optional :transfer_phone_number, String, api_name: :transferPhoneNumber + + # @!attribute tts_provider + # Speech-synthesis provider. Uses the default when omitted. + # + # @return [String, nil] + optional :tts_provider, String, api_name: :ttsProvider + + # @!attribute tts_voice_id + # Identifier of the synthesized voice that speaks. Choose from the voices + # available in the dashboard. Uses a neutral default when omitted. + # + # @return [String, nil] + optional :tts_voice_id, String, api_name: :ttsVoiceId + + # @!attribute voicemail_action + # What the agent does when an answering machine or voicemail is detected on an + # outbound call. + # + # @return [Symbol, Zavudev::Models::AgentCreateParams::Voice::VoicemailAction, nil] + optional :voicemail_action, + enum: -> { Zavudev::AgentCreateParams::Voice::VoicemailAction }, + api_name: :voicemailAction + + # @!attribute voicemail_message + # Message spoken when `voicemailAction` is `leave_message`. Falls back to + # `greeting` when omitted. + # + # @return [String, nil] + optional :voicemail_message, String, api_name: :voicemailMessage + + # @!attribute voice_speed + # Speech rate. 1.0 is natural. Only honoured by voices that support rate control; + # ignored by the others. + # + # @return [Float, nil] + optional :voice_speed, Float, api_name: :voiceSpeed + + # @!method initialize(enabled:, greeting: nil, greetings: nil, interruptible: nil, language: nil, max_call_duration_minutes: nil, max_idle_seconds: nil, model: nil, record_calls: nil, stt_model: nil, stt_provider: nil, transfer_phone_number: nil, tts_provider: nil, tts_voice_id: nil, voicemail_action: nil, voicemail_message: nil, voice_speed: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::AgentCreateParams::Voice} for more details. + # + # Voice Agent configuration on a sender's AI agent. Controls how the agent behaves + # on inbound and outbound phone calls through Zavu's managed voice pipeline + # (speech recognition, the agent's LLM, and speech synthesis, with real-time + # interruption handling). Requires the Voice Agents feature to be enabled for your + # team. + # + # @param enabled [Boolean] Whether the agent handles voice calls. When false, the sender's number is not an + # + # @param greeting [String] Opening line the agent speaks when the call connects. If omitted, the agent wait + # + # @param greetings [Hash{Symbol=>String}] Greeting per language, keyed by language code. Used when the caller's language d + # + # @param interruptible [Boolean] Whether the caller can interrupt the agent while it is speaking (barge-in). When + # + # @param language [String] BCP-47 language code used for both speech recognition and speech synthesis (e.g. + # + # @param max_call_duration_minutes [Integer] Hard limit on call length in minutes. The call ends automatically when reached. + # + # @param max_idle_seconds [Integer] How long the agent waits during silence before ending the call. + # + # @param model [String] Model that runs the conversation, co-located in the voice network for lowest lat + # + # @param record_calls [Boolean] Whether the call audio is recorded. + # + # @param stt_model [String] Speech-recognition model. Uses the default when omitted. + # + # @param stt_provider [String] Speech-recognition provider. Uses the default when omitted. + # + # @param transfer_phone_number [String] E.164 phone number the agent can transfer the call to. When set, the agent is gi + # + # @param tts_provider [String] Speech-synthesis provider. Uses the default when omitted. + # + # @param tts_voice_id [String] Identifier of the synthesized voice that speaks. Choose from the voices availabl + # + # @param voicemail_action [Symbol, Zavudev::Models::AgentCreateParams::Voice::VoicemailAction] What the agent does when an answering machine or voicemail is detected on an out + # + # @param voicemail_message [String] Message spoken when `voicemailAction` is `leave_message`. Falls back to `greetin + # + # @param voice_speed [Float] Speech rate. 1.0 is natural. Only honoured by voices that support rate control; + + # What the agent does when an answering machine or voicemail is detected on an + # outbound call. + # + # @see Zavudev::Models::AgentCreateParams::Voice#voicemail_action + module VoicemailAction + extend Zavudev::Internal::Type::Enum + + HANGUP = :hangup + LEAVE_MESSAGE = :leave_message + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/zavudev/models/agent_create_response.rb b/lib/zavudev/models/agent_create_response.rb new file mode 100644 index 0000000..85eca42 --- /dev/null +++ b/lib/zavudev/models/agent_create_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#create + class AgentCreateResponse < Zavudev::Internal::Type::BaseModel + # @!attribute agent + # AI Agent configuration for a sender. + # + # @return [Zavudev::Models::Senders::SendersAgent] + required :agent, -> { Zavudev::Senders::SendersAgent } + + # @!method initialize(agent:) + # @param agent [Zavudev::Models::Senders::SendersAgent] AI Agent configuration for a sender. + end + end +end diff --git a/lib/zavudev/models/agent_delete_params.rb b/lib/zavudev/models/agent_delete_params.rb new file mode 100644 index 0000000..5535a6b --- /dev/null +++ b/lib/zavudev/models/agent_delete_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#delete + class AgentDeleteParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute agent_id + # + # @return [String] + required :agent_id, String + + # @!method initialize(agent_id:, request_options: {}) + # @param agent_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/agent_list_params.rb b/lib/zavudev/models/agent_list_params.rb new file mode 100644 index 0000000..eeeb7ea --- /dev/null +++ b/lib/zavudev/models/agent_list_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#list + class AgentListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute cursor + # + # @return [String, nil] + optional :cursor, String + + # @!attribute limit + # + # @return [Integer, nil] + optional :limit, Integer + + # @!method initialize(cursor: nil, limit: nil, request_options: {}) + # @param cursor [String] + # @param limit [Integer] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/agent_list_voices_params.rb b/lib/zavudev/models/agent_list_voices_params.rb new file mode 100644 index 0000000..da8b929 --- /dev/null +++ b/lib/zavudev/models/agent_list_voices_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#list_voices + class AgentListVoicesParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute language + # BCP-47 tag (`en`, `es`, `pt-BR`). Omit, or pass `auto`, for every voice. + # + # @return [String, nil] + optional :language, String + + # @!method initialize(language: nil, request_options: {}) + # @param language [String] BCP-47 tag (`en`, `es`, `pt-BR`). Omit, or pass `auto`, for every voice. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/agent_list_voices_response.rb b/lib/zavudev/models/agent_list_voices_response.rb new file mode 100644 index 0000000..1767fd5 --- /dev/null +++ b/lib/zavudev/models/agent_list_voices_response.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#list_voices + class AgentListVoicesResponse < Zavudev::Internal::Type::BaseModel + # @!attribute items + # + # @return [Array] + required :items, -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::AgentListVoicesResponse::Item] } + + # @!attribute languages + # Languages an agent can be pinned to. `auto` follows the caller. + # + # @return [Array] + required :languages, Zavudev::Internal::Type::ArrayOf[String] + + # @!attribute total + # Voices in the catalog, before filtering. + # + # @return [Integer, nil] + optional :total, Integer + + # @!method initialize(items:, languages:, total: nil) + # @param items [Array] + # + # @param languages [Array] Languages an agent can be pinned to. `auto` follows the caller. + # + # @param total [Integer] Voices in the catalog, before filtering. + + class Item < Zavudev::Internal::Type::BaseModel + # @!attribute id + # Value for `voice.ttsVoiceId`. + # + # @return [String] + required :id, String + + # @!attribute language + # + # @return [String] + required :language, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!method initialize(id:, language:, name:) + # @param id [String] Value for `voice.ttsVoiceId`. + # + # @param language [String] + # + # @param name [String] + end + end + end +end diff --git a/lib/zavudev/models/agent_retrieve_params.rb b/lib/zavudev/models/agent_retrieve_params.rb new file mode 100644 index 0000000..3a823d8 --- /dev/null +++ b/lib/zavudev/models/agent_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#retrieve + class AgentRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute agent_id + # + # @return [String] + required :agent_id, String + + # @!method initialize(agent_id:, request_options: {}) + # @param agent_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/agent_retrieve_response.rb b/lib/zavudev/models/agent_retrieve_response.rb new file mode 100644 index 0000000..45b870c --- /dev/null +++ b/lib/zavudev/models/agent_retrieve_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#retrieve + class AgentRetrieveResponse < Zavudev::Internal::Type::BaseModel + # @!attribute agent + # AI Agent configuration for a sender. + # + # @return [Zavudev::Models::Senders::SendersAgent] + required :agent, -> { Zavudev::Senders::SendersAgent } + + # @!method initialize(agent:) + # @param agent [Zavudev::Models::Senders::SendersAgent] AI Agent configuration for a sender. + end + end +end diff --git a/lib/zavudev/models/agent_template_list_params.rb b/lib/zavudev/models/agent_template_list_params.rb new file mode 100644 index 0000000..27068bf --- /dev/null +++ b/lib/zavudev/models/agent_template_list_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::AgentTemplates#list + class AgentTemplateListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/agent_template_list_response.rb b/lib/zavudev/models/agent_template_list_response.rb new file mode 100644 index 0000000..cdbabab --- /dev/null +++ b/lib/zavudev/models/agent_template_list_response.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::AgentTemplates#list + class AgentTemplateListResponse < Zavudev::Internal::Type::BaseModel + # @!attribute items + # + # @return [Array] + required :items, -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::AgentTemplateListResponse::Item] } + + # @!method initialize(items:) + # @param items [Array] + + class Item < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute category + # + # @return [Symbol, Zavudev::Models::AgentTemplateListResponse::Item::Category] + required :category, enum: -> { Zavudev::Models::AgentTemplateListResponse::Item::Category } + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute summary + # + # @return [String] + required :summary, String + + # @!attribute tool_count + # + # @return [Integer] + required :tool_count, Integer, api_name: :toolCount + + # @!attribute voice + # Whether this agent answers phone calls. + # + # @return [Boolean] + required :voice, Zavudev::Internal::Type::Boolean + + # @!method initialize(id:, category:, name:, summary:, tool_count:, voice:) + # Compact catalog entry for a factory agent. + # + # @param id [String] + # + # @param category [Symbol, Zavudev::Models::AgentTemplateListResponse::Item::Category] + # + # @param name [String] + # + # @param summary [String] + # + # @param tool_count [Integer] + # + # @param voice [Boolean] Whether this agent answers phone calls. + + # @see Zavudev::Models::AgentTemplateListResponse::Item#category + module Category + extend Zavudev::Internal::Type::Enum + + SALES = :sales + SUPPORT = :support + FRONT_DESK = :frontDesk + OPS = :ops + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/zavudev/models/agent_template_retrieve_params.rb b/lib/zavudev/models/agent_template_retrieve_params.rb new file mode 100644 index 0000000..7f60fbe --- /dev/null +++ b/lib/zavudev/models/agent_template_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::AgentTemplates#retrieve + class AgentTemplateRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute template_id + # + # @return [String] + required :template_id, String + + # @!method initialize(template_id:, request_options: {}) + # @param template_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/agent_template_retrieve_response.rb b/lib/zavudev/models/agent_template_retrieve_response.rb new file mode 100644 index 0000000..cb81d0e --- /dev/null +++ b/lib/zavudev/models/agent_template_retrieve_response.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::AgentTemplates#retrieve + class AgentTemplateRetrieveResponse < Zavudev::Internal::Type::BaseModel + # @!attribute template + # A fully rendered factory agent: the function files to scaffold plus the secrets + # it needs. Returned by GET /v1/agent-templates/{templateId} and consumed by + # `npx zavudev agents pull`. + # + # @return [Zavudev::Models::AgentTemplateRetrieveResponse::Template] + required :template, -> { Zavudev::Models::AgentTemplateRetrieveResponse::Template } + + # @!method initialize(template:) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::AgentTemplateRetrieveResponse} for more details. + # + # @param template [Zavudev::Models::AgentTemplateRetrieveResponse::Template] A fully rendered factory agent: the function files to scaffold plus the secrets + + # @see Zavudev::Models::AgentTemplateRetrieveResponse#template + class Template < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute category + # + # @return [Symbol, Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category] + required :category, enum: -> { Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category } + + # @!attribute default_slug + # + # @return [String] + required :default_slug, String, api_name: :defaultSlug + + # @!attribute dependencies + # npm dependencies for the scaffolded function. + # + # @return [Hash{Symbol=>String}] + required :dependencies, Zavudev::Internal::Type::HashOf[String] + + # @!attribute files + # + # @return [Array] + required :files, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::AgentTemplateRetrieveResponse::Template::File] } + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute required_secrets + # + # @return [Array] + required :required_secrets, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::AgentTemplateRetrieveResponse::Template::RequiredSecret] }, + api_name: :requiredSecrets + + # @!attribute summary + # + # @return [String] + required :summary, String + + # @!attribute voice + # + # @return [Boolean] + required :voice, Zavudev::Internal::Type::Boolean + + # @!method initialize(id:, category:, default_slug:, dependencies:, files:, name:, required_secrets:, summary:, voice:) + # A fully rendered factory agent: the function files to scaffold plus the secrets + # it needs. Returned by GET /v1/agent-templates/{templateId} and consumed by + # `npx zavudev agents pull`. + # + # @param id [String] + # + # @param category [Symbol, Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category] + # + # @param default_slug [String] + # + # @param dependencies [Hash{Symbol=>String}] npm dependencies for the scaffolded function. + # + # @param files [Array] + # + # @param name [String] + # + # @param required_secrets [Array] + # + # @param summary [String] + # + # @param voice [Boolean] + + # @see Zavudev::Models::AgentTemplateRetrieveResponse::Template#category + module Category + extend Zavudev::Internal::Type::Enum + + SALES = :sales + SUPPORT = :support + FRONT_DESK = :frontDesk + OPS = :ops + + # @!method self.values + # @return [Array] + end + + class File < Zavudev::Internal::Type::BaseModel + # @!attribute content + # File contents to write verbatim. + # + # @return [String] + required :content, String + + # @!attribute path + # + # @return [String] + required :path, String + + # @!method initialize(content:, path:) + # @param content [String] File contents to write verbatim. + # + # @param path [String] + end + + class RequiredSecret < Zavudev::Internal::Type::BaseModel + # @!attribute hint + # + # @return [String] + required :hint, String + + # @!attribute key + # + # @return [String] + required :key, String + + # @!method initialize(hint:, key:) + # @param hint [String] + # @param key [String] + end + end + end + end +end diff --git a/lib/zavudev/models/agent_test_params.rb b/lib/zavudev/models/agent_test_params.rb new file mode 100644 index 0000000..3d3e78b --- /dev/null +++ b/lib/zavudev/models/agent_test_params.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#test_ + class AgentTestParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute agent_id + # + # @return [String] + required :agent_id, String + + # @!attribute message + # What to say to the agent. + # + # @return [String] + required :message, String + + # @!attribute execute_tools + # Run the tools the agent calls instead of reporting the choice and stopping. + # + # Off by default because a tool handler talks to the outside world: a rehearsal + # that charges a card is not a rehearsal. Turn it on to exercise the loop that + # actually matters — the model picks a tool, the handler answers, the model + # replies with the result — without sending a message to anyone. What ran comes + # back in `executedToolCalls`. + # + # @return [Boolean, nil] + optional :execute_tools, Zavudev::Internal::Type::Boolean, api_name: :executeTools + + # @!attribute history + # Prior turns, oldest first, to exercise multi-turn behaviour without persisting a + # thread. Trimmed to the agent's context window. + # + # @return [Array, nil] + optional :history, -> { Zavudev::Internal::Type::ArrayOf[Zavudev::AgentTestParams::History] } + + # @!attribute use_knowledge_base + # Set false to skip retrieval and isolate prompt behaviour from the knowledge + # base. + # + # @return [Boolean, nil] + optional :use_knowledge_base, Zavudev::Internal::Type::Boolean, api_name: :useKnowledgeBase + + # @!method initialize(agent_id:, message:, execute_tools: nil, history: nil, use_knowledge_base: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::AgentTestParams} for more details. + # + # @param agent_id [String] + # + # @param message [String] What to say to the agent. + # + # @param execute_tools [Boolean] Run the tools the agent calls instead of reporting the choice and stopping. + # + # @param history [Array] Prior turns, oldest first, to exercise multi-turn behaviour without persisting a + # + # @param use_knowledge_base [Boolean] Set false to skip retrieval and isolate prompt behaviour from the knowledge base + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + + class History < Zavudev::Internal::Type::BaseModel + # @!attribute content + # + # @return [String] + required :content, String + + # @!attribute role + # + # @return [Symbol, Zavudev::Models::AgentTestParams::History::Role] + required :role, enum: -> { Zavudev::AgentTestParams::History::Role } + + # @!method initialize(content:, role:) + # @param content [String] + # @param role [Symbol, Zavudev::Models::AgentTestParams::History::Role] + + # @see Zavudev::Models::AgentTestParams::History#role + module Role + extend Zavudev::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/zavudev/models/agent_test_response.rb b/lib/zavudev/models/agent_test_response.rb new file mode 100644 index 0000000..9f3dc9c --- /dev/null +++ b/lib/zavudev/models/agent_test_response.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#test_ + class AgentTestResponse < Zavudev::Internal::Type::BaseModel + # @!attribute error + # + # @return [String, nil] + required :error, String, nil?: true + + # @!attribute input_tokens + # + # @return [Integer] + required :input_tokens, Integer, api_name: :inputTokens + + # @!attribute knowledge_chunks_used + # Knowledge-base chunks retrieved for this message. Zero means the answer was not + # grounded in your documents. + # + # @return [Integer] + required :knowledge_chunks_used, Integer, api_name: :knowledgeChunksUsed + + # @!attribute latency_ms + # + # @return [Integer] + required :latency_ms, Integer, api_name: :latencyMs + + # @!attribute output_tokens + # + # @return [Integer] + required :output_tokens, Integer, api_name: :outputTokens + + # @!attribute success + # + # @return [Boolean] + required :success, Zavudev::Internal::Type::Boolean + + # @!attribute text + # What the agent would reply. + # + # @return [String, nil] + required :text, String, nil?: true + + # @!attribute warnings + # Things that are true of this agent but that a dry run cannot prove. Surfaced so + # a passing dry run is never mistaken for proof that the agent works live. + # + # - The agent being disabled. + # - Enabled tools that were **not offered to the model** here — the model never + # saw them, so a reply that looks like a lookup was invented. Live conversations + # on every channel do offer them; running them here would cause real side + # effects. + # - An agent whose sender has none of the channels it triggers on, which answers + # every dry run and no real message. + # - Contact metadata that exists on a real conversation but not here. + # + # @return [Array] + required :warnings, Zavudev::Internal::Type::ArrayOf[String] + + # @!attribute executed_tool_calls + # Tools that actually ran, in order, when the request set `executeTools`. Empty on + # a normal dry run, where nothing is executed. An entry with `ok: false` means the + # agent saw an error and answered around it, which is what a customer would have + # received. + # + # @return [Array, nil] + optional :executed_tool_calls, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::AgentTestResponse::ExecutedToolCall] }, + api_name: :executedToolCalls + + # @!method initialize(error:, input_tokens:, knowledge_chunks_used:, latency_ms:, output_tokens:, success:, text:, warnings:, executed_tool_calls: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::AgentTestResponse} for more details. + # + # @param error [String, nil] + # + # @param input_tokens [Integer] + # + # @param knowledge_chunks_used [Integer] Knowledge-base chunks retrieved for this message. Zero means the answer was not + # + # @param latency_ms [Integer] + # + # @param output_tokens [Integer] + # + # @param success [Boolean] + # + # @param text [String, nil] What the agent would reply. + # + # @param warnings [Array] Things that are true of this agent but that a dry run cannot prove. Surfaced so + # + # @param executed_tool_calls [Array] Tools that actually ran, in order, when the request set `executeTools`. Empty on + + class ExecutedToolCall < Zavudev::Internal::Type::BaseModel + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute ok + # + # @return [Boolean] + required :ok, Zavudev::Internal::Type::Boolean + + # @!attribute error + # + # @return [String, nil] + optional :error, String, nil?: true + + # @!method initialize(name:, ok:, error: nil) + # @param name [String] + # @param ok [Boolean] + # @param error [String, nil] + end + end + end +end diff --git a/lib/zavudev/models/agent_update_params.rb b/lib/zavudev/models/agent_update_params.rb new file mode 100644 index 0000000..46d6c6b --- /dev/null +++ b/lib/zavudev/models/agent_update_params.rb @@ -0,0 +1,295 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#update + class AgentUpdateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute agent_id + # + # @return [String] + required :agent_id, String + + # @!attribute api_key + # + # @return [String, nil] + optional :api_key, String, api_name: :apiKey + + # @!attribute context_window_messages + # + # @return [Integer, nil] + optional :context_window_messages, Integer, api_name: :contextWindowMessages + + # @!attribute enabled + # + # @return [Boolean, nil] + optional :enabled, Zavudev::Internal::Type::Boolean + + # @!attribute include_contact_metadata + # + # @return [Boolean, nil] + optional :include_contact_metadata, Zavudev::Internal::Type::Boolean, api_name: :includeContactMetadata + + # @!attribute max_tokens + # + # @return [Integer, nil] + optional :max_tokens, Integer, api_name: :maxTokens, nil?: true + + # @!attribute model + # + # @return [String, nil] + optional :model, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute provider + # LLM provider for the AI agent. + # + # @return [Symbol, Zavudev::Models::Senders::AgentProvider, nil] + optional :provider, enum: -> { Zavudev::Senders::AgentProvider } + + # @!attribute system_prompt + # + # @return [String, nil] + optional :system_prompt, String, api_name: :systemPrompt + + # @!attribute temperature + # + # @return [Float, nil] + optional :temperature, Float, nil?: true + + # @!attribute trigger_on_channels + # + # @return [Array, nil] + optional :trigger_on_channels, Zavudev::Internal::Type::ArrayOf[String], api_name: :triggerOnChannels + + # @!attribute trigger_on_message_types + # + # @return [Array, nil] + optional :trigger_on_message_types, + Zavudev::Internal::Type::ArrayOf[String], + api_name: :triggerOnMessageTypes + + # @!attribute voice + # Voice Agent configuration. Patch this object to enable voice, change the + # greeting, or adjust call limits. Requires the Voice Agents feature to be enabled + # for your team. + # + # @return [Zavudev::Models::AgentUpdateParams::Voice, nil] + optional :voice, -> { Zavudev::AgentUpdateParams::Voice } + + # @!method initialize(agent_id:, api_key: nil, context_window_messages: nil, enabled: nil, include_contact_metadata: nil, max_tokens: nil, model: nil, name: nil, provider: nil, system_prompt: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, voice: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::AgentUpdateParams} for more details. + # + # @param agent_id [String] + # + # @param api_key [String] + # + # @param context_window_messages [Integer] + # + # @param enabled [Boolean] + # + # @param include_contact_metadata [Boolean] + # + # @param max_tokens [Integer, nil] + # + # @param model [String] + # + # @param name [String] + # + # @param provider [Symbol, Zavudev::Models::Senders::AgentProvider] LLM provider for the AI agent. + # + # @param system_prompt [String] + # + # @param temperature [Float, nil] + # + # @param trigger_on_channels [Array] + # + # @param trigger_on_message_types [Array] + # + # @param voice [Zavudev::Models::AgentUpdateParams::Voice] Voice Agent configuration. Patch this object to enable voice, change the greetin + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + + class Voice < Zavudev::Internal::Type::BaseModel + # @!attribute enabled + # Whether the agent handles voice calls. When false, the sender's number is not + # answered by the voice agent and outbound calls are rejected. + # + # @return [Boolean] + required :enabled, Zavudev::Internal::Type::Boolean + + # @!attribute greeting + # Opening line the agent speaks when the call connects. If omitted, the agent + # waits for the caller to speak first. + # + # @return [String, nil] + optional :greeting, String + + # @!attribute greetings + # Greeting per language, keyed by language code. Used when the caller's language + # differs from the one `greeting` is written in. + # + # @return [Hash{Symbol=>String}, nil] + optional :greetings, Zavudev::Internal::Type::HashOf[String] + + # @!attribute interruptible + # Whether the caller can interrupt the agent while it is speaking (barge-in). When + # true, the agent stops talking as soon as the caller starts. + # + # @return [Boolean, nil] + optional :interruptible, Zavudev::Internal::Type::Boolean + + # @!attribute language + # BCP-47 language code used for both speech recognition and speech synthesis (e.g. + # `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted. + # + # @return [String, nil] + optional :language, String + + # @!attribute max_call_duration_minutes + # Hard limit on call length in minutes. The call ends automatically when reached. + # + # @return [Integer, nil] + optional :max_call_duration_minutes, Integer, api_name: :maxCallDurationMinutes + + # @!attribute max_idle_seconds + # How long the agent waits during silence before ending the call. + # + # @return [Integer, nil] + optional :max_idle_seconds, Integer, api_name: :maxIdleSeconds + + # @!attribute model + # Model that runs the conversation, co-located in the voice network for lowest + # latency. Independent of the model used for text messaging. Derived from the + # agent's text model when omitted. + # + # @return [String, nil] + optional :model, String + + # @!attribute record_calls + # Whether the call audio is recorded. + # + # @return [Boolean, nil] + optional :record_calls, Zavudev::Internal::Type::Boolean, api_name: :recordCalls + + # @!attribute stt_model + # Speech-recognition model. Uses the default when omitted. + # + # @return [String, nil] + optional :stt_model, String, api_name: :sttModel + + # @!attribute stt_provider + # Speech-recognition provider. Uses the default when omitted. + # + # @return [String, nil] + optional :stt_provider, String, api_name: :sttProvider + + # @!attribute transfer_phone_number + # E.164 phone number the agent can transfer the call to. When set, the agent is + # given a transfer tool it can use to hand the call to a human. + # + # @return [String, nil] + optional :transfer_phone_number, String, api_name: :transferPhoneNumber + + # @!attribute tts_provider + # Speech-synthesis provider. Uses the default when omitted. + # + # @return [String, nil] + optional :tts_provider, String, api_name: :ttsProvider + + # @!attribute tts_voice_id + # Identifier of the synthesized voice that speaks. Choose from the voices + # available in the dashboard. Uses a neutral default when omitted. + # + # @return [String, nil] + optional :tts_voice_id, String, api_name: :ttsVoiceId + + # @!attribute voicemail_action + # What the agent does when an answering machine or voicemail is detected on an + # outbound call. + # + # @return [Symbol, Zavudev::Models::AgentUpdateParams::Voice::VoicemailAction, nil] + optional :voicemail_action, + enum: -> { Zavudev::AgentUpdateParams::Voice::VoicemailAction }, + api_name: :voicemailAction + + # @!attribute voicemail_message + # Message spoken when `voicemailAction` is `leave_message`. Falls back to + # `greeting` when omitted. + # + # @return [String, nil] + optional :voicemail_message, String, api_name: :voicemailMessage + + # @!attribute voice_speed + # Speech rate. 1.0 is natural. Only honoured by voices that support rate control; + # ignored by the others. + # + # @return [Float, nil] + optional :voice_speed, Float, api_name: :voiceSpeed + + # @!method initialize(enabled:, greeting: nil, greetings: nil, interruptible: nil, language: nil, max_call_duration_minutes: nil, max_idle_seconds: nil, model: nil, record_calls: nil, stt_model: nil, stt_provider: nil, transfer_phone_number: nil, tts_provider: nil, tts_voice_id: nil, voicemail_action: nil, voicemail_message: nil, voice_speed: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::AgentUpdateParams::Voice} for more details. + # + # Voice Agent configuration. Patch this object to enable voice, change the + # greeting, or adjust call limits. Requires the Voice Agents feature to be enabled + # for your team. + # + # @param enabled [Boolean] Whether the agent handles voice calls. When false, the sender's number is not an + # + # @param greeting [String] Opening line the agent speaks when the call connects. If omitted, the agent wait + # + # @param greetings [Hash{Symbol=>String}] Greeting per language, keyed by language code. Used when the caller's language d + # + # @param interruptible [Boolean] Whether the caller can interrupt the agent while it is speaking (barge-in). When + # + # @param language [String] BCP-47 language code used for both speech recognition and speech synthesis (e.g. + # + # @param max_call_duration_minutes [Integer] Hard limit on call length in minutes. The call ends automatically when reached. + # + # @param max_idle_seconds [Integer] How long the agent waits during silence before ending the call. + # + # @param model [String] Model that runs the conversation, co-located in the voice network for lowest lat + # + # @param record_calls [Boolean] Whether the call audio is recorded. + # + # @param stt_model [String] Speech-recognition model. Uses the default when omitted. + # + # @param stt_provider [String] Speech-recognition provider. Uses the default when omitted. + # + # @param transfer_phone_number [String] E.164 phone number the agent can transfer the call to. When set, the agent is gi + # + # @param tts_provider [String] Speech-synthesis provider. Uses the default when omitted. + # + # @param tts_voice_id [String] Identifier of the synthesized voice that speaks. Choose from the voices availabl + # + # @param voicemail_action [Symbol, Zavudev::Models::AgentUpdateParams::Voice::VoicemailAction] What the agent does when an answering machine or voicemail is detected on an out + # + # @param voicemail_message [String] Message spoken when `voicemailAction` is `leave_message`. Falls back to `greetin + # + # @param voice_speed [Float] Speech rate. 1.0 is natural. Only honoured by voices that support rate control; + + # What the agent does when an answering machine or voicemail is detected on an + # outbound call. + # + # @see Zavudev::Models::AgentUpdateParams::Voice#voicemail_action + module VoicemailAction + extend Zavudev::Internal::Type::Enum + + HANGUP = :hangup + LEAVE_MESSAGE = :leave_message + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/zavudev/models/agent_update_response.rb b/lib/zavudev/models/agent_update_response.rb new file mode 100644 index 0000000..8e43f2f --- /dev/null +++ b/lib/zavudev/models/agent_update_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Agents#update + class AgentUpdateResponse < Zavudev::Internal::Type::BaseModel + # @!attribute agent + # AI Agent configuration for a sender. + # + # @return [Zavudev::Models::Senders::SendersAgent] + required :agent, -> { Zavudev::Senders::SendersAgent } + + # @!method initialize(agent:) + # @param agent [Zavudev::Models::Senders::SendersAgent] AI Agent configuration for a sender. + end + end +end diff --git a/lib/zavudev/models/agents/sender_connect_params.rb b/lib/zavudev/models/agents/sender_connect_params.rb new file mode 100644 index 0000000..58c3b0c --- /dev/null +++ b/lib/zavudev/models/agents/sender_connect_params.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Agents + # @see Zavudev::Resources::Agents::Senders#connect + class SenderConnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute agent_id + # + # @return [String] + required :agent_id, String + + # @!attribute sender_id + # Sender to connect. + # + # @return [String] + required :sender_id, String, api_name: :senderId + + # @!method initialize(agent_id:, sender_id:, request_options: {}) + # @param agent_id [String] + # + # @param sender_id [String] Sender to connect. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/agents/sender_connect_response.rb b/lib/zavudev/models/agents/sender_connect_response.rb new file mode 100644 index 0000000..cef6d0c --- /dev/null +++ b/lib/zavudev/models/agents/sender_connect_response.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Agents + # @see Zavudev::Resources::Agents::Senders#connect + class SenderConnectResponse < Zavudev::Internal::Type::BaseModel + # @!attribute agent + # AI Agent configuration for a sender. + # + # @return [Zavudev::Models::Senders::SendersAgent] + required :agent, -> { Zavudev::Senders::SendersAgent } + + # @!method initialize(agent:) + # @param agent [Zavudev::Models::Senders::SendersAgent] AI Agent configuration for a sender. + end + end + end +end diff --git a/lib/zavudev/models/agents/sender_disconnect_params.rb b/lib/zavudev/models/agents/sender_disconnect_params.rb new file mode 100644 index 0000000..96b2cd5 --- /dev/null +++ b/lib/zavudev/models/agents/sender_disconnect_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Agents + # @see Zavudev::Resources::Agents::Senders#disconnect + class SenderDisconnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute agent_id + # + # @return [String] + required :agent_id, String + + # @!attribute sender_id + # + # @return [String] + required :sender_id, String + + # @!method initialize(agent_id:, sender_id:, request_options: {}) + # @param agent_id [String] + # @param sender_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/call_create_params.rb b/lib/zavudev/models/call_create_params.rb new file mode 100644 index 0000000..7af7528 --- /dev/null +++ b/lib/zavudev/models/call_create_params.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Calls#create + class CallCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute to + # Recipient phone number in E.164 format. + # + # @return [String] + required :to, String + + # @!attribute greeting + # Overrides the agent's configured greeting for this call only. + # + # @return [String, nil] + optional :greeting, String + + # @!attribute language + # Language the agent speaks on this call only, as a BCP-47 tag (`en`, `es`, + # `es-ES`, `pt-BR`), or `auto` to detect the caller's language and follow it. + # Overrides the agent's configured language for speech recognition, the agent's + # replies, and the synthesized voice. If the agent uses a custom voice you + # supplied, that voice is kept and only the language changes. When omitted, the + # agent's configured language is used. + # + # @return [String, nil] + optional :language, String + + # @!attribute max_duration_minutes + # Overrides the agent's maximum call duration for this call only. + # + # @return [Integer, nil] + optional :max_duration_minutes, Integer, api_name: :maxDurationMinutes + + # @!attribute metadata + # Arbitrary metadata to associate with the call. Returned on the call object and + # included in voice webhooks. + # + # @return [Hash{Symbol=>String}, nil] + optional :metadata, Zavudev::Internal::Type::HashOf[String] + + # @!attribute sender_id + # Sender profile that places the call. Uses the project's default sender if + # omitted. The sender's agent must have voice enabled. + # + # @return [String, nil] + optional :sender_id, String, api_name: :senderId + + # @!method initialize(to:, greeting: nil, language: nil, max_duration_minutes: nil, metadata: nil, sender_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallCreateParams} for more details. + # + # @param to [String] Recipient phone number in E.164 format. + # + # @param greeting [String] Overrides the agent's configured greeting for this call only. + # + # @param language [String] Language the agent speaks on this call only, as a BCP-47 tag (`en`, `es`, `es-ES + # + # @param max_duration_minutes [Integer] Overrides the agent's maximum call duration for this call only. + # + # @param metadata [Hash{Symbol=>String}] Arbitrary metadata to associate with the call. Returned on the call object and i + # + # @param sender_id [String] Sender profile that places the call. Uses the project's default sender if omitte + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/call_create_response.rb b/lib/zavudev/models/call_create_response.rb new file mode 100644 index 0000000..fd61835 --- /dev/null +++ b/lib/zavudev/models/call_create_response.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Calls#create + class CallCreateResponse < Zavudev::Internal::Type::BaseModel + # @!attribute call + # + # @return [Zavudev::Models::CallCreateResponse::Call] + required :call, -> { Zavudev::Models::CallCreateResponse::Call } + + # @!method initialize(call:) + # @param call [Zavudev::Models::CallCreateResponse::Call] + + # @see Zavudev::Models::CallCreateResponse#call + class Call < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute direction + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + # + # @return [Symbol, Zavudev::Models::CallCreateResponse::Call::Direction] + required :direction, enum: -> { Zavudev::Models::CallCreateResponse::Call::Direction } + + # @!attribute from + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + # + # @return [String] + required :from, String + + # @!attribute status + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + # + # @return [Symbol, Zavudev::Models::CallCreateResponse::Call::Status] + required :status, enum: -> { Zavudev::Models::CallCreateResponse::Call::Status } + + # @!attribute to + # Callee phone number in E.164 format. + # + # @return [String] + required :to, String + + # @!attribute answered_at + # When the call was answered. + # + # @return [Time, nil] + optional :answered_at, Time, api_name: :answeredAt, nil?: true + + # @!attribute cost + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + # + # @return [Float, nil] + optional :cost, Float, nil?: true + + # @!attribute duration_seconds + # Billable talk time in seconds, measured from answer to hangup. + # + # @return [Integer, nil] + optional :duration_seconds, Integer, api_name: :durationSeconds, nil?: true + + # @!attribute ended_at + # When the call ended. + # + # @return [Time, nil] + optional :ended_at, Time, api_name: :endedAt, nil?: true + + # @!attribute end_reason + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + # + # @return [String, nil] + optional :end_reason, String, api_name: :endReason, nil?: true + + # @!attribute metadata + # Arbitrary metadata you attached when creating the call. + # + # @return [Hash{Symbol=>String}, nil] + optional :metadata, Zavudev::Internal::Type::HashOf[String] + + # @!attribute transcript + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + # + # @return [Array, nil] + optional :transcript, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::CallCreateResponse::Call::Transcript] } + + # @!attribute turn_count + # Number of conversation turns exchanged during the call. + # + # @return [Integer, nil] + optional :turn_count, Integer, api_name: :turnCount, nil?: true + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, created_at:, direction:, from:, status:, to:, answered_at: nil, cost: nil, duration_seconds: nil, ended_at: nil, end_reason: nil, metadata: nil, transcript: nil, turn_count: nil, updated_at: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallCreateResponse::Call} for more details. + # + # @param id [String] + # + # @param created_at [Time] + # + # @param direction [Symbol, Zavudev::Models::CallCreateResponse::Call::Direction] Whether the call was placed by Zavu (outbound) or received from a caller (inboun + # + # @param from [String] Caller phone number in E.164 format. Your sender's number for outbound calls; th + # + # @param status [Symbol, Zavudev::Models::CallCreateResponse::Call::Status] Lifecycle status of a voice call. + # + # @param to [String] Callee phone number in E.164 format. + # + # @param answered_at [Time, nil] When the call was answered. + # + # @param cost [Float, nil] Total cost of the call in USD, combining the managed voice pipeline per-minute c + # + # @param duration_seconds [Integer, nil] Billable talk time in seconds, measured from answer to hangup. + # + # @param ended_at [Time, nil] When the call ended. + # + # @param end_reason [String, nil] Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). P + # + # @param metadata [Hash{Symbol=>String}] Arbitrary metadata you attached when creating the call. + # + # @param transcript [Array] Ordered transcript of the call. Included when retrieving a single call; omitted + # + # @param turn_count [Integer, nil] Number of conversation turns exchanged during the call. + # + # @param updated_at [Time] + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + # + # @see Zavudev::Models::CallCreateResponse::Call#direction + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND = :inbound + OUTBOUND = :outbound + + # @!method self.values + # @return [Array] + end + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + # + # @see Zavudev::Models::CallCreateResponse::Call#status + module Status + extend Zavudev::Internal::Type::Enum + + QUEUED = :queued + RINGING = :ringing + IN_PROGRESS = :in_progress + COMPLETED = :completed + FAILED = :failed + BUSY = :busy + NO_ANSWER = :no_answer + CANCELED = :canceled + + # @!method self.values + # @return [Array] + end + + class Transcript < Zavudev::Internal::Type::BaseModel + # @!attribute role + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + # + # @return [Symbol, Zavudev::Models::CallCreateResponse::Call::Transcript::Role] + required :role, enum: -> { Zavudev::Models::CallCreateResponse::Call::Transcript::Role } + + # @!attribute seq + # Ordinal position of the turn within the call, starting at 0. + # + # @return [Integer] + required :seq, Integer + + # @!attribute text + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + # + # @return [String] + required :text, String + + # @!attribute ended_at + # When the turn ended. + # + # @return [Time, nil] + optional :ended_at, Time, api_name: :endedAt, nil?: true + + # @!attribute started_at + # When the turn started. + # + # @return [Time, nil] + optional :started_at, Time, api_name: :startedAt, nil?: true + + # @!method initialize(role:, seq:, text:, ended_at: nil, started_at: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallCreateResponse::Call::Transcript} for more details. + # + # A single turn in a voice call transcript. + # + # @param role [Symbol, Zavudev::Models::CallCreateResponse::Call::Transcript::Role] Who produced the turn. `tool` records a tool call the agent made during the conv + # + # @param seq [Integer] Ordinal position of the turn within the call, starting at 0. + # + # @param text [String] Transcribed speech for `user` and `assistant` turns, or a JSON summary of the to + # + # @param ended_at [Time, nil] When the turn ended. + # + # @param started_at [Time, nil] When the turn started. + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + # + # @see Zavudev::Models::CallCreateResponse::Call::Transcript#role + module Role + extend Zavudev::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + TOOL = :tool + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/zavudev/models/call_hangup_params.rb b/lib/zavudev/models/call_hangup_params.rb new file mode 100644 index 0000000..1957236 --- /dev/null +++ b/lib/zavudev/models/call_hangup_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Calls#hangup + class CallHangupParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute call_id + # + # @return [String] + required :call_id, String + + # @!method initialize(call_id:, request_options: {}) + # @param call_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/call_hangup_response.rb b/lib/zavudev/models/call_hangup_response.rb new file mode 100644 index 0000000..31c50ad --- /dev/null +++ b/lib/zavudev/models/call_hangup_response.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Calls#hangup + class CallHangupResponse < Zavudev::Internal::Type::BaseModel + # @!attribute call + # + # @return [Zavudev::Models::CallHangupResponse::Call] + required :call, -> { Zavudev::Models::CallHangupResponse::Call } + + # @!method initialize(call:) + # @param call [Zavudev::Models::CallHangupResponse::Call] + + # @see Zavudev::Models::CallHangupResponse#call + class Call < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute direction + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + # + # @return [Symbol, Zavudev::Models::CallHangupResponse::Call::Direction] + required :direction, enum: -> { Zavudev::Models::CallHangupResponse::Call::Direction } + + # @!attribute from + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + # + # @return [String] + required :from, String + + # @!attribute status + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + # + # @return [Symbol, Zavudev::Models::CallHangupResponse::Call::Status] + required :status, enum: -> { Zavudev::Models::CallHangupResponse::Call::Status } + + # @!attribute to + # Callee phone number in E.164 format. + # + # @return [String] + required :to, String + + # @!attribute answered_at + # When the call was answered. + # + # @return [Time, nil] + optional :answered_at, Time, api_name: :answeredAt, nil?: true + + # @!attribute cost + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + # + # @return [Float, nil] + optional :cost, Float, nil?: true + + # @!attribute duration_seconds + # Billable talk time in seconds, measured from answer to hangup. + # + # @return [Integer, nil] + optional :duration_seconds, Integer, api_name: :durationSeconds, nil?: true + + # @!attribute ended_at + # When the call ended. + # + # @return [Time, nil] + optional :ended_at, Time, api_name: :endedAt, nil?: true + + # @!attribute end_reason + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + # + # @return [String, nil] + optional :end_reason, String, api_name: :endReason, nil?: true + + # @!attribute metadata + # Arbitrary metadata you attached when creating the call. + # + # @return [Hash{Symbol=>String}, nil] + optional :metadata, Zavudev::Internal::Type::HashOf[String] + + # @!attribute transcript + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + # + # @return [Array, nil] + optional :transcript, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::CallHangupResponse::Call::Transcript] } + + # @!attribute turn_count + # Number of conversation turns exchanged during the call. + # + # @return [Integer, nil] + optional :turn_count, Integer, api_name: :turnCount, nil?: true + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, created_at:, direction:, from:, status:, to:, answered_at: nil, cost: nil, duration_seconds: nil, ended_at: nil, end_reason: nil, metadata: nil, transcript: nil, turn_count: nil, updated_at: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallHangupResponse::Call} for more details. + # + # @param id [String] + # + # @param created_at [Time] + # + # @param direction [Symbol, Zavudev::Models::CallHangupResponse::Call::Direction] Whether the call was placed by Zavu (outbound) or received from a caller (inboun + # + # @param from [String] Caller phone number in E.164 format. Your sender's number for outbound calls; th + # + # @param status [Symbol, Zavudev::Models::CallHangupResponse::Call::Status] Lifecycle status of a voice call. + # + # @param to [String] Callee phone number in E.164 format. + # + # @param answered_at [Time, nil] When the call was answered. + # + # @param cost [Float, nil] Total cost of the call in USD, combining the managed voice pipeline per-minute c + # + # @param duration_seconds [Integer, nil] Billable talk time in seconds, measured from answer to hangup. + # + # @param ended_at [Time, nil] When the call ended. + # + # @param end_reason [String, nil] Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). P + # + # @param metadata [Hash{Symbol=>String}] Arbitrary metadata you attached when creating the call. + # + # @param transcript [Array] Ordered transcript of the call. Included when retrieving a single call; omitted + # + # @param turn_count [Integer, nil] Number of conversation turns exchanged during the call. + # + # @param updated_at [Time] + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + # + # @see Zavudev::Models::CallHangupResponse::Call#direction + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND = :inbound + OUTBOUND = :outbound + + # @!method self.values + # @return [Array] + end + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + # + # @see Zavudev::Models::CallHangupResponse::Call#status + module Status + extend Zavudev::Internal::Type::Enum + + QUEUED = :queued + RINGING = :ringing + IN_PROGRESS = :in_progress + COMPLETED = :completed + FAILED = :failed + BUSY = :busy + NO_ANSWER = :no_answer + CANCELED = :canceled + + # @!method self.values + # @return [Array] + end + + class Transcript < Zavudev::Internal::Type::BaseModel + # @!attribute role + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + # + # @return [Symbol, Zavudev::Models::CallHangupResponse::Call::Transcript::Role] + required :role, enum: -> { Zavudev::Models::CallHangupResponse::Call::Transcript::Role } + + # @!attribute seq + # Ordinal position of the turn within the call, starting at 0. + # + # @return [Integer] + required :seq, Integer + + # @!attribute text + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + # + # @return [String] + required :text, String + + # @!attribute ended_at + # When the turn ended. + # + # @return [Time, nil] + optional :ended_at, Time, api_name: :endedAt, nil?: true + + # @!attribute started_at + # When the turn started. + # + # @return [Time, nil] + optional :started_at, Time, api_name: :startedAt, nil?: true + + # @!method initialize(role:, seq:, text:, ended_at: nil, started_at: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallHangupResponse::Call::Transcript} for more details. + # + # A single turn in a voice call transcript. + # + # @param role [Symbol, Zavudev::Models::CallHangupResponse::Call::Transcript::Role] Who produced the turn. `tool` records a tool call the agent made during the conv + # + # @param seq [Integer] Ordinal position of the turn within the call, starting at 0. + # + # @param text [String] Transcribed speech for `user` and `assistant` turns, or a JSON summary of the to + # + # @param ended_at [Time, nil] When the turn ended. + # + # @param started_at [Time, nil] When the turn started. + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + # + # @see Zavudev::Models::CallHangupResponse::Call::Transcript#role + module Role + extend Zavudev::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + TOOL = :tool + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/zavudev/models/call_list_params.rb b/lib/zavudev/models/call_list_params.rb new file mode 100644 index 0000000..d4430d8 --- /dev/null +++ b/lib/zavudev/models/call_list_params.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Calls#list + class CallListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute cursor + # + # @return [String, nil] + optional :cursor, String + + # @!attribute direction + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + # + # @return [Symbol, Zavudev::Models::CallListParams::Direction, nil] + optional :direction, enum: -> { Zavudev::CallListParams::Direction } + + # @!attribute limit + # + # @return [Integer, nil] + optional :limit, Integer + + # @!attribute status + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + # + # @return [Symbol, Zavudev::Models::CallListParams::Status, nil] + optional :status, enum: -> { Zavudev::CallListParams::Status } + + # @!method initialize(cursor: nil, direction: nil, limit: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallListParams} for more details. + # + # @param cursor [String] + # + # @param direction [Symbol, Zavudev::Models::CallListParams::Direction] Whether the call was placed by Zavu (outbound) or received from a caller (inboun + # + # @param limit [Integer] + # + # @param status [Symbol, Zavudev::Models::CallListParams::Status] Lifecycle status of a voice call. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND = :inbound + OUTBOUND = :outbound + + # @!method self.values + # @return [Array] + end + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + module Status + extend Zavudev::Internal::Type::Enum + + QUEUED = :queued + RINGING = :ringing + IN_PROGRESS = :in_progress + COMPLETED = :completed + FAILED = :failed + BUSY = :busy + NO_ANSWER = :no_answer + CANCELED = :canceled + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/zavudev/models/call_list_response.rb b/lib/zavudev/models/call_list_response.rb new file mode 100644 index 0000000..8d4593f --- /dev/null +++ b/lib/zavudev/models/call_list_response.rb @@ -0,0 +1,251 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Calls#list + class CallListResponse < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute direction + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + # + # @return [Symbol, Zavudev::Models::CallListResponse::Direction] + required :direction, enum: -> { Zavudev::Models::CallListResponse::Direction } + + # @!attribute from + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + # + # @return [String] + required :from, String + + # @!attribute status + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + # + # @return [Symbol, Zavudev::Models::CallListResponse::Status] + required :status, enum: -> { Zavudev::Models::CallListResponse::Status } + + # @!attribute to + # Callee phone number in E.164 format. + # + # @return [String] + required :to, String + + # @!attribute answered_at + # When the call was answered. + # + # @return [Time, nil] + optional :answered_at, Time, api_name: :answeredAt, nil?: true + + # @!attribute cost + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + # + # @return [Float, nil] + optional :cost, Float, nil?: true + + # @!attribute duration_seconds + # Billable talk time in seconds, measured from answer to hangup. + # + # @return [Integer, nil] + optional :duration_seconds, Integer, api_name: :durationSeconds, nil?: true + + # @!attribute ended_at + # When the call ended. + # + # @return [Time, nil] + optional :ended_at, Time, api_name: :endedAt, nil?: true + + # @!attribute end_reason + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + # + # @return [String, nil] + optional :end_reason, String, api_name: :endReason, nil?: true + + # @!attribute metadata + # Arbitrary metadata you attached when creating the call. + # + # @return [Hash{Symbol=>String}, nil] + optional :metadata, Zavudev::Internal::Type::HashOf[String] + + # @!attribute transcript + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + # + # @return [Array, nil] + optional :transcript, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::CallListResponse::Transcript] } + + # @!attribute turn_count + # Number of conversation turns exchanged during the call. + # + # @return [Integer, nil] + optional :turn_count, Integer, api_name: :turnCount, nil?: true + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, created_at:, direction:, from:, status:, to:, answered_at: nil, cost: nil, duration_seconds: nil, ended_at: nil, end_reason: nil, metadata: nil, transcript: nil, turn_count: nil, updated_at: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallListResponse} for more details. + # + # @param id [String] + # + # @param created_at [Time] + # + # @param direction [Symbol, Zavudev::Models::CallListResponse::Direction] Whether the call was placed by Zavu (outbound) or received from a caller (inboun + # + # @param from [String] Caller phone number in E.164 format. Your sender's number for outbound calls; th + # + # @param status [Symbol, Zavudev::Models::CallListResponse::Status] Lifecycle status of a voice call. + # + # @param to [String] Callee phone number in E.164 format. + # + # @param answered_at [Time, nil] When the call was answered. + # + # @param cost [Float, nil] Total cost of the call in USD, combining the managed voice pipeline per-minute c + # + # @param duration_seconds [Integer, nil] Billable talk time in seconds, measured from answer to hangup. + # + # @param ended_at [Time, nil] When the call ended. + # + # @param end_reason [String, nil] Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). P + # + # @param metadata [Hash{Symbol=>String}] Arbitrary metadata you attached when creating the call. + # + # @param transcript [Array] Ordered transcript of the call. Included when retrieving a single call; omitted + # + # @param turn_count [Integer, nil] Number of conversation turns exchanged during the call. + # + # @param updated_at [Time] + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + # + # @see Zavudev::Models::CallListResponse#direction + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND = :inbound + OUTBOUND = :outbound + + # @!method self.values + # @return [Array] + end + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + # + # @see Zavudev::Models::CallListResponse#status + module Status + extend Zavudev::Internal::Type::Enum + + QUEUED = :queued + RINGING = :ringing + IN_PROGRESS = :in_progress + COMPLETED = :completed + FAILED = :failed + BUSY = :busy + NO_ANSWER = :no_answer + CANCELED = :canceled + + # @!method self.values + # @return [Array] + end + + class Transcript < Zavudev::Internal::Type::BaseModel + # @!attribute role + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + # + # @return [Symbol, Zavudev::Models::CallListResponse::Transcript::Role] + required :role, enum: -> { Zavudev::Models::CallListResponse::Transcript::Role } + + # @!attribute seq + # Ordinal position of the turn within the call, starting at 0. + # + # @return [Integer] + required :seq, Integer + + # @!attribute text + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + # + # @return [String] + required :text, String + + # @!attribute ended_at + # When the turn ended. + # + # @return [Time, nil] + optional :ended_at, Time, api_name: :endedAt, nil?: true + + # @!attribute started_at + # When the turn started. + # + # @return [Time, nil] + optional :started_at, Time, api_name: :startedAt, nil?: true + + # @!method initialize(role:, seq:, text:, ended_at: nil, started_at: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallListResponse::Transcript} for more details. + # + # A single turn in a voice call transcript. + # + # @param role [Symbol, Zavudev::Models::CallListResponse::Transcript::Role] Who produced the turn. `tool` records a tool call the agent made during the conv + # + # @param seq [Integer] Ordinal position of the turn within the call, starting at 0. + # + # @param text [String] Transcribed speech for `user` and `assistant` turns, or a JSON summary of the to + # + # @param ended_at [Time, nil] When the turn ended. + # + # @param started_at [Time, nil] When the turn started. + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + # + # @see Zavudev::Models::CallListResponse::Transcript#role + module Role + extend Zavudev::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + TOOL = :tool + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/zavudev/models/call_retrieve_params.rb b/lib/zavudev/models/call_retrieve_params.rb new file mode 100644 index 0000000..bd9bde9 --- /dev/null +++ b/lib/zavudev/models/call_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Calls#retrieve + class CallRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute call_id + # + # @return [String] + required :call_id, String + + # @!method initialize(call_id:, request_options: {}) + # @param call_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/call_retrieve_response.rb b/lib/zavudev/models/call_retrieve_response.rb new file mode 100644 index 0000000..d9a59f1 --- /dev/null +++ b/lib/zavudev/models/call_retrieve_response.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Calls#retrieve + class CallRetrieveResponse < Zavudev::Internal::Type::BaseModel + # @!attribute call + # + # @return [Zavudev::Models::CallRetrieveResponse::Call] + required :call, -> { Zavudev::Models::CallRetrieveResponse::Call } + + # @!method initialize(call:) + # @param call [Zavudev::Models::CallRetrieveResponse::Call] + + # @see Zavudev::Models::CallRetrieveResponse#call + class Call < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute direction + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + # + # @return [Symbol, Zavudev::Models::CallRetrieveResponse::Call::Direction] + required :direction, enum: -> { Zavudev::Models::CallRetrieveResponse::Call::Direction } + + # @!attribute from + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + # + # @return [String] + required :from, String + + # @!attribute status + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + # + # @return [Symbol, Zavudev::Models::CallRetrieveResponse::Call::Status] + required :status, enum: -> { Zavudev::Models::CallRetrieveResponse::Call::Status } + + # @!attribute to + # Callee phone number in E.164 format. + # + # @return [String] + required :to, String + + # @!attribute answered_at + # When the call was answered. + # + # @return [Time, nil] + optional :answered_at, Time, api_name: :answeredAt, nil?: true + + # @!attribute cost + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + # + # @return [Float, nil] + optional :cost, Float, nil?: true + + # @!attribute duration_seconds + # Billable talk time in seconds, measured from answer to hangup. + # + # @return [Integer, nil] + optional :duration_seconds, Integer, api_name: :durationSeconds, nil?: true + + # @!attribute ended_at + # When the call ended. + # + # @return [Time, nil] + optional :ended_at, Time, api_name: :endedAt, nil?: true + + # @!attribute end_reason + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + # + # @return [String, nil] + optional :end_reason, String, api_name: :endReason, nil?: true + + # @!attribute metadata + # Arbitrary metadata you attached when creating the call. + # + # @return [Hash{Symbol=>String}, nil] + optional :metadata, Zavudev::Internal::Type::HashOf[String] + + # @!attribute transcript + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + # + # @return [Array, nil] + optional :transcript, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::CallRetrieveResponse::Call::Transcript] } + + # @!attribute turn_count + # Number of conversation turns exchanged during the call. + # + # @return [Integer, nil] + optional :turn_count, Integer, api_name: :turnCount, nil?: true + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, created_at:, direction:, from:, status:, to:, answered_at: nil, cost: nil, duration_seconds: nil, ended_at: nil, end_reason: nil, metadata: nil, transcript: nil, turn_count: nil, updated_at: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallRetrieveResponse::Call} for more details. + # + # @param id [String] + # + # @param created_at [Time] + # + # @param direction [Symbol, Zavudev::Models::CallRetrieveResponse::Call::Direction] Whether the call was placed by Zavu (outbound) or received from a caller (inboun + # + # @param from [String] Caller phone number in E.164 format. Your sender's number for outbound calls; th + # + # @param status [Symbol, Zavudev::Models::CallRetrieveResponse::Call::Status] Lifecycle status of a voice call. + # + # @param to [String] Callee phone number in E.164 format. + # + # @param answered_at [Time, nil] When the call was answered. + # + # @param cost [Float, nil] Total cost of the call in USD, combining the managed voice pipeline per-minute c + # + # @param duration_seconds [Integer, nil] Billable talk time in seconds, measured from answer to hangup. + # + # @param ended_at [Time, nil] When the call ended. + # + # @param end_reason [String, nil] Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). P + # + # @param metadata [Hash{Symbol=>String}] Arbitrary metadata you attached when creating the call. + # + # @param transcript [Array] Ordered transcript of the call. Included when retrieving a single call; omitted + # + # @param turn_count [Integer, nil] Number of conversation turns exchanged during the call. + # + # @param updated_at [Time] + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + # + # @see Zavudev::Models::CallRetrieveResponse::Call#direction + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND = :inbound + OUTBOUND = :outbound + + # @!method self.values + # @return [Array] + end + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + # + # @see Zavudev::Models::CallRetrieveResponse::Call#status + module Status + extend Zavudev::Internal::Type::Enum + + QUEUED = :queued + RINGING = :ringing + IN_PROGRESS = :in_progress + COMPLETED = :completed + FAILED = :failed + BUSY = :busy + NO_ANSWER = :no_answer + CANCELED = :canceled + + # @!method self.values + # @return [Array] + end + + class Transcript < Zavudev::Internal::Type::BaseModel + # @!attribute role + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + # + # @return [Symbol, Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role] + required :role, enum: -> { Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role } + + # @!attribute seq + # Ordinal position of the turn within the call, starting at 0. + # + # @return [Integer] + required :seq, Integer + + # @!attribute text + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + # + # @return [String] + required :text, String + + # @!attribute ended_at + # When the turn ended. + # + # @return [Time, nil] + optional :ended_at, Time, api_name: :endedAt, nil?: true + + # @!attribute started_at + # When the turn started. + # + # @return [Time, nil] + optional :started_at, Time, api_name: :startedAt, nil?: true + + # @!method initialize(role:, seq:, text:, ended_at: nil, started_at: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallRetrieveResponse::Call::Transcript} for more details. + # + # A single turn in a voice call transcript. + # + # @param role [Symbol, Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role] Who produced the turn. `tool` records a tool call the agent made during the conv + # + # @param seq [Integer] Ordinal position of the turn within the call, starting at 0. + # + # @param text [String] Transcribed speech for `user` and `assistant` turns, or a JSON summary of the to + # + # @param ended_at [Time, nil] When the turn ended. + # + # @param started_at [Time, nil] When the turn started. + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + # + # @see Zavudev::Models::CallRetrieveResponse::Call::Transcript#role + module Role + extend Zavudev::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + TOOL = :tool + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/zavudev/models/conversation_list_messages_params.rb b/lib/zavudev/models/conversation_list_messages_params.rb new file mode 100644 index 0000000..753bf4f --- /dev/null +++ b/lib/zavudev/models/conversation_list_messages_params.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Conversations#list_messages + class ConversationListMessagesParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute conversation_id + # + # @return [String] + required :conversation_id, String + + # @!attribute cursor + # Opaque cursor from a previous response's `nextCursor`. + # + # @return [String, nil] + optional :cursor, String + + # @!attribute limit + # + # @return [Integer, nil] + optional :limit, Integer + + # @!method initialize(conversation_id:, cursor: nil, limit: nil, request_options: {}) + # @param conversation_id [String] + # + # @param cursor [String] Opaque cursor from a previous response's `nextCursor`. + # + # @param limit [Integer] + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/conversation_list_params.rb b/lib/zavudev/models/conversation_list_params.rb new file mode 100644 index 0000000..1e86058 --- /dev/null +++ b/lib/zavudev/models/conversation_list_params.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Conversations#list + class ConversationListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute channel + # Keep only threads that have carried this channel. + # + # @return [Symbol, Zavudev::Models::ConversationListParams::Channel, nil] + optional :channel, enum: -> { Zavudev::ConversationListParams::Channel } + + # @!attribute cursor + # Opaque cursor from a previous response's `nextCursor`. Do not construct it. + # + # @return [String, nil] + optional :cursor, String + + # @!attribute limit + # + # @return [Integer, nil] + optional :limit, Integer + + # @!attribute search + # Search threads by identity: phone number (any format — `+1 (555) 123-4567` and + # `15551234567` both match), email address (full or local part), WhatsApp group + # subject, WhatsApp username, or BSUID. Matching is by whole word, with prefix + # matching on the last term, so `mar` finds `maria@example.com` and `+1555` finds + # `+15551234567`; a fragment from the middle or end of a number (`4567`) does not + # match. + # + # It does **not** search message bodies — only who the thread is with. + # + # Results come back ranked by relevance rather than by recency, so the usual "most + # recently active first" ordering does not apply while `q` is set. `senderId` and + # `channel` still narrow the results, and `cursor` paginates them as usual. An + # empty or whitespace-only `q` returns no items rather than the full list. + # + # @return [String, nil] + optional :search, String + + # @!attribute sender_id + # Keep only threads last handled by this sender. + # + # @return [String, nil] + optional :sender_id, String + + # @!method initialize(channel: nil, cursor: nil, limit: nil, search: nil, sender_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ConversationListParams} for more details. + # + # @param channel [Symbol, Zavudev::Models::ConversationListParams::Channel] Keep only threads that have carried this channel. + # + # @param cursor [String] Opaque cursor from a previous response's `nextCursor`. Do not construct it. + # + # @param limit [Integer] + # + # @param search [String] Search threads by identity: phone number (any format — `+1 (555) 123-4567` and ` + # + # @param sender_id [String] Keep only threads last handled by this sender. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + + # Keep only threads that have carried this channel. + module Channel + extend Zavudev::Internal::Type::Enum + + SMS = :sms + SMS_ONEWAY = :sms_oneway + WHATSAPP = :whatsapp + EMAIL = :email + TELEGRAM = :telegram + INSTAGRAM = :instagram + MESSENGER = :messenger + VOICE = :voice + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/zavudev/models/conversation_list_response.rb b/lib/zavudev/models/conversation_list_response.rb new file mode 100644 index 0000000..15c1a07 --- /dev/null +++ b/lib/zavudev/models/conversation_list_response.rb @@ -0,0 +1,226 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Conversations#list + class ConversationListResponse < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute channels + # Every channel this thread has carried messages on. + # + # @return [Array] + required :channels, Zavudev::Internal::Type::ArrayOf[String] + + # @!attribute contact_identifier + # The key this thread is filed under: a phone number in E.164, a WhatsApp + # business-scoped user ID (BSUID), a numeric chat ID + # (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number, + # so do not parse it as one. + # + # @return [String] + required :contact_identifier, String, api_name: :contactIdentifier + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute last_message + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + # + # @return [Zavudev::Models::ConversationListResponse::LastMessage] + required :last_message, + -> { Zavudev::Models::ConversationListResponse::LastMessage }, + api_name: :lastMessage + + # @!attribute message_count + # + # @return [Integer] + required :message_count, Integer, api_name: :messageCount + + # @!attribute unread_count + # Inbound messages not yet marked read. Reset with POST + # /v1/conversations/{conversationId}/read. + # + # @return [Integer] + required :unread_count, Integer, api_name: :unreadCount + + # @!attribute updated_at + # + # @return [Time] + required :updated_at, Time, api_name: :updatedAt + + # @!attribute contact_id + # ID of the contact this thread belongs to. Absent on group threads and on threads + # whose contact has not been resolved yet. + # + # @return [String, nil] + optional :contact_id, String, api_name: :contactId + + # @!attribute email + # Email address of the thread, when the contact was reached by email. + # + # @return [String, nil] + optional :email, String + + # @!attribute group + # Present when the thread is a group chat rather than a one-to-one conversation. + # + # @return [Zavudev::Models::ConversationListResponse::Group, nil] + optional :group, -> { Zavudev::Models::ConversationListResponse::Group } + + # @!attribute sender_id + # Sender that last handled this thread. Use it as the `Zavu-Sender` header when + # replying so the answer leaves from the same number the contact knows. + # + # @return [String, nil] + optional :sender_id, String, api_name: :senderId + + # @!attribute whatsapp + # WhatsApp identity, present when the contact adopted a username. + # + # @return [Zavudev::Models::ConversationListResponse::Whatsapp, nil] + optional :whatsapp, -> { Zavudev::Models::ConversationListResponse::Whatsapp } + + # @!method initialize(id:, channels:, contact_identifier:, created_at:, last_message:, message_count:, unread_count:, updated_at:, contact_id: nil, email: nil, group: nil, sender_id: nil, whatsapp: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ConversationListResponse} for more details. + # + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + # + # @param id [String] + # + # @param channels [Array] Every channel this thread has carried messages on. + # + # @param contact_identifier [String] The key this thread is filed under: a phone number in E.164, a WhatsApp business + # + # @param created_at [Time] + # + # @param last_message [Zavudev::Models::ConversationListResponse::LastMessage] Denormalized preview of the most recent message, so a thread list needs no extra + # + # @param message_count [Integer] + # + # @param unread_count [Integer] Inbound messages not yet marked read. Reset with POST /v1/conversations/{convers + # + # @param updated_at [Time] + # + # @param contact_id [String] ID of the contact this thread belongs to. Absent on group threads and on threads + # + # @param email [String] Email address of the thread, when the contact was reached by email. + # + # @param group [Zavudev::Models::ConversationListResponse::Group] Present when the thread is a group chat rather than a one-to-one conversation. + # + # @param sender_id [String] Sender that last handled this thread. Use it as the `Zavu-Sender` header when re + # + # @param whatsapp [Zavudev::Models::ConversationListResponse::Whatsapp] WhatsApp identity, present when the contact adopted a username. + + # @see Zavudev::Models::ConversationListResponse#last_message + class LastMessage < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute at + # + # @return [Time] + required :at, Time + + # @!attribute channel + # Delivery channel. Use 'auto' for intelligent routing. + # + # @return [Symbol, Zavudev::Models::Channel] + required :channel, enum: -> { Zavudev::Channel } + + # @!attribute direction + # + # @return [Symbol, Zavudev::Models::ConversationListResponse::LastMessage::Direction] + required :direction, enum: -> { Zavudev::Models::ConversationListResponse::LastMessage::Direction } + + # @!attribute text + # Text or caption. Empty when the last message carried no text (e.g. media). + # + # @return [String] + required :text, String + + # @!method initialize(id:, at:, channel:, direction:, text:) + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + # + # @param id [String] + # + # @param at [Time] + # + # @param channel [Symbol, Zavudev::Models::Channel] Delivery channel. Use 'auto' for intelligent routing. + # + # @param direction [Symbol, Zavudev::Models::ConversationListResponse::LastMessage::Direction] + # + # @param text [String] Text or caption. Empty when the last message carried no text (e.g. media). + + # @see Zavudev::Models::ConversationListResponse::LastMessage#direction + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND = :inbound + OUTBOUND = :outbound + + # @!method self.values + # @return [Array] + end + end + + # @see Zavudev::Models::ConversationListResponse#group + class Group < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute participant_count + # + # @return [Integer, nil] + optional :participant_count, Integer, api_name: :participantCount + + # @!attribute subject + # + # @return [String, nil] + optional :subject, String + + # @!method initialize(id:, participant_count: nil, subject: nil) + # Present when the thread is a group chat rather than a one-to-one conversation. + # + # @param id [String] + # @param participant_count [Integer] + # @param subject [String] + end + + # @see Zavudev::Models::ConversationListResponse#whatsapp + class Whatsapp < Zavudev::Internal::Type::BaseModel + # @!attribute bsuid + # Business-scoped user ID. Can be used as `to` when sending. + # + # @return [String, nil] + optional :bsuid, String + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(bsuid: nil, username: nil) + # WhatsApp identity, present when the contact adopted a username. + # + # @param bsuid [String] Business-scoped user ID. Can be used as `to` when sending. + # + # @param username [String] + end + end + end +end diff --git a/lib/zavudev/models/conversation_mark_as_read_params.rb b/lib/zavudev/models/conversation_mark_as_read_params.rb new file mode 100644 index 0000000..df05e45 --- /dev/null +++ b/lib/zavudev/models/conversation_mark_as_read_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Conversations#mark_as_read + class ConversationMarkAsReadParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute conversation_id + # + # @return [String] + required :conversation_id, String + + # @!method initialize(conversation_id:, request_options: {}) + # @param conversation_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/conversation_mark_as_read_response.rb b/lib/zavudev/models/conversation_mark_as_read_response.rb new file mode 100644 index 0000000..71f9c6c --- /dev/null +++ b/lib/zavudev/models/conversation_mark_as_read_response.rb @@ -0,0 +1,245 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Conversations#mark_as_read + class ConversationMarkAsReadResponse < Zavudev::Internal::Type::BaseModel + # @!attribute conversation + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + # + # @return [Zavudev::Models::ConversationMarkAsReadResponse::Conversation] + required :conversation, -> { Zavudev::Models::ConversationMarkAsReadResponse::Conversation } + + # @!method initialize(conversation:) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ConversationMarkAsReadResponse} for more details. + # + # @param conversation [Zavudev::Models::ConversationMarkAsReadResponse::Conversation] An inbox thread with one contact. A conversation groups every message exchanged + + # @see Zavudev::Models::ConversationMarkAsReadResponse#conversation + class Conversation < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute channels + # Every channel this thread has carried messages on. + # + # @return [Array] + required :channels, Zavudev::Internal::Type::ArrayOf[String] + + # @!attribute contact_identifier + # The key this thread is filed under: a phone number in E.164, a WhatsApp + # business-scoped user ID (BSUID), a numeric chat ID + # (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number, + # so do not parse it as one. + # + # @return [String] + required :contact_identifier, String, api_name: :contactIdentifier + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute last_message + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + # + # @return [Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage] + required :last_message, + -> { Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage }, + api_name: :lastMessage + + # @!attribute message_count + # + # @return [Integer] + required :message_count, Integer, api_name: :messageCount + + # @!attribute unread_count + # Inbound messages not yet marked read. Reset with POST + # /v1/conversations/{conversationId}/read. + # + # @return [Integer] + required :unread_count, Integer, api_name: :unreadCount + + # @!attribute updated_at + # + # @return [Time] + required :updated_at, Time, api_name: :updatedAt + + # @!attribute contact_id + # ID of the contact this thread belongs to. Absent on group threads and on threads + # whose contact has not been resolved yet. + # + # @return [String, nil] + optional :contact_id, String, api_name: :contactId + + # @!attribute email + # Email address of the thread, when the contact was reached by email. + # + # @return [String, nil] + optional :email, String + + # @!attribute group + # Present when the thread is a group chat rather than a one-to-one conversation. + # + # @return [Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group, nil] + optional :group, -> { Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group } + + # @!attribute sender_id + # Sender that last handled this thread. Use it as the `Zavu-Sender` header when + # replying so the answer leaves from the same number the contact knows. + # + # @return [String, nil] + optional :sender_id, String, api_name: :senderId + + # @!attribute whatsapp + # WhatsApp identity, present when the contact adopted a username. + # + # @return [Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp, nil] + optional :whatsapp, -> { Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp } + + # @!method initialize(id:, channels:, contact_identifier:, created_at:, last_message:, message_count:, unread_count:, updated_at:, contact_id: nil, email: nil, group: nil, sender_id: nil, whatsapp: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ConversationMarkAsReadResponse::Conversation} for more + # details. + # + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + # + # @param id [String] + # + # @param channels [Array] Every channel this thread has carried messages on. + # + # @param contact_identifier [String] The key this thread is filed under: a phone number in E.164, a WhatsApp business + # + # @param created_at [Time] + # + # @param last_message [Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage] Denormalized preview of the most recent message, so a thread list needs no extra + # + # @param message_count [Integer] + # + # @param unread_count [Integer] Inbound messages not yet marked read. Reset with POST /v1/conversations/{convers + # + # @param updated_at [Time] + # + # @param contact_id [String] ID of the contact this thread belongs to. Absent on group threads and on threads + # + # @param email [String] Email address of the thread, when the contact was reached by email. + # + # @param group [Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group] Present when the thread is a group chat rather than a one-to-one conversation. + # + # @param sender_id [String] Sender that last handled this thread. Use it as the `Zavu-Sender` header when re + # + # @param whatsapp [Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp] WhatsApp identity, present when the contact adopted a username. + + # @see Zavudev::Models::ConversationMarkAsReadResponse::Conversation#last_message + class LastMessage < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute at + # + # @return [Time] + required :at, Time + + # @!attribute channel + # Delivery channel. Use 'auto' for intelligent routing. + # + # @return [Symbol, Zavudev::Models::Channel] + required :channel, enum: -> { Zavudev::Channel } + + # @!attribute direction + # + # @return [Symbol, Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::Direction] + required :direction, + enum: -> { Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::Direction } + + # @!attribute text + # Text or caption. Empty when the last message carried no text (e.g. media). + # + # @return [String] + required :text, String + + # @!method initialize(id:, at:, channel:, direction:, text:) + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + # + # @param id [String] + # + # @param at [Time] + # + # @param channel [Symbol, Zavudev::Models::Channel] Delivery channel. Use 'auto' for intelligent routing. + # + # @param direction [Symbol, Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::Direction] + # + # @param text [String] Text or caption. Empty when the last message carried no text (e.g. media). + + # @see Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage#direction + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND = :inbound + OUTBOUND = :outbound + + # @!method self.values + # @return [Array] + end + end + + # @see Zavudev::Models::ConversationMarkAsReadResponse::Conversation#group + class Group < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute participant_count + # + # @return [Integer, nil] + optional :participant_count, Integer, api_name: :participantCount + + # @!attribute subject + # + # @return [String, nil] + optional :subject, String + + # @!method initialize(id:, participant_count: nil, subject: nil) + # Present when the thread is a group chat rather than a one-to-one conversation. + # + # @param id [String] + # @param participant_count [Integer] + # @param subject [String] + end + + # @see Zavudev::Models::ConversationMarkAsReadResponse::Conversation#whatsapp + class Whatsapp < Zavudev::Internal::Type::BaseModel + # @!attribute bsuid + # Business-scoped user ID. Can be used as `to` when sending. + # + # @return [String, nil] + optional :bsuid, String + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(bsuid: nil, username: nil) + # WhatsApp identity, present when the contact adopted a username. + # + # @param bsuid [String] Business-scoped user ID. Can be used as `to` when sending. + # + # @param username [String] + end + end + end + end +end diff --git a/lib/zavudev/models/conversation_retrieve_params.rb b/lib/zavudev/models/conversation_retrieve_params.rb new file mode 100644 index 0000000..b7eb1d8 --- /dev/null +++ b/lib/zavudev/models/conversation_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Conversations#retrieve + class ConversationRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute conversation_id + # + # @return [String] + required :conversation_id, String + + # @!method initialize(conversation_id:, request_options: {}) + # @param conversation_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/conversation_retrieve_response.rb b/lib/zavudev/models/conversation_retrieve_response.rb new file mode 100644 index 0000000..13be82c --- /dev/null +++ b/lib/zavudev/models/conversation_retrieve_response.rb @@ -0,0 +1,244 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Conversations#retrieve + class ConversationRetrieveResponse < Zavudev::Internal::Type::BaseModel + # @!attribute conversation + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + # + # @return [Zavudev::Models::ConversationRetrieveResponse::Conversation] + required :conversation, -> { Zavudev::Models::ConversationRetrieveResponse::Conversation } + + # @!method initialize(conversation:) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ConversationRetrieveResponse} for more details. + # + # @param conversation [Zavudev::Models::ConversationRetrieveResponse::Conversation] An inbox thread with one contact. A conversation groups every message exchanged + + # @see Zavudev::Models::ConversationRetrieveResponse#conversation + class Conversation < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute channels + # Every channel this thread has carried messages on. + # + # @return [Array] + required :channels, Zavudev::Internal::Type::ArrayOf[String] + + # @!attribute contact_identifier + # The key this thread is filed under: a phone number in E.164, a WhatsApp + # business-scoped user ID (BSUID), a numeric chat ID + # (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number, + # so do not parse it as one. + # + # @return [String] + required :contact_identifier, String, api_name: :contactIdentifier + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute last_message + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + # + # @return [Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage] + required :last_message, + -> { Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage }, + api_name: :lastMessage + + # @!attribute message_count + # + # @return [Integer] + required :message_count, Integer, api_name: :messageCount + + # @!attribute unread_count + # Inbound messages not yet marked read. Reset with POST + # /v1/conversations/{conversationId}/read. + # + # @return [Integer] + required :unread_count, Integer, api_name: :unreadCount + + # @!attribute updated_at + # + # @return [Time] + required :updated_at, Time, api_name: :updatedAt + + # @!attribute contact_id + # ID of the contact this thread belongs to. Absent on group threads and on threads + # whose contact has not been resolved yet. + # + # @return [String, nil] + optional :contact_id, String, api_name: :contactId + + # @!attribute email + # Email address of the thread, when the contact was reached by email. + # + # @return [String, nil] + optional :email, String + + # @!attribute group + # Present when the thread is a group chat rather than a one-to-one conversation. + # + # @return [Zavudev::Models::ConversationRetrieveResponse::Conversation::Group, nil] + optional :group, -> { Zavudev::Models::ConversationRetrieveResponse::Conversation::Group } + + # @!attribute sender_id + # Sender that last handled this thread. Use it as the `Zavu-Sender` header when + # replying so the answer leaves from the same number the contact knows. + # + # @return [String, nil] + optional :sender_id, String, api_name: :senderId + + # @!attribute whatsapp + # WhatsApp identity, present when the contact adopted a username. + # + # @return [Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp, nil] + optional :whatsapp, -> { Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp } + + # @!method initialize(id:, channels:, contact_identifier:, created_at:, last_message:, message_count:, unread_count:, updated_at:, contact_id: nil, email: nil, group: nil, sender_id: nil, whatsapp: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ConversationRetrieveResponse::Conversation} for more details. + # + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + # + # @param id [String] + # + # @param channels [Array] Every channel this thread has carried messages on. + # + # @param contact_identifier [String] The key this thread is filed under: a phone number in E.164, a WhatsApp business + # + # @param created_at [Time] + # + # @param last_message [Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage] Denormalized preview of the most recent message, so a thread list needs no extra + # + # @param message_count [Integer] + # + # @param unread_count [Integer] Inbound messages not yet marked read. Reset with POST /v1/conversations/{convers + # + # @param updated_at [Time] + # + # @param contact_id [String] ID of the contact this thread belongs to. Absent on group threads and on threads + # + # @param email [String] Email address of the thread, when the contact was reached by email. + # + # @param group [Zavudev::Models::ConversationRetrieveResponse::Conversation::Group] Present when the thread is a group chat rather than a one-to-one conversation. + # + # @param sender_id [String] Sender that last handled this thread. Use it as the `Zavu-Sender` header when re + # + # @param whatsapp [Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp] WhatsApp identity, present when the contact adopted a username. + + # @see Zavudev::Models::ConversationRetrieveResponse::Conversation#last_message + class LastMessage < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute at + # + # @return [Time] + required :at, Time + + # @!attribute channel + # Delivery channel. Use 'auto' for intelligent routing. + # + # @return [Symbol, Zavudev::Models::Channel] + required :channel, enum: -> { Zavudev::Channel } + + # @!attribute direction + # + # @return [Symbol, Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::Direction] + required :direction, + enum: -> { Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::Direction } + + # @!attribute text + # Text or caption. Empty when the last message carried no text (e.g. media). + # + # @return [String] + required :text, String + + # @!method initialize(id:, at:, channel:, direction:, text:) + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + # + # @param id [String] + # + # @param at [Time] + # + # @param channel [Symbol, Zavudev::Models::Channel] Delivery channel. Use 'auto' for intelligent routing. + # + # @param direction [Symbol, Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::Direction] + # + # @param text [String] Text or caption. Empty when the last message carried no text (e.g. media). + + # @see Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage#direction + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND = :inbound + OUTBOUND = :outbound + + # @!method self.values + # @return [Array] + end + end + + # @see Zavudev::Models::ConversationRetrieveResponse::Conversation#group + class Group < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute participant_count + # + # @return [Integer, nil] + optional :participant_count, Integer, api_name: :participantCount + + # @!attribute subject + # + # @return [String, nil] + optional :subject, String + + # @!method initialize(id:, participant_count: nil, subject: nil) + # Present when the thread is a group chat rather than a one-to-one conversation. + # + # @param id [String] + # @param participant_count [Integer] + # @param subject [String] + end + + # @see Zavudev::Models::ConversationRetrieveResponse::Conversation#whatsapp + class Whatsapp < Zavudev::Internal::Type::BaseModel + # @!attribute bsuid + # Business-scoped user ID. Can be used as `to` when sending. + # + # @return [String, nil] + optional :bsuid, String + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(bsuid: nil, username: nil) + # WhatsApp identity, present when the contact adopted a username. + # + # @param bsuid [String] Business-scoped user ID. Can be used as `to` when sending. + # + # @param username [String] + end + end + end + end +end diff --git a/lib/zavudev/models/email_domain_create_params.rb b/lib/zavudev/models/email_domain_create_params.rb new file mode 100644 index 0000000..63b6a66 --- /dev/null +++ b/lib/zavudev/models/email_domain_create_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::EmailDomains#create + class EmailDomainCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute domain + # Bare domain, e.g. example.com. + # + # @return [String] + required :domain, String + + # @!method initialize(domain:, request_options: {}) + # @param domain [String] Bare domain, e.g. example.com. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/email_domain_create_response.rb b/lib/zavudev/models/email_domain_create_response.rb new file mode 100644 index 0000000..14b820b --- /dev/null +++ b/lib/zavudev/models/email_domain_create_response.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::EmailDomains#create + class EmailDomainCreateResponse < Zavudev::Internal::Type::BaseModel + # @!attribute domain + # + # @return [Zavudev::Models::EmailDomainCreateResponse::Domain] + required :domain, -> { Zavudev::Models::EmailDomainCreateResponse::Domain } + + # @!method initialize(domain:) + # @param domain [Zavudev::Models::EmailDomainCreateResponse::Domain] + + # @see Zavudev::Models::EmailDomainCreateResponse#domain + class Domain < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute dkim_status + # + # @return [String] + required :dkim_status, String, api_name: :dkimStatus + + # @!attribute domain + # + # @return [String] + required :domain, String + + # @!attribute status + # Overall verification status. + # + # @return [String] + required :status, String + + # @!attribute dns_records + # DNS records to publish. Present when fetching a single domain or after adding + # one. + # + # @return [Array, nil] + optional :dns_records, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord] }, + api_name: :dnsRecords + + # @!method initialize(id:, dkim_status:, domain:, status:, dns_records: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::EmailDomainCreateResponse::Domain} for more details. + # + # @param id [String] + # + # @param dkim_status [String] + # + # @param domain [String] + # + # @param status [String] Overall verification status. + # + # @param dns_records [Array] DNS records to publish. Present when fetching a single domain or after adding on + + class DNSRecord < Zavudev::Internal::Type::BaseModel + # @!attribute name + # Record host/name to create. + # + # @return [String] + required :name, String + + # @!attribute purpose + # What the record is for. + # + # @return [Symbol, Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose] + required :purpose, enum: -> { Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose } + + # @!attribute required + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + # + # @return [Boolean] + required :required, Zavudev::Internal::Type::Boolean + + # @!attribute type + # DNS record type. + # + # @return [String] + required :type, String + + # @!attribute value + # Record value. + # + # @return [String] + required :value, String + + # @!attribute priority + # Priority (MX records only). + # + # @return [Integer, nil] + optional :priority, Integer + + # @!method initialize(name:, purpose:, required:, type:, value:, priority: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord} for more + # details. + # + # @param name [String] Record host/name to create. + # + # @param purpose [Symbol, Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose] What the record is for. + # + # @param required [Boolean] Whether the record is required to verify + send (DKIM) or recommended for delive + # + # @param type [String] DNS record type. + # + # @param value [String] Record value. + # + # @param priority [Integer] Priority (MX records only). + + # What the record is for. + # + # @see Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord#purpose + module Purpose + extend Zavudev::Internal::Type::Enum + + DKIM = :dkim + SPF = :spf + DMARC = :dmarc + MAIL_FROM = :mail_from + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/zavudev/models/email_domain_delete_params.rb b/lib/zavudev/models/email_domain_delete_params.rb new file mode 100644 index 0000000..f8103a1 --- /dev/null +++ b/lib/zavudev/models/email_domain_delete_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::EmailDomains#delete + class EmailDomainDeleteParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute domain_id + # + # @return [String] + required :domain_id, String + + # @!method initialize(domain_id:, request_options: {}) + # @param domain_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/email_domain_list_params.rb b/lib/zavudev/models/email_domain_list_params.rb new file mode 100644 index 0000000..05d00aa --- /dev/null +++ b/lib/zavudev/models/email_domain_list_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::EmailDomains#list + class EmailDomainListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/email_domain_list_response.rb b/lib/zavudev/models/email_domain_list_response.rb new file mode 100644 index 0000000..3587bb6 --- /dev/null +++ b/lib/zavudev/models/email_domain_list_response.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::EmailDomains#list + class EmailDomainListResponse < Zavudev::Internal::Type::BaseModel + # @!attribute items + # + # @return [Array] + required :items, -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::EmailDomainListResponse::Item] } + + # @!method initialize(items:) + # @param items [Array] + + class Item < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute dkim_status + # + # @return [String] + required :dkim_status, String, api_name: :dkimStatus + + # @!attribute domain + # + # @return [String] + required :domain, String + + # @!attribute status + # Overall verification status. + # + # @return [String] + required :status, String + + # @!attribute dns_records + # DNS records to publish. Present when fetching a single domain or after adding + # one. + # + # @return [Array, nil] + optional :dns_records, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::EmailDomainListResponse::Item::DNSRecord] }, + api_name: :dnsRecords + + # @!method initialize(id:, dkim_status:, domain:, status:, dns_records: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::EmailDomainListResponse::Item} for more details. + # + # @param id [String] + # + # @param dkim_status [String] + # + # @param domain [String] + # + # @param status [String] Overall verification status. + # + # @param dns_records [Array] DNS records to publish. Present when fetching a single domain or after adding on + + class DNSRecord < Zavudev::Internal::Type::BaseModel + # @!attribute name + # Record host/name to create. + # + # @return [String] + required :name, String + + # @!attribute purpose + # What the record is for. + # + # @return [Symbol, Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose] + required :purpose, enum: -> { Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose } + + # @!attribute required + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + # + # @return [Boolean] + required :required, Zavudev::Internal::Type::Boolean + + # @!attribute type + # DNS record type. + # + # @return [String] + required :type, String + + # @!attribute value + # Record value. + # + # @return [String] + required :value, String + + # @!attribute priority + # Priority (MX records only). + # + # @return [Integer, nil] + optional :priority, Integer + + # @!method initialize(name:, purpose:, required:, type:, value:, priority: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::EmailDomainListResponse::Item::DNSRecord} for more details. + # + # @param name [String] Record host/name to create. + # + # @param purpose [Symbol, Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose] What the record is for. + # + # @param required [Boolean] Whether the record is required to verify + send (DKIM) or recommended for delive + # + # @param type [String] DNS record type. + # + # @param value [String] Record value. + # + # @param priority [Integer] Priority (MX records only). + + # What the record is for. + # + # @see Zavudev::Models::EmailDomainListResponse::Item::DNSRecord#purpose + module Purpose + extend Zavudev::Internal::Type::Enum + + DKIM = :dkim + SPF = :spf + DMARC = :dmarc + MAIL_FROM = :mail_from + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/zavudev/models/email_domain_retrieve_params.rb b/lib/zavudev/models/email_domain_retrieve_params.rb new file mode 100644 index 0000000..1b78334 --- /dev/null +++ b/lib/zavudev/models/email_domain_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::EmailDomains#retrieve + class EmailDomainRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute domain_id + # + # @return [String] + required :domain_id, String + + # @!method initialize(domain_id:, request_options: {}) + # @param domain_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/email_domain_retrieve_response.rb b/lib/zavudev/models/email_domain_retrieve_response.rb new file mode 100644 index 0000000..8ad865e --- /dev/null +++ b/lib/zavudev/models/email_domain_retrieve_response.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::EmailDomains#retrieve + class EmailDomainRetrieveResponse < Zavudev::Internal::Type::BaseModel + # @!attribute domain + # + # @return [Zavudev::Models::EmailDomainRetrieveResponse::Domain] + required :domain, -> { Zavudev::Models::EmailDomainRetrieveResponse::Domain } + + # @!method initialize(domain:) + # @param domain [Zavudev::Models::EmailDomainRetrieveResponse::Domain] + + # @see Zavudev::Models::EmailDomainRetrieveResponse#domain + class Domain < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute dkim_status + # + # @return [String] + required :dkim_status, String, api_name: :dkimStatus + + # @!attribute domain + # + # @return [String] + required :domain, String + + # @!attribute status + # Overall verification status. + # + # @return [String] + required :status, String + + # @!attribute dns_records + # DNS records to publish. Present when fetching a single domain or after adding + # one. + # + # @return [Array, nil] + optional :dns_records, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord] }, + api_name: :dnsRecords + + # @!method initialize(id:, dkim_status:, domain:, status:, dns_records: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::EmailDomainRetrieveResponse::Domain} for more details. + # + # @param id [String] + # + # @param dkim_status [String] + # + # @param domain [String] + # + # @param status [String] Overall verification status. + # + # @param dns_records [Array] DNS records to publish. Present when fetching a single domain or after adding on + + class DNSRecord < Zavudev::Internal::Type::BaseModel + # @!attribute name + # Record host/name to create. + # + # @return [String] + required :name, String + + # @!attribute purpose + # What the record is for. + # + # @return [Symbol, Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose] + required :purpose, enum: -> { Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose } + + # @!attribute required + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + # + # @return [Boolean] + required :required, Zavudev::Internal::Type::Boolean + + # @!attribute type + # DNS record type. + # + # @return [String] + required :type, String + + # @!attribute value + # Record value. + # + # @return [String] + required :value, String + + # @!attribute priority + # Priority (MX records only). + # + # @return [Integer, nil] + optional :priority, Integer + + # @!method initialize(name:, purpose:, required:, type:, value:, priority: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord} for more + # details. + # + # @param name [String] Record host/name to create. + # + # @param purpose [Symbol, Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose] What the record is for. + # + # @param required [Boolean] Whether the record is required to verify + send (DKIM) or recommended for delive + # + # @param type [String] DNS record type. + # + # @param value [String] Record value. + # + # @param priority [Integer] Priority (MX records only). + + # What the record is for. + # + # @see Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord#purpose + module Purpose + extend Zavudev::Internal::Type::Enum + + DKIM = :dkim + SPF = :spf + DMARC = :dmarc + MAIL_FROM = :mail_from + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/zavudev/models/email_domain_verify_params.rb b/lib/zavudev/models/email_domain_verify_params.rb new file mode 100644 index 0000000..c920e16 --- /dev/null +++ b/lib/zavudev/models/email_domain_verify_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::EmailDomains#verify + class EmailDomainVerifyParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute domain_id + # + # @return [String] + required :domain_id, String + + # @!method initialize(domain_id:, request_options: {}) + # @param domain_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/email_domain_verify_response.rb b/lib/zavudev/models/email_domain_verify_response.rb new file mode 100644 index 0000000..bc3514b --- /dev/null +++ b/lib/zavudev/models/email_domain_verify_response.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::EmailDomains#verify + class EmailDomainVerifyResponse < Zavudev::Internal::Type::BaseModel + # @!attribute domain + # + # @return [Zavudev::Models::EmailDomainVerifyResponse::Domain] + required :domain, -> { Zavudev::Models::EmailDomainVerifyResponse::Domain } + + # @!method initialize(domain:) + # @param domain [Zavudev::Models::EmailDomainVerifyResponse::Domain] + + # @see Zavudev::Models::EmailDomainVerifyResponse#domain + class Domain < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute dkim_status + # + # @return [String] + required :dkim_status, String, api_name: :dkimStatus + + # @!attribute domain + # + # @return [String] + required :domain, String + + # @!attribute status + # Overall verification status. + # + # @return [String] + required :status, String + + # @!attribute dns_records + # DNS records to publish. Present when fetching a single domain or after adding + # one. + # + # @return [Array, nil] + optional :dns_records, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord] }, + api_name: :dnsRecords + + # @!method initialize(id:, dkim_status:, domain:, status:, dns_records: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::EmailDomainVerifyResponse::Domain} for more details. + # + # @param id [String] + # + # @param dkim_status [String] + # + # @param domain [String] + # + # @param status [String] Overall verification status. + # + # @param dns_records [Array] DNS records to publish. Present when fetching a single domain or after adding on + + class DNSRecord < Zavudev::Internal::Type::BaseModel + # @!attribute name + # Record host/name to create. + # + # @return [String] + required :name, String + + # @!attribute purpose + # What the record is for. + # + # @return [Symbol, Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose] + required :purpose, enum: -> { Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose } + + # @!attribute required + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + # + # @return [Boolean] + required :required, Zavudev::Internal::Type::Boolean + + # @!attribute type + # DNS record type. + # + # @return [String] + required :type, String + + # @!attribute value + # Record value. + # + # @return [String] + required :value, String + + # @!attribute priority + # Priority (MX records only). + # + # @return [Integer, nil] + optional :priority, Integer + + # @!method initialize(name:, purpose:, required:, type:, value:, priority: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord} for more + # details. + # + # @param name [String] Record host/name to create. + # + # @param purpose [Symbol, Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose] What the record is for. + # + # @param required [Boolean] Whether the record is required to verify + send (DKIM) or recommended for delive + # + # @param type [String] DNS record type. + # + # @param value [String] Record value. + # + # @param priority [Integer] Priority (MX records only). + + # What the record is for. + # + # @see Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord#purpose + module Purpose + extend Zavudev::Internal::Type::Enum + + DKIM = :dkim + SPF = :spf + DMARC = :dmarc + MAIL_FROM = :mail_from + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/zavudev/models/function_list_deployments_params.rb b/lib/zavudev/models/function_list_deployments_params.rb new file mode 100644 index 0000000..6800265 --- /dev/null +++ b/lib/zavudev/models/function_list_deployments_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Functions#list_deployments + class FunctionListDeploymentsParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute function_id + # + # @return [String] + required :function_id, String + + # @!attribute limit + # + # @return [Integer, nil] + optional :limit, Integer + + # @!method initialize(function_id:, limit: nil, request_options: {}) + # @param function_id [String] + # @param limit [Integer] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/function_list_deployments_response.rb b/lib/zavudev/models/function_list_deployments_response.rb new file mode 100644 index 0000000..9d46635 --- /dev/null +++ b/lib/zavudev/models/function_list_deployments_response.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Functions#list_deployments + class FunctionListDeploymentsResponse < Zavudev::Internal::Type::BaseModel + # @!attribute deployments + # + # @return [Array] + required :deployments, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::FunctionListDeploymentsResponse::Deployment] } + + # @!method initialize(deployments:) + # @param deployments [Array] + + class Deployment < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute bundle_size_bytes + # + # @return [Integer, nil] + optional :bundle_size_bytes, Integer, api_name: :bundleSizeBytes, nil?: true + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute deployed_at + # + # @return [Time, nil] + optional :deployed_at, Time, api_name: :deployedAt, nil?: true + + # @!attribute error_message + # + # @return [String, nil] + optional :error_message, String, api_name: :errorMessage, nil?: true + + # @!attribute is_active + # + # @return [Boolean, nil] + optional :is_active, Zavudev::Internal::Type::Boolean, api_name: :isActive + + # @!attribute status + # Stage of a function deployment. + # + # @return [Symbol, Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status, nil] + optional :status, enum: -> { Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status } + + # @!attribute version + # + # @return [Integer, nil] + optional :version, Integer + + # @!method initialize(id: nil, bundle_size_bytes: nil, created_at: nil, deployed_at: nil, error_message: nil, is_active: nil, status: nil, version: nil) + # @param id [String] + # + # @param bundle_size_bytes [Integer, nil] + # + # @param created_at [Time] + # + # @param deployed_at [Time, nil] + # + # @param error_message [String, nil] + # + # @param is_active [Boolean] + # + # @param status [Symbol, Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status] Stage of a function deployment. + # + # @param version [Integer] + + # Stage of a function deployment. + # + # @see Zavudev::Models::FunctionListDeploymentsResponse::Deployment#status + module Status + extend Zavudev::Internal::Type::Enum + + PENDING = :pending + BUNDLING = :bundling + UPLOADING = :uploading + PUBLISHING = :publishing + ACTIVE = :active + FAILED = :failed + SUPERSEDED = :superseded + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/zavudev/models/function_list_event_types_params.rb b/lib/zavudev/models/function_list_event_types_params.rb new file mode 100644 index 0000000..5eacd61 --- /dev/null +++ b/lib/zavudev/models/function_list_event_types_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Functions#list_event_types + class FunctionListEventTypesParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/function_list_event_types_response.rb b/lib/zavudev/models/function_list_event_types_response.rb new file mode 100644 index 0000000..5b12303 --- /dev/null +++ b/lib/zavudev/models/function_list_event_types_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Functions#list_event_types + class FunctionListEventTypesResponse < Zavudev::Internal::Type::BaseModel + # @!attribute events + # + # @return [Array] + required :events, Zavudev::Internal::Type::ArrayOf[String] + + # @!method initialize(events:) + # @param events [Array] + end + end +end diff --git a/lib/zavudev/models/function_rollback_deployment_params.rb b/lib/zavudev/models/function_rollback_deployment_params.rb new file mode 100644 index 0000000..b0d4398 --- /dev/null +++ b/lib/zavudev/models/function_rollback_deployment_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Functions#rollback_deployment + class FunctionRollbackDeploymentParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute function_id + # + # @return [String] + required :function_id, String + + # @!attribute deployment_id + # ID of the deployment to roll back to. + # + # @return [String] + required :deployment_id, String, api_name: :deploymentId + + # @!method initialize(function_id:, deployment_id:, request_options: {}) + # @param function_id [String] + # + # @param deployment_id [String] ID of the deployment to roll back to. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/function_rollback_deployment_response.rb b/lib/zavudev/models/function_rollback_deployment_response.rb new file mode 100644 index 0000000..a080dc7 --- /dev/null +++ b/lib/zavudev/models/function_rollback_deployment_response.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Functions#rollback_deployment + class FunctionRollbackDeploymentResponse < Zavudev::Internal::Type::BaseModel + # @!attribute deployment + # + # @return [Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment] + required :deployment, -> { Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment } + + # @!attribute previous_draft + # The draft that was replaced, so a UI can offer to restore it. + # + # @return [Object, nil] + optional :previous_draft, Zavudev::Internal::Type::Unknown, api_name: :previousDraft, nil?: true + + # @!attribute rolled_back_to_version + # + # @return [Integer, nil] + optional :rolled_back_to_version, Integer, api_name: :rolledBackToVersion + + # @!method initialize(deployment:, previous_draft: nil, rolled_back_to_version: nil) + # @param deployment [Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment] + # + # @param previous_draft [Object, nil] The draft that was replaced, so a UI can offer to restore it. + # + # @param rolled_back_to_version [Integer] + + # @see Zavudev::Models::FunctionRollbackDeploymentResponse#deployment + class Deployment < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute function_id + # + # @return [String] + required :function_id, String, api_name: :functionId + + # @!attribute status + # Stage of a function deployment. + # + # @return [Symbol, Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status] + required :status, enum: -> { Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status } + + # @!attribute version + # Monotonically increasing deployment version, starting at 1. + # + # @return [Integer] + required :version, Integer + + # @!attribute build_logs + # What the build printed: dependency installation, the bundler's output, and the + # compiler's message when it failed. Returned when fetching a single deployment, + # omitted from the list. Read this first when a deploy fails — `errorMessage` is + # often the outer wrapper's summary, and the line that names the broken import or + # the syntax error is here. + # + # @return [String, nil] + optional :build_logs, String, api_name: :buildLogs, nil?: true + + # @!attribute bundle_bytes + # Size of the built bundle in bytes. Null until the build finishes. + # + # @return [Integer, nil] + optional :bundle_bytes, Integer, api_name: :bundleBytes, nil?: true + + # @!attribute deployed_at + # + # @return [Time, nil] + optional :deployed_at, Time, api_name: :deployedAt, nil?: true + + # @!attribute error_message + # Failure reason when status is 'failed'. + # + # @return [String, nil] + optional :error_message, String, api_name: :errorMessage, nil?: true + + # @!attribute source_code_bytes + # Total size of the deployed source tree in bytes. + # + # @return [Integer, nil] + optional :source_code_bytes, Integer, api_name: :sourceCodeBytes, nil?: true + + # @!method initialize(id:, created_at:, function_id:, status:, version:, build_logs: nil, bundle_bytes: nil, deployed_at: nil, error_message: nil, source_code_bytes: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment} for more + # details. + # + # @param id [String] + # + # @param created_at [Time] + # + # @param function_id [String] + # + # @param status [Symbol, Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status] Stage of a function deployment. + # + # @param version [Integer] Monotonically increasing deployment version, starting at 1. + # + # @param build_logs [String, nil] What the build printed: dependency installation, the bundler's output, and the c + # + # @param bundle_bytes [Integer, nil] Size of the built bundle in bytes. Null until the build finishes. + # + # @param deployed_at [Time, nil] + # + # @param error_message [String, nil] Failure reason when status is 'failed'. + # + # @param source_code_bytes [Integer, nil] Total size of the deployed source tree in bytes. + + # Stage of a function deployment. + # + # @see Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment#status + module Status + extend Zavudev::Internal::Type::Enum + + PENDING = :pending + BUNDLING = :bundling + UPLOADING = :uploading + PUBLISHING = :publishing + ACTIVE = :active + FAILED = :failed + SUPERSEDED = :superseded + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/zavudev/models/functions/git_link_deploy_now_params.rb b/lib/zavudev/models/functions/git_link_deploy_now_params.rb new file mode 100644 index 0000000..08eb1fc --- /dev/null +++ b/lib/zavudev/models/functions/git_link_deploy_now_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::GitLink#deploy_now + class GitLinkDeployNowParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute function_id + # + # @return [String] + required :function_id, String + + # @!method initialize(function_id:, request_options: {}) + # @param function_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/functions/git_link_deploy_now_response.rb b/lib/zavudev/models/functions/git_link_deploy_now_response.rb new file mode 100644 index 0000000..cf124f2 --- /dev/null +++ b/lib/zavudev/models/functions/git_link_deploy_now_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::GitLink#deploy_now + class GitLinkDeployNowResponse < Zavudev::Internal::Type::BaseModel + # @!attribute scheduled + # + # @return [Boolean] + required :scheduled, Zavudev::Internal::Type::Boolean + + # @!method initialize(scheduled:) + # @param scheduled [Boolean] + end + end + end +end diff --git a/lib/zavudev/models/functions/git_link_link_params.rb b/lib/zavudev/models/functions/git_link_link_params.rb new file mode 100644 index 0000000..f341dbd --- /dev/null +++ b/lib/zavudev/models/functions/git_link_link_params.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::GitLink#link + class GitLinkLinkParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute function_id + # + # @return [String] + required :function_id, String + + # @!attribute owner + # + # @return [String] + required :owner, String + + # @!attribute repo + # + # @return [String] + required :repo, String + + # @!attribute auto_deploy + # + # @return [Boolean, nil] + optional :auto_deploy, Zavudev::Internal::Type::Boolean, api_name: :autoDeploy + + # @!attribute branch + # + # @return [String, nil] + optional :branch, String + + # @!attribute root_dir + # Subdirectory holding the project, for monorepos. + # + # @return [String, nil] + optional :root_dir, String, api_name: :rootDir + + # @!method initialize(function_id:, owner:, repo:, auto_deploy: nil, branch: nil, root_dir: nil, request_options: {}) + # @param function_id [String] + # + # @param owner [String] + # + # @param repo [String] + # + # @param auto_deploy [Boolean] + # + # @param branch [String] + # + # @param root_dir [String] Subdirectory holding the project, for monorepos. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/functions/git_link_link_response.rb b/lib/zavudev/models/functions/git_link_link_response.rb new file mode 100644 index 0000000..d243c58 --- /dev/null +++ b/lib/zavudev/models/functions/git_link_link_response.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::GitLink#link + class GitLinkLinkResponse < Zavudev::Internal::Type::BaseModel + # @!attribute link + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + # + # @return [Zavudev::Models::Functions::GitLinkLinkResponse::Link] + required :link, -> { Zavudev::Models::Functions::GitLinkLinkResponse::Link } + + # @!attribute webhook_url + # Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # where you add it to the repository yourself. + # + # @return [String] + required :webhook_url, String, api_name: :webhookUrl + + # @!attribute webhook_secret + # Shared secret for the repository's webhook. **Returned only when creating a + # `manual` link, and only there** — every later read strips it, and re-linking + # mints a new one. Absent entirely on an `app` link, which needs no secret of its + # own. + # + # @return [String, nil] + optional :webhook_secret, String, api_name: :webhookSecret + + # @!method initialize(link:, webhook_url:, webhook_secret: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Functions::GitLinkLinkResponse} for more details. + # + # @param link [Zavudev::Models::Functions::GitLinkLinkResponse::Link] A GitHub repository bound to a function. A push to `branch` deploys the function + # + # @param webhook_url [String] Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # + # @param webhook_secret [String] Shared secret for the repository's webhook. \*\*Returned only when creating a + # `man + + # @see Zavudev::Models::Functions::GitLinkLinkResponse#link + class Link < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute auto_deploy + # When false the link is kept and pushes are ignored. + # + # @return [Boolean] + required :auto_deploy, Zavudev::Internal::Type::Boolean, api_name: :autoDeploy + + # @!attribute branch + # Only pushes to this branch deploy. + # + # @return [String] + required :branch, String + + # @!attribute connection + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + # + # @return [Symbol, Zavudev::Models::Functions::GitLinkLinkResponse::Link::Connection] + required :connection, enum: -> { Zavudev::Models::Functions::GitLinkLinkResponse::Link::Connection } + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute function_id + # + # @return [String] + required :function_id, String, api_name: :functionId + + # @!attribute owner + # + # @return [String] + required :owner, String + + # @!attribute provider + # + # @return [Symbol, Zavudev::Models::Functions::GitLinkLinkResponse::Link::Provider] + required :provider, enum: -> { Zavudev::Models::Functions::GitLinkLinkResponse::Link::Provider } + + # @!attribute repo + # + # @return [String] + required :repo, String + + # @!attribute updated_at + # + # @return [Time] + required :updated_at, Time, api_name: :updatedAt + + # @!attribute last_commit_message + # + # @return [String, nil] + optional :last_commit_message, String, api_name: :lastCommitMessage, nil?: true + + # @!attribute last_commit_sha + # + # @return [String, nil] + optional :last_commit_sha, String, api_name: :lastCommitSha, nil?: true + + # @!attribute last_deploy_at + # + # @return [Time, nil] + optional :last_deploy_at, Time, api_name: :lastDeployAt, nil?: true + + # @!attribute last_error + # Why the last deploy failed. Null otherwise. + # + # @return [String, nil] + optional :last_error, String, api_name: :lastError, nil?: true + + # @!attribute last_status + # + # @return [Symbol, Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus, nil] + optional :last_status, + enum: -> { Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus }, + api_name: :lastStatus, + nil?: true + + # @!attribute root_dir + # Subdirectory holding the project, for monorepos. Null when the project is at the + # repository root. + # + # @return [String, nil] + optional :root_dir, String, api_name: :rootDir, nil?: true + + # @!method initialize(id:, auto_deploy:, branch:, connection:, created_at:, function_id:, owner:, provider:, repo:, updated_at:, last_commit_message: nil, last_commit_sha: nil, last_deploy_at: nil, last_error: nil, last_status: nil, root_dir: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Functions::GitLinkLinkResponse::Link} for more details. + # + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + # + # @param id [String] + # + # @param auto_deploy [Boolean] When false the link is kept and pushes are ignored. + # + # @param branch [String] Only pushes to this branch deploy. + # + # @param connection [Symbol, Zavudev::Models::Functions::GitLinkLinkResponse::Link::Connection] How this link authenticates, decided by the server rather than by the caller. + # + # @param created_at [Time] + # + # @param function_id [String] + # + # @param owner [String] + # + # @param provider [Symbol, Zavudev::Models::Functions::GitLinkLinkResponse::Link::Provider] + # + # @param repo [String] + # + # @param updated_at [Time] + # + # @param last_commit_message [String, nil] + # + # @param last_commit_sha [String, nil] + # + # @param last_deploy_at [Time, nil] + # + # @param last_error [String, nil] Why the last deploy failed. Null otherwise. + # + # @param last_status [Symbol, Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus, nil] + # + # @param root_dir [String, nil] Subdirectory holding the project, for monorepos. Null when the project is at the + + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + # + # @see Zavudev::Models::Functions::GitLinkLinkResponse::Link#connection + module Connection + extend Zavudev::Internal::Type::Enum + + APP = :app + MANUAL = :manual + + # @!method self.values + # @return [Array] + end + + # @see Zavudev::Models::Functions::GitLinkLinkResponse::Link#provider + module Provider + extend Zavudev::Internal::Type::Enum + + GITHUB = :github + + # @!method self.values + # @return [Array] + end + + # @see Zavudev::Models::Functions::GitLinkLinkResponse::Link#last_status + module LastStatus + extend Zavudev::Internal::Type::Enum + + DEPLOYING = :deploying + DEPLOYED = :deployed + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/zavudev/models/functions/git_link_retrieve_params.rb b/lib/zavudev/models/functions/git_link_retrieve_params.rb new file mode 100644 index 0000000..e61af8a --- /dev/null +++ b/lib/zavudev/models/functions/git_link_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::GitLink#retrieve + class GitLinkRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute function_id + # + # @return [String] + required :function_id, String + + # @!method initialize(function_id:, request_options: {}) + # @param function_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/functions/git_link_retrieve_response.rb b/lib/zavudev/models/functions/git_link_retrieve_response.rb new file mode 100644 index 0000000..7b9d5f2 --- /dev/null +++ b/lib/zavudev/models/functions/git_link_retrieve_response.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::GitLink#retrieve + class GitLinkRetrieveResponse < Zavudev::Internal::Type::BaseModel + # @!attribute link + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + # + # @return [Zavudev::Models::Functions::GitLinkRetrieveResponse::Link] + required :link, -> { Zavudev::Models::Functions::GitLinkRetrieveResponse::Link } + + # @!attribute webhook_url + # Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # where you add it to the repository yourself. + # + # @return [String] + required :webhook_url, String, api_name: :webhookUrl + + # @!attribute webhook_secret + # Shared secret for the repository's webhook. **Returned only when creating a + # `manual` link, and only there** — every later read strips it, and re-linking + # mints a new one. Absent entirely on an `app` link, which needs no secret of its + # own. + # + # @return [String, nil] + optional :webhook_secret, String, api_name: :webhookSecret + + # @!method initialize(link:, webhook_url:, webhook_secret: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Functions::GitLinkRetrieveResponse} for more details. + # + # @param link [Zavudev::Models::Functions::GitLinkRetrieveResponse::Link] A GitHub repository bound to a function. A push to `branch` deploys the function + # + # @param webhook_url [String] Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # + # @param webhook_secret [String] Shared secret for the repository's webhook. \*\*Returned only when creating a + # `man + + # @see Zavudev::Models::Functions::GitLinkRetrieveResponse#link + class Link < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute auto_deploy + # When false the link is kept and pushes are ignored. + # + # @return [Boolean] + required :auto_deploy, Zavudev::Internal::Type::Boolean, api_name: :autoDeploy + + # @!attribute branch + # Only pushes to this branch deploy. + # + # @return [String] + required :branch, String + + # @!attribute connection + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + # + # @return [Symbol, Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Connection] + required :connection, enum: -> { Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Connection } + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute function_id + # + # @return [String] + required :function_id, String, api_name: :functionId + + # @!attribute owner + # + # @return [String] + required :owner, String + + # @!attribute provider + # + # @return [Symbol, Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Provider] + required :provider, enum: -> { Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Provider } + + # @!attribute repo + # + # @return [String] + required :repo, String + + # @!attribute updated_at + # + # @return [Time] + required :updated_at, Time, api_name: :updatedAt + + # @!attribute last_commit_message + # + # @return [String, nil] + optional :last_commit_message, String, api_name: :lastCommitMessage, nil?: true + + # @!attribute last_commit_sha + # + # @return [String, nil] + optional :last_commit_sha, String, api_name: :lastCommitSha, nil?: true + + # @!attribute last_deploy_at + # + # @return [Time, nil] + optional :last_deploy_at, Time, api_name: :lastDeployAt, nil?: true + + # @!attribute last_error + # Why the last deploy failed. Null otherwise. + # + # @return [String, nil] + optional :last_error, String, api_name: :lastError, nil?: true + + # @!attribute last_status + # + # @return [Symbol, Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus, nil] + optional :last_status, + enum: -> { Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus }, + api_name: :lastStatus, + nil?: true + + # @!attribute root_dir + # Subdirectory holding the project, for monorepos. Null when the project is at the + # repository root. + # + # @return [String, nil] + optional :root_dir, String, api_name: :rootDir, nil?: true + + # @!method initialize(id:, auto_deploy:, branch:, connection:, created_at:, function_id:, owner:, provider:, repo:, updated_at:, last_commit_message: nil, last_commit_sha: nil, last_deploy_at: nil, last_error: nil, last_status: nil, root_dir: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Functions::GitLinkRetrieveResponse::Link} for more details. + # + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + # + # @param id [String] + # + # @param auto_deploy [Boolean] When false the link is kept and pushes are ignored. + # + # @param branch [String] Only pushes to this branch deploy. + # + # @param connection [Symbol, Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Connection] How this link authenticates, decided by the server rather than by the caller. + # + # @param created_at [Time] + # + # @param function_id [String] + # + # @param owner [String] + # + # @param provider [Symbol, Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Provider] + # + # @param repo [String] + # + # @param updated_at [Time] + # + # @param last_commit_message [String, nil] + # + # @param last_commit_sha [String, nil] + # + # @param last_deploy_at [Time, nil] + # + # @param last_error [String, nil] Why the last deploy failed. Null otherwise. + # + # @param last_status [Symbol, Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus, nil] + # + # @param root_dir [String, nil] Subdirectory holding the project, for monorepos. Null when the project is at the + + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + # + # @see Zavudev::Models::Functions::GitLinkRetrieveResponse::Link#connection + module Connection + extend Zavudev::Internal::Type::Enum + + APP = :app + MANUAL = :manual + + # @!method self.values + # @return [Array] + end + + # @see Zavudev::Models::Functions::GitLinkRetrieveResponse::Link#provider + module Provider + extend Zavudev::Internal::Type::Enum + + GITHUB = :github + + # @!method self.values + # @return [Array] + end + + # @see Zavudev::Models::Functions::GitLinkRetrieveResponse::Link#last_status + module LastStatus + extend Zavudev::Internal::Type::Enum + + DEPLOYING = :deploying + DEPLOYED = :deployed + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/zavudev/models/functions/git_link_unlink_params.rb b/lib/zavudev/models/functions/git_link_unlink_params.rb new file mode 100644 index 0000000..f2b1758 --- /dev/null +++ b/lib/zavudev/models/functions/git_link_unlink_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::GitLink#unlink + class GitLinkUnlinkParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute function_id + # + # @return [String] + required :function_id, String + + # @!method initialize(function_id:, request_options: {}) + # @param function_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/functions/git_link_update_params.rb b/lib/zavudev/models/functions/git_link_update_params.rb new file mode 100644 index 0000000..ca01859 --- /dev/null +++ b/lib/zavudev/models/functions/git_link_update_params.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::GitLink#update + class GitLinkUpdateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute function_id + # + # @return [String] + required :function_id, String + + # @!attribute auto_deploy + # + # @return [Boolean, nil] + optional :auto_deploy, Zavudev::Internal::Type::Boolean, api_name: :autoDeploy + + # @!attribute branch + # + # @return [String, nil] + optional :branch, String + + # @!attribute root_dir + # + # @return [String, nil] + optional :root_dir, String, api_name: :rootDir, nil?: true + + # @!method initialize(function_id:, auto_deploy: nil, branch: nil, root_dir: nil, request_options: {}) + # @param function_id [String] + # @param auto_deploy [Boolean] + # @param branch [String] + # @param root_dir [String, nil] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/functions/git_link_update_response.rb b/lib/zavudev/models/functions/git_link_update_response.rb new file mode 100644 index 0000000..c8ea8b5 --- /dev/null +++ b/lib/zavudev/models/functions/git_link_update_response.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::GitLink#update + class GitLinkUpdateResponse < Zavudev::Internal::Type::BaseModel + # @!attribute link + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + # + # @return [Zavudev::Models::Functions::GitLinkUpdateResponse::Link] + required :link, -> { Zavudev::Models::Functions::GitLinkUpdateResponse::Link } + + # @!attribute webhook_url + # Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # where you add it to the repository yourself. + # + # @return [String] + required :webhook_url, String, api_name: :webhookUrl + + # @!attribute webhook_secret + # Shared secret for the repository's webhook. **Returned only when creating a + # `manual` link, and only there** — every later read strips it, and re-linking + # mints a new one. Absent entirely on an `app` link, which needs no secret of its + # own. + # + # @return [String, nil] + optional :webhook_secret, String, api_name: :webhookSecret + + # @!method initialize(link:, webhook_url:, webhook_secret: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Functions::GitLinkUpdateResponse} for more details. + # + # @param link [Zavudev::Models::Functions::GitLinkUpdateResponse::Link] A GitHub repository bound to a function. A push to `branch` deploys the function + # + # @param webhook_url [String] Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # + # @param webhook_secret [String] Shared secret for the repository's webhook. \*\*Returned only when creating a + # `man + + # @see Zavudev::Models::Functions::GitLinkUpdateResponse#link + class Link < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute auto_deploy + # When false the link is kept and pushes are ignored. + # + # @return [Boolean] + required :auto_deploy, Zavudev::Internal::Type::Boolean, api_name: :autoDeploy + + # @!attribute branch + # Only pushes to this branch deploy. + # + # @return [String] + required :branch, String + + # @!attribute connection + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + # + # @return [Symbol, Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Connection] + required :connection, enum: -> { Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Connection } + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute function_id + # + # @return [String] + required :function_id, String, api_name: :functionId + + # @!attribute owner + # + # @return [String] + required :owner, String + + # @!attribute provider + # + # @return [Symbol, Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Provider] + required :provider, enum: -> { Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Provider } + + # @!attribute repo + # + # @return [String] + required :repo, String + + # @!attribute updated_at + # + # @return [Time] + required :updated_at, Time, api_name: :updatedAt + + # @!attribute last_commit_message + # + # @return [String, nil] + optional :last_commit_message, String, api_name: :lastCommitMessage, nil?: true + + # @!attribute last_commit_sha + # + # @return [String, nil] + optional :last_commit_sha, String, api_name: :lastCommitSha, nil?: true + + # @!attribute last_deploy_at + # + # @return [Time, nil] + optional :last_deploy_at, Time, api_name: :lastDeployAt, nil?: true + + # @!attribute last_error + # Why the last deploy failed. Null otherwise. + # + # @return [String, nil] + optional :last_error, String, api_name: :lastError, nil?: true + + # @!attribute last_status + # + # @return [Symbol, Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus, nil] + optional :last_status, + enum: -> { Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus }, + api_name: :lastStatus, + nil?: true + + # @!attribute root_dir + # Subdirectory holding the project, for monorepos. Null when the project is at the + # repository root. + # + # @return [String, nil] + optional :root_dir, String, api_name: :rootDir, nil?: true + + # @!method initialize(id:, auto_deploy:, branch:, connection:, created_at:, function_id:, owner:, provider:, repo:, updated_at:, last_commit_message: nil, last_commit_sha: nil, last_deploy_at: nil, last_error: nil, last_status: nil, root_dir: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Functions::GitLinkUpdateResponse::Link} for more details. + # + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + # + # @param id [String] + # + # @param auto_deploy [Boolean] When false the link is kept and pushes are ignored. + # + # @param branch [String] Only pushes to this branch deploy. + # + # @param connection [Symbol, Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Connection] How this link authenticates, decided by the server rather than by the caller. + # + # @param created_at [Time] + # + # @param function_id [String] + # + # @param owner [String] + # + # @param provider [Symbol, Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Provider] + # + # @param repo [String] + # + # @param updated_at [Time] + # + # @param last_commit_message [String, nil] + # + # @param last_commit_sha [String, nil] + # + # @param last_deploy_at [Time, nil] + # + # @param last_error [String, nil] Why the last deploy failed. Null otherwise. + # + # @param last_status [Symbol, Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus, nil] + # + # @param root_dir [String, nil] Subdirectory holding the project, for monorepos. Null when the project is at the + + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + # + # @see Zavudev::Models::Functions::GitLinkUpdateResponse::Link#connection + module Connection + extend Zavudev::Internal::Type::Enum + + APP = :app + MANUAL = :manual + + # @!method self.values + # @return [Array] + end + + # @see Zavudev::Models::Functions::GitLinkUpdateResponse::Link#provider + module Provider + extend Zavudev::Internal::Type::Enum + + GITHUB = :github + + # @!method self.values + # @return [Array] + end + + # @see Zavudev::Models::Functions::GitLinkUpdateResponse::Link#last_status + module LastStatus + extend Zavudev::Internal::Type::Enum + + DEPLOYING = :deploying + DEPLOYED = :deployed + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/zavudev/models/functions/trigger_create_params.rb b/lib/zavudev/models/functions/trigger_create_params.rb new file mode 100644 index 0000000..393981f --- /dev/null +++ b/lib/zavudev/models/functions/trigger_create_params.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::Triggers#create + class TriggerCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute function_id + # + # @return [String] + required :function_id, String + + # @!attribute event_types + # Event types to subscribe to. + # + # @return [Array] + required :event_types, Zavudev::Internal::Type::ArrayOf[String], api_name: :eventTypes + + # @!attribute sender_ids + # Senders to scope the triggers to. Use null for all senders. + # + # @return [Array] + required :sender_ids, Zavudev::Internal::Type::ArrayOf[String, nil?: true], api_name: :senderIds + + # @!attribute cron + # Required when eventTypes includes `cron`: a 5-field cron expression (minute hour + # day-of-month month day-of-week), evaluated in UTC. + # + # @return [String, nil] + optional :cron, String + + # @!method initialize(function_id:, event_types:, sender_ids:, cron: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Functions::TriggerCreateParams} for more details. + # + # @param function_id [String] + # + # @param event_types [Array] Event types to subscribe to. + # + # @param sender_ids [Array] Senders to scope the triggers to. Use null for all senders. + # + # @param cron [String] Required when eventTypes includes `cron`: a 5-field cron expression (minute hour + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/functions/trigger_create_response.rb b/lib/zavudev/models/functions/trigger_create_response.rb new file mode 100644 index 0000000..f0580c8 --- /dev/null +++ b/lib/zavudev/models/functions/trigger_create_response.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::Triggers#create + class TriggerCreateResponse < Zavudev::Internal::Type::BaseModel + # @!attribute added + # + # @return [Integer] + required :added, Integer + + # @!attribute skipped + # Number of triggers that already existed. + # + # @return [Integer] + required :skipped, Integer + + # @!attribute triggers + # + # @return [Array] + required :triggers, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::Functions::TriggerCreateResponse::Trigger] } + + # @!method initialize(added:, skipped:, triggers:) + # @param added [Integer] + # + # @param skipped [Integer] Number of triggers that already existed. + # + # @param triggers [Array] + + class Trigger < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active + # + # @return [Boolean] + required :active, Zavudev::Internal::Type::Boolean + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute event_type + # Event type that fires the function. See GET /v1/functions/event-types for the + # supported list. The special type `cron` fires on a schedule instead of a + # messaging event and carries a `cron` expression. + # + # @return [String] + required :event_type, String, api_name: :eventType + + # @!attribute function_id + # + # @return [String] + required :function_id, String, api_name: :functionId + + # @!attribute updated_at + # + # @return [Time] + required :updated_at, Time, api_name: :updatedAt + + # @!attribute cron + # 5-field cron expression (minute hour day-of-month month day-of-week), evaluated + # in UTC. Present only on `cron` triggers. + # + # @return [String, nil] + optional :cron, String, nil?: true + + # @!attribute last_run_at + # Last time the schedule fired. Null until the first fire. + # + # @return [Time, nil] + optional :last_run_at, Time, api_name: :lastRunAt, nil?: true + + # @!attribute next_run_at + # Next scheduled fire time. Present only on `cron` triggers. + # + # @return [Time, nil] + optional :next_run_at, Time, api_name: :nextRunAt, nil?: true + + # @!attribute sender_id + # Restrict the trigger to a single sender. Null means all senders in the project. + # + # @return [String, nil] + optional :sender_id, String, api_name: :senderId, nil?: true + + # @!method initialize(id:, active:, created_at:, event_type:, function_id:, updated_at:, cron: nil, last_run_at: nil, next_run_at: nil, sender_id: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Functions::TriggerCreateResponse::Trigger} for more details. + # + # A subscription that runs a Zavu Function when a messaging event fires. + # + # @param id [String] + # + # @param active [Boolean] + # + # @param created_at [Time] + # + # @param event_type [String] Event type that fires the function. See GET /v1/functions/event-types for the su + # + # @param function_id [String] + # + # @param updated_at [Time] + # + # @param cron [String, nil] 5-field cron expression (minute hour day-of-month month day-of-week), evaluated + # + # @param last_run_at [Time, nil] Last time the schedule fired. Null until the first fire. + # + # @param next_run_at [Time, nil] Next scheduled fire time. Present only on `cron` triggers. + # + # @param sender_id [String, nil] Restrict the trigger to a single sender. Null means all senders in the project. + end + end + end + end +end diff --git a/lib/zavudev/models/functions/trigger_delete_params.rb b/lib/zavudev/models/functions/trigger_delete_params.rb new file mode 100644 index 0000000..f0d8e5f --- /dev/null +++ b/lib/zavudev/models/functions/trigger_delete_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::Triggers#delete + class TriggerDeleteParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute trigger_id + # + # @return [String] + required :trigger_id, String + + # @!method initialize(trigger_id:, request_options: {}) + # @param trigger_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/functions/trigger_list_params.rb b/lib/zavudev/models/functions/trigger_list_params.rb new file mode 100644 index 0000000..413855d --- /dev/null +++ b/lib/zavudev/models/functions/trigger_list_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::Triggers#list + class TriggerListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute function_id + # + # @return [String] + required :function_id, String + + # @!method initialize(function_id:, request_options: {}) + # @param function_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/functions/trigger_list_response.rb b/lib/zavudev/models/functions/trigger_list_response.rb new file mode 100644 index 0000000..3b918e3 --- /dev/null +++ b/lib/zavudev/models/functions/trigger_list_response.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::Triggers#list + class TriggerListResponse < Zavudev::Internal::Type::BaseModel + # @!attribute triggers + # + # @return [Array] + required :triggers, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::Functions::TriggerListResponse::Trigger] } + + # @!method initialize(triggers:) + # @param triggers [Array] + + class Trigger < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active + # + # @return [Boolean] + required :active, Zavudev::Internal::Type::Boolean + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute event_type + # Event type that fires the function. See GET /v1/functions/event-types for the + # supported list. The special type `cron` fires on a schedule instead of a + # messaging event and carries a `cron` expression. + # + # @return [String] + required :event_type, String, api_name: :eventType + + # @!attribute function_id + # + # @return [String] + required :function_id, String, api_name: :functionId + + # @!attribute updated_at + # + # @return [Time] + required :updated_at, Time, api_name: :updatedAt + + # @!attribute cron + # 5-field cron expression (minute hour day-of-month month day-of-week), evaluated + # in UTC. Present only on `cron` triggers. + # + # @return [String, nil] + optional :cron, String, nil?: true + + # @!attribute last_run_at + # Last time the schedule fired. Null until the first fire. + # + # @return [Time, nil] + optional :last_run_at, Time, api_name: :lastRunAt, nil?: true + + # @!attribute next_run_at + # Next scheduled fire time. Present only on `cron` triggers. + # + # @return [Time, nil] + optional :next_run_at, Time, api_name: :nextRunAt, nil?: true + + # @!attribute sender_id + # Restrict the trigger to a single sender. Null means all senders in the project. + # + # @return [String, nil] + optional :sender_id, String, api_name: :senderId, nil?: true + + # @!method initialize(id:, active:, created_at:, event_type:, function_id:, updated_at:, cron: nil, last_run_at: nil, next_run_at: nil, sender_id: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Functions::TriggerListResponse::Trigger} for more details. + # + # A subscription that runs a Zavu Function when a messaging event fires. + # + # @param id [String] + # + # @param active [Boolean] + # + # @param created_at [Time] + # + # @param event_type [String] Event type that fires the function. See GET /v1/functions/event-types for the su + # + # @param function_id [String] + # + # @param updated_at [Time] + # + # @param cron [String, nil] 5-field cron expression (minute hour day-of-month month day-of-week), evaluated + # + # @param last_run_at [Time, nil] Last time the schedule fired. Null until the first fire. + # + # @param next_run_at [Time, nil] Next scheduled fire time. Present only on `cron` triggers. + # + # @param sender_id [String, nil] Restrict the trigger to a single sender. Null means all senders in the project. + end + end + end + end +end diff --git a/lib/zavudev/models/functions/trigger_update_params.rb b/lib/zavudev/models/functions/trigger_update_params.rb new file mode 100644 index 0000000..67c2025 --- /dev/null +++ b/lib/zavudev/models/functions/trigger_update_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::Triggers#update + class TriggerUpdateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute trigger_id + # + # @return [String] + required :trigger_id, String + + # @!attribute active + # + # @return [Boolean] + required :active, Zavudev::Internal::Type::Boolean + + # @!method initialize(trigger_id:, active:, request_options: {}) + # @param trigger_id [String] + # @param active [Boolean] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/functions/trigger_update_response.rb b/lib/zavudev/models/functions/trigger_update_response.rb new file mode 100644 index 0000000..48f7165 --- /dev/null +++ b/lib/zavudev/models/functions/trigger_update_response.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Functions + # @see Zavudev::Resources::Functions::Triggers#update + class TriggerUpdateResponse < Zavudev::Internal::Type::BaseModel + # @!attribute active + # + # @return [Boolean] + required :active, Zavudev::Internal::Type::Boolean + + # @!attribute ok + # + # @return [Boolean] + required :ok, Zavudev::Internal::Type::Boolean + + # @!method initialize(active:, ok:) + # @param active [Boolean] + # @param ok [Boolean] + end + end + end +end diff --git a/lib/zavudev/models/introspect_validate_email_params.rb b/lib/zavudev/models/introspect_validate_email_params.rb new file mode 100644 index 0000000..5dcfbe2 --- /dev/null +++ b/lib/zavudev/models/introspect_validate_email_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Introspect#validate_email + class IntrospectValidateEmailParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute email + # Single email address to validate. + # + # @return [String, nil] + optional :email, String + + # @!attribute emails + # Batch of email addresses to validate (max 100). + # + # @return [Array, nil] + optional :emails, Zavudev::Internal::Type::ArrayOf[String] + + # @!method initialize(email: nil, emails: nil, request_options: {}) + # @param email [String] Single email address to validate. + # + # @param emails [Array] Batch of email addresses to validate (max 100). + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/introspect_validate_email_response.rb b/lib/zavudev/models/introspect_validate_email_response.rb new file mode 100644 index 0000000..358792a --- /dev/null +++ b/lib/zavudev/models/introspect_validate_email_response.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Introspect#validate_email + class IntrospectValidateEmailResponse < Zavudev::Internal::Type::BaseModel + # @!attribute results + # One result per submitted address, in the same order. + # + # @return [Array] + required :results, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::IntrospectValidateEmailResponse::Result] } + + # @!attribute summary + # + # @return [Zavudev::Models::IntrospectValidateEmailResponse::Summary] + required :summary, -> { Zavudev::Models::IntrospectValidateEmailResponse::Summary } + + # @!method initialize(results:, summary:) + # @param results [Array] One result per submitted address, in the same order. + # + # @param summary [Zavudev::Models::IntrospectValidateEmailResponse::Summary] + + class Result < Zavudev::Internal::Type::BaseModel + # @!attribute domain + # Domain part of the address. Null when the syntax is invalid. + # + # @return [String, nil] + required :domain, String, nil?: true + + # @!attribute email + # The address exactly as submitted. + # + # @return [String] + required :email, String + + # @!attribute normalized + # Lowercased, trimmed form of the address. Null when the syntax is invalid. + # + # @return [String, nil] + required :normalized, String, nil?: true + + # @!attribute reasons + # Signals behind the verdict. Empty for a clean `deliverable` address. + # + # @return [Array] + required :reasons, + -> { Zavudev::Internal::Type::ArrayOf[enum: Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason] } + + # @!attribute verdict + # Validation verdict. + # + # - `deliverable`: nothing suggests the address will bounce. + # - `risky`: sendable, but a signal predicts elevated bounce/complaint odds (role + # address, disposable domain, MX-less domain, prior soft bounce). + # - `undeliverable`: will bounce or is blocked (invalid syntax, dead domain, or + # the address is on your suppression list after a hard bounce/complaint). + # + # @return [Symbol, Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict] + required :verdict, enum: -> { Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict } + + # @!method initialize(domain:, email:, normalized:, reasons:, verdict:) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::IntrospectValidateEmailResponse::Result} for more details. + # + # @param domain [String, nil] Domain part of the address. Null when the syntax is invalid. + # + # @param email [String] The address exactly as submitted. + # + # @param normalized [String, nil] Lowercased, trimmed form of the address. Null when the syntax is invalid. + # + # @param reasons [Array] Signals behind the verdict. Empty for a clean `deliverable` address. + # + # @param verdict [Symbol, Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict] Validation verdict. + + module Reason + extend Zavudev::Internal::Type::Enum + + INVALID_SYNTAX = :invalid_syntax + DOMAIN_NOT_FOUND = :domain_not_found + DOMAIN_NO_MX = :domain_no_mx + DISPOSABLE_DOMAIN = :disposable_domain + ROLE_ADDRESS = :role_address + SUPPRESSED_HARD_BOUNCE = :suppressed_hard_bounce + SUPPRESSED_SOFT_BOUNCE = :suppressed_soft_bounce + SUPPRESSED_COMPLAINT = :suppressed_complaint + SUPPRESSED_MANUAL = :suppressed_manual + SUPPRESSED_UNSUBSCRIBE = :suppressed_unsubscribe + + # @!method self.values + # @return [Array] + end + + # Validation verdict. + # + # - `deliverable`: nothing suggests the address will bounce. + # - `risky`: sendable, but a signal predicts elevated bounce/complaint odds (role + # address, disposable domain, MX-less domain, prior soft bounce). + # - `undeliverable`: will bounce or is blocked (invalid syntax, dead domain, or + # the address is on your suppression list after a hard bounce/complaint). + # + # @see Zavudev::Models::IntrospectValidateEmailResponse::Result#verdict + module Verdict + extend Zavudev::Internal::Type::Enum + + DELIVERABLE = :deliverable + RISKY = :risky + UNDELIVERABLE = :undeliverable + + # @!method self.values + # @return [Array] + end + end + + # @see Zavudev::Models::IntrospectValidateEmailResponse#summary + class Summary < Zavudev::Internal::Type::BaseModel + # @!attribute deliverable + # + # @return [Integer] + required :deliverable, Integer + + # @!attribute risky + # + # @return [Integer] + required :risky, Integer + + # @!attribute total + # + # @return [Integer] + required :total, Integer + + # @!attribute undeliverable + # + # @return [Integer] + required :undeliverable, Integer + + # @!method initialize(deliverable:, risky:, total:, undeliverable:) + # @param deliverable [Integer] + # @param risky [Integer] + # @param total [Integer] + # @param undeliverable [Integer] + end + end + end +end diff --git a/lib/zavudev/models/message_list_attachments_params.rb b/lib/zavudev/models/message_list_attachments_params.rb new file mode 100644 index 0000000..be571b7 --- /dev/null +++ b/lib/zavudev/models/message_list_attachments_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Messages#list_attachments + class MessageListAttachmentsParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute message_id + # + # @return [String] + required :message_id, String + + # @!method initialize(message_id:, request_options: {}) + # @param message_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/message_list_attachments_response.rb b/lib/zavudev/models/message_list_attachments_response.rb new file mode 100644 index 0000000..5f0010f --- /dev/null +++ b/lib/zavudev/models/message_list_attachments_response.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Messages#list_attachments + class MessageListAttachmentsResponse < Zavudev::Internal::Type::BaseModel + # @!attribute items + # + # @return [Array] + required :items, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::MessageListAttachmentsResponse::Item] } + + # @!method initialize(items:) + # @param items [Array] + + class Item < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute content_id + # Content-ID for inline attachments (referenced in the HTML body as + # `cid:`). Null for regular attachments. + # + # @return [String, nil] + required :content_id, String, api_name: :contentId, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute download_url + # Short-lived signed URL to download the attachment bytes. Freshly generated on + # each request and expires; do not cache it. Null if the stored file is no longer + # available. + # + # @return [String, nil] + required :download_url, String, api_name: :downloadUrl, nil?: true + + # @!attribute filename + # + # @return [String] + required :filename, String + + # @!attribute is_inline + # Whether the attachment is inline (embedded in the HTML body) rather than a + # regular attachment. + # + # @return [Boolean] + required :is_inline, Zavudev::Internal::Type::Boolean, api_name: :isInline + + # @!attribute mime_type + # MIME type of the attachment. + # + # @return [String] + required :mime_type, String, api_name: :mimeType + + # @!attribute size + # Size of the attachment in bytes. + # + # @return [Integer] + required :size, Integer + + # @!method initialize(id:, content_id:, created_at:, download_url:, filename:, is_inline:, mime_type:, size:) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::MessageListAttachmentsResponse::Item} for more details. + # + # A stored file attachment for an email message (inbound or outbound). + # + # @param id [String] + # + # @param content_id [String, nil] Content-ID for inline attachments (referenced in the HTML body as `cid:Object}] + end + end + end + end + end +end diff --git a/lib/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rb b/lib/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rb new file mode 100644 index 0000000..c07546c --- /dev/null +++ b/lib/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + # @see Zavudev::Resources::Senders::Agent::KnowledgeBases::Documents#retrieve_document + class DocumentRetrieveDocumentResponse < Zavudev::Internal::Type::BaseModel + # @!attribute document + # + # @return [Zavudev::Models::Senders::Agent::AgentDocument] + required :document, -> { Zavudev::Senders::Agent::AgentDocument } + + # @!method initialize(document:) + # @param document [Zavudev::Models::Senders::Agent::AgentDocument] + end + end + end + end + end +end diff --git a/lib/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rb b/lib/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rb new file mode 100644 index 0000000..95a326b --- /dev/null +++ b/lib/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + # @see Zavudev::Resources::Senders::Agent::KnowledgeBases::Documents#update_document + class DocumentUpdateDocumentParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute sender_id + # + # @return [String] + required :sender_id, String + + # @!attribute kb_id + # + # @return [String] + required :kb_id, String + + # @!attribute doc_id + # + # @return [String] + required :doc_id, String + + # @!attribute content + # + # @return [String, nil] + optional :content, String + + # @!attribute title + # + # @return [String, nil] + optional :title, String + + # @!method initialize(sender_id:, kb_id:, doc_id:, content: nil, title: nil, request_options: {}) + # @param sender_id [String] + # @param kb_id [String] + # @param doc_id [String] + # @param content [String] + # @param title [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end + end +end diff --git a/lib/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rb b/lib/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rb new file mode 100644 index 0000000..48cf840 --- /dev/null +++ b/lib/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + # @see Zavudev::Resources::Senders::Agent::KnowledgeBases::Documents#update_document + class DocumentUpdateDocumentResponse < Zavudev::Internal::Type::BaseModel + # @!attribute document + # + # @return [Zavudev::Models::Senders::Agent::AgentDocument] + required :document, -> { Zavudev::Senders::Agent::AgentDocument } + + # @!method initialize(document:) + # @param document [Zavudev::Models::Senders::Agent::AgentDocument] + end + end + end + end + end +end diff --git a/lib/zavudev/models/senders/agent/tool_list_test_runs_params.rb b/lib/zavudev/models/senders/agent/tool_list_test_runs_params.rb new file mode 100644 index 0000000..cad495a --- /dev/null +++ b/lib/zavudev/models/senders/agent/tool_list_test_runs_params.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Senders + module Agent + # @see Zavudev::Resources::Senders::Agent::Tools#list_test_runs + class ToolListTestRunsParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute sender_id + # + # @return [String] + required :sender_id, String + + # @!attribute tool_id + # + # @return [String] + required :tool_id, String + + # @!attribute limit + # + # @return [Integer, nil] + optional :limit, Integer + + # @!method initialize(sender_id:, tool_id:, limit: nil, request_options: {}) + # @param sender_id [String] + # @param tool_id [String] + # @param limit [Integer] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/zavudev/models/senders/agent/tool_list_test_runs_response.rb b/lib/zavudev/models/senders/agent/tool_list_test_runs_response.rb new file mode 100644 index 0000000..3ffbc92 --- /dev/null +++ b/lib/zavudev/models/senders/agent/tool_list_test_runs_response.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Senders + module Agent + # @see Zavudev::Resources::Senders::Agent::Tools#list_test_runs + class ToolListTestRunsResponse < Zavudev::Internal::Type::BaseModel + # @!attribute items + # + # @return [Array] + required :items, + -> { Zavudev::Internal::Type::ArrayOf[Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item] } + + # @!method initialize(items:) + # @param items [Array] + + class Item < Zavudev::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute duration_ms + # + # @return [Integer] + required :duration_ms, Integer, api_name: :durationMs + + # @!attribute success + # Whether the tool returned without error. A tool that answered with a non-2xx + # status is a failed run, not an error of this endpoint. + # + # @return [Boolean] + required :success, Zavudev::Internal::Type::Boolean + + # @!attribute tool_id + # + # @return [String] + required :tool_id, String, api_name: :toolId + + # @!attribute error + # Why the run failed, when it did. + # + # @return [String, nil] + optional :error, String, nil?: true + + # @!attribute params + # The parameters the tool was called with. + # + # @return [Hash{Symbol=>Object}, nil] + optional :params, Zavudev::Internal::Type::HashOf[Zavudev::Internal::Type::Unknown] + + # @!attribute response + # The tool's response body, truncated. + # + # @return [String, nil] + optional :response, String, nil?: true + + # @!attribute status_code + # HTTP status the tool's webhook returned. Absent for tools that do not go over + # HTTP. + # + # @return [Integer, nil] + optional :status_code, Integer, api_name: :statusCode, nil?: true + + # @!method initialize(id:, created_at:, duration_ms:, success:, tool_id:, error: nil, params: nil, response: nil, status_code: nil) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item} for more + # details. + # + # One run of a tool triggered from the test endpoint. Recorded so a test is + # verifiable after the fact rather than only visible in the response. + # + # @param id [String] + # + # @param created_at [Time] + # + # @param duration_ms [Integer] + # + # @param success [Boolean] Whether the tool returned without error. A tool that answered with a non-2xx sta + # + # @param tool_id [String] + # + # @param error [String, nil] Why the run failed, when it did. + # + # @param params [Hash{Symbol=>Object}] The parameters the tool was called with. + # + # @param response [String, nil] The tool's response body, truncated. + # + # @param status_code [Integer, nil] HTTP status the tool's webhook returned. Absent for tools that do not go over HT + end + end + end + end + end +end diff --git a/lib/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rb b/lib/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rb new file mode 100644 index 0000000..52d4e4f --- /dev/null +++ b/lib/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Senders + module Agent + module Tools + # @see Zavudev::Resources::Senders::Agent::Tools::Webhook#rotate_secret + class WebhookRotateSecretParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute sender_id + # + # @return [String] + required :sender_id, String + + # @!attribute tool_id + # + # @return [String] + required :tool_id, String + + # @!method initialize(sender_id:, tool_id:, request_options: {}) + # @param sender_id [String] + # @param tool_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end + end +end diff --git a/lib/zavudev/models/senders/telegram_connect_params.rb b/lib/zavudev/models/senders/telegram_connect_params.rb new file mode 100644 index 0000000..299425f --- /dev/null +++ b/lib/zavudev/models/senders/telegram_connect_params.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Senders + # @see Zavudev::Resources::Senders::Telegram#connect + class TelegramConnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute sender_id + # + # @return [String] + required :sender_id, String + + # @!attribute bot_token + # Bot token from @BotFather. + # + # @return [String] + required :bot_token, String, api_name: :botToken + + # @!method initialize(sender_id:, bot_token:, request_options: {}) + # @param sender_id [String] + # + # @param bot_token [String] Bot token from @BotFather. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/senders/telegram_connect_response.rb b/lib/zavudev/models/senders/telegram_connect_response.rb new file mode 100644 index 0000000..4f32427 --- /dev/null +++ b/lib/zavudev/models/senders/telegram_connect_response.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Senders + # @see Zavudev::Resources::Senders::Telegram#connect + class TelegramConnectResponse < Zavudev::Internal::Type::BaseModel + # @!attribute telegram + # + # @return [Zavudev::Models::Senders::TelegramConnectResponse::Telegram] + required :telegram, -> { Zavudev::Models::Senders::TelegramConnectResponse::Telegram } + + # @!method initialize(telegram:) + # @param telegram [Zavudev::Models::Senders::TelegramConnectResponse::Telegram] + + # @see Zavudev::Models::Senders::TelegramConnectResponse#telegram + class Telegram < Zavudev::Internal::Type::BaseModel + # @!attribute connected + # + # @return [Boolean] + required :connected, Zavudev::Internal::Type::Boolean + + # @!attribute bot_id + # + # @return [String, nil] + optional :bot_id, String, api_name: :botId + + # @!attribute bot_username + # + # @return [String, nil] + optional :bot_username, String, api_name: :botUsername + + # @!method initialize(connected:, bot_id: nil, bot_username: nil) + # @param connected [Boolean] + # @param bot_id [String] + # @param bot_username [String] + end + end + end + end +end diff --git a/lib/zavudev/models/senders/telegram_disconnect_params.rb b/lib/zavudev/models/senders/telegram_disconnect_params.rb new file mode 100644 index 0000000..9791fa8 --- /dev/null +++ b/lib/zavudev/models/senders/telegram_disconnect_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + module Senders + # @see Zavudev::Resources::Senders::Telegram#disconnect + class TelegramDisconnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute sender_id + # + # @return [String] + required :sender_id, String + + # @!method initialize(sender_id:, request_options: {}) + # @param sender_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/zavudev/models/template_sync_params.rb b/lib/zavudev/models/template_sync_params.rb new file mode 100644 index 0000000..bd7a7a1 --- /dev/null +++ b/lib/zavudev/models/template_sync_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Templates#sync + class TemplateSyncParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute sender_id + # Sync only the WhatsApp Business Account attached to this sender. If omitted, + # every WhatsApp sender in the project is synced. + # + # @return [String, nil] + optional :sender_id, String, api_name: :senderId + + # @!method initialize(sender_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::TemplateSyncParams} for more details. + # + # @param sender_id [String] Sync only the WhatsApp Business Account attached to this sender. If omitted, eve + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/template_sync_response.rb b/lib/zavudev/models/template_sync_response.rb new file mode 100644 index 0000000..042562a --- /dev/null +++ b/lib/zavudev/models/template_sync_response.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::Templates#sync + class TemplateSyncResponse < Zavudev::Internal::Type::BaseModel + # @!attribute accounts_synced + # WhatsApp Business Accounts reconciled in this call. + # + # @return [Integer] + required :accounts_synced, Integer, api_name: :accountsSynced + + # @!attribute errors + # Problems hit while syncing. Non-empty with a 200 means part of the sync did not + # complete — the rest still did. + # + # @return [Array] + required :errors, Zavudev::Internal::Type::ArrayOf[String] + + # @!attribute imported + # Templates that existed on Meta and were created in Zavu by this call. + # + # @return [Integer] + required :imported, Integer + + # @!attribute linked + # Existing Zavu templates that were matched to a Meta template by name and bound + # to its Meta ID. + # + # @return [Integer] + required :linked, Integer + + # @!attribute skipped + # Meta templates left alone: already linked to a Zavu template, or + # rejected/disabled on Meta. + # + # @return [Integer] + required :skipped, Integer + + # @!attribute updated + # Templates whose approval status changed to match Meta. + # + # @return [Integer] + required :updated, Integer + + # @!method initialize(accounts_synced:, errors:, imported:, linked:, skipped:, updated:) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::TemplateSyncResponse} for more details. + # + # @param accounts_synced [Integer] WhatsApp Business Accounts reconciled in this call. + # + # @param errors [Array] Problems hit while syncing. Non-empty with a 200 means part of the sync did not + # + # @param imported [Integer] Templates that existed on Meta and were created in Zavu by this call. + # + # @param linked [Integer] Existing Zavu templates that were matched to a Meta template by name and bound t + # + # @param skipped [Integer] Meta templates left alone: already linked to a Zavu template, or rejected/disabl + # + # @param updated [Integer] Templates whose approval status changed to match Meta. + end + end +end diff --git a/lib/zavudev/models/url_escalate_params.rb b/lib/zavudev/models/url_escalate_params.rb new file mode 100644 index 0000000..b2f25c2 --- /dev/null +++ b/lib/zavudev/models/url_escalate_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::URLs#escalate + class URLEscalateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + # @!attribute url_id + # + # @return [String] + required :url_id, String + + # @!attribute reason + # Why the URL should be reviewed manually. + # + # @return [String] + required :reason, String + + # @!method initialize(url_id:, reason:, request_options: {}) + # @param url_id [String] + # + # @param reason [String] Why the URL should be reviewed manually. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/zavudev/models/url_escalate_response.rb b/lib/zavudev/models/url_escalate_response.rb new file mode 100644 index 0000000..1d70106 --- /dev/null +++ b/lib/zavudev/models/url_escalate_response.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Zavudev + module Models + # @see Zavudev::Resources::URLs#escalate + class URLEscalateResponse < Zavudev::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute url + # + # @return [Zavudev::Models::VerifiedURL] + required :url, -> { Zavudev::VerifiedURL } + + # @!method initialize(message:, url:) + # @param message [String] + # @param url [Zavudev::Models::VerifiedURL] + end + end +end diff --git a/lib/zavudev/resources/agent_templates.rb b/lib/zavudev/resources/agent_templates.rb new file mode 100644 index 0000000..7500cca --- /dev/null +++ b/lib/zavudev/resources/agent_templates.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Zavudev + module Resources + class AgentTemplates + # Fetch a single factory agent fully rendered: the function files to scaffold (an + # `index.ts` that declares the agent with `defineAgent` and its skills with + # `defineTool`) plus the secrets it needs. This is what + # `npx zavudev agents pull ` writes to disk before `npx zavudev deploy`. + # + # @overload retrieve(template_id, request_options: {}) + # + # @param template_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::AgentTemplateRetrieveResponse] + # + # @see Zavudev::Models::AgentTemplateRetrieveParams + def retrieve(template_id, params = {}) + @client.request( + method: :get, + path: ["v1/agent-templates/%1$s", template_id], + model: Zavudev::Models::AgentTemplateRetrieveResponse, + options: params[:request_options] + ) + end + + # List the factory agents available to scaffold with `npx zavudev agents pull`. + # Each entry is a ready-made voice or text agent (system prompt, skills, and — for + # voice agents — a co-located voice config). + # + # @overload list(request_options: {}) + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::AgentTemplateListResponse] + # + # @see Zavudev::Models::AgentTemplateListParams + def list(params = {}) + @client.request( + method: :get, + path: "v1/agent-templates", + model: Zavudev::Models::AgentTemplateListResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Zavudev::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/zavudev/resources/agents.rb b/lib/zavudev/resources/agents.rb new file mode 100644 index 0000000..5f5d2ea --- /dev/null +++ b/lib/zavudev/resources/agents.rb @@ -0,0 +1,253 @@ +# frozen_string_literal: true + +module Zavudev + module Resources + class Agents + # @return [Zavudev::Resources::Agents::Senders] + attr_reader :senders + + # Some parameter documentations has been truncated, see + # {Zavudev::Models::AgentCreateParams} for more details. + # + # Create an agent without a sender. It is created disabled; connect a sender and + # enable it when you are ready for it to answer. + # + # **Sub-resources.** An agent's tools, flows and knowledge bases are reachable at + # `/v1/agents/{agentId}/tools`, `/v1/agents/{agentId}/flows` and + # `/v1/agents/{agentId}/knowledge-bases`, mirroring the sender-scoped routes + # documented under `/v1/senders/{senderId}/agent/...` exactly. Use the + # agent-scoped form while the agent has no sender: the sender-scoped one cannot + # address it. + # + # @overload create(model:, name:, provider:, system_prompt:, context_window_messages: nil, include_contact_metadata: nil, max_tokens: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, voice: nil, request_options: {}) + # + # @param model [String] + # + # @param name [String] + # + # @param provider [Symbol, Zavudev::Models::Senders::AgentProvider] LLM provider for the AI agent. + # + # @param system_prompt [String] + # + # @param context_window_messages [Integer] + # + # @param include_contact_metadata [Boolean] + # + # @param max_tokens [Integer] + # + # @param temperature [Float] + # + # @param trigger_on_channels [Array] + # + # @param trigger_on_message_types [Array] + # + # @param voice [Zavudev::Models::AgentCreateParams::Voice] Voice Agent configuration on a sender's AI agent. Controls how the agent behaves + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::AgentCreateResponse] + # + # @see Zavudev::Models::AgentCreateParams + def create(params) + parsed, options = Zavudev::AgentCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/agents", + body: parsed, + model: Zavudev::Models::AgentCreateResponse, + options: options + ) + end + + # Get an agent + # + # @overload retrieve(agent_id, request_options: {}) + # + # @param agent_id [String] Agent ID. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::AgentRetrieveResponse] + # + # @see Zavudev::Models::AgentRetrieveParams + def retrieve(agent_id, params = {}) + @client.request( + method: :get, + path: ["v1/agents/%1$s", agent_id], + model: Zavudev::Models::AgentRetrieveResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Zavudev::Models::AgentUpdateParams} for more details. + # + # Update an agent + # + # @overload update(agent_id, api_key: nil, context_window_messages: nil, enabled: nil, include_contact_metadata: nil, max_tokens: nil, model: nil, name: nil, provider: nil, system_prompt: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, voice: nil, request_options: {}) + # + # @param agent_id [String] Agent ID. + # + # @param api_key [String] + # + # @param context_window_messages [Integer] + # + # @param enabled [Boolean] + # + # @param include_contact_metadata [Boolean] + # + # @param max_tokens [Integer, nil] + # + # @param model [String] + # + # @param name [String] + # + # @param provider [Symbol, Zavudev::Models::Senders::AgentProvider] LLM provider for the AI agent. + # + # @param system_prompt [String] + # + # @param temperature [Float, nil] + # + # @param trigger_on_channels [Array] + # + # @param trigger_on_message_types [Array] + # + # @param voice [Zavudev::Models::AgentUpdateParams::Voice] Voice Agent configuration. Patch this object to enable voice, change the greetin + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::AgentUpdateResponse] + # + # @see Zavudev::Models::AgentUpdateParams + def update(agent_id, params = {}) + parsed, options = Zavudev::AgentUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/agents/%1$s", agent_id], + body: parsed, + model: Zavudev::Models::AgentUpdateResponse, + options: options + ) + end + + # Every agent in the project, newest first — including agents that are not + # connected to any sender yet, which the sender-scoped routes cannot reach. Each + # item carries `senderIds`, the senders the agent answers on. + # + # @overload list(cursor: nil, limit: nil, request_options: {}) + # + # @param cursor [String] + # @param limit [Integer] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Internal::Cursor] + # + # @see Zavudev::Models::AgentListParams + def list(params = {}) + parsed, options = Zavudev::AgentListParams.dump_request(params) + query = Zavudev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/agents", + query: query, + page: Zavudev::Internal::Cursor, + model: Zavudev::Senders::SendersAgent, + options: options + ) + end + + # Delete an agent + # + # @overload delete(agent_id, request_options: {}) + # + # @param agent_id [String] Agent ID. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Zavudev::Models::AgentDeleteParams + def delete(agent_id, params = {}) + @client.request( + method: :delete, + path: ["v1/agents/%1$s", agent_id], + model: NilClass, + options: params[:request_options] + ) + end + + # The voices an agent can speak with, for `voice.ttsVoiceId`. Filter by `language` + # to get the ones that speak it; a voice can still be used with `language: auto`, + # where the agent follows the caller and keeps the chosen voice. + # + # @overload list_voices(language: nil, request_options: {}) + # + # @param language [String] BCP-47 tag (`en`, `es`, `pt-BR`). Omit, or pass `auto`, for every voice. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::AgentListVoicesResponse] + # + # @see Zavudev::Models::AgentListVoicesParams + def list_voices(params = {}) + parsed, options = Zavudev::AgentListVoicesParams.dump_request(params) + query = Zavudev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/agents/voices", + query: query, + model: Zavudev::Models::AgentListVoicesResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Zavudev::Models::AgentTestParams} for more details. + # + # Run the agent's prompt, model and knowledge base against a message and return + # the reply instead of delivering it. Writes nothing and charges nothing, so it is + # safe to call repeatedly while iterating on a prompt. + # + # Note that a dry run never **executes** tools — running them would cause real + # side effects. Live conversations on every channel do call them. When the agent + # has enabled tools, that gap is reported in `warnings` rather than silently + # producing an answer that looks like a tool call happened. + # + # @overload test_(agent_id, message:, execute_tools: nil, history: nil, use_knowledge_base: nil, request_options: {}) + # + # @param agent_id [String] Agent ID. + # + # @param message [String] What to say to the agent. + # + # @param execute_tools [Boolean] Run the tools the agent calls instead of reporting the choice and stopping. + # + # @param history [Array] Prior turns, oldest first, to exercise multi-turn behaviour without persisting a + # + # @param use_knowledge_base [Boolean] Set false to skip retrieval and isolate prompt behaviour from the knowledge base + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::AgentTestResponse] + # + # @see Zavudev::Models::AgentTestParams + def test_(agent_id, params) + parsed, options = Zavudev::AgentTestParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/agents/%1$s/test", agent_id], + body: parsed, + model: Zavudev::Models::AgentTestResponse, + options: options + ) + end + + # @api private + # + # @param client [Zavudev::Client] + def initialize(client:) + @client = client + @senders = Zavudev::Resources::Agents::Senders.new(client: client) + end + end + end +end diff --git a/lib/zavudev/resources/agents/senders.rb b/lib/zavudev/resources/agents/senders.rb new file mode 100644 index 0000000..b1098dd --- /dev/null +++ b/lib/zavudev/resources/agents/senders.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Zavudev + module Resources + class Agents + class Senders + # Make the agent answer on this sender. An agent can serve several senders; a + # sender answers with at most one agent, so connecting one that is already in use + # returns `400` naming the agent that holds it. + # + # @overload connect(agent_id, sender_id:, request_options: {}) + # + # @param agent_id [String] Agent ID. + # + # @param sender_id [String] Sender to connect. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Agents::SenderConnectResponse] + # + # @see Zavudev::Models::Agents::SenderConnectParams + def connect(agent_id, params) + parsed, options = Zavudev::Agents::SenderConnectParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/agents/%1$s/senders", agent_id], + body: parsed, + model: Zavudev::Models::Agents::SenderConnectResponse, + options: options + ) + end + + # Stop the agent answering on this sender. The agent's primary sender is part of + # the agent itself and cannot be disconnected here. + # + # @overload disconnect(sender_id, agent_id:, request_options: {}) + # + # @param sender_id [String] + # + # @param agent_id [String] Agent ID. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Zavudev::Models::Agents::SenderDisconnectParams + def disconnect(sender_id, params) + parsed, options = Zavudev::Agents::SenderDisconnectParams.dump_request(params) + agent_id = + parsed.delete(:agent_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: ["v1/agents/%1$s/senders/%2$s", agent_id, sender_id], + model: NilClass, + options: options + ) + end + + # @api private + # + # @param client [Zavudev::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/zavudev/resources/calls.rb b/lib/zavudev/resources/calls.rb new file mode 100644 index 0000000..11bc1f8 --- /dev/null +++ b/lib/zavudev/resources/calls.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +module Zavudev + module Resources + class Calls + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallCreateParams} for more details. + # + # Place an outbound voice call answered by the voice agent configured on the + # sender. Zavu dials the recipient and runs the conversation through its managed + # voice pipeline (speech recognition, the agent's LLM, and speech synthesis, with + # real-time interruption handling). + # + # **Requirements:** + # + # - The Voice Agents feature must be enabled for your team (otherwise `403`). + # - The sender's agent must have `voice.enabled` set to `true`. + # - Not available with test-mode API keys. + # + # **Billing:** Voice calls are billed per minute of connected time plus telephony, + # deducted from your prepaid balance. A short-duration estimate is reserved when + # the call is placed; you are charged for the actual duration when the call ends. + # + # @overload create(to:, greeting: nil, language: nil, max_duration_minutes: nil, metadata: nil, sender_id: nil, request_options: {}) + # + # @param to [String] Recipient phone number in E.164 format. + # + # @param greeting [String] Overrides the agent's configured greeting for this call only. + # + # @param language [String] Language the agent speaks on this call only, as a BCP-47 tag (`en`, `es`, `es-ES + # + # @param max_duration_minutes [Integer] Overrides the agent's maximum call duration for this call only. + # + # @param metadata [Hash{Symbol=>String}] Arbitrary metadata to associate with the call. Returned on the call object and i + # + # @param sender_id [String] Sender profile that places the call. Uses the project's default sender if omitte + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::CallCreateResponse] + # + # @see Zavudev::Models::CallCreateParams + def create(params) + parsed, options = Zavudev::CallCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/calls", + body: parsed, + model: Zavudev::Models::CallCreateResponse, + options: options + ) + end + + # Retrieve a single voice call, including its full transcript once the + # conversation has produced turns. + # + # @overload retrieve(call_id, request_options: {}) + # + # @param call_id [String] Voice call ID. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::CallRetrieveResponse] + # + # @see Zavudev::Models::CallRetrieveParams + def retrieve(call_id, params = {}) + @client.request( + method: :get, + path: ["v1/calls/%1$s", call_id], + model: Zavudev::Models::CallRetrieveResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Zavudev::Models::CallListParams} for more details. + # + # List voice calls for this project, most recent first. Transcripts are omitted + # from the list; fetch a single call to get its transcript. + # + # @overload list(cursor: nil, direction: nil, limit: nil, status: nil, request_options: {}) + # + # @param cursor [String] + # + # @param direction [Symbol, Zavudev::Models::CallListParams::Direction] Whether the call was placed by Zavu (outbound) or received from a caller (inboun + # + # @param limit [Integer] + # + # @param status [Symbol, Zavudev::Models::CallListParams::Status] Lifecycle status of a voice call. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Internal::Cursor] + # + # @see Zavudev::Models::CallListParams + def list(params = {}) + parsed, options = Zavudev::CallListParams.dump_request(params) + query = Zavudev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/calls", + query: query, + page: Zavudev::Internal::Cursor, + model: Zavudev::Models::CallListResponse, + options: options + ) + end + + # End an active voice call. The call must still be ringing or in progress. Not + # available with test-mode API keys. + # + # @overload hangup(call_id, request_options: {}) + # + # @param call_id [String] Voice call ID. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::CallHangupResponse] + # + # @see Zavudev::Models::CallHangupParams + def hangup(call_id, params = {}) + @client.request( + method: :post, + path: ["v1/calls/%1$s/hangup", call_id], + model: Zavudev::Models::CallHangupResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Zavudev::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/zavudev/resources/conversations.rb b/lib/zavudev/resources/conversations.rb new file mode 100644 index 0000000..e6b91f5 --- /dev/null +++ b/lib/zavudev/resources/conversations.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +module Zavudev + module Resources + class Conversations + # Get conversation + # + # @overload retrieve(conversation_id, request_options: {}) + # + # @param conversation_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::ConversationRetrieveResponse] + # + # @see Zavudev::Models::ConversationRetrieveParams + def retrieve(conversation_id, params = {}) + @client.request( + method: :get, + path: ["v1/conversations/%1$s", conversation_id], + model: Zavudev::Models::ConversationRetrieveResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ConversationListParams} for more details. + # + # List inbox threads, most recently active first. A conversation groups every + # message with one contact across channels, which is what you need to build an + # inbox: `GET /v1/messages` returns a flat log with no thread to hang it on. + # + # Use `senderId` to scope the list to a single number, and `channel` to keep only + # threads that have carried that channel. + # + # @overload list(channel: nil, cursor: nil, limit: nil, search: nil, sender_id: nil, request_options: {}) + # + # @param channel [Symbol, Zavudev::Models::ConversationListParams::Channel] Keep only threads that have carried this channel. + # + # @param cursor [String] Opaque cursor from a previous response's `nextCursor`. Do not construct it. + # + # @param limit [Integer] + # + # @param search [String] Search threads by identity: phone number (any format — `+1 (555) 123-4567` and ` + # + # @param sender_id [String] Keep only threads last handled by this sender. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Internal::Cursor] + # + # @see Zavudev::Models::ConversationListParams + def list(params = {}) + parsed, options = Zavudev::ConversationListParams.dump_request(params) + query = Zavudev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/conversations", + query: query.transform_keys(sender_id: "senderId"), + page: Zavudev::Internal::Cursor, + model: Zavudev::Models::ConversationListResponse, + options: options + ) + end + + # Messages in this thread, newest first, across every channel it has carried. + # Reply with `POST /v1/messages`, passing the conversation's `senderId` as the + # `Zavu-Sender` header so the answer leaves from the number the contact already + # knows. + # + # @overload list_messages(conversation_id, cursor: nil, limit: nil, request_options: {}) + # + # @param conversation_id [String] + # + # @param cursor [String] Opaque cursor from a previous response's `nextCursor`. + # + # @param limit [Integer] + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Internal::Cursor] + # + # @see Zavudev::Models::ConversationListMessagesParams + def list_messages(conversation_id, params = {}) + parsed, options = Zavudev::ConversationListMessagesParams.dump_request(params) + query = Zavudev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/conversations/%1$s/messages", conversation_id], + query: query, + page: Zavudev::Internal::Cursor, + model: Zavudev::Message, + options: options + ) + end + + # Reset the thread's `unreadCount` to zero. Marks the thread read in your own + # inbox only: it does not send a read receipt to the contact. + # + # @overload mark_as_read(conversation_id, request_options: {}) + # + # @param conversation_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::ConversationMarkAsReadResponse] + # + # @see Zavudev::Models::ConversationMarkAsReadParams + def mark_as_read(conversation_id, params = {}) + @client.request( + method: :post, + path: ["v1/conversations/%1$s/read", conversation_id], + model: Zavudev::Models::ConversationMarkAsReadResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Zavudev::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/zavudev/resources/email_domains.rb b/lib/zavudev/resources/email_domains.rb new file mode 100644 index 0000000..a5d67b2 --- /dev/null +++ b/lib/zavudev/resources/email_domains.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +module Zavudev + module Resources + class EmailDomains + # Add a domain to send email from. Returns the DNS records to publish (DKIM CNAMEs + # are required; SPF, DMARC, and MAIL FROM are recommended). Publish them at your + # DNS provider, then verify. + # + # @overload create(domain:, request_options: {}) + # + # @param domain [String] Bare domain, e.g. example.com. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::EmailDomainCreateResponse] + # + # @see Zavudev::Models::EmailDomainCreateParams + def create(params) + parsed, options = Zavudev::EmailDomainCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/email-domains", + body: parsed, + model: Zavudev::Models::EmailDomainCreateResponse, + options: options + ) + end + + # Fetch a domain with its DNS records and current status. + # + # @overload retrieve(domain_id, request_options: {}) + # + # @param domain_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::EmailDomainRetrieveResponse] + # + # @see Zavudev::Models::EmailDomainRetrieveParams + def retrieve(domain_id, params = {}) + @client.request( + method: :get, + path: ["v1/email-domains/%1$s", domain_id], + model: Zavudev::Models::EmailDomainRetrieveResponse, + options: params[:request_options] + ) + end + + # List email domains + # + # @overload list(request_options: {}) + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::EmailDomainListResponse] + # + # @see Zavudev::Models::EmailDomainListParams + def list(params = {}) + @client.request( + method: :get, + path: "v1/email-domains", + model: Zavudev::Models::EmailDomainListResponse, + options: params[:request_options] + ) + end + + # Remove an email domain + # + # @overload delete(domain_id, request_options: {}) + # + # @param domain_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Zavudev::Models::EmailDomainDeleteParams + def delete(domain_id, params = {}) + @client.request( + method: :delete, + path: ["v1/email-domains/%1$s", domain_id], + model: NilClass, + options: params[:request_options] + ) + end + + # Re-check the domain's published DNS records and refresh its status. + # + # @overload verify(domain_id, request_options: {}) + # + # @param domain_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::EmailDomainVerifyResponse] + # + # @see Zavudev::Models::EmailDomainVerifyParams + def verify(domain_id, params = {}) + @client.request( + method: :post, + path: ["v1/email-domains/%1$s/verify", domain_id], + model: Zavudev::Models::EmailDomainVerifyResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Zavudev::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/zavudev/resources/functions.rb b/lib/zavudev/resources/functions.rb index 0ee1a6b..f5d90d5 100644 --- a/lib/zavudev/resources/functions.rb +++ b/lib/zavudev/resources/functions.rb @@ -6,6 +6,12 @@ class Functions # @return [Zavudev::Resources::Functions::Secrets] attr_reader :secrets + # @return [Zavudev::Resources::Functions::Triggers] + attr_reader :triggers + + # @return [Zavudev::Resources::Functions::GitLink] + attr_reader :git_link + # Some parameter documentations has been truncated, see # {Zavudev::Models::FunctionCreateParams} for more details. # @@ -193,6 +199,80 @@ def get_deployment(deployment_id, params = {}) ) end + # List a function's deployment history, newest first. Source code is omitted; + # fetch a single deployment via GET /v1/functions/deployments/{deploymentId} for + # full details. + # + # @overload list_deployments(function_id, limit: nil, request_options: {}) + # + # @param function_id [String] Zavu Function ID. + # + # @param limit [Integer] + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::FunctionListDeploymentsResponse] + # + # @see Zavudev::Models::FunctionListDeploymentsParams + def list_deployments(function_id, params = {}) + parsed, options = Zavudev::FunctionListDeploymentsParams.dump_request(params) + query = Zavudev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/functions/%1$s/deployments", function_id], + query: query, + model: Zavudev::Models::FunctionListDeploymentsResponse, + options: options + ) + end + + # List the event types a function trigger can subscribe to. Includes the special + # type `cron`, which fires on a schedule (see POST + # /v1/functions/{functionId}/triggers) rather than on a messaging event. + # + # @overload list_event_types(request_options: {}) + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::FunctionListEventTypesResponse] + # + # @see Zavudev::Models::FunctionListEventTypesParams + def list_event_types(params = {}) + @client.request( + method: :get, + path: "v1/functions/event-types", + model: Zavudev::Models::FunctionListEventTypesResponse, + options: params[:request_options] + ) + end + + # Re-deploy a previous version by copying its source, dependencies, and runtime + # pin onto the function's draft, then deploying. Returns immediately with a + # deployment ID — poll GET /v1/functions/deployments/{deploymentId} until status + # is active or failed. Secrets are not rolled back. + # + # @overload rollback_deployment(function_id, deployment_id:, request_options: {}) + # + # @param function_id [String] Zavu Function ID. + # + # @param deployment_id [String] ID of the deployment to roll back to. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::FunctionRollbackDeploymentResponse] + # + # @see Zavudev::Models::FunctionRollbackDeploymentParams + def rollback_deployment(function_id, params) + parsed, options = Zavudev::FunctionRollbackDeploymentParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/functions/%1$s/rollback", function_id], + body: parsed, + model: Zavudev::Models::FunctionRollbackDeploymentResponse, + options: options + ) + end + # Fetch invocation logs for a function. Logs are paginated via `nextToken`. Pass # `startTime` / `endTime` (Unix epoch milliseconds) to bound the window, or # `filterPattern` to filter messages. @@ -239,6 +319,8 @@ def tail_logs(function_id, params = {}) def initialize(client:) @client = client @secrets = Zavudev::Resources::Functions::Secrets.new(client: client) + @triggers = Zavudev::Resources::Functions::Triggers.new(client: client) + @git_link = Zavudev::Resources::Functions::GitLink.new(client: client) end end end diff --git a/lib/zavudev/resources/functions/git_link.rb b/lib/zavudev/resources/functions/git_link.rb new file mode 100644 index 0000000..407c625 --- /dev/null +++ b/lib/zavudev/resources/functions/git_link.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +module Zavudev + module Resources + class Functions + class GitLink + # The link and its last deploy. Never returns the webhook secret. + # + # @overload retrieve(function_id, request_options: {}) + # + # @param function_id [String] Zavu Function ID. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Functions::GitLinkRetrieveResponse] + # + # @see Zavudev::Models::Functions::GitLinkRetrieveParams + def retrieve(function_id, params = {}) + @client.request( + method: :get, + path: ["v1/functions/%1$s/git-link", function_id], + model: Zavudev::Models::Functions::GitLinkRetrieveResponse, + options: params[:request_options] + ) + end + + # Change the branch, the root directory, or whether pushes deploy. Pass at least + # one field. `rootDir: null` clears the subdirectory. + # + # @overload update(function_id, auto_deploy: nil, branch: nil, root_dir: nil, request_options: {}) + # + # @param function_id [String] Zavu Function ID. + # + # @param auto_deploy [Boolean] + # + # @param branch [String] + # + # @param root_dir [String, nil] + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Functions::GitLinkUpdateResponse] + # + # @see Zavudev::Models::Functions::GitLinkUpdateParams + def update(function_id, params = {}) + parsed, options = Zavudev::Functions::GitLinkUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/functions/%1$s/git-link", function_id], + body: parsed, + model: Zavudev::Models::Functions::GitLinkUpdateResponse, + options: options + ) + end + + # Fetch the linked branch and deploy it without waiting for a push. Returns + # immediately; follow the outcome with `GET /v1/functions/{functionId}/git-link`, + # whose `lastStatus` and `lastError` describe the run. + # + # @overload deploy_now(function_id, request_options: {}) + # + # @param function_id [String] Zavu Function ID. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Functions::GitLinkDeployNowResponse] + # + # @see Zavudev::Models::Functions::GitLinkDeployNowParams + def deploy_now(function_id, params = {}) + @client.request( + method: :post, + path: ["v1/functions/%1$s/git-link/deploy", function_id], + model: Zavudev::Models::Functions::GitLinkDeployNowResponse, + options: params[:request_options] + ) + end + + # Bind a repository to this function so every push to `branch` deploys it. A + # function holds at most one link; linking again returns 400. + # + # **The server decides how the link authenticates.** If the project has the Zavu + # GitHub App installed, the link uses that installation: private repositories work + # and there is nothing to configure in the repository. Otherwise it falls back to + # a manual link and the response carries a `webhookSecret` you add to the + # repository yourself. `connection` says which one you got. + # + # The repository is not checked against GitHub here, because it cannot be: an + # owner/repo that does not exist, or that the installation cannot see, is accepted + # and fails on the first deploy with a fetch error. + # + # @overload link(function_id, owner:, repo:, auto_deploy: nil, branch: nil, root_dir: nil, request_options: {}) + # + # @param function_id [String] Zavu Function ID. + # + # @param owner [String] + # + # @param repo [String] + # + # @param auto_deploy [Boolean] + # + # @param branch [String] + # + # @param root_dir [String] Subdirectory holding the project, for monorepos. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Functions::GitLinkLinkResponse] + # + # @see Zavudev::Models::Functions::GitLinkLinkParams + def link(function_id, params) + parsed, options = Zavudev::Functions::GitLinkLinkParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/functions/%1$s/git-link", function_id], + body: parsed, + model: Zavudev::Models::Functions::GitLinkLinkResponse, + options: options + ) + end + + # Remove the link. The function and its deployments stay. A manual webhook left in + # the repository stops being accepted, so remove it there too. + # + # @overload unlink(function_id, request_options: {}) + # + # @param function_id [String] Zavu Function ID. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Zavudev::Models::Functions::GitLinkUnlinkParams + def unlink(function_id, params = {}) + @client.request( + method: :delete, + path: ["v1/functions/%1$s/git-link", function_id], + model: NilClass, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Zavudev::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/zavudev/resources/functions/triggers.rb b/lib/zavudev/resources/functions/triggers.rb new file mode 100644 index 0000000..06714bf --- /dev/null +++ b/lib/zavudev/resources/functions/triggers.rb @@ -0,0 +1,116 @@ +# frozen_string_literal: true + +module Zavudev + module Resources + class Functions + class Triggers + # Some parameter documentations has been truncated, see + # {Zavudev::Models::Functions::TriggerCreateParams} for more details. + # + # Subscribe a function to one or more event types, optionally scoped to specific + # senders. Provide eventTypes and senderIds (use null in senderIds for all + # senders); a trigger is created for each event type and sender combination. + # + # The special event type `cron` runs the function on a schedule instead of a + # messaging event: include a `cron` field with a 5-field UTC cron expression + # (minimum granularity one minute). A cron trigger ignores the sender axis, and a + # function may hold several cron triggers with different expressions. The function + # receives an event with `type: "cron"` and `data.cron`. + # + # @overload create(function_id, event_types:, sender_ids:, cron: nil, request_options: {}) + # + # @param function_id [String] Zavu Function ID. + # + # @param event_types [Array] Event types to subscribe to. + # + # @param sender_ids [Array] Senders to scope the triggers to. Use null for all senders. + # + # @param cron [String] Required when eventTypes includes `cron`: a 5-field cron expression (minute hour + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Functions::TriggerCreateResponse] + # + # @see Zavudev::Models::Functions::TriggerCreateParams + def create(function_id, params) + parsed, options = Zavudev::Functions::TriggerCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/functions/%1$s/triggers", function_id], + body: parsed, + model: Zavudev::Models::Functions::TriggerCreateResponse, + options: options + ) + end + + # Enable or disable a trigger + # + # @overload update(trigger_id, active:, request_options: {}) + # + # @param trigger_id [String] + # @param active [Boolean] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Functions::TriggerUpdateResponse] + # + # @see Zavudev::Models::Functions::TriggerUpdateParams + def update(trigger_id, params) + parsed, options = Zavudev::Functions::TriggerUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/functions/triggers/%1$s", trigger_id], + body: parsed, + model: Zavudev::Models::Functions::TriggerUpdateResponse, + options: options + ) + end + + # List function triggers + # + # @overload list(function_id, request_options: {}) + # + # @param function_id [String] Zavu Function ID. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Functions::TriggerListResponse] + # + # @see Zavudev::Models::Functions::TriggerListParams + def list(function_id, params = {}) + @client.request( + method: :get, + path: ["v1/functions/%1$s/triggers", function_id], + model: Zavudev::Models::Functions::TriggerListResponse, + options: params[:request_options] + ) + end + + # Delete a trigger + # + # @overload delete(trigger_id, request_options: {}) + # + # @param trigger_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Zavudev::Models::Functions::TriggerDeleteParams + def delete(trigger_id, params = {}) + @client.request( + method: :delete, + path: ["v1/functions/triggers/%1$s", trigger_id], + model: NilClass, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Zavudev::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/zavudev/resources/introspect.rb b/lib/zavudev/resources/introspect.rb index 7b19927..5c42e7f 100644 --- a/lib/zavudev/resources/introspect.rb +++ b/lib/zavudev/resources/introspect.rb @@ -3,6 +3,39 @@ module Zavudev module Resources class Introspect + # Heuristic email validation to run before sending: catches invalid syntax, dead + # domains (no MX/A records), disposable inboxes, role-based addresses (info@, + # contacto@, sales@), and addresses already on your project's suppression list. + # Use it to clean a list before a broadcast and keep your bounce rate low. + # + # No mailbox-level (SMTP) probe is performed, so a `deliverable` verdict is not a + # delivery guarantee — it means no negative signal was found. Treat `risky` + # addresses with care and drop `undeliverable` ones. + # + # Accepts a single `email` or an `emails` batch (max 100 per request). + # + # @overload validate_email(email: nil, emails: nil, request_options: {}) + # + # @param email [String] Single email address to validate. + # + # @param emails [Array] Batch of email addresses to validate (max 100). + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::IntrospectValidateEmailResponse] + # + # @see Zavudev::Models::IntrospectValidateEmailParams + def validate_email(params = {}) + parsed, options = Zavudev::IntrospectValidateEmailParams.dump_request(params) + @client.request( + method: :post, + path: "v1/introspect/email", + body: parsed, + model: Zavudev::Models::IntrospectValidateEmailResponse, + options: options + ) + end + # Validate a phone number and check if a WhatsApp conversation window is open. # # @overload validate_phone(phone_number:, request_options: {}) diff --git a/lib/zavudev/resources/messages.rb b/lib/zavudev/resources/messages.rb index a40b4bc..cc1dd94 100644 --- a/lib/zavudev/resources/messages.rb +++ b/lib/zavudev/resources/messages.rb @@ -54,6 +54,30 @@ def list(params = {}) ) end + # List the stored file attachments for an email message and get a short-lived + # signed `downloadUrl` for each. Works for both inbound emails (received via + # `message.inbound`) and outbound emails you sent with attachments. Messages + # without stored attachments (including SMS, WhatsApp, and other channels) return + # an empty list. Each `downloadUrl` is generated fresh per request and expires — + # fetch the file promptly and do not cache the URL. + # + # @overload list_attachments(message_id, request_options: {}) + # + # @param message_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::MessageListAttachmentsResponse] + # + # @see Zavudev::Models::MessageListAttachmentsParams + def list_attachments(message_id, params = {}) + @client.request( + method: :get, + path: ["v1/messages/%1$s/attachments", message_id], + model: Zavudev::Models::MessageListAttachmentsResponse, + options: params[:request_options] + ) + end + # Some parameter documentations has been truncated, see # {Zavudev::Models::MessageReactParams} for more details. # diff --git a/lib/zavudev/resources/senders.rb b/lib/zavudev/resources/senders.rb index f82d870..d01e7c7 100644 --- a/lib/zavudev/resources/senders.rb +++ b/lib/zavudev/resources/senders.rb @@ -9,6 +9,9 @@ class Senders # @return [Zavudev::Resources::Senders::WhatsappSync] attr_reader :whatsapp_sync + # @return [Zavudev::Resources::Senders::Telegram] + attr_reader :telegram + # Some parameter documentations has been truncated, see # {Zavudev::Models::SenderCreateParams} for more details. # @@ -278,6 +281,7 @@ def initialize(client:) @client = client @agent = Zavudev::Resources::Senders::Agent.new(client: client) @whatsapp_sync = Zavudev::Resources::Senders::WhatsappSync.new(client: client) + @telegram = Zavudev::Resources::Senders::Telegram.new(client: client) end end end diff --git a/lib/zavudev/resources/senders/agent/knowledge_bases/documents.rb b/lib/zavudev/resources/senders/agent/knowledge_bases/documents.rb index abaaf2c..e077dc4 100644 --- a/lib/zavudev/resources/senders/agent/knowledge_bases/documents.rb +++ b/lib/zavudev/resources/senders/agent/knowledge_bases/documents.rb @@ -103,6 +103,77 @@ def delete(doc_id, params) ) end + # Get a single document from a knowledge base. + # + # @overload retrieve_document(doc_id, sender_id:, kb_id:, request_options: {}) + # + # @param doc_id [String] + # @param sender_id [String] + # @param kb_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentRetrieveDocumentResponse] + # + # @see Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentRetrieveDocumentParams + def retrieve_document(doc_id, params) + parsed, options = + Zavudev::Senders::Agent::KnowledgeBases::DocumentRetrieveDocumentParams.dump_request(params) + sender_id = + parsed.delete(:sender_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + kb_id = + parsed.delete(:kb_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/senders/%1$s/agent/knowledge-bases/%2$s/documents/%3$s", sender_id, kb_id, doc_id], + model: Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentRetrieveDocumentResponse, + options: options + ) + end + + # Update a document's title or content. Updating content reprocesses the document + # for RAG. + # + # @overload update_document(doc_id, sender_id:, kb_id:, content: nil, title: nil, request_options: {}) + # + # @param doc_id [String] Path param + # + # @param sender_id [String] Path param + # + # @param kb_id [String] Path param + # + # @param content [String] Body param + # + # @param title [String] Body param + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentUpdateDocumentResponse] + # + # @see Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentUpdateDocumentParams + def update_document(doc_id, params) + parsed, options = + Zavudev::Senders::Agent::KnowledgeBases::DocumentUpdateDocumentParams.dump_request(params) + sender_id = + parsed.delete(:sender_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + kb_id = + parsed.delete(:kb_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :patch, + path: ["v1/senders/%1$s/agent/knowledge-bases/%2$s/documents/%3$s", sender_id, kb_id, doc_id], + body: parsed, + model: Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentUpdateDocumentResponse, + options: options + ) + end + # @api private # # @param client [Zavudev::Client] diff --git a/lib/zavudev/resources/senders/agent/tools.rb b/lib/zavudev/resources/senders/agent/tools.rb index b19d891..6d876c9 100644 --- a/lib/zavudev/resources/senders/agent/tools.rb +++ b/lib/zavudev/resources/senders/agent/tools.rb @@ -5,6 +5,9 @@ module Resources class Senders class Agent class Tools + # @return [Zavudev::Resources::Senders::Agent::Tools::Webhook] + attr_reader :webhook + # Some parameter documentations has been truncated, see # {Zavudev::Models::Senders::Agent::ToolCreateParams} for more details. # @@ -158,6 +161,39 @@ def delete(tool_id, params) ) end + # Recent runs of this tool triggered from the test endpoint, newest first. Covers + # manual tests only: a tool called by an agent during a real conversation is not + # recorded here. + # + # @overload list_test_runs(tool_id, sender_id:, limit: nil, request_options: {}) + # + # @param tool_id [String] Path param + # + # @param sender_id [String] Path param + # + # @param limit [Integer] Query param + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Senders::Agent::ToolListTestRunsResponse] + # + # @see Zavudev::Models::Senders::Agent::ToolListTestRunsParams + def list_test_runs(tool_id, params) + parsed, options = Zavudev::Senders::Agent::ToolListTestRunsParams.dump_request(params) + query = Zavudev::Internal::Util.encode_query_params(parsed) + sender_id = + parsed.delete(:sender_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/senders/%1$s/agent/tools/%2$s/test-runs", sender_id, tool_id], + query: query, + model: Zavudev::Models::Senders::Agent::ToolListTestRunsResponse, + options: options + ) + end + # Run a tool with the parameters you supply and return what it answered. # # The call is synchronous: the response carries the tool's status, body, and @@ -202,6 +238,7 @@ def test_(tool_id, params) # @param client [Zavudev::Client] def initialize(client:) @client = client + @webhook = Zavudev::Resources::Senders::Agent::Tools::Webhook.new(client: client) end end end diff --git a/lib/zavudev/resources/senders/agent/tools/webhook.rb b/lib/zavudev/resources/senders/agent/tools/webhook.rb new file mode 100644 index 0000000..4db4f95 --- /dev/null +++ b/lib/zavudev/resources/senders/agent/tools/webhook.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Zavudev + module Resources + class Senders + class Agent + class Tools + class Webhook + # Generate a new signing secret for this tool. The previous one stops working on + # the next call, with no overlap, so update your endpoint first. The tool keeps + # its id, so flows that reference it by name are unaffected. + # + # @overload rotate_secret(tool_id, sender_id:, request_options: {}) + # + # @param tool_id [String] + # @param sender_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::WebhookSecretResponse] + # + # @see Zavudev::Models::Senders::Agent::Tools::WebhookRotateSecretParams + def rotate_secret(tool_id, params) + parsed, options = Zavudev::Senders::Agent::Tools::WebhookRotateSecretParams.dump_request(params) + sender_id = + parsed.delete(:sender_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :post, + path: ["v1/senders/%1$s/agent/tools/%2$s/webhook/secret", sender_id, tool_id], + model: Zavudev::WebhookSecretResponse, + options: options + ) + end + + # @api private + # + # @param client [Zavudev::Client] + def initialize(client:) + @client = client + end + end + end + end + end + end +end diff --git a/lib/zavudev/resources/senders/telegram.rb b/lib/zavudev/resources/senders/telegram.rb new file mode 100644 index 0000000..3cd34f2 --- /dev/null +++ b/lib/zavudev/resources/senders/telegram.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Zavudev + module Resources + class Senders + class Telegram + # Connect a Telegram bot to a sender. Provide the bot token from @BotFather; Zavu + # validates it, registers the webhook, and routes the sender's Telegram messages + # through it. + # + # @overload connect(sender_id, bot_token:, request_options: {}) + # + # @param sender_id [String] + # + # @param bot_token [String] Bot token from @BotFather. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::Senders::TelegramConnectResponse] + # + # @see Zavudev::Models::Senders::TelegramConnectParams + def connect(sender_id, params) + parsed, options = Zavudev::Senders::TelegramConnectParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/senders/%1$s/telegram", sender_id], + body: parsed, + model: Zavudev::Models::Senders::TelegramConnectResponse, + options: options + ) + end + + # Disconnect Telegram from a sender and remove the webhook. + # + # @overload disconnect(sender_id, request_options: {}) + # + # @param sender_id [String] + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Zavudev::Models::Senders::TelegramDisconnectParams + def disconnect(sender_id, params = {}) + @client.request( + method: :delete, + path: ["v1/senders/%1$s/telegram", sender_id], + model: NilClass, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Zavudev::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/zavudev/resources/templates.rb b/lib/zavudev/resources/templates.rb index e06c982..bf86322 100644 --- a/lib/zavudev/resources/templates.rb +++ b/lib/zavudev/resources/templates.rb @@ -142,6 +142,51 @@ def submit(template_id, params) ) end + # Some parameter documentations has been truncated, see + # {Zavudev::Models::TemplateSyncParams} for more details. + # + # Reconcile this project's templates against WhatsApp. Two things happen per + # connected WhatsApp Business Account: templates that exist on Meta but not in + # Zavu are imported (or linked to an existing template with the same name), and + # the approval status of the templates Zavu already knows about is refreshed from + # Meta. + # + # This is what to call when a template was created outside Zavu — in Meta Business + # Manager, or by another tool — or when a `template.status_changed` webhook was + # missed and a template is stuck in `pending`. Status changes normally arrive by + # webhook; this endpoint is the recovery path and the only path for a template + # Zavu never created. + # + # Templates that Meta reports as rejected or disabled are not imported; they are + # counted in `skipped`. Existing local templates are matched first by Meta + # template ID, then by name. + # + # By default every sender in the project with a WhatsApp Business Account is + # synced. Pass `senderId` to sync only that sender's account. The call is + # synchronous — it waits for Meta and returns what changed — so it can take a few + # seconds per account. A failure on one account does not fail the request: it is + # reported in `errors` and the remaining accounts are still synced. + # + # @overload sync(sender_id: nil, request_options: {}) + # + # @param sender_id [String] Sync only the WhatsApp Business Account attached to this sender. If omitted, eve + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::TemplateSyncResponse] + # + # @see Zavudev::Models::TemplateSyncParams + def sync(params = {}) + parsed, options = Zavudev::TemplateSyncParams.dump_request(params) + @client.request( + method: :post, + path: "v1/templates/sync", + body: parsed, + model: Zavudev::Models::TemplateSyncResponse, + options: options + ) + end + # @api private # # @param client [Zavudev::Client] diff --git a/lib/zavudev/resources/urls.rb b/lib/zavudev/resources/urls.rb index fb5a287..3a86dbe 100644 --- a/lib/zavudev/resources/urls.rb +++ b/lib/zavudev/resources/urls.rb @@ -3,6 +3,31 @@ module Zavudev module Resources class URLs + # Request manual review of a rejected URL. Only URLs in 'rejected' status can be + # escalated; the status then moves to 'escalated'. + # + # @overload escalate(url_id, reason:, request_options: {}) + # + # @param url_id [String] + # + # @param reason [String] Why the URL should be reviewed manually. + # + # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Zavudev::Models::URLEscalateResponse] + # + # @see Zavudev::Models::URLEscalateParams + def escalate(url_id, params) + parsed, options = Zavudev::URLEscalateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/urls/%1$s/escalate", url_id], + body: parsed, + model: Zavudev::Models::URLEscalateResponse, + options: options + ) + end + # List URLs that have been verified for this project. # # @overload list_verified(cursor: nil, limit: nil, status: nil, request_options: {}) diff --git a/rbi/zavudev/client.rbi b/rbi/zavudev/client.rbi index 09bbdc2..aa64ba4 100644 --- a/rbi/zavudev/client.rbi +++ b/rbi/zavudev/client.rbi @@ -61,6 +61,21 @@ module Zavudev sig { returns(Zavudev::Resources::Functions) } attr_reader :functions + sig { returns(Zavudev::Resources::Conversations) } + attr_reader :conversations + + sig { returns(Zavudev::Resources::Calls) } + attr_reader :calls + + sig { returns(Zavudev::Resources::AgentTemplates) } + attr_reader :agent_templates + + sig { returns(Zavudev::Resources::EmailDomains) } + attr_reader :email_domains + + sig { returns(Zavudev::Resources::Agents) } + attr_reader :agents + # @api private sig { override.returns(T::Hash[String, String]) } private def auth_headers diff --git a/rbi/zavudev/models.rbi b/rbi/zavudev/models.rbi index c9d45c3..09270c3 100644 --- a/rbi/zavudev/models.rbi +++ b/rbi/zavudev/models.rbi @@ -13,6 +13,26 @@ module Zavudev AddressStatus = Zavudev::Models::AddressStatus + AgentCreateParams = Zavudev::Models::AgentCreateParams + + AgentDeleteParams = Zavudev::Models::AgentDeleteParams + + AgentListParams = Zavudev::Models::AgentListParams + + AgentListVoicesParams = Zavudev::Models::AgentListVoicesParams + + AgentRetrieveParams = Zavudev::Models::AgentRetrieveParams + + Agents = Zavudev::Models::Agents + + AgentTemplateListParams = Zavudev::Models::AgentTemplateListParams + + AgentTemplateRetrieveParams = Zavudev::Models::AgentTemplateRetrieveParams + + AgentTestParams = Zavudev::Models::AgentTestParams + + AgentUpdateParams = Zavudev::Models::AgentUpdateParams + AvailablePhoneNumber = Zavudev::Models::AvailablePhoneNumber BalanceRetrieveParams = Zavudev::Models::BalanceRetrieveParams @@ -57,6 +77,14 @@ module Zavudev BroadcastUpdateParams = Zavudev::Models::BroadcastUpdateParams + CallCreateParams = Zavudev::Models::CallCreateParams + + CallHangupParams = Zavudev::Models::CallHangupParams + + CallListParams = Zavudev::Models::CallListParams + + CallRetrieveParams = Zavudev::Models::CallRetrieveParams + Channel = Zavudev::Models::Channel Contact = Zavudev::Models::Contact @@ -82,6 +110,25 @@ module Zavudev ContactUpdateParams = Zavudev::Models::ContactUpdateParams + ConversationListMessagesParams = + Zavudev::Models::ConversationListMessagesParams + + ConversationListParams = Zavudev::Models::ConversationListParams + + ConversationMarkAsReadParams = Zavudev::Models::ConversationMarkAsReadParams + + ConversationRetrieveParams = Zavudev::Models::ConversationRetrieveParams + + EmailDomainCreateParams = Zavudev::Models::EmailDomainCreateParams + + EmailDomainDeleteParams = Zavudev::Models::EmailDomainDeleteParams + + EmailDomainListParams = Zavudev::Models::EmailDomainListParams + + EmailDomainRetrieveParams = Zavudev::Models::EmailDomainRetrieveParams + + EmailDomainVerifyParams = Zavudev::Models::EmailDomainVerifyParams + FunctionCreateParams = Zavudev::Models::FunctionCreateParams FunctionDeleteParams = Zavudev::Models::FunctionDeleteParams @@ -90,14 +137,23 @@ module Zavudev FunctionGetDeploymentParams = Zavudev::Models::FunctionGetDeploymentParams + FunctionListDeploymentsParams = Zavudev::Models::FunctionListDeploymentsParams + + FunctionListEventTypesParams = Zavudev::Models::FunctionListEventTypesParams + FunctionRetrieveParams = Zavudev::Models::FunctionRetrieveParams + FunctionRollbackDeploymentParams = + Zavudev::Models::FunctionRollbackDeploymentParams + Functions = Zavudev::Models::Functions FunctionTailLogsParams = Zavudev::Models::FunctionTailLogsParams FunctionUpdateParams = Zavudev::Models::FunctionUpdateParams + IntrospectValidateEmailParams = Zavudev::Models::IntrospectValidateEmailParams + IntrospectValidatePhoneParams = Zavudev::Models::IntrospectValidatePhoneParams Invitation = Zavudev::Models::Invitation @@ -118,6 +174,8 @@ module Zavudev MessageContent = Zavudev::Models::MessageContent + MessageListAttachmentsParams = Zavudev::Models::MessageListAttachmentsParams + MessageListParams = Zavudev::Models::MessageListParams MessageReactParams = Zavudev::Models::MessageReactParams @@ -241,6 +299,10 @@ module Zavudev TemplateSubmitParams = Zavudev::Models::TemplateSubmitParams + TemplateSyncParams = Zavudev::Models::TemplateSyncParams + + URLEscalateParams = Zavudev::Models::URLEscalateParams + URLListVerifiedParams = Zavudev::Models::URLListVerifiedParams URLRetrieveDetailsParams = Zavudev::Models::URLRetrieveDetailsParams diff --git a/rbi/zavudev/models/agent_create_params.rbi b/rbi/zavudev/models/agent_create_params.rbi new file mode 100644 index 0000000..c78c14c --- /dev/null +++ b/rbi/zavudev/models/agent_create_params.rbi @@ -0,0 +1,417 @@ +# typed: strong + +module Zavudev + module Models + class AgentCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::AgentCreateParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :model + + sig { returns(String) } + attr_accessor :name + + # LLM provider for the AI agent. + sig { returns(Zavudev::Senders::AgentProvider::OrSymbol) } + attr_accessor :provider + + sig { returns(String) } + attr_accessor :system_prompt + + sig { returns(T.nilable(Integer)) } + attr_reader :context_window_messages + + sig { params(context_window_messages: Integer).void } + attr_writer :context_window_messages + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_contact_metadata + + sig { params(include_contact_metadata: T::Boolean).void } + attr_writer :include_contact_metadata + + sig { returns(T.nilable(Integer)) } + attr_reader :max_tokens + + sig { params(max_tokens: Integer).void } + attr_writer :max_tokens + + sig { returns(T.nilable(Float)) } + attr_reader :temperature + + sig { params(temperature: Float).void } + attr_writer :temperature + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :trigger_on_channels + + sig { params(trigger_on_channels: T::Array[String]).void } + attr_writer :trigger_on_channels + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :trigger_on_message_types + + sig { params(trigger_on_message_types: T::Array[String]).void } + attr_writer :trigger_on_message_types + + # Voice Agent configuration on a sender's AI agent. Controls how the agent behaves + # on inbound and outbound phone calls through Zavu's managed voice pipeline + # (speech recognition, the agent's LLM, and speech synthesis, with real-time + # interruption handling). Requires the Voice Agents feature to be enabled for your + # team. + sig { returns(T.nilable(Zavudev::AgentCreateParams::Voice)) } + attr_reader :voice + + sig { params(voice: Zavudev::AgentCreateParams::Voice::OrHash).void } + attr_writer :voice + + sig do + params( + model: String, + name: String, + provider: Zavudev::Senders::AgentProvider::OrSymbol, + system_prompt: String, + context_window_messages: Integer, + include_contact_metadata: T::Boolean, + max_tokens: Integer, + temperature: Float, + trigger_on_channels: T::Array[String], + trigger_on_message_types: T::Array[String], + voice: Zavudev::AgentCreateParams::Voice::OrHash, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + model:, + name:, + # LLM provider for the AI agent. + provider:, + system_prompt:, + context_window_messages: nil, + include_contact_metadata: nil, + max_tokens: nil, + temperature: nil, + trigger_on_channels: nil, + trigger_on_message_types: nil, + # Voice Agent configuration on a sender's AI agent. Controls how the agent behaves + # on inbound and outbound phone calls through Zavu's managed voice pipeline + # (speech recognition, the agent's LLM, and speech synthesis, with real-time + # interruption handling). Requires the Voice Agents feature to be enabled for your + # team. + voice: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + model: String, + name: String, + provider: Zavudev::Senders::AgentProvider::OrSymbol, + system_prompt: String, + context_window_messages: Integer, + include_contact_metadata: T::Boolean, + max_tokens: Integer, + temperature: Float, + trigger_on_channels: T::Array[String], + trigger_on_message_types: T::Array[String], + voice: Zavudev::AgentCreateParams::Voice, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + + class Voice < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Zavudev::AgentCreateParams::Voice, Zavudev::Internal::AnyHash) + end + + # Whether the agent handles voice calls. When false, the sender's number is not + # answered by the voice agent and outbound calls are rejected. + sig { returns(T::Boolean) } + attr_accessor :enabled + + # Opening line the agent speaks when the call connects. If omitted, the agent + # waits for the caller to speak first. + sig { returns(T.nilable(String)) } + attr_reader :greeting + + sig { params(greeting: String).void } + attr_writer :greeting + + # Greeting per language, keyed by language code. Used when the caller's language + # differs from the one `greeting` is written in. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_reader :greetings + + sig { params(greetings: T::Hash[Symbol, String]).void } + attr_writer :greetings + + # Whether the caller can interrupt the agent while it is speaking (barge-in). When + # true, the agent stops talking as soon as the caller starts. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :interruptible + + sig { params(interruptible: T::Boolean).void } + attr_writer :interruptible + + # BCP-47 language code used for both speech recognition and speech synthesis (e.g. + # `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Hard limit on call length in minutes. The call ends automatically when reached. + sig { returns(T.nilable(Integer)) } + attr_reader :max_call_duration_minutes + + sig { params(max_call_duration_minutes: Integer).void } + attr_writer :max_call_duration_minutes + + # How long the agent waits during silence before ending the call. + sig { returns(T.nilable(Integer)) } + attr_reader :max_idle_seconds + + sig { params(max_idle_seconds: Integer).void } + attr_writer :max_idle_seconds + + # Model that runs the conversation, co-located in the voice network for lowest + # latency. Independent of the model used for text messaging. Derived from the + # agent's text model when omitted. + sig { returns(T.nilable(String)) } + attr_reader :model + + sig { params(model: String).void } + attr_writer :model + + # Whether the call audio is recorded. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :record_calls + + sig { params(record_calls: T::Boolean).void } + attr_writer :record_calls + + # Speech-recognition model. Uses the default when omitted. + sig { returns(T.nilable(String)) } + attr_reader :stt_model + + sig { params(stt_model: String).void } + attr_writer :stt_model + + # Speech-recognition provider. Uses the default when omitted. + sig { returns(T.nilable(String)) } + attr_reader :stt_provider + + sig { params(stt_provider: String).void } + attr_writer :stt_provider + + # E.164 phone number the agent can transfer the call to. When set, the agent is + # given a transfer tool it can use to hand the call to a human. + sig { returns(T.nilable(String)) } + attr_reader :transfer_phone_number + + sig { params(transfer_phone_number: String).void } + attr_writer :transfer_phone_number + + # Speech-synthesis provider. Uses the default when omitted. + sig { returns(T.nilable(String)) } + attr_reader :tts_provider + + sig { params(tts_provider: String).void } + attr_writer :tts_provider + + # Identifier of the synthesized voice that speaks. Choose from the voices + # available in the dashboard. Uses a neutral default when omitted. + sig { returns(T.nilable(String)) } + attr_reader :tts_voice_id + + sig { params(tts_voice_id: String).void } + attr_writer :tts_voice_id + + # What the agent does when an answering machine or voicemail is detected on an + # outbound call. + sig do + returns( + T.nilable( + Zavudev::AgentCreateParams::Voice::VoicemailAction::OrSymbol + ) + ) + end + attr_reader :voicemail_action + + sig do + params( + voicemail_action: + Zavudev::AgentCreateParams::Voice::VoicemailAction::OrSymbol + ).void + end + attr_writer :voicemail_action + + # Message spoken when `voicemailAction` is `leave_message`. Falls back to + # `greeting` when omitted. + sig { returns(T.nilable(String)) } + attr_reader :voicemail_message + + sig { params(voicemail_message: String).void } + attr_writer :voicemail_message + + # Speech rate. 1.0 is natural. Only honoured by voices that support rate control; + # ignored by the others. + sig { returns(T.nilable(Float)) } + attr_reader :voice_speed + + sig { params(voice_speed: Float).void } + attr_writer :voice_speed + + # Voice Agent configuration on a sender's AI agent. Controls how the agent behaves + # on inbound and outbound phone calls through Zavu's managed voice pipeline + # (speech recognition, the agent's LLM, and speech synthesis, with real-time + # interruption handling). Requires the Voice Agents feature to be enabled for your + # team. + sig do + params( + enabled: T::Boolean, + greeting: String, + greetings: T::Hash[Symbol, String], + interruptible: T::Boolean, + language: String, + max_call_duration_minutes: Integer, + max_idle_seconds: Integer, + model: String, + record_calls: T::Boolean, + stt_model: String, + stt_provider: String, + transfer_phone_number: String, + tts_provider: String, + tts_voice_id: String, + voicemail_action: + Zavudev::AgentCreateParams::Voice::VoicemailAction::OrSymbol, + voicemail_message: String, + voice_speed: Float + ).returns(T.attached_class) + end + def self.new( + # Whether the agent handles voice calls. When false, the sender's number is not + # answered by the voice agent and outbound calls are rejected. + enabled:, + # Opening line the agent speaks when the call connects. If omitted, the agent + # waits for the caller to speak first. + greeting: nil, + # Greeting per language, keyed by language code. Used when the caller's language + # differs from the one `greeting` is written in. + greetings: nil, + # Whether the caller can interrupt the agent while it is speaking (barge-in). When + # true, the agent stops talking as soon as the caller starts. + interruptible: nil, + # BCP-47 language code used for both speech recognition and speech synthesis (e.g. + # `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted. + language: nil, + # Hard limit on call length in minutes. The call ends automatically when reached. + max_call_duration_minutes: nil, + # How long the agent waits during silence before ending the call. + max_idle_seconds: nil, + # Model that runs the conversation, co-located in the voice network for lowest + # latency. Independent of the model used for text messaging. Derived from the + # agent's text model when omitted. + model: nil, + # Whether the call audio is recorded. + record_calls: nil, + # Speech-recognition model. Uses the default when omitted. + stt_model: nil, + # Speech-recognition provider. Uses the default when omitted. + stt_provider: nil, + # E.164 phone number the agent can transfer the call to. When set, the agent is + # given a transfer tool it can use to hand the call to a human. + transfer_phone_number: nil, + # Speech-synthesis provider. Uses the default when omitted. + tts_provider: nil, + # Identifier of the synthesized voice that speaks. Choose from the voices + # available in the dashboard. Uses a neutral default when omitted. + tts_voice_id: nil, + # What the agent does when an answering machine or voicemail is detected on an + # outbound call. + voicemail_action: nil, + # Message spoken when `voicemailAction` is `leave_message`. Falls back to + # `greeting` when omitted. + voicemail_message: nil, + # Speech rate. 1.0 is natural. Only honoured by voices that support rate control; + # ignored by the others. + voice_speed: nil + ) + end + + sig do + override.returns( + { + enabled: T::Boolean, + greeting: String, + greetings: T::Hash[Symbol, String], + interruptible: T::Boolean, + language: String, + max_call_duration_minutes: Integer, + max_idle_seconds: Integer, + model: String, + record_calls: T::Boolean, + stt_model: String, + stt_provider: String, + transfer_phone_number: String, + tts_provider: String, + tts_voice_id: String, + voicemail_action: + Zavudev::AgentCreateParams::Voice::VoicemailAction::OrSymbol, + voicemail_message: String, + voice_speed: Float + } + ) + end + def to_hash + end + + # What the agent does when an answering machine or voicemail is detected on an + # outbound call. + module VoicemailAction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::AgentCreateParams::Voice::VoicemailAction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HANGUP = + T.let( + :hangup, + Zavudev::AgentCreateParams::Voice::VoicemailAction::TaggedSymbol + ) + LEAVE_MESSAGE = + T.let( + :leave_message, + Zavudev::AgentCreateParams::Voice::VoicemailAction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::AgentCreateParams::Voice::VoicemailAction::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/zavudev/models/agent_create_response.rbi b/rbi/zavudev/models/agent_create_response.rbi new file mode 100644 index 0000000..29686c4 --- /dev/null +++ b/rbi/zavudev/models/agent_create_response.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Zavudev + module Models + class AgentCreateResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentCreateResponse, + Zavudev::Internal::AnyHash + ) + end + + # AI Agent configuration for a sender. + sig { returns(Zavudev::Senders::SendersAgent) } + attr_reader :agent + + sig { params(agent: Zavudev::Senders::SendersAgent::OrHash).void } + attr_writer :agent + + sig do + params(agent: Zavudev::Senders::SendersAgent::OrHash).returns( + T.attached_class + ) + end + def self.new( + # AI Agent configuration for a sender. + agent: + ) + end + + sig { override.returns({ agent: Zavudev::Senders::SendersAgent }) } + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/agent_delete_params.rbi b/rbi/zavudev/models/agent_delete_params.rbi new file mode 100644 index 0000000..5b7143b --- /dev/null +++ b/rbi/zavudev/models/agent_delete_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Zavudev + module Models + class AgentDeleteParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::AgentDeleteParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :agent_id + + sig do + params( + agent_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(agent_id:, request_options: {}) + end + + sig do + override.returns( + { agent_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/agent_list_params.rbi b/rbi/zavudev/models/agent_list_params.rbi new file mode 100644 index 0000000..b861128 --- /dev/null +++ b/rbi/zavudev/models/agent_list_params.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Zavudev + module Models + class AgentListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::AgentListParams, Zavudev::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig do + params( + cursor: String, + limit: Integer, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(cursor: nil, limit: nil, request_options: {}) + end + + sig do + override.returns( + { + cursor: String, + limit: Integer, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/agent_list_voices_params.rbi b/rbi/zavudev/models/agent_list_voices_params.rbi new file mode 100644 index 0000000..31db1df --- /dev/null +++ b/rbi/zavudev/models/agent_list_voices_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Zavudev + module Models + class AgentListVoicesParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::AgentListVoicesParams, Zavudev::Internal::AnyHash) + end + + # BCP-47 tag (`en`, `es`, `pt-BR`). Omit, or pass `auto`, for every voice. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + sig do + params( + language: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # BCP-47 tag (`en`, `es`, `pt-BR`). Omit, or pass `auto`, for every voice. + language: nil, + request_options: {} + ) + end + + sig do + override.returns( + { language: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/agent_list_voices_response.rbi b/rbi/zavudev/models/agent_list_voices_response.rbi new file mode 100644 index 0000000..74513e6 --- /dev/null +++ b/rbi/zavudev/models/agent_list_voices_response.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module Zavudev + module Models + class AgentListVoicesResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentListVoicesResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(T::Array[Zavudev::Models::AgentListVoicesResponse::Item]) } + attr_accessor :items + + # Languages an agent can be pinned to. `auto` follows the caller. + sig { returns(T::Array[String]) } + attr_accessor :languages + + # Voices in the catalog, before filtering. + sig { returns(T.nilable(Integer)) } + attr_reader :total + + sig { params(total: Integer).void } + attr_writer :total + + sig do + params( + items: + T::Array[Zavudev::Models::AgentListVoicesResponse::Item::OrHash], + languages: T::Array[String], + total: Integer + ).returns(T.attached_class) + end + def self.new( + items:, + # Languages an agent can be pinned to. `auto` follows the caller. + languages:, + # Voices in the catalog, before filtering. + total: nil + ) + end + + sig do + override.returns( + { + items: T::Array[Zavudev::Models::AgentListVoicesResponse::Item], + languages: T::Array[String], + total: Integer + } + ) + end + def to_hash + end + + class Item < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentListVoicesResponse::Item, + Zavudev::Internal::AnyHash + ) + end + + # Value for `voice.ttsVoiceId`. + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :language + + sig { returns(String) } + attr_accessor :name + + sig do + params(id: String, language: String, name: String).returns( + T.attached_class + ) + end + def self.new( + # Value for `voice.ttsVoiceId`. + id:, + language:, + name: + ) + end + + sig { override.returns({ id: String, language: String, name: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/agent_retrieve_params.rbi b/rbi/zavudev/models/agent_retrieve_params.rbi new file mode 100644 index 0000000..e438cd2 --- /dev/null +++ b/rbi/zavudev/models/agent_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Zavudev + module Models + class AgentRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::AgentRetrieveParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :agent_id + + sig do + params( + agent_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(agent_id:, request_options: {}) + end + + sig do + override.returns( + { agent_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/agent_retrieve_response.rbi b/rbi/zavudev/models/agent_retrieve_response.rbi new file mode 100644 index 0000000..a1029ae --- /dev/null +++ b/rbi/zavudev/models/agent_retrieve_response.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Zavudev + module Models + class AgentRetrieveResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentRetrieveResponse, + Zavudev::Internal::AnyHash + ) + end + + # AI Agent configuration for a sender. + sig { returns(Zavudev::Senders::SendersAgent) } + attr_reader :agent + + sig { params(agent: Zavudev::Senders::SendersAgent::OrHash).void } + attr_writer :agent + + sig do + params(agent: Zavudev::Senders::SendersAgent::OrHash).returns( + T.attached_class + ) + end + def self.new( + # AI Agent configuration for a sender. + agent: + ) + end + + sig { override.returns({ agent: Zavudev::Senders::SendersAgent }) } + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/agent_template_list_params.rbi b/rbi/zavudev/models/agent_template_list_params.rbi new file mode 100644 index 0000000..931f084 --- /dev/null +++ b/rbi/zavudev/models/agent_template_list_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Zavudev + module Models + class AgentTemplateListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::AgentTemplateListParams, Zavudev::Internal::AnyHash) + end + + sig do + params(request_options: Zavudev::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Zavudev::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/agent_template_list_response.rbi b/rbi/zavudev/models/agent_template_list_response.rbi new file mode 100644 index 0000000..784a13e --- /dev/null +++ b/rbi/zavudev/models/agent_template_list_response.rbi @@ -0,0 +1,153 @@ +# typed: strong + +module Zavudev + module Models + class AgentTemplateListResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentTemplateListResponse, + Zavudev::Internal::AnyHash + ) + end + + sig do + returns(T::Array[Zavudev::Models::AgentTemplateListResponse::Item]) + end + attr_accessor :items + + sig do + params( + items: + T::Array[Zavudev::Models::AgentTemplateListResponse::Item::OrHash] + ).returns(T.attached_class) + end + def self.new(items:) + end + + sig do + override.returns( + { items: T::Array[Zavudev::Models::AgentTemplateListResponse::Item] } + ) + end + def to_hash + end + + class Item < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentTemplateListResponse::Item, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + Zavudev::Models::AgentTemplateListResponse::Item::Category::TaggedSymbol + ) + end + attr_accessor :category + + sig { returns(String) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :summary + + sig { returns(Integer) } + attr_accessor :tool_count + + # Whether this agent answers phone calls. + sig { returns(T::Boolean) } + attr_accessor :voice + + # Compact catalog entry for a factory agent. + sig do + params( + id: String, + category: + Zavudev::Models::AgentTemplateListResponse::Item::Category::OrSymbol, + name: String, + summary: String, + tool_count: Integer, + voice: T::Boolean + ).returns(T.attached_class) + end + def self.new( + id:, + category:, + name:, + summary:, + tool_count:, + # Whether this agent answers phone calls. + voice: + ) + end + + sig do + override.returns( + { + id: String, + category: + Zavudev::Models::AgentTemplateListResponse::Item::Category::TaggedSymbol, + name: String, + summary: String, + tool_count: Integer, + voice: T::Boolean + } + ) + end + def to_hash + end + + module Category + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::AgentTemplateListResponse::Item::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SALES = + T.let( + :sales, + Zavudev::Models::AgentTemplateListResponse::Item::Category::TaggedSymbol + ) + SUPPORT = + T.let( + :support, + Zavudev::Models::AgentTemplateListResponse::Item::Category::TaggedSymbol + ) + FRONT_DESK = + T.let( + :frontDesk, + Zavudev::Models::AgentTemplateListResponse::Item::Category::TaggedSymbol + ) + OPS = + T.let( + :ops, + Zavudev::Models::AgentTemplateListResponse::Item::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::AgentTemplateListResponse::Item::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/zavudev/models/agent_template_retrieve_params.rbi b/rbi/zavudev/models/agent_template_retrieve_params.rbi new file mode 100644 index 0000000..399e284 --- /dev/null +++ b/rbi/zavudev/models/agent_template_retrieve_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Zavudev + module Models + class AgentTemplateRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::AgentTemplateRetrieveParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :template_id + + sig do + params( + template_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(template_id:, request_options: {}) + end + + sig do + override.returns( + { template_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/agent_template_retrieve_response.rbi b/rbi/zavudev/models/agent_template_retrieve_response.rbi new file mode 100644 index 0000000..50ecf07 --- /dev/null +++ b/rbi/zavudev/models/agent_template_retrieve_response.rbi @@ -0,0 +1,266 @@ +# typed: strong + +module Zavudev + module Models + class AgentTemplateRetrieveResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentTemplateRetrieveResponse, + Zavudev::Internal::AnyHash + ) + end + + # A fully rendered factory agent: the function files to scaffold plus the secrets + # it needs. Returned by GET /v1/agent-templates/{templateId} and consumed by + # `npx zavudev agents pull`. + sig { returns(Zavudev::Models::AgentTemplateRetrieveResponse::Template) } + attr_reader :template + + sig do + params( + template: + Zavudev::Models::AgentTemplateRetrieveResponse::Template::OrHash + ).void + end + attr_writer :template + + sig do + params( + template: + Zavudev::Models::AgentTemplateRetrieveResponse::Template::OrHash + ).returns(T.attached_class) + end + def self.new( + # A fully rendered factory agent: the function files to scaffold plus the secrets + # it needs. Returned by GET /v1/agent-templates/{templateId} and consumed by + # `npx zavudev agents pull`. + template: + ) + end + + sig do + override.returns( + { template: Zavudev::Models::AgentTemplateRetrieveResponse::Template } + ) + end + def to_hash + end + + class Template < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentTemplateRetrieveResponse::Template, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category::TaggedSymbol + ) + end + attr_accessor :category + + sig { returns(String) } + attr_accessor :default_slug + + # npm dependencies for the scaffolded function. + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :dependencies + + sig do + returns( + T::Array[ + Zavudev::Models::AgentTemplateRetrieveResponse::Template::File + ] + ) + end + attr_accessor :files + + sig { returns(String) } + attr_accessor :name + + sig do + returns( + T::Array[ + Zavudev::Models::AgentTemplateRetrieveResponse::Template::RequiredSecret + ] + ) + end + attr_accessor :required_secrets + + sig { returns(String) } + attr_accessor :summary + + sig { returns(T::Boolean) } + attr_accessor :voice + + # A fully rendered factory agent: the function files to scaffold plus the secrets + # it needs. Returned by GET /v1/agent-templates/{templateId} and consumed by + # `npx zavudev agents pull`. + sig do + params( + id: String, + category: + Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category::OrSymbol, + default_slug: String, + dependencies: T::Hash[Symbol, String], + files: + T::Array[ + Zavudev::Models::AgentTemplateRetrieveResponse::Template::File::OrHash + ], + name: String, + required_secrets: + T::Array[ + Zavudev::Models::AgentTemplateRetrieveResponse::Template::RequiredSecret::OrHash + ], + summary: String, + voice: T::Boolean + ).returns(T.attached_class) + end + def self.new( + id:, + category:, + default_slug:, + # npm dependencies for the scaffolded function. + dependencies:, + files:, + name:, + required_secrets:, + summary:, + voice: + ) + end + + sig do + override.returns( + { + id: String, + category: + Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category::TaggedSymbol, + default_slug: String, + dependencies: T::Hash[Symbol, String], + files: + T::Array[ + Zavudev::Models::AgentTemplateRetrieveResponse::Template::File + ], + name: String, + required_secrets: + T::Array[ + Zavudev::Models::AgentTemplateRetrieveResponse::Template::RequiredSecret + ], + summary: String, + voice: T::Boolean + } + ) + end + def to_hash + end + + module Category + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SALES = + T.let( + :sales, + Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category::TaggedSymbol + ) + SUPPORT = + T.let( + :support, + Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category::TaggedSymbol + ) + FRONT_DESK = + T.let( + :frontDesk, + Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category::TaggedSymbol + ) + OPS = + T.let( + :ops, + Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::AgentTemplateRetrieveResponse::Template::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + class File < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentTemplateRetrieveResponse::Template::File, + Zavudev::Internal::AnyHash + ) + end + + # File contents to write verbatim. + sig { returns(String) } + attr_accessor :content + + sig { returns(String) } + attr_accessor :path + + sig do + params(content: String, path: String).returns(T.attached_class) + end + def self.new( + # File contents to write verbatim. + content:, + path: + ) + end + + sig { override.returns({ content: String, path: String }) } + def to_hash + end + end + + class RequiredSecret < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentTemplateRetrieveResponse::Template::RequiredSecret, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :hint + + sig { returns(String) } + attr_accessor :key + + sig { params(hint: String, key: String).returns(T.attached_class) } + def self.new(hint:, key:) + end + + sig { override.returns({ hint: String, key: String }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/zavudev/models/agent_test_params.rbi b/rbi/zavudev/models/agent_test_params.rbi new file mode 100644 index 0000000..8fef810 --- /dev/null +++ b/rbi/zavudev/models/agent_test_params.rbi @@ -0,0 +1,161 @@ +# typed: strong + +module Zavudev + module Models + class AgentTestParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::AgentTestParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :agent_id + + # What to say to the agent. + sig { returns(String) } + attr_accessor :message + + # Run the tools the agent calls instead of reporting the choice and stopping. + # + # Off by default because a tool handler talks to the outside world: a rehearsal + # that charges a card is not a rehearsal. Turn it on to exercise the loop that + # actually matters — the model picks a tool, the handler answers, the model + # replies with the result — without sending a message to anyone. What ran comes + # back in `executedToolCalls`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :execute_tools + + sig { params(execute_tools: T::Boolean).void } + attr_writer :execute_tools + + # Prior turns, oldest first, to exercise multi-turn behaviour without persisting a + # thread. Trimmed to the agent's context window. + sig { returns(T.nilable(T::Array[Zavudev::AgentTestParams::History])) } + attr_reader :history + + sig do + params( + history: T::Array[Zavudev::AgentTestParams::History::OrHash] + ).void + end + attr_writer :history + + # Set false to skip retrieval and isolate prompt behaviour from the knowledge + # base. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_knowledge_base + + sig { params(use_knowledge_base: T::Boolean).void } + attr_writer :use_knowledge_base + + sig do + params( + agent_id: String, + message: String, + execute_tools: T::Boolean, + history: T::Array[Zavudev::AgentTestParams::History::OrHash], + use_knowledge_base: T::Boolean, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + agent_id:, + # What to say to the agent. + message:, + # Run the tools the agent calls instead of reporting the choice and stopping. + # + # Off by default because a tool handler talks to the outside world: a rehearsal + # that charges a card is not a rehearsal. Turn it on to exercise the loop that + # actually matters — the model picks a tool, the handler answers, the model + # replies with the result — without sending a message to anyone. What ran comes + # back in `executedToolCalls`. + execute_tools: nil, + # Prior turns, oldest first, to exercise multi-turn behaviour without persisting a + # thread. Trimmed to the agent's context window. + history: nil, + # Set false to skip retrieval and isolate prompt behaviour from the knowledge + # base. + use_knowledge_base: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + agent_id: String, + message: String, + execute_tools: T::Boolean, + history: T::Array[Zavudev::AgentTestParams::History], + use_knowledge_base: T::Boolean, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + + class History < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Zavudev::AgentTestParams::History, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :content + + sig { returns(Zavudev::AgentTestParams::History::Role::OrSymbol) } + attr_accessor :role + + sig do + params( + content: String, + role: Zavudev::AgentTestParams::History::Role::OrSymbol + ).returns(T.attached_class) + end + def self.new(content:, role:) + end + + sig do + override.returns( + { + content: String, + role: Zavudev::AgentTestParams::History::Role::OrSymbol + } + ) + end + def to_hash + end + + module Role + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::AgentTestParams::History::Role) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let(:user, Zavudev::AgentTestParams::History::Role::TaggedSymbol) + ASSISTANT = + T.let( + :assistant, + Zavudev::AgentTestParams::History::Role::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Zavudev::AgentTestParams::History::Role::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/zavudev/models/agent_test_response.rbi b/rbi/zavudev/models/agent_test_response.rbi new file mode 100644 index 0000000..adce8e3 --- /dev/null +++ b/rbi/zavudev/models/agent_test_response.rbi @@ -0,0 +1,176 @@ +# typed: strong + +module Zavudev + module Models + class AgentTestResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Zavudev::Models::AgentTestResponse, Zavudev::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :error + + sig { returns(Integer) } + attr_accessor :input_tokens + + # Knowledge-base chunks retrieved for this message. Zero means the answer was not + # grounded in your documents. + sig { returns(Integer) } + attr_accessor :knowledge_chunks_used + + sig { returns(Integer) } + attr_accessor :latency_ms + + sig { returns(Integer) } + attr_accessor :output_tokens + + sig { returns(T::Boolean) } + attr_accessor :success + + # What the agent would reply. + sig { returns(T.nilable(String)) } + attr_accessor :text + + # Things that are true of this agent but that a dry run cannot prove. Surfaced so + # a passing dry run is never mistaken for proof that the agent works live. + # + # - The agent being disabled. + # - Enabled tools that were **not offered to the model** here — the model never + # saw them, so a reply that looks like a lookup was invented. Live conversations + # on every channel do offer them; running them here would cause real side + # effects. + # - An agent whose sender has none of the channels it triggers on, which answers + # every dry run and no real message. + # - Contact metadata that exists on a real conversation but not here. + sig { returns(T::Array[String]) } + attr_accessor :warnings + + # Tools that actually ran, in order, when the request set `executeTools`. Empty on + # a normal dry run, where nothing is executed. An entry with `ok: false` means the + # agent saw an error and answered around it, which is what a customer would have + # received. + sig do + returns( + T.nilable( + T::Array[Zavudev::Models::AgentTestResponse::ExecutedToolCall] + ) + ) + end + attr_reader :executed_tool_calls + + sig do + params( + executed_tool_calls: + T::Array[ + Zavudev::Models::AgentTestResponse::ExecutedToolCall::OrHash + ] + ).void + end + attr_writer :executed_tool_calls + + sig do + params( + error: T.nilable(String), + input_tokens: Integer, + knowledge_chunks_used: Integer, + latency_ms: Integer, + output_tokens: Integer, + success: T::Boolean, + text: T.nilable(String), + warnings: T::Array[String], + executed_tool_calls: + T::Array[ + Zavudev::Models::AgentTestResponse::ExecutedToolCall::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + error:, + input_tokens:, + # Knowledge-base chunks retrieved for this message. Zero means the answer was not + # grounded in your documents. + knowledge_chunks_used:, + latency_ms:, + output_tokens:, + success:, + # What the agent would reply. + text:, + # Things that are true of this agent but that a dry run cannot prove. Surfaced so + # a passing dry run is never mistaken for proof that the agent works live. + # + # - The agent being disabled. + # - Enabled tools that were **not offered to the model** here — the model never + # saw them, so a reply that looks like a lookup was invented. Live conversations + # on every channel do offer them; running them here would cause real side + # effects. + # - An agent whose sender has none of the channels it triggers on, which answers + # every dry run and no real message. + # - Contact metadata that exists on a real conversation but not here. + warnings:, + # Tools that actually ran, in order, when the request set `executeTools`. Empty on + # a normal dry run, where nothing is executed. An entry with `ok: false` means the + # agent saw an error and answered around it, which is what a customer would have + # received. + executed_tool_calls: nil + ) + end + + sig do + override.returns( + { + error: T.nilable(String), + input_tokens: Integer, + knowledge_chunks_used: Integer, + latency_ms: Integer, + output_tokens: Integer, + success: T::Boolean, + text: T.nilable(String), + warnings: T::Array[String], + executed_tool_calls: + T::Array[Zavudev::Models::AgentTestResponse::ExecutedToolCall] + } + ) + end + def to_hash + end + + class ExecutedToolCall < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentTestResponse::ExecutedToolCall, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Boolean) } + attr_accessor :ok + + sig { returns(T.nilable(String)) } + attr_accessor :error + + sig do + params( + name: String, + ok: T::Boolean, + error: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(name:, ok:, error: nil) + end + + sig do + override.returns( + { name: String, ok: T::Boolean, error: T.nilable(String) } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/agent_update_params.rbi b/rbi/zavudev/models/agent_update_params.rbi new file mode 100644 index 0000000..0ff6b1d --- /dev/null +++ b/rbi/zavudev/models/agent_update_params.rbi @@ -0,0 +1,441 @@ +# typed: strong + +module Zavudev + module Models + class AgentUpdateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::AgentUpdateParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :agent_id + + sig { returns(T.nilable(String)) } + attr_reader :api_key + + sig { params(api_key: String).void } + attr_writer :api_key + + sig { returns(T.nilable(Integer)) } + attr_reader :context_window_messages + + sig { params(context_window_messages: Integer).void } + attr_writer :context_window_messages + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enabled + + sig { params(enabled: T::Boolean).void } + attr_writer :enabled + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_contact_metadata + + sig { params(include_contact_metadata: T::Boolean).void } + attr_writer :include_contact_metadata + + sig { returns(T.nilable(Integer)) } + attr_accessor :max_tokens + + sig { returns(T.nilable(String)) } + attr_reader :model + + sig { params(model: String).void } + attr_writer :model + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # LLM provider for the AI agent. + sig { returns(T.nilable(Zavudev::Senders::AgentProvider::OrSymbol)) } + attr_reader :provider + + sig { params(provider: Zavudev::Senders::AgentProvider::OrSymbol).void } + attr_writer :provider + + sig { returns(T.nilable(String)) } + attr_reader :system_prompt + + sig { params(system_prompt: String).void } + attr_writer :system_prompt + + sig { returns(T.nilable(Float)) } + attr_accessor :temperature + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :trigger_on_channels + + sig { params(trigger_on_channels: T::Array[String]).void } + attr_writer :trigger_on_channels + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :trigger_on_message_types + + sig { params(trigger_on_message_types: T::Array[String]).void } + attr_writer :trigger_on_message_types + + # Voice Agent configuration. Patch this object to enable voice, change the + # greeting, or adjust call limits. Requires the Voice Agents feature to be enabled + # for your team. + sig { returns(T.nilable(Zavudev::AgentUpdateParams::Voice)) } + attr_reader :voice + + sig { params(voice: Zavudev::AgentUpdateParams::Voice::OrHash).void } + attr_writer :voice + + sig do + params( + agent_id: String, + api_key: String, + context_window_messages: Integer, + enabled: T::Boolean, + include_contact_metadata: T::Boolean, + max_tokens: T.nilable(Integer), + model: String, + name: String, + provider: Zavudev::Senders::AgentProvider::OrSymbol, + system_prompt: String, + temperature: T.nilable(Float), + trigger_on_channels: T::Array[String], + trigger_on_message_types: T::Array[String], + voice: Zavudev::AgentUpdateParams::Voice::OrHash, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + agent_id:, + api_key: nil, + context_window_messages: nil, + enabled: nil, + include_contact_metadata: nil, + max_tokens: nil, + model: nil, + name: nil, + # LLM provider for the AI agent. + provider: nil, + system_prompt: nil, + temperature: nil, + trigger_on_channels: nil, + trigger_on_message_types: nil, + # Voice Agent configuration. Patch this object to enable voice, change the + # greeting, or adjust call limits. Requires the Voice Agents feature to be enabled + # for your team. + voice: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + agent_id: String, + api_key: String, + context_window_messages: Integer, + enabled: T::Boolean, + include_contact_metadata: T::Boolean, + max_tokens: T.nilable(Integer), + model: String, + name: String, + provider: Zavudev::Senders::AgentProvider::OrSymbol, + system_prompt: String, + temperature: T.nilable(Float), + trigger_on_channels: T::Array[String], + trigger_on_message_types: T::Array[String], + voice: Zavudev::AgentUpdateParams::Voice, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + + class Voice < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Zavudev::AgentUpdateParams::Voice, Zavudev::Internal::AnyHash) + end + + # Whether the agent handles voice calls. When false, the sender's number is not + # answered by the voice agent and outbound calls are rejected. + sig { returns(T::Boolean) } + attr_accessor :enabled + + # Opening line the agent speaks when the call connects. If omitted, the agent + # waits for the caller to speak first. + sig { returns(T.nilable(String)) } + attr_reader :greeting + + sig { params(greeting: String).void } + attr_writer :greeting + + # Greeting per language, keyed by language code. Used when the caller's language + # differs from the one `greeting` is written in. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_reader :greetings + + sig { params(greetings: T::Hash[Symbol, String]).void } + attr_writer :greetings + + # Whether the caller can interrupt the agent while it is speaking (barge-in). When + # true, the agent stops talking as soon as the caller starts. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :interruptible + + sig { params(interruptible: T::Boolean).void } + attr_writer :interruptible + + # BCP-47 language code used for both speech recognition and speech synthesis (e.g. + # `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Hard limit on call length in minutes. The call ends automatically when reached. + sig { returns(T.nilable(Integer)) } + attr_reader :max_call_duration_minutes + + sig { params(max_call_duration_minutes: Integer).void } + attr_writer :max_call_duration_minutes + + # How long the agent waits during silence before ending the call. + sig { returns(T.nilable(Integer)) } + attr_reader :max_idle_seconds + + sig { params(max_idle_seconds: Integer).void } + attr_writer :max_idle_seconds + + # Model that runs the conversation, co-located in the voice network for lowest + # latency. Independent of the model used for text messaging. Derived from the + # agent's text model when omitted. + sig { returns(T.nilable(String)) } + attr_reader :model + + sig { params(model: String).void } + attr_writer :model + + # Whether the call audio is recorded. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :record_calls + + sig { params(record_calls: T::Boolean).void } + attr_writer :record_calls + + # Speech-recognition model. Uses the default when omitted. + sig { returns(T.nilable(String)) } + attr_reader :stt_model + + sig { params(stt_model: String).void } + attr_writer :stt_model + + # Speech-recognition provider. Uses the default when omitted. + sig { returns(T.nilable(String)) } + attr_reader :stt_provider + + sig { params(stt_provider: String).void } + attr_writer :stt_provider + + # E.164 phone number the agent can transfer the call to. When set, the agent is + # given a transfer tool it can use to hand the call to a human. + sig { returns(T.nilable(String)) } + attr_reader :transfer_phone_number + + sig { params(transfer_phone_number: String).void } + attr_writer :transfer_phone_number + + # Speech-synthesis provider. Uses the default when omitted. + sig { returns(T.nilable(String)) } + attr_reader :tts_provider + + sig { params(tts_provider: String).void } + attr_writer :tts_provider + + # Identifier of the synthesized voice that speaks. Choose from the voices + # available in the dashboard. Uses a neutral default when omitted. + sig { returns(T.nilable(String)) } + attr_reader :tts_voice_id + + sig { params(tts_voice_id: String).void } + attr_writer :tts_voice_id + + # What the agent does when an answering machine or voicemail is detected on an + # outbound call. + sig do + returns( + T.nilable( + Zavudev::AgentUpdateParams::Voice::VoicemailAction::OrSymbol + ) + ) + end + attr_reader :voicemail_action + + sig do + params( + voicemail_action: + Zavudev::AgentUpdateParams::Voice::VoicemailAction::OrSymbol + ).void + end + attr_writer :voicemail_action + + # Message spoken when `voicemailAction` is `leave_message`. Falls back to + # `greeting` when omitted. + sig { returns(T.nilable(String)) } + attr_reader :voicemail_message + + sig { params(voicemail_message: String).void } + attr_writer :voicemail_message + + # Speech rate. 1.0 is natural. Only honoured by voices that support rate control; + # ignored by the others. + sig { returns(T.nilable(Float)) } + attr_reader :voice_speed + + sig { params(voice_speed: Float).void } + attr_writer :voice_speed + + # Voice Agent configuration. Patch this object to enable voice, change the + # greeting, or adjust call limits. Requires the Voice Agents feature to be enabled + # for your team. + sig do + params( + enabled: T::Boolean, + greeting: String, + greetings: T::Hash[Symbol, String], + interruptible: T::Boolean, + language: String, + max_call_duration_minutes: Integer, + max_idle_seconds: Integer, + model: String, + record_calls: T::Boolean, + stt_model: String, + stt_provider: String, + transfer_phone_number: String, + tts_provider: String, + tts_voice_id: String, + voicemail_action: + Zavudev::AgentUpdateParams::Voice::VoicemailAction::OrSymbol, + voicemail_message: String, + voice_speed: Float + ).returns(T.attached_class) + end + def self.new( + # Whether the agent handles voice calls. When false, the sender's number is not + # answered by the voice agent and outbound calls are rejected. + enabled:, + # Opening line the agent speaks when the call connects. If omitted, the agent + # waits for the caller to speak first. + greeting: nil, + # Greeting per language, keyed by language code. Used when the caller's language + # differs from the one `greeting` is written in. + greetings: nil, + # Whether the caller can interrupt the agent while it is speaking (barge-in). When + # true, the agent stops talking as soon as the caller starts. + interruptible: nil, + # BCP-47 language code used for both speech recognition and speech synthesis (e.g. + # `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted. + language: nil, + # Hard limit on call length in minutes. The call ends automatically when reached. + max_call_duration_minutes: nil, + # How long the agent waits during silence before ending the call. + max_idle_seconds: nil, + # Model that runs the conversation, co-located in the voice network for lowest + # latency. Independent of the model used for text messaging. Derived from the + # agent's text model when omitted. + model: nil, + # Whether the call audio is recorded. + record_calls: nil, + # Speech-recognition model. Uses the default when omitted. + stt_model: nil, + # Speech-recognition provider. Uses the default when omitted. + stt_provider: nil, + # E.164 phone number the agent can transfer the call to. When set, the agent is + # given a transfer tool it can use to hand the call to a human. + transfer_phone_number: nil, + # Speech-synthesis provider. Uses the default when omitted. + tts_provider: nil, + # Identifier of the synthesized voice that speaks. Choose from the voices + # available in the dashboard. Uses a neutral default when omitted. + tts_voice_id: nil, + # What the agent does when an answering machine or voicemail is detected on an + # outbound call. + voicemail_action: nil, + # Message spoken when `voicemailAction` is `leave_message`. Falls back to + # `greeting` when omitted. + voicemail_message: nil, + # Speech rate. 1.0 is natural. Only honoured by voices that support rate control; + # ignored by the others. + voice_speed: nil + ) + end + + sig do + override.returns( + { + enabled: T::Boolean, + greeting: String, + greetings: T::Hash[Symbol, String], + interruptible: T::Boolean, + language: String, + max_call_duration_minutes: Integer, + max_idle_seconds: Integer, + model: String, + record_calls: T::Boolean, + stt_model: String, + stt_provider: String, + transfer_phone_number: String, + tts_provider: String, + tts_voice_id: String, + voicemail_action: + Zavudev::AgentUpdateParams::Voice::VoicemailAction::OrSymbol, + voicemail_message: String, + voice_speed: Float + } + ) + end + def to_hash + end + + # What the agent does when an answering machine or voicemail is detected on an + # outbound call. + module VoicemailAction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::AgentUpdateParams::Voice::VoicemailAction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HANGUP = + T.let( + :hangup, + Zavudev::AgentUpdateParams::Voice::VoicemailAction::TaggedSymbol + ) + LEAVE_MESSAGE = + T.let( + :leave_message, + Zavudev::AgentUpdateParams::Voice::VoicemailAction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::AgentUpdateParams::Voice::VoicemailAction::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/zavudev/models/agent_update_response.rbi b/rbi/zavudev/models/agent_update_response.rbi new file mode 100644 index 0000000..2e84b88 --- /dev/null +++ b/rbi/zavudev/models/agent_update_response.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Zavudev + module Models + class AgentUpdateResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::AgentUpdateResponse, + Zavudev::Internal::AnyHash + ) + end + + # AI Agent configuration for a sender. + sig { returns(Zavudev::Senders::SendersAgent) } + attr_reader :agent + + sig { params(agent: Zavudev::Senders::SendersAgent::OrHash).void } + attr_writer :agent + + sig do + params(agent: Zavudev::Senders::SendersAgent::OrHash).returns( + T.attached_class + ) + end + def self.new( + # AI Agent configuration for a sender. + agent: + ) + end + + sig { override.returns({ agent: Zavudev::Senders::SendersAgent }) } + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/agents/sender_connect_params.rbi b/rbi/zavudev/models/agents/sender_connect_params.rbi new file mode 100644 index 0000000..9aeb06a --- /dev/null +++ b/rbi/zavudev/models/agents/sender_connect_params.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Zavudev + module Models + module Agents + class SenderConnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Agents::SenderConnectParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :agent_id + + # Sender to connect. + sig { returns(String) } + attr_accessor :sender_id + + sig do + params( + agent_id: String, + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + agent_id:, + # Sender to connect. + sender_id:, + request_options: {} + ) + end + + sig do + override.returns( + { + agent_id: String, + sender_id: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/agents/sender_connect_response.rbi b/rbi/zavudev/models/agents/sender_connect_response.rbi new file mode 100644 index 0000000..00a2249 --- /dev/null +++ b/rbi/zavudev/models/agents/sender_connect_response.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Zavudev + module Models + module Agents + class SenderConnectResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Agents::SenderConnectResponse, + Zavudev::Internal::AnyHash + ) + end + + # AI Agent configuration for a sender. + sig { returns(Zavudev::Senders::SendersAgent) } + attr_reader :agent + + sig { params(agent: Zavudev::Senders::SendersAgent::OrHash).void } + attr_writer :agent + + sig do + params(agent: Zavudev::Senders::SendersAgent::OrHash).returns( + T.attached_class + ) + end + def self.new( + # AI Agent configuration for a sender. + agent: + ) + end + + sig { override.returns({ agent: Zavudev::Senders::SendersAgent }) } + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/agents/sender_disconnect_params.rbi b/rbi/zavudev/models/agents/sender_disconnect_params.rbi new file mode 100644 index 0000000..35925ba --- /dev/null +++ b/rbi/zavudev/models/agents/sender_disconnect_params.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Zavudev + module Models + module Agents + class SenderDisconnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Agents::SenderDisconnectParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :agent_id + + sig { returns(String) } + attr_accessor :sender_id + + sig do + params( + agent_id: String, + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(agent_id:, sender_id:, request_options: {}) + end + + sig do + override.returns( + { + agent_id: String, + sender_id: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/call_create_params.rbi b/rbi/zavudev/models/call_create_params.rbi new file mode 100644 index 0000000..a8ac193 --- /dev/null +++ b/rbi/zavudev/models/call_create_params.rbi @@ -0,0 +1,112 @@ +# typed: strong + +module Zavudev + module Models + class CallCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::CallCreateParams, Zavudev::Internal::AnyHash) + end + + # Recipient phone number in E.164 format. + sig { returns(String) } + attr_accessor :to + + # Overrides the agent's configured greeting for this call only. + sig { returns(T.nilable(String)) } + attr_reader :greeting + + sig { params(greeting: String).void } + attr_writer :greeting + + # Language the agent speaks on this call only, as a BCP-47 tag (`en`, `es`, + # `es-ES`, `pt-BR`), or `auto` to detect the caller's language and follow it. + # Overrides the agent's configured language for speech recognition, the agent's + # replies, and the synthesized voice. If the agent uses a custom voice you + # supplied, that voice is kept and only the language changes. When omitted, the + # agent's configured language is used. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Overrides the agent's maximum call duration for this call only. + sig { returns(T.nilable(Integer)) } + attr_reader :max_duration_minutes + + sig { params(max_duration_minutes: Integer).void } + attr_writer :max_duration_minutes + + # Arbitrary metadata to associate with the call. Returned on the call object and + # included in voice webhooks. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, String]).void } + attr_writer :metadata + + # Sender profile that places the call. Uses the project's default sender if + # omitted. The sender's agent must have voice enabled. + sig { returns(T.nilable(String)) } + attr_reader :sender_id + + sig { params(sender_id: String).void } + attr_writer :sender_id + + sig do + params( + to: String, + greeting: String, + language: String, + max_duration_minutes: Integer, + metadata: T::Hash[Symbol, String], + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Recipient phone number in E.164 format. + to:, + # Overrides the agent's configured greeting for this call only. + greeting: nil, + # Language the agent speaks on this call only, as a BCP-47 tag (`en`, `es`, + # `es-ES`, `pt-BR`), or `auto` to detect the caller's language and follow it. + # Overrides the agent's configured language for speech recognition, the agent's + # replies, and the synthesized voice. If the agent uses a custom voice you + # supplied, that voice is kept and only the language changes. When omitted, the + # agent's configured language is used. + language: nil, + # Overrides the agent's maximum call duration for this call only. + max_duration_minutes: nil, + # Arbitrary metadata to associate with the call. Returned on the call object and + # included in voice webhooks. + metadata: nil, + # Sender profile that places the call. Uses the project's default sender if + # omitted. The sender's agent must have voice enabled. + sender_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + to: String, + greeting: String, + language: String, + max_duration_minutes: Integer, + metadata: T::Hash[Symbol, String], + sender_id: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/call_create_response.rbi b/rbi/zavudev/models/call_create_response.rbi new file mode 100644 index 0000000..94b1af0 --- /dev/null +++ b/rbi/zavudev/models/call_create_response.rbi @@ -0,0 +1,466 @@ +# typed: strong + +module Zavudev + module Models + class CallCreateResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Zavudev::Models::CallCreateResponse, Zavudev::Internal::AnyHash) + end + + sig { returns(Zavudev::Models::CallCreateResponse::Call) } + attr_reader :call + + sig do + params(call: Zavudev::Models::CallCreateResponse::Call::OrHash).void + end + attr_writer :call + + sig do + params(call: Zavudev::Models::CallCreateResponse::Call::OrHash).returns( + T.attached_class + ) + end + def self.new(call:) + end + + sig do + override.returns({ call: Zavudev::Models::CallCreateResponse::Call }) + end + def to_hash + end + + class Call < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::CallCreateResponse::Call, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + sig do + returns( + Zavudev::Models::CallCreateResponse::Call::Direction::TaggedSymbol + ) + end + attr_accessor :direction + + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + sig { returns(String) } + attr_accessor :from + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + sig do + returns( + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Callee phone number in E.164 format. + sig { returns(String) } + attr_accessor :to + + # When the call was answered. + sig { returns(T.nilable(Time)) } + attr_accessor :answered_at + + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + sig { returns(T.nilable(Float)) } + attr_accessor :cost + + # Billable talk time in seconds, measured from answer to hangup. + sig { returns(T.nilable(Integer)) } + attr_accessor :duration_seconds + + # When the call ended. + sig { returns(T.nilable(Time)) } + attr_accessor :ended_at + + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + sig { returns(T.nilable(String)) } + attr_accessor :end_reason + + # Arbitrary metadata you attached when creating the call. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, String]).void } + attr_writer :metadata + + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + sig do + returns( + T.nilable( + T::Array[Zavudev::Models::CallCreateResponse::Call::Transcript] + ) + ) + end + attr_reader :transcript + + sig do + params( + transcript: + T::Array[ + Zavudev::Models::CallCreateResponse::Call::Transcript::OrHash + ] + ).void + end + attr_writer :transcript + + # Number of conversation turns exchanged during the call. + sig { returns(T.nilable(Integer)) } + attr_accessor :turn_count + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + sig do + params( + id: String, + created_at: Time, + direction: + Zavudev::Models::CallCreateResponse::Call::Direction::OrSymbol, + from: String, + status: Zavudev::Models::CallCreateResponse::Call::Status::OrSymbol, + to: String, + answered_at: T.nilable(Time), + cost: T.nilable(Float), + duration_seconds: T.nilable(Integer), + ended_at: T.nilable(Time), + end_reason: T.nilable(String), + metadata: T::Hash[Symbol, String], + transcript: + T::Array[ + Zavudev::Models::CallCreateResponse::Call::Transcript::OrHash + ], + turn_count: T.nilable(Integer), + updated_at: Time + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + direction:, + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + from:, + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + status:, + # Callee phone number in E.164 format. + to:, + # When the call was answered. + answered_at: nil, + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + cost: nil, + # Billable talk time in seconds, measured from answer to hangup. + duration_seconds: nil, + # When the call ended. + ended_at: nil, + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + end_reason: nil, + # Arbitrary metadata you attached when creating the call. + metadata: nil, + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + transcript: nil, + # Number of conversation turns exchanged during the call. + turn_count: nil, + updated_at: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + direction: + Zavudev::Models::CallCreateResponse::Call::Direction::TaggedSymbol, + from: String, + status: + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol, + to: String, + answered_at: T.nilable(Time), + cost: T.nilable(Float), + duration_seconds: T.nilable(Integer), + ended_at: T.nilable(Time), + end_reason: T.nilable(String), + metadata: T::Hash[Symbol, String], + transcript: + T::Array[Zavudev::Models::CallCreateResponse::Call::Transcript], + turn_count: T.nilable(Integer), + updated_at: Time + } + ) + end + def to_hash + end + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + module Direction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::CallCreateResponse::Call::Direction + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INBOUND = + T.let( + :inbound, + Zavudev::Models::CallCreateResponse::Call::Direction::TaggedSymbol + ) + OUTBOUND = + T.let( + :outbound, + Zavudev::Models::CallCreateResponse::Call::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::CallCreateResponse::Call::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + module Status + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::Models::CallCreateResponse::Call::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + QUEUED = + T.let( + :queued, + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol + ) + RINGING = + T.let( + :ringing, + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol + ) + IN_PROGRESS = + T.let( + :in_progress, + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol + ) + BUSY = + T.let( + :busy, + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol + ) + NO_ANSWER = + T.let( + :no_answer, + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::CallCreateResponse::Call::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Transcript < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::CallCreateResponse::Call::Transcript, + Zavudev::Internal::AnyHash + ) + end + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + sig do + returns( + Zavudev::Models::CallCreateResponse::Call::Transcript::Role::TaggedSymbol + ) + end + attr_accessor :role + + # Ordinal position of the turn within the call, starting at 0. + sig { returns(Integer) } + attr_accessor :seq + + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + sig { returns(String) } + attr_accessor :text + + # When the turn ended. + sig { returns(T.nilable(Time)) } + attr_accessor :ended_at + + # When the turn started. + sig { returns(T.nilable(Time)) } + attr_accessor :started_at + + # A single turn in a voice call transcript. + sig do + params( + role: + Zavudev::Models::CallCreateResponse::Call::Transcript::Role::OrSymbol, + seq: Integer, + text: String, + ended_at: T.nilable(Time), + started_at: T.nilable(Time) + ).returns(T.attached_class) + end + def self.new( + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + role:, + # Ordinal position of the turn within the call, starting at 0. + seq:, + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + text:, + # When the turn ended. + ended_at: nil, + # When the turn started. + started_at: nil + ) + end + + sig do + override.returns( + { + role: + Zavudev::Models::CallCreateResponse::Call::Transcript::Role::TaggedSymbol, + seq: Integer, + text: String, + ended_at: T.nilable(Time), + started_at: T.nilable(Time) + } + ) + end + def to_hash + end + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + module Role + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::CallCreateResponse::Call::Transcript::Role + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + Zavudev::Models::CallCreateResponse::Call::Transcript::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + Zavudev::Models::CallCreateResponse::Call::Transcript::Role::TaggedSymbol + ) + TOOL = + T.let( + :tool, + Zavudev::Models::CallCreateResponse::Call::Transcript::Role::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::CallCreateResponse::Call::Transcript::Role::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/call_hangup_params.rbi b/rbi/zavudev/models/call_hangup_params.rbi new file mode 100644 index 0000000..5ef3e38 --- /dev/null +++ b/rbi/zavudev/models/call_hangup_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Zavudev + module Models + class CallHangupParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::CallHangupParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :call_id + + sig do + params( + call_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(call_id:, request_options: {}) + end + + sig do + override.returns( + { call_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/call_hangup_response.rbi b/rbi/zavudev/models/call_hangup_response.rbi new file mode 100644 index 0000000..de2c498 --- /dev/null +++ b/rbi/zavudev/models/call_hangup_response.rbi @@ -0,0 +1,466 @@ +# typed: strong + +module Zavudev + module Models + class CallHangupResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Zavudev::Models::CallHangupResponse, Zavudev::Internal::AnyHash) + end + + sig { returns(Zavudev::Models::CallHangupResponse::Call) } + attr_reader :call + + sig do + params(call: Zavudev::Models::CallHangupResponse::Call::OrHash).void + end + attr_writer :call + + sig do + params(call: Zavudev::Models::CallHangupResponse::Call::OrHash).returns( + T.attached_class + ) + end + def self.new(call:) + end + + sig do + override.returns({ call: Zavudev::Models::CallHangupResponse::Call }) + end + def to_hash + end + + class Call < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::CallHangupResponse::Call, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + sig do + returns( + Zavudev::Models::CallHangupResponse::Call::Direction::TaggedSymbol + ) + end + attr_accessor :direction + + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + sig { returns(String) } + attr_accessor :from + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + sig do + returns( + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Callee phone number in E.164 format. + sig { returns(String) } + attr_accessor :to + + # When the call was answered. + sig { returns(T.nilable(Time)) } + attr_accessor :answered_at + + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + sig { returns(T.nilable(Float)) } + attr_accessor :cost + + # Billable talk time in seconds, measured from answer to hangup. + sig { returns(T.nilable(Integer)) } + attr_accessor :duration_seconds + + # When the call ended. + sig { returns(T.nilable(Time)) } + attr_accessor :ended_at + + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + sig { returns(T.nilable(String)) } + attr_accessor :end_reason + + # Arbitrary metadata you attached when creating the call. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, String]).void } + attr_writer :metadata + + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + sig do + returns( + T.nilable( + T::Array[Zavudev::Models::CallHangupResponse::Call::Transcript] + ) + ) + end + attr_reader :transcript + + sig do + params( + transcript: + T::Array[ + Zavudev::Models::CallHangupResponse::Call::Transcript::OrHash + ] + ).void + end + attr_writer :transcript + + # Number of conversation turns exchanged during the call. + sig { returns(T.nilable(Integer)) } + attr_accessor :turn_count + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + sig do + params( + id: String, + created_at: Time, + direction: + Zavudev::Models::CallHangupResponse::Call::Direction::OrSymbol, + from: String, + status: Zavudev::Models::CallHangupResponse::Call::Status::OrSymbol, + to: String, + answered_at: T.nilable(Time), + cost: T.nilable(Float), + duration_seconds: T.nilable(Integer), + ended_at: T.nilable(Time), + end_reason: T.nilable(String), + metadata: T::Hash[Symbol, String], + transcript: + T::Array[ + Zavudev::Models::CallHangupResponse::Call::Transcript::OrHash + ], + turn_count: T.nilable(Integer), + updated_at: Time + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + direction:, + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + from:, + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + status:, + # Callee phone number in E.164 format. + to:, + # When the call was answered. + answered_at: nil, + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + cost: nil, + # Billable talk time in seconds, measured from answer to hangup. + duration_seconds: nil, + # When the call ended. + ended_at: nil, + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + end_reason: nil, + # Arbitrary metadata you attached when creating the call. + metadata: nil, + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + transcript: nil, + # Number of conversation turns exchanged during the call. + turn_count: nil, + updated_at: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + direction: + Zavudev::Models::CallHangupResponse::Call::Direction::TaggedSymbol, + from: String, + status: + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol, + to: String, + answered_at: T.nilable(Time), + cost: T.nilable(Float), + duration_seconds: T.nilable(Integer), + ended_at: T.nilable(Time), + end_reason: T.nilable(String), + metadata: T::Hash[Symbol, String], + transcript: + T::Array[Zavudev::Models::CallHangupResponse::Call::Transcript], + turn_count: T.nilable(Integer), + updated_at: Time + } + ) + end + def to_hash + end + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + module Direction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::CallHangupResponse::Call::Direction + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INBOUND = + T.let( + :inbound, + Zavudev::Models::CallHangupResponse::Call::Direction::TaggedSymbol + ) + OUTBOUND = + T.let( + :outbound, + Zavudev::Models::CallHangupResponse::Call::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::CallHangupResponse::Call::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + module Status + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::Models::CallHangupResponse::Call::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + QUEUED = + T.let( + :queued, + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol + ) + RINGING = + T.let( + :ringing, + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol + ) + IN_PROGRESS = + T.let( + :in_progress, + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol + ) + BUSY = + T.let( + :busy, + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol + ) + NO_ANSWER = + T.let( + :no_answer, + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::CallHangupResponse::Call::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Transcript < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::CallHangupResponse::Call::Transcript, + Zavudev::Internal::AnyHash + ) + end + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + sig do + returns( + Zavudev::Models::CallHangupResponse::Call::Transcript::Role::TaggedSymbol + ) + end + attr_accessor :role + + # Ordinal position of the turn within the call, starting at 0. + sig { returns(Integer) } + attr_accessor :seq + + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + sig { returns(String) } + attr_accessor :text + + # When the turn ended. + sig { returns(T.nilable(Time)) } + attr_accessor :ended_at + + # When the turn started. + sig { returns(T.nilable(Time)) } + attr_accessor :started_at + + # A single turn in a voice call transcript. + sig do + params( + role: + Zavudev::Models::CallHangupResponse::Call::Transcript::Role::OrSymbol, + seq: Integer, + text: String, + ended_at: T.nilable(Time), + started_at: T.nilable(Time) + ).returns(T.attached_class) + end + def self.new( + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + role:, + # Ordinal position of the turn within the call, starting at 0. + seq:, + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + text:, + # When the turn ended. + ended_at: nil, + # When the turn started. + started_at: nil + ) + end + + sig do + override.returns( + { + role: + Zavudev::Models::CallHangupResponse::Call::Transcript::Role::TaggedSymbol, + seq: Integer, + text: String, + ended_at: T.nilable(Time), + started_at: T.nilable(Time) + } + ) + end + def to_hash + end + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + module Role + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::CallHangupResponse::Call::Transcript::Role + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + Zavudev::Models::CallHangupResponse::Call::Transcript::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + Zavudev::Models::CallHangupResponse::Call::Transcript::Role::TaggedSymbol + ) + TOOL = + T.let( + :tool, + Zavudev::Models::CallHangupResponse::Call::Transcript::Role::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::CallHangupResponse::Call::Transcript::Role::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/call_list_params.rbi b/rbi/zavudev/models/call_list_params.rbi new file mode 100644 index 0000000..9f869b2 --- /dev/null +++ b/rbi/zavudev/models/call_list_params.rbi @@ -0,0 +1,159 @@ +# typed: strong + +module Zavudev + module Models + class CallListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::CallListParams, Zavudev::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + sig { returns(T.nilable(Zavudev::CallListParams::Direction::OrSymbol)) } + attr_reader :direction + + sig do + params(direction: Zavudev::CallListParams::Direction::OrSymbol).void + end + attr_writer :direction + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + sig { returns(T.nilable(Zavudev::CallListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Zavudev::CallListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + cursor: String, + direction: Zavudev::CallListParams::Direction::OrSymbol, + limit: Integer, + status: Zavudev::CallListParams::Status::OrSymbol, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + cursor: nil, + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + direction: nil, + limit: nil, + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + cursor: String, + direction: Zavudev::CallListParams::Direction::OrSymbol, + limit: Integer, + status: Zavudev::CallListParams::Status::OrSymbol, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + module Direction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Zavudev::CallListParams::Direction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INBOUND = + T.let(:inbound, Zavudev::CallListParams::Direction::TaggedSymbol) + OUTBOUND = + T.let(:outbound, Zavudev::CallListParams::Direction::TaggedSymbol) + + sig do + override.returns( + T::Array[Zavudev::CallListParams::Direction::TaggedSymbol] + ) + end + def self.values + end + end + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + module Status + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Zavudev::CallListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + QUEUED = T.let(:queued, Zavudev::CallListParams::Status::TaggedSymbol) + RINGING = T.let(:ringing, Zavudev::CallListParams::Status::TaggedSymbol) + IN_PROGRESS = + T.let(:in_progress, Zavudev::CallListParams::Status::TaggedSymbol) + COMPLETED = + T.let(:completed, Zavudev::CallListParams::Status::TaggedSymbol) + FAILED = T.let(:failed, Zavudev::CallListParams::Status::TaggedSymbol) + BUSY = T.let(:busy, Zavudev::CallListParams::Status::TaggedSymbol) + NO_ANSWER = + T.let(:no_answer, Zavudev::CallListParams::Status::TaggedSymbol) + CANCELED = + T.let(:canceled, Zavudev::CallListParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Zavudev::CallListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/zavudev/models/call_list_response.rbi b/rbi/zavudev/models/call_list_response.rbi new file mode 100644 index 0000000..ad0431c --- /dev/null +++ b/rbi/zavudev/models/call_list_response.rbi @@ -0,0 +1,405 @@ +# typed: strong + +module Zavudev + module Models + class CallListResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Zavudev::Models::CallListResponse, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + sig do + returns(Zavudev::Models::CallListResponse::Direction::TaggedSymbol) + end + attr_accessor :direction + + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + sig { returns(String) } + attr_accessor :from + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + sig { returns(Zavudev::Models::CallListResponse::Status::TaggedSymbol) } + attr_accessor :status + + # Callee phone number in E.164 format. + sig { returns(String) } + attr_accessor :to + + # When the call was answered. + sig { returns(T.nilable(Time)) } + attr_accessor :answered_at + + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + sig { returns(T.nilable(Float)) } + attr_accessor :cost + + # Billable talk time in seconds, measured from answer to hangup. + sig { returns(T.nilable(Integer)) } + attr_accessor :duration_seconds + + # When the call ended. + sig { returns(T.nilable(Time)) } + attr_accessor :ended_at + + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + sig { returns(T.nilable(String)) } + attr_accessor :end_reason + + # Arbitrary metadata you attached when creating the call. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, String]).void } + attr_writer :metadata + + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + sig do + returns( + T.nilable(T::Array[Zavudev::Models::CallListResponse::Transcript]) + ) + end + attr_reader :transcript + + sig do + params( + transcript: + T::Array[Zavudev::Models::CallListResponse::Transcript::OrHash] + ).void + end + attr_writer :transcript + + # Number of conversation turns exchanged during the call. + sig { returns(T.nilable(Integer)) } + attr_accessor :turn_count + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + sig do + params( + id: String, + created_at: Time, + direction: Zavudev::Models::CallListResponse::Direction::OrSymbol, + from: String, + status: Zavudev::Models::CallListResponse::Status::OrSymbol, + to: String, + answered_at: T.nilable(Time), + cost: T.nilable(Float), + duration_seconds: T.nilable(Integer), + ended_at: T.nilable(Time), + end_reason: T.nilable(String), + metadata: T::Hash[Symbol, String], + transcript: + T::Array[Zavudev::Models::CallListResponse::Transcript::OrHash], + turn_count: T.nilable(Integer), + updated_at: Time + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + direction:, + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + from:, + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + status:, + # Callee phone number in E.164 format. + to:, + # When the call was answered. + answered_at: nil, + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + cost: nil, + # Billable talk time in seconds, measured from answer to hangup. + duration_seconds: nil, + # When the call ended. + ended_at: nil, + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + end_reason: nil, + # Arbitrary metadata you attached when creating the call. + metadata: nil, + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + transcript: nil, + # Number of conversation turns exchanged during the call. + turn_count: nil, + updated_at: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + direction: + Zavudev::Models::CallListResponse::Direction::TaggedSymbol, + from: String, + status: Zavudev::Models::CallListResponse::Status::TaggedSymbol, + to: String, + answered_at: T.nilable(Time), + cost: T.nilable(Float), + duration_seconds: T.nilable(Integer), + ended_at: T.nilable(Time), + end_reason: T.nilable(String), + metadata: T::Hash[Symbol, String], + transcript: T::Array[Zavudev::Models::CallListResponse::Transcript], + turn_count: T.nilable(Integer), + updated_at: Time + } + ) + end + def to_hash + end + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + module Direction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::Models::CallListResponse::Direction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INBOUND = + T.let( + :inbound, + Zavudev::Models::CallListResponse::Direction::TaggedSymbol + ) + OUTBOUND = + T.let( + :outbound, + Zavudev::Models::CallListResponse::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Zavudev::Models::CallListResponse::Direction::TaggedSymbol] + ) + end + def self.values + end + end + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + module Status + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::Models::CallListResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + QUEUED = + T.let( + :queued, + Zavudev::Models::CallListResponse::Status::TaggedSymbol + ) + RINGING = + T.let( + :ringing, + Zavudev::Models::CallListResponse::Status::TaggedSymbol + ) + IN_PROGRESS = + T.let( + :in_progress, + Zavudev::Models::CallListResponse::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + Zavudev::Models::CallListResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Zavudev::Models::CallListResponse::Status::TaggedSymbol + ) + BUSY = + T.let(:busy, Zavudev::Models::CallListResponse::Status::TaggedSymbol) + NO_ANSWER = + T.let( + :no_answer, + Zavudev::Models::CallListResponse::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + Zavudev::Models::CallListResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Zavudev::Models::CallListResponse::Status::TaggedSymbol] + ) + end + def self.values + end + end + + class Transcript < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::CallListResponse::Transcript, + Zavudev::Internal::AnyHash + ) + end + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + sig do + returns( + Zavudev::Models::CallListResponse::Transcript::Role::TaggedSymbol + ) + end + attr_accessor :role + + # Ordinal position of the turn within the call, starting at 0. + sig { returns(Integer) } + attr_accessor :seq + + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + sig { returns(String) } + attr_accessor :text + + # When the turn ended. + sig { returns(T.nilable(Time)) } + attr_accessor :ended_at + + # When the turn started. + sig { returns(T.nilable(Time)) } + attr_accessor :started_at + + # A single turn in a voice call transcript. + sig do + params( + role: Zavudev::Models::CallListResponse::Transcript::Role::OrSymbol, + seq: Integer, + text: String, + ended_at: T.nilable(Time), + started_at: T.nilable(Time) + ).returns(T.attached_class) + end + def self.new( + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + role:, + # Ordinal position of the turn within the call, starting at 0. + seq:, + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + text:, + # When the turn ended. + ended_at: nil, + # When the turn started. + started_at: nil + ) + end + + sig do + override.returns( + { + role: + Zavudev::Models::CallListResponse::Transcript::Role::TaggedSymbol, + seq: Integer, + text: String, + ended_at: T.nilable(Time), + started_at: T.nilable(Time) + } + ) + end + def to_hash + end + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + module Role + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::Models::CallListResponse::Transcript::Role) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + Zavudev::Models::CallListResponse::Transcript::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + Zavudev::Models::CallListResponse::Transcript::Role::TaggedSymbol + ) + TOOL = + T.let( + :tool, + Zavudev::Models::CallListResponse::Transcript::Role::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::CallListResponse::Transcript::Role::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/zavudev/models/call_retrieve_params.rbi b/rbi/zavudev/models/call_retrieve_params.rbi new file mode 100644 index 0000000..4c29861 --- /dev/null +++ b/rbi/zavudev/models/call_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Zavudev + module Models + class CallRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::CallRetrieveParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :call_id + + sig do + params( + call_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(call_id:, request_options: {}) + end + + sig do + override.returns( + { call_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/call_retrieve_response.rbi b/rbi/zavudev/models/call_retrieve_response.rbi new file mode 100644 index 0000000..fecf8ab --- /dev/null +++ b/rbi/zavudev/models/call_retrieve_response.rbi @@ -0,0 +1,472 @@ +# typed: strong + +module Zavudev + module Models + class CallRetrieveResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::CallRetrieveResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(Zavudev::Models::CallRetrieveResponse::Call) } + attr_reader :call + + sig do + params(call: Zavudev::Models::CallRetrieveResponse::Call::OrHash).void + end + attr_writer :call + + sig do + params( + call: Zavudev::Models::CallRetrieveResponse::Call::OrHash + ).returns(T.attached_class) + end + def self.new(call:) + end + + sig do + override.returns({ call: Zavudev::Models::CallRetrieveResponse::Call }) + end + def to_hash + end + + class Call < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::CallRetrieveResponse::Call, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + sig do + returns( + Zavudev::Models::CallRetrieveResponse::Call::Direction::TaggedSymbol + ) + end + attr_accessor :direction + + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + sig { returns(String) } + attr_accessor :from + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + sig do + returns( + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Callee phone number in E.164 format. + sig { returns(String) } + attr_accessor :to + + # When the call was answered. + sig { returns(T.nilable(Time)) } + attr_accessor :answered_at + + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + sig { returns(T.nilable(Float)) } + attr_accessor :cost + + # Billable talk time in seconds, measured from answer to hangup. + sig { returns(T.nilable(Integer)) } + attr_accessor :duration_seconds + + # When the call ended. + sig { returns(T.nilable(Time)) } + attr_accessor :ended_at + + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + sig { returns(T.nilable(String)) } + attr_accessor :end_reason + + # Arbitrary metadata you attached when creating the call. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, String]).void } + attr_writer :metadata + + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + sig do + returns( + T.nilable( + T::Array[Zavudev::Models::CallRetrieveResponse::Call::Transcript] + ) + ) + end + attr_reader :transcript + + sig do + params( + transcript: + T::Array[ + Zavudev::Models::CallRetrieveResponse::Call::Transcript::OrHash + ] + ).void + end + attr_writer :transcript + + # Number of conversation turns exchanged during the call. + sig { returns(T.nilable(Integer)) } + attr_accessor :turn_count + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + sig do + params( + id: String, + created_at: Time, + direction: + Zavudev::Models::CallRetrieveResponse::Call::Direction::OrSymbol, + from: String, + status: + Zavudev::Models::CallRetrieveResponse::Call::Status::OrSymbol, + to: String, + answered_at: T.nilable(Time), + cost: T.nilable(Float), + duration_seconds: T.nilable(Integer), + ended_at: T.nilable(Time), + end_reason: T.nilable(String), + metadata: T::Hash[Symbol, String], + transcript: + T::Array[ + Zavudev::Models::CallRetrieveResponse::Call::Transcript::OrHash + ], + turn_count: T.nilable(Integer), + updated_at: Time + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + direction:, + # Caller phone number in E.164 format. Your sender's number for outbound calls; + # the caller's number for inbound calls. + from:, + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + status:, + # Callee phone number in E.164 format. + to:, + # When the call was answered. + answered_at: nil, + # Total cost of the call in USD, combining the managed voice pipeline per-minute + # charge and telephony. Available once the call has ended. + cost: nil, + # Billable talk time in seconds, measured from answer to hangup. + duration_seconds: nil, + # When the call ended. + ended_at: nil, + # Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`). + # Present once the call is no longer active. + end_reason: nil, + # Arbitrary metadata you attached when creating the call. + metadata: nil, + # Ordered transcript of the call. Included when retrieving a single call; omitted + # from list responses. + transcript: nil, + # Number of conversation turns exchanged during the call. + turn_count: nil, + updated_at: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + direction: + Zavudev::Models::CallRetrieveResponse::Call::Direction::TaggedSymbol, + from: String, + status: + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol, + to: String, + answered_at: T.nilable(Time), + cost: T.nilable(Float), + duration_seconds: T.nilable(Integer), + ended_at: T.nilable(Time), + end_reason: T.nilable(String), + metadata: T::Hash[Symbol, String], + transcript: + T::Array[ + Zavudev::Models::CallRetrieveResponse::Call::Transcript + ], + turn_count: T.nilable(Integer), + updated_at: Time + } + ) + end + def to_hash + end + + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + module Direction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::CallRetrieveResponse::Call::Direction + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INBOUND = + T.let( + :inbound, + Zavudev::Models::CallRetrieveResponse::Call::Direction::TaggedSymbol + ) + OUTBOUND = + T.let( + :outbound, + Zavudev::Models::CallRetrieveResponse::Call::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::CallRetrieveResponse::Call::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + module Status + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::Models::CallRetrieveResponse::Call::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + QUEUED = + T.let( + :queued, + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol + ) + RINGING = + T.let( + :ringing, + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol + ) + IN_PROGRESS = + T.let( + :in_progress, + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol + ) + BUSY = + T.let( + :busy, + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol + ) + NO_ANSWER = + T.let( + :no_answer, + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::CallRetrieveResponse::Call::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Transcript < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::CallRetrieveResponse::Call::Transcript, + Zavudev::Internal::AnyHash + ) + end + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + sig do + returns( + Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role::TaggedSymbol + ) + end + attr_accessor :role + + # Ordinal position of the turn within the call, starting at 0. + sig { returns(Integer) } + attr_accessor :seq + + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + sig { returns(String) } + attr_accessor :text + + # When the turn ended. + sig { returns(T.nilable(Time)) } + attr_accessor :ended_at + + # When the turn started. + sig { returns(T.nilable(Time)) } + attr_accessor :started_at + + # A single turn in a voice call transcript. + sig do + params( + role: + Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role::OrSymbol, + seq: Integer, + text: String, + ended_at: T.nilable(Time), + started_at: T.nilable(Time) + ).returns(T.attached_class) + end + def self.new( + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + role:, + # Ordinal position of the turn within the call, starting at 0. + seq:, + # Transcribed speech for `user` and `assistant` turns, or a JSON summary of the + # tool call for `tool` turns. + text:, + # When the turn ended. + ended_at: nil, + # When the turn started. + started_at: nil + ) + end + + sig do + override.returns( + { + role: + Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role::TaggedSymbol, + seq: Integer, + text: String, + ended_at: T.nilable(Time), + started_at: T.nilable(Time) + } + ) + end + def to_hash + end + + # Who produced the turn. `tool` records a tool call the agent made during the + # conversation. + module Role + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role::TaggedSymbol + ) + TOOL = + T.let( + :tool, + Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::CallRetrieveResponse::Call::Transcript::Role::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/conversation_list_messages_params.rbi b/rbi/zavudev/models/conversation_list_messages_params.rbi new file mode 100644 index 0000000..21006b7 --- /dev/null +++ b/rbi/zavudev/models/conversation_list_messages_params.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Zavudev + module Models + class ConversationListMessagesParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::ConversationListMessagesParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :conversation_id + + # Opaque cursor from a previous response's `nextCursor`. + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig do + params( + conversation_id: String, + cursor: String, + limit: Integer, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + conversation_id:, + # Opaque cursor from a previous response's `nextCursor`. + cursor: nil, + limit: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + conversation_id: String, + cursor: String, + limit: Integer, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/conversation_list_params.rbi b/rbi/zavudev/models/conversation_list_params.rbi new file mode 100644 index 0000000..a59c84c --- /dev/null +++ b/rbi/zavudev/models/conversation_list_params.rbi @@ -0,0 +1,167 @@ +# typed: strong + +module Zavudev + module Models + class ConversationListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::ConversationListParams, Zavudev::Internal::AnyHash) + end + + # Keep only threads that have carried this channel. + sig do + returns(T.nilable(Zavudev::ConversationListParams::Channel::OrSymbol)) + end + attr_reader :channel + + sig do + params(channel: Zavudev::ConversationListParams::Channel::OrSymbol).void + end + attr_writer :channel + + # Opaque cursor from a previous response's `nextCursor`. Do not construct it. + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Search threads by identity: phone number (any format — `+1 (555) 123-4567` and + # `15551234567` both match), email address (full or local part), WhatsApp group + # subject, WhatsApp username, or BSUID. Matching is by whole word, with prefix + # matching on the last term, so `mar` finds `maria@example.com` and `+1555` finds + # `+15551234567`; a fragment from the middle or end of a number (`4567`) does not + # match. + # + # It does **not** search message bodies — only who the thread is with. + # + # Results come back ranked by relevance rather than by recency, so the usual "most + # recently active first" ordering does not apply while `q` is set. `senderId` and + # `channel` still narrow the results, and `cursor` paginates them as usual. An + # empty or whitespace-only `q` returns no items rather than the full list. + sig { returns(T.nilable(String)) } + attr_reader :search + + sig { params(search: String).void } + attr_writer :search + + # Keep only threads last handled by this sender. + sig { returns(T.nilable(String)) } + attr_reader :sender_id + + sig { params(sender_id: String).void } + attr_writer :sender_id + + sig do + params( + channel: Zavudev::ConversationListParams::Channel::OrSymbol, + cursor: String, + limit: Integer, + search: String, + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Keep only threads that have carried this channel. + channel: nil, + # Opaque cursor from a previous response's `nextCursor`. Do not construct it. + cursor: nil, + limit: nil, + # Search threads by identity: phone number (any format — `+1 (555) 123-4567` and + # `15551234567` both match), email address (full or local part), WhatsApp group + # subject, WhatsApp username, or BSUID. Matching is by whole word, with prefix + # matching on the last term, so `mar` finds `maria@example.com` and `+1555` finds + # `+15551234567`; a fragment from the middle or end of a number (`4567`) does not + # match. + # + # It does **not** search message bodies — only who the thread is with. + # + # Results come back ranked by relevance rather than by recency, so the usual "most + # recently active first" ordering does not apply while `q` is set. `senderId` and + # `channel` still narrow the results, and `cursor` paginates them as usual. An + # empty or whitespace-only `q` returns no items rather than the full list. + search: nil, + # Keep only threads last handled by this sender. + sender_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + channel: Zavudev::ConversationListParams::Channel::OrSymbol, + cursor: String, + limit: Integer, + search: String, + sender_id: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + + # Keep only threads that have carried this channel. + module Channel + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Zavudev::ConversationListParams::Channel) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMS = + T.let(:sms, Zavudev::ConversationListParams::Channel::TaggedSymbol) + SMS_ONEWAY = + T.let( + :sms_oneway, + Zavudev::ConversationListParams::Channel::TaggedSymbol + ) + WHATSAPP = + T.let( + :whatsapp, + Zavudev::ConversationListParams::Channel::TaggedSymbol + ) + EMAIL = + T.let(:email, Zavudev::ConversationListParams::Channel::TaggedSymbol) + TELEGRAM = + T.let( + :telegram, + Zavudev::ConversationListParams::Channel::TaggedSymbol + ) + INSTAGRAM = + T.let( + :instagram, + Zavudev::ConversationListParams::Channel::TaggedSymbol + ) + MESSENGER = + T.let( + :messenger, + Zavudev::ConversationListParams::Channel::TaggedSymbol + ) + VOICE = + T.let(:voice, Zavudev::ConversationListParams::Channel::TaggedSymbol) + + sig do + override.returns( + T::Array[Zavudev::ConversationListParams::Channel::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/zavudev/models/conversation_list_response.rbi b/rbi/zavudev/models/conversation_list_response.rbi new file mode 100644 index 0000000..ae4c6a5 --- /dev/null +++ b/rbi/zavudev/models/conversation_list_response.rbi @@ -0,0 +1,367 @@ +# typed: strong + +module Zavudev + module Models + class ConversationListResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationListResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Every channel this thread has carried messages on. + sig { returns(T::Array[String]) } + attr_accessor :channels + + # The key this thread is filed under: a phone number in E.164, a WhatsApp + # business-scoped user ID (BSUID), a numeric chat ID + # (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number, + # so do not parse it as one. + sig { returns(String) } + attr_accessor :contact_identifier + + sig { returns(Time) } + attr_accessor :created_at + + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + sig { returns(Zavudev::Models::ConversationListResponse::LastMessage) } + attr_reader :last_message + + sig do + params( + last_message: + Zavudev::Models::ConversationListResponse::LastMessage::OrHash + ).void + end + attr_writer :last_message + + sig { returns(Integer) } + attr_accessor :message_count + + # Inbound messages not yet marked read. Reset with POST + # /v1/conversations/{conversationId}/read. + sig { returns(Integer) } + attr_accessor :unread_count + + sig { returns(Time) } + attr_accessor :updated_at + + # ID of the contact this thread belongs to. Absent on group threads and on threads + # whose contact has not been resolved yet. + sig { returns(T.nilable(String)) } + attr_reader :contact_id + + sig { params(contact_id: String).void } + attr_writer :contact_id + + # Email address of the thread, when the contact was reached by email. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Present when the thread is a group chat rather than a one-to-one conversation. + sig do + returns(T.nilable(Zavudev::Models::ConversationListResponse::Group)) + end + attr_reader :group + + sig do + params( + group: Zavudev::Models::ConversationListResponse::Group::OrHash + ).void + end + attr_writer :group + + # Sender that last handled this thread. Use it as the `Zavu-Sender` header when + # replying so the answer leaves from the same number the contact knows. + sig { returns(T.nilable(String)) } + attr_reader :sender_id + + sig { params(sender_id: String).void } + attr_writer :sender_id + + # WhatsApp identity, present when the contact adopted a username. + sig do + returns(T.nilable(Zavudev::Models::ConversationListResponse::Whatsapp)) + end + attr_reader :whatsapp + + sig do + params( + whatsapp: Zavudev::Models::ConversationListResponse::Whatsapp::OrHash + ).void + end + attr_writer :whatsapp + + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + sig do + params( + id: String, + channels: T::Array[String], + contact_identifier: String, + created_at: Time, + last_message: + Zavudev::Models::ConversationListResponse::LastMessage::OrHash, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: Zavudev::Models::ConversationListResponse::Group::OrHash, + sender_id: String, + whatsapp: Zavudev::Models::ConversationListResponse::Whatsapp::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # Every channel this thread has carried messages on. + channels:, + # The key this thread is filed under: a phone number in E.164, a WhatsApp + # business-scoped user ID (BSUID), a numeric chat ID + # (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number, + # so do not parse it as one. + contact_identifier:, + created_at:, + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + last_message:, + message_count:, + # Inbound messages not yet marked read. Reset with POST + # /v1/conversations/{conversationId}/read. + unread_count:, + updated_at:, + # ID of the contact this thread belongs to. Absent on group threads and on threads + # whose contact has not been resolved yet. + contact_id: nil, + # Email address of the thread, when the contact was reached by email. + email: nil, + # Present when the thread is a group chat rather than a one-to-one conversation. + group: nil, + # Sender that last handled this thread. Use it as the `Zavu-Sender` header when + # replying so the answer leaves from the same number the contact knows. + sender_id: nil, + # WhatsApp identity, present when the contact adopted a username. + whatsapp: nil + ) + end + + sig do + override.returns( + { + id: String, + channels: T::Array[String], + contact_identifier: String, + created_at: Time, + last_message: + Zavudev::Models::ConversationListResponse::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: Zavudev::Models::ConversationListResponse::Group, + sender_id: String, + whatsapp: Zavudev::Models::ConversationListResponse::Whatsapp + } + ) + end + def to_hash + end + + class LastMessage < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationListResponse::LastMessage, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :at + + # Delivery channel. Use 'auto' for intelligent routing. + sig { returns(Zavudev::Channel::TaggedSymbol) } + attr_accessor :channel + + sig do + returns( + Zavudev::Models::ConversationListResponse::LastMessage::Direction::TaggedSymbol + ) + end + attr_accessor :direction + + # Text or caption. Empty when the last message carried no text (e.g. media). + sig { returns(String) } + attr_accessor :text + + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + sig do + params( + id: String, + at: Time, + channel: Zavudev::Channel::OrSymbol, + direction: + Zavudev::Models::ConversationListResponse::LastMessage::Direction::OrSymbol, + text: String + ).returns(T.attached_class) + end + def self.new( + id:, + at:, + # Delivery channel. Use 'auto' for intelligent routing. + channel:, + direction:, + # Text or caption. Empty when the last message carried no text (e.g. media). + text: + ) + end + + sig do + override.returns( + { + id: String, + at: Time, + channel: Zavudev::Channel::TaggedSymbol, + direction: + Zavudev::Models::ConversationListResponse::LastMessage::Direction::TaggedSymbol, + text: String + } + ) + end + def to_hash + end + + module Direction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::ConversationListResponse::LastMessage::Direction + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INBOUND = + T.let( + :inbound, + Zavudev::Models::ConversationListResponse::LastMessage::Direction::TaggedSymbol + ) + OUTBOUND = + T.let( + :outbound, + Zavudev::Models::ConversationListResponse::LastMessage::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::ConversationListResponse::LastMessage::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Group < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationListResponse::Group, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_reader :participant_count + + sig { params(participant_count: Integer).void } + attr_writer :participant_count + + sig { returns(T.nilable(String)) } + attr_reader :subject + + sig { params(subject: String).void } + attr_writer :subject + + # Present when the thread is a group chat rather than a one-to-one conversation. + sig do + params( + id: String, + participant_count: Integer, + subject: String + ).returns(T.attached_class) + end + def self.new(id:, participant_count: nil, subject: nil) + end + + sig do + override.returns( + { id: String, participant_count: Integer, subject: String } + ) + end + def to_hash + end + end + + class Whatsapp < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationListResponse::Whatsapp, + Zavudev::Internal::AnyHash + ) + end + + # Business-scoped user ID. Can be used as `to` when sending. + sig { returns(T.nilable(String)) } + attr_reader :bsuid + + sig { params(bsuid: String).void } + attr_writer :bsuid + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # WhatsApp identity, present when the contact adopted a username. + sig do + params(bsuid: String, username: String).returns(T.attached_class) + end + def self.new( + # Business-scoped user ID. Can be used as `to` when sending. + bsuid: nil, + username: nil + ) + end + + sig { override.returns({ bsuid: String, username: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/conversation_mark_as_read_params.rbi b/rbi/zavudev/models/conversation_mark_as_read_params.rbi new file mode 100644 index 0000000..c5ae763 --- /dev/null +++ b/rbi/zavudev/models/conversation_mark_as_read_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Zavudev + module Models + class ConversationMarkAsReadParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::ConversationMarkAsReadParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :conversation_id + + sig do + params( + conversation_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(conversation_id:, request_options: {}) + end + + sig do + override.returns( + { conversation_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/conversation_mark_as_read_response.rbi b/rbi/zavudev/models/conversation_mark_as_read_response.rbi new file mode 100644 index 0000000..efe4aa3 --- /dev/null +++ b/rbi/zavudev/models/conversation_mark_as_read_response.rbi @@ -0,0 +1,436 @@ +# typed: strong + +module Zavudev + module Models + class ConversationMarkAsReadResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationMarkAsReadResponse, + Zavudev::Internal::AnyHash + ) + end + + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + sig do + returns(Zavudev::Models::ConversationMarkAsReadResponse::Conversation) + end + attr_reader :conversation + + sig do + params( + conversation: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::OrHash + ).void + end + attr_writer :conversation + + sig do + params( + conversation: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::OrHash + ).returns(T.attached_class) + end + def self.new( + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + conversation: + ) + end + + sig do + override.returns( + { + conversation: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation + } + ) + end + def to_hash + end + + class Conversation < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationMarkAsReadResponse::Conversation, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Every channel this thread has carried messages on. + sig { returns(T::Array[String]) } + attr_accessor :channels + + # The key this thread is filed under: a phone number in E.164, a WhatsApp + # business-scoped user ID (BSUID), a numeric chat ID + # (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number, + # so do not parse it as one. + sig { returns(String) } + attr_accessor :contact_identifier + + sig { returns(Time) } + attr_accessor :created_at + + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + sig do + returns( + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage + ) + end + attr_reader :last_message + + sig do + params( + last_message: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::OrHash + ).void + end + attr_writer :last_message + + sig { returns(Integer) } + attr_accessor :message_count + + # Inbound messages not yet marked read. Reset with POST + # /v1/conversations/{conversationId}/read. + sig { returns(Integer) } + attr_accessor :unread_count + + sig { returns(Time) } + attr_accessor :updated_at + + # ID of the contact this thread belongs to. Absent on group threads and on threads + # whose contact has not been resolved yet. + sig { returns(T.nilable(String)) } + attr_reader :contact_id + + sig { params(contact_id: String).void } + attr_writer :contact_id + + # Email address of the thread, when the contact was reached by email. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Present when the thread is a group chat rather than a one-to-one conversation. + sig do + returns( + T.nilable( + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group + ) + ) + end + attr_reader :group + + sig do + params( + group: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group::OrHash + ).void + end + attr_writer :group + + # Sender that last handled this thread. Use it as the `Zavu-Sender` header when + # replying so the answer leaves from the same number the contact knows. + sig { returns(T.nilable(String)) } + attr_reader :sender_id + + sig { params(sender_id: String).void } + attr_writer :sender_id + + # WhatsApp identity, present when the contact adopted a username. + sig do + returns( + T.nilable( + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp + ) + ) + end + attr_reader :whatsapp + + sig do + params( + whatsapp: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp::OrHash + ).void + end + attr_writer :whatsapp + + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + sig do + params( + id: String, + channels: T::Array[String], + contact_identifier: String, + created_at: Time, + last_message: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::OrHash, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group::OrHash, + sender_id: String, + whatsapp: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # Every channel this thread has carried messages on. + channels:, + # The key this thread is filed under: a phone number in E.164, a WhatsApp + # business-scoped user ID (BSUID), a numeric chat ID + # (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number, + # so do not parse it as one. + contact_identifier:, + created_at:, + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + last_message:, + message_count:, + # Inbound messages not yet marked read. Reset with POST + # /v1/conversations/{conversationId}/read. + unread_count:, + updated_at:, + # ID of the contact this thread belongs to. Absent on group threads and on threads + # whose contact has not been resolved yet. + contact_id: nil, + # Email address of the thread, when the contact was reached by email. + email: nil, + # Present when the thread is a group chat rather than a one-to-one conversation. + group: nil, + # Sender that last handled this thread. Use it as the `Zavu-Sender` header when + # replying so the answer leaves from the same number the contact knows. + sender_id: nil, + # WhatsApp identity, present when the contact adopted a username. + whatsapp: nil + ) + end + + sig do + override.returns( + { + id: String, + channels: T::Array[String], + contact_identifier: String, + created_at: Time, + last_message: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group, + sender_id: String, + whatsapp: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp + } + ) + end + def to_hash + end + + class LastMessage < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :at + + # Delivery channel. Use 'auto' for intelligent routing. + sig { returns(Zavudev::Channel::TaggedSymbol) } + attr_accessor :channel + + sig do + returns( + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::Direction::TaggedSymbol + ) + end + attr_accessor :direction + + # Text or caption. Empty when the last message carried no text (e.g. media). + sig { returns(String) } + attr_accessor :text + + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + sig do + params( + id: String, + at: Time, + channel: Zavudev::Channel::OrSymbol, + direction: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::Direction::OrSymbol, + text: String + ).returns(T.attached_class) + end + def self.new( + id:, + at:, + # Delivery channel. Use 'auto' for intelligent routing. + channel:, + direction:, + # Text or caption. Empty when the last message carried no text (e.g. media). + text: + ) + end + + sig do + override.returns( + { + id: String, + at: Time, + channel: Zavudev::Channel::TaggedSymbol, + direction: + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::Direction::TaggedSymbol, + text: String + } + ) + end + def to_hash + end + + module Direction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::Direction + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INBOUND = + T.let( + :inbound, + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::Direction::TaggedSymbol + ) + OUTBOUND = + T.let( + :outbound, + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Group < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_reader :participant_count + + sig { params(participant_count: Integer).void } + attr_writer :participant_count + + sig { returns(T.nilable(String)) } + attr_reader :subject + + sig { params(subject: String).void } + attr_writer :subject + + # Present when the thread is a group chat rather than a one-to-one conversation. + sig do + params( + id: String, + participant_count: Integer, + subject: String + ).returns(T.attached_class) + end + def self.new(id:, participant_count: nil, subject: nil) + end + + sig do + override.returns( + { id: String, participant_count: Integer, subject: String } + ) + end + def to_hash + end + end + + class Whatsapp < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp, + Zavudev::Internal::AnyHash + ) + end + + # Business-scoped user ID. Can be used as `to` when sending. + sig { returns(T.nilable(String)) } + attr_reader :bsuid + + sig { params(bsuid: String).void } + attr_writer :bsuid + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # WhatsApp identity, present when the contact adopted a username. + sig do + params(bsuid: String, username: String).returns(T.attached_class) + end + def self.new( + # Business-scoped user ID. Can be used as `to` when sending. + bsuid: nil, + username: nil + ) + end + + sig { override.returns({ bsuid: String, username: String }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/zavudev/models/conversation_retrieve_params.rbi b/rbi/zavudev/models/conversation_retrieve_params.rbi new file mode 100644 index 0000000..9e98b2d --- /dev/null +++ b/rbi/zavudev/models/conversation_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Zavudev + module Models + class ConversationRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::ConversationRetrieveParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :conversation_id + + sig do + params( + conversation_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(conversation_id:, request_options: {}) + end + + sig do + override.returns( + { conversation_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/conversation_retrieve_response.rbi b/rbi/zavudev/models/conversation_retrieve_response.rbi new file mode 100644 index 0000000..ff648b6 --- /dev/null +++ b/rbi/zavudev/models/conversation_retrieve_response.rbi @@ -0,0 +1,436 @@ +# typed: strong + +module Zavudev + module Models + class ConversationRetrieveResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationRetrieveResponse, + Zavudev::Internal::AnyHash + ) + end + + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + sig do + returns(Zavudev::Models::ConversationRetrieveResponse::Conversation) + end + attr_reader :conversation + + sig do + params( + conversation: + Zavudev::Models::ConversationRetrieveResponse::Conversation::OrHash + ).void + end + attr_writer :conversation + + sig do + params( + conversation: + Zavudev::Models::ConversationRetrieveResponse::Conversation::OrHash + ).returns(T.attached_class) + end + def self.new( + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + conversation: + ) + end + + sig do + override.returns( + { + conversation: + Zavudev::Models::ConversationRetrieveResponse::Conversation + } + ) + end + def to_hash + end + + class Conversation < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationRetrieveResponse::Conversation, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Every channel this thread has carried messages on. + sig { returns(T::Array[String]) } + attr_accessor :channels + + # The key this thread is filed under: a phone number in E.164, a WhatsApp + # business-scoped user ID (BSUID), a numeric chat ID + # (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number, + # so do not parse it as one. + sig { returns(String) } + attr_accessor :contact_identifier + + sig { returns(Time) } + attr_accessor :created_at + + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + sig do + returns( + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage + ) + end + attr_reader :last_message + + sig do + params( + last_message: + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::OrHash + ).void + end + attr_writer :last_message + + sig { returns(Integer) } + attr_accessor :message_count + + # Inbound messages not yet marked read. Reset with POST + # /v1/conversations/{conversationId}/read. + sig { returns(Integer) } + attr_accessor :unread_count + + sig { returns(Time) } + attr_accessor :updated_at + + # ID of the contact this thread belongs to. Absent on group threads and on threads + # whose contact has not been resolved yet. + sig { returns(T.nilable(String)) } + attr_reader :contact_id + + sig { params(contact_id: String).void } + attr_writer :contact_id + + # Email address of the thread, when the contact was reached by email. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Present when the thread is a group chat rather than a one-to-one conversation. + sig do + returns( + T.nilable( + Zavudev::Models::ConversationRetrieveResponse::Conversation::Group + ) + ) + end + attr_reader :group + + sig do + params( + group: + Zavudev::Models::ConversationRetrieveResponse::Conversation::Group::OrHash + ).void + end + attr_writer :group + + # Sender that last handled this thread. Use it as the `Zavu-Sender` header when + # replying so the answer leaves from the same number the contact knows. + sig { returns(T.nilable(String)) } + attr_reader :sender_id + + sig { params(sender_id: String).void } + attr_writer :sender_id + + # WhatsApp identity, present when the contact adopted a username. + sig do + returns( + T.nilable( + Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp + ) + ) + end + attr_reader :whatsapp + + sig do + params( + whatsapp: + Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp::OrHash + ).void + end + attr_writer :whatsapp + + # An inbox thread with one contact. A conversation groups every message exchanged + # with that contact across channels, so a contact who writes on WhatsApp and later + # by email stays in one thread. + sig do + params( + id: String, + channels: T::Array[String], + contact_identifier: String, + created_at: Time, + last_message: + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::OrHash, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: + Zavudev::Models::ConversationRetrieveResponse::Conversation::Group::OrHash, + sender_id: String, + whatsapp: + Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # Every channel this thread has carried messages on. + channels:, + # The key this thread is filed under: a phone number in E.164, a WhatsApp + # business-scoped user ID (BSUID), a numeric chat ID + # (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number, + # so do not parse it as one. + contact_identifier:, + created_at:, + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + last_message:, + message_count:, + # Inbound messages not yet marked read. Reset with POST + # /v1/conversations/{conversationId}/read. + unread_count:, + updated_at:, + # ID of the contact this thread belongs to. Absent on group threads and on threads + # whose contact has not been resolved yet. + contact_id: nil, + # Email address of the thread, when the contact was reached by email. + email: nil, + # Present when the thread is a group chat rather than a one-to-one conversation. + group: nil, + # Sender that last handled this thread. Use it as the `Zavu-Sender` header when + # replying so the answer leaves from the same number the contact knows. + sender_id: nil, + # WhatsApp identity, present when the contact adopted a username. + whatsapp: nil + ) + end + + sig do + override.returns( + { + id: String, + channels: T::Array[String], + contact_identifier: String, + created_at: Time, + last_message: + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: + Zavudev::Models::ConversationRetrieveResponse::Conversation::Group, + sender_id: String, + whatsapp: + Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp + } + ) + end + def to_hash + end + + class LastMessage < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :at + + # Delivery channel. Use 'auto' for intelligent routing. + sig { returns(Zavudev::Channel::TaggedSymbol) } + attr_accessor :channel + + sig do + returns( + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::Direction::TaggedSymbol + ) + end + attr_accessor :direction + + # Text or caption. Empty when the last message carried no text (e.g. media). + sig { returns(String) } + attr_accessor :text + + # Denormalized preview of the most recent message, so a thread list needs no extra + # fetch. + sig do + params( + id: String, + at: Time, + channel: Zavudev::Channel::OrSymbol, + direction: + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::Direction::OrSymbol, + text: String + ).returns(T.attached_class) + end + def self.new( + id:, + at:, + # Delivery channel. Use 'auto' for intelligent routing. + channel:, + direction:, + # Text or caption. Empty when the last message carried no text (e.g. media). + text: + ) + end + + sig do + override.returns( + { + id: String, + at: Time, + channel: Zavudev::Channel::TaggedSymbol, + direction: + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::Direction::TaggedSymbol, + text: String + } + ) + end + def to_hash + end + + module Direction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::Direction + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INBOUND = + T.let( + :inbound, + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::Direction::TaggedSymbol + ) + OUTBOUND = + T.let( + :outbound, + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Group < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationRetrieveResponse::Conversation::Group, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_reader :participant_count + + sig { params(participant_count: Integer).void } + attr_writer :participant_count + + sig { returns(T.nilable(String)) } + attr_reader :subject + + sig { params(subject: String).void } + attr_writer :subject + + # Present when the thread is a group chat rather than a one-to-one conversation. + sig do + params( + id: String, + participant_count: Integer, + subject: String + ).returns(T.attached_class) + end + def self.new(id:, participant_count: nil, subject: nil) + end + + sig do + override.returns( + { id: String, participant_count: Integer, subject: String } + ) + end + def to_hash + end + end + + class Whatsapp < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp, + Zavudev::Internal::AnyHash + ) + end + + # Business-scoped user ID. Can be used as `to` when sending. + sig { returns(T.nilable(String)) } + attr_reader :bsuid + + sig { params(bsuid: String).void } + attr_writer :bsuid + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # WhatsApp identity, present when the contact adopted a username. + sig do + params(bsuid: String, username: String).returns(T.attached_class) + end + def self.new( + # Business-scoped user ID. Can be used as `to` when sending. + bsuid: nil, + username: nil + ) + end + + sig { override.returns({ bsuid: String, username: String }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/zavudev/models/email_domain_create_params.rbi b/rbi/zavudev/models/email_domain_create_params.rbi new file mode 100644 index 0000000..ac4c4b4 --- /dev/null +++ b/rbi/zavudev/models/email_domain_create_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Zavudev + module Models + class EmailDomainCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::EmailDomainCreateParams, Zavudev::Internal::AnyHash) + end + + # Bare domain, e.g. example.com. + sig { returns(String) } + attr_accessor :domain + + sig do + params( + domain: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Bare domain, e.g. example.com. + domain:, + request_options: {} + ) + end + + sig do + override.returns( + { domain: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/email_domain_create_response.rbi b/rbi/zavudev/models/email_domain_create_response.rbi new file mode 100644 index 0000000..10c8ee4 --- /dev/null +++ b/rbi/zavudev/models/email_domain_create_response.rbi @@ -0,0 +1,259 @@ +# typed: strong + +module Zavudev + module Models + class EmailDomainCreateResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainCreateResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(Zavudev::Models::EmailDomainCreateResponse::Domain) } + attr_reader :domain + + sig do + params( + domain: Zavudev::Models::EmailDomainCreateResponse::Domain::OrHash + ).void + end + attr_writer :domain + + sig do + params( + domain: Zavudev::Models::EmailDomainCreateResponse::Domain::OrHash + ).returns(T.attached_class) + end + def self.new(domain:) + end + + sig do + override.returns( + { domain: Zavudev::Models::EmailDomainCreateResponse::Domain } + ) + end + def to_hash + end + + class Domain < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainCreateResponse::Domain, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :dkim_status + + sig { returns(String) } + attr_accessor :domain + + # Overall verification status. + sig { returns(String) } + attr_accessor :status + + # DNS records to publish. Present when fetching a single domain or after adding + # one. + sig do + returns( + T.nilable( + T::Array[ + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord + ] + ) + ) + end + attr_reader :dns_records + + sig do + params( + dns_records: + T::Array[ + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::OrHash + ] + ).void + end + attr_writer :dns_records + + sig do + params( + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: + T::Array[ + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + id:, + dkim_status:, + domain:, + # Overall verification status. + status:, + # DNS records to publish. Present when fetching a single domain or after adding + # one. + dns_records: nil + ) + end + + sig do + override.returns( + { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: + T::Array[ + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord + ] + } + ) + end + def to_hash + end + + class DNSRecord < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord, + Zavudev::Internal::AnyHash + ) + end + + # Record host/name to create. + sig { returns(String) } + attr_accessor :name + + # What the record is for. + sig do + returns( + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + end + attr_accessor :purpose + + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + sig { returns(T::Boolean) } + attr_accessor :required + + # DNS record type. + sig { returns(String) } + attr_accessor :type + + # Record value. + sig { returns(String) } + attr_accessor :value + + # Priority (MX records only). + sig { returns(T.nilable(Integer)) } + attr_reader :priority + + sig { params(priority: Integer).void } + attr_writer :priority + + sig do + params( + name: String, + purpose: + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose::OrSymbol, + required: T::Boolean, + type: String, + value: String, + priority: Integer + ).returns(T.attached_class) + end + def self.new( + # Record host/name to create. + name:, + # What the record is for. + purpose:, + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + required:, + # DNS record type. + type:, + # Record value. + value:, + # Priority (MX records only). + priority: nil + ) + end + + sig do + override.returns( + { + name: String, + purpose: + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose::TaggedSymbol, + required: T::Boolean, + type: String, + value: String, + priority: Integer + } + ) + end + def to_hash + end + + # What the record is for. + module Purpose + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DKIM = + T.let( + :dkim, + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + SPF = + T.let( + :spf, + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + DMARC = + T.let( + :dmarc, + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + MAIL_FROM = + T.let( + :mail_from, + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/email_domain_delete_params.rbi b/rbi/zavudev/models/email_domain_delete_params.rbi new file mode 100644 index 0000000..c9ba6a7 --- /dev/null +++ b/rbi/zavudev/models/email_domain_delete_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Zavudev + module Models + class EmailDomainDeleteParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::EmailDomainDeleteParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :domain_id + + sig do + params( + domain_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(domain_id:, request_options: {}) + end + + sig do + override.returns( + { domain_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/email_domain_list_params.rbi b/rbi/zavudev/models/email_domain_list_params.rbi new file mode 100644 index 0000000..bf2a28d --- /dev/null +++ b/rbi/zavudev/models/email_domain_list_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Zavudev + module Models + class EmailDomainListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::EmailDomainListParams, Zavudev::Internal::AnyHash) + end + + sig do + params(request_options: Zavudev::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Zavudev::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/email_domain_list_response.rbi b/rbi/zavudev/models/email_domain_list_response.rbi new file mode 100644 index 0000000..e40a2ed --- /dev/null +++ b/rbi/zavudev/models/email_domain_list_response.rbi @@ -0,0 +1,253 @@ +# typed: strong + +module Zavudev + module Models + class EmailDomainListResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainListResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(T::Array[Zavudev::Models::EmailDomainListResponse::Item]) } + attr_accessor :items + + sig do + params( + items: + T::Array[Zavudev::Models::EmailDomainListResponse::Item::OrHash] + ).returns(T.attached_class) + end + def self.new(items:) + end + + sig do + override.returns( + { items: T::Array[Zavudev::Models::EmailDomainListResponse::Item] } + ) + end + def to_hash + end + + class Item < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainListResponse::Item, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :dkim_status + + sig { returns(String) } + attr_accessor :domain + + # Overall verification status. + sig { returns(String) } + attr_accessor :status + + # DNS records to publish. Present when fetching a single domain or after adding + # one. + sig do + returns( + T.nilable( + T::Array[ + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord + ] + ) + ) + end + attr_reader :dns_records + + sig do + params( + dns_records: + T::Array[ + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::OrHash + ] + ).void + end + attr_writer :dns_records + + sig do + params( + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: + T::Array[ + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + id:, + dkim_status:, + domain:, + # Overall verification status. + status:, + # DNS records to publish. Present when fetching a single domain or after adding + # one. + dns_records: nil + ) + end + + sig do + override.returns( + { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: + T::Array[ + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord + ] + } + ) + end + def to_hash + end + + class DNSRecord < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord, + Zavudev::Internal::AnyHash + ) + end + + # Record host/name to create. + sig { returns(String) } + attr_accessor :name + + # What the record is for. + sig do + returns( + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose::TaggedSymbol + ) + end + attr_accessor :purpose + + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + sig { returns(T::Boolean) } + attr_accessor :required + + # DNS record type. + sig { returns(String) } + attr_accessor :type + + # Record value. + sig { returns(String) } + attr_accessor :value + + # Priority (MX records only). + sig { returns(T.nilable(Integer)) } + attr_reader :priority + + sig { params(priority: Integer).void } + attr_writer :priority + + sig do + params( + name: String, + purpose: + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose::OrSymbol, + required: T::Boolean, + type: String, + value: String, + priority: Integer + ).returns(T.attached_class) + end + def self.new( + # Record host/name to create. + name:, + # What the record is for. + purpose:, + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + required:, + # DNS record type. + type:, + # Record value. + value:, + # Priority (MX records only). + priority: nil + ) + end + + sig do + override.returns( + { + name: String, + purpose: + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose::TaggedSymbol, + required: T::Boolean, + type: String, + value: String, + priority: Integer + } + ) + end + def to_hash + end + + # What the record is for. + module Purpose + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DKIM = + T.let( + :dkim, + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose::TaggedSymbol + ) + SPF = + T.let( + :spf, + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose::TaggedSymbol + ) + DMARC = + T.let( + :dmarc, + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose::TaggedSymbol + ) + MAIL_FROM = + T.let( + :mail_from, + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::Purpose::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/email_domain_retrieve_params.rbi b/rbi/zavudev/models/email_domain_retrieve_params.rbi new file mode 100644 index 0000000..5d8f73b --- /dev/null +++ b/rbi/zavudev/models/email_domain_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Zavudev + module Models + class EmailDomainRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::EmailDomainRetrieveParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :domain_id + + sig do + params( + domain_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(domain_id:, request_options: {}) + end + + sig do + override.returns( + { domain_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/email_domain_retrieve_response.rbi b/rbi/zavudev/models/email_domain_retrieve_response.rbi new file mode 100644 index 0000000..90c72a7 --- /dev/null +++ b/rbi/zavudev/models/email_domain_retrieve_response.rbi @@ -0,0 +1,259 @@ +# typed: strong + +module Zavudev + module Models + class EmailDomainRetrieveResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainRetrieveResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(Zavudev::Models::EmailDomainRetrieveResponse::Domain) } + attr_reader :domain + + sig do + params( + domain: Zavudev::Models::EmailDomainRetrieveResponse::Domain::OrHash + ).void + end + attr_writer :domain + + sig do + params( + domain: Zavudev::Models::EmailDomainRetrieveResponse::Domain::OrHash + ).returns(T.attached_class) + end + def self.new(domain:) + end + + sig do + override.returns( + { domain: Zavudev::Models::EmailDomainRetrieveResponse::Domain } + ) + end + def to_hash + end + + class Domain < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainRetrieveResponse::Domain, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :dkim_status + + sig { returns(String) } + attr_accessor :domain + + # Overall verification status. + sig { returns(String) } + attr_accessor :status + + # DNS records to publish. Present when fetching a single domain or after adding + # one. + sig do + returns( + T.nilable( + T::Array[ + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord + ] + ) + ) + end + attr_reader :dns_records + + sig do + params( + dns_records: + T::Array[ + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::OrHash + ] + ).void + end + attr_writer :dns_records + + sig do + params( + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: + T::Array[ + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + id:, + dkim_status:, + domain:, + # Overall verification status. + status:, + # DNS records to publish. Present when fetching a single domain or after adding + # one. + dns_records: nil + ) + end + + sig do + override.returns( + { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: + T::Array[ + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord + ] + } + ) + end + def to_hash + end + + class DNSRecord < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord, + Zavudev::Internal::AnyHash + ) + end + + # Record host/name to create. + sig { returns(String) } + attr_accessor :name + + # What the record is for. + sig do + returns( + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + end + attr_accessor :purpose + + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + sig { returns(T::Boolean) } + attr_accessor :required + + # DNS record type. + sig { returns(String) } + attr_accessor :type + + # Record value. + sig { returns(String) } + attr_accessor :value + + # Priority (MX records only). + sig { returns(T.nilable(Integer)) } + attr_reader :priority + + sig { params(priority: Integer).void } + attr_writer :priority + + sig do + params( + name: String, + purpose: + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose::OrSymbol, + required: T::Boolean, + type: String, + value: String, + priority: Integer + ).returns(T.attached_class) + end + def self.new( + # Record host/name to create. + name:, + # What the record is for. + purpose:, + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + required:, + # DNS record type. + type:, + # Record value. + value:, + # Priority (MX records only). + priority: nil + ) + end + + sig do + override.returns( + { + name: String, + purpose: + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose::TaggedSymbol, + required: T::Boolean, + type: String, + value: String, + priority: Integer + } + ) + end + def to_hash + end + + # What the record is for. + module Purpose + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DKIM = + T.let( + :dkim, + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + SPF = + T.let( + :spf, + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + DMARC = + T.let( + :dmarc, + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + MAIL_FROM = + T.let( + :mail_from, + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/email_domain_verify_params.rbi b/rbi/zavudev/models/email_domain_verify_params.rbi new file mode 100644 index 0000000..649ccf0 --- /dev/null +++ b/rbi/zavudev/models/email_domain_verify_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Zavudev + module Models + class EmailDomainVerifyParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::EmailDomainVerifyParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :domain_id + + sig do + params( + domain_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(domain_id:, request_options: {}) + end + + sig do + override.returns( + { domain_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/email_domain_verify_response.rbi b/rbi/zavudev/models/email_domain_verify_response.rbi new file mode 100644 index 0000000..4431441 --- /dev/null +++ b/rbi/zavudev/models/email_domain_verify_response.rbi @@ -0,0 +1,259 @@ +# typed: strong + +module Zavudev + module Models + class EmailDomainVerifyResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainVerifyResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(Zavudev::Models::EmailDomainVerifyResponse::Domain) } + attr_reader :domain + + sig do + params( + domain: Zavudev::Models::EmailDomainVerifyResponse::Domain::OrHash + ).void + end + attr_writer :domain + + sig do + params( + domain: Zavudev::Models::EmailDomainVerifyResponse::Domain::OrHash + ).returns(T.attached_class) + end + def self.new(domain:) + end + + sig do + override.returns( + { domain: Zavudev::Models::EmailDomainVerifyResponse::Domain } + ) + end + def to_hash + end + + class Domain < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainVerifyResponse::Domain, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :dkim_status + + sig { returns(String) } + attr_accessor :domain + + # Overall verification status. + sig { returns(String) } + attr_accessor :status + + # DNS records to publish. Present when fetching a single domain or after adding + # one. + sig do + returns( + T.nilable( + T::Array[ + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord + ] + ) + ) + end + attr_reader :dns_records + + sig do + params( + dns_records: + T::Array[ + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::OrHash + ] + ).void + end + attr_writer :dns_records + + sig do + params( + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: + T::Array[ + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + id:, + dkim_status:, + domain:, + # Overall verification status. + status:, + # DNS records to publish. Present when fetching a single domain or after adding + # one. + dns_records: nil + ) + end + + sig do + override.returns( + { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: + T::Array[ + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord + ] + } + ) + end + def to_hash + end + + class DNSRecord < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord, + Zavudev::Internal::AnyHash + ) + end + + # Record host/name to create. + sig { returns(String) } + attr_accessor :name + + # What the record is for. + sig do + returns( + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + end + attr_accessor :purpose + + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + sig { returns(T::Boolean) } + attr_accessor :required + + # DNS record type. + sig { returns(String) } + attr_accessor :type + + # Record value. + sig { returns(String) } + attr_accessor :value + + # Priority (MX records only). + sig { returns(T.nilable(Integer)) } + attr_reader :priority + + sig { params(priority: Integer).void } + attr_writer :priority + + sig do + params( + name: String, + purpose: + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose::OrSymbol, + required: T::Boolean, + type: String, + value: String, + priority: Integer + ).returns(T.attached_class) + end + def self.new( + # Record host/name to create. + name:, + # What the record is for. + purpose:, + # Whether the record is required to verify + send (DKIM) or recommended for + # deliverability. + required:, + # DNS record type. + type:, + # Record value. + value:, + # Priority (MX records only). + priority: nil + ) + end + + sig do + override.returns( + { + name: String, + purpose: + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose::TaggedSymbol, + required: T::Boolean, + type: String, + value: String, + priority: Integer + } + ) + end + def to_hash + end + + # What the record is for. + module Purpose + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DKIM = + T.let( + :dkim, + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + SPF = + T.let( + :spf, + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + DMARC = + T.let( + :dmarc, + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + MAIL_FROM = + T.let( + :mail_from, + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::Purpose::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/function_list_deployments_params.rbi b/rbi/zavudev/models/function_list_deployments_params.rbi new file mode 100644 index 0000000..ed1f9e5 --- /dev/null +++ b/rbi/zavudev/models/function_list_deployments_params.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Zavudev + module Models + class FunctionListDeploymentsParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::FunctionListDeploymentsParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :function_id + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig do + params( + function_id: String, + limit: Integer, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(function_id:, limit: nil, request_options: {}) + end + + sig do + override.returns( + { + function_id: String, + limit: Integer, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/function_list_deployments_response.rbi b/rbi/zavudev/models/function_list_deployments_response.rbi new file mode 100644 index 0000000..7335041 --- /dev/null +++ b/rbi/zavudev/models/function_list_deployments_response.rbi @@ -0,0 +1,211 @@ +# typed: strong + +module Zavudev + module Models + class FunctionListDeploymentsResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::FunctionListDeploymentsResponse, + Zavudev::Internal::AnyHash + ) + end + + sig do + returns( + T::Array[Zavudev::Models::FunctionListDeploymentsResponse::Deployment] + ) + end + attr_accessor :deployments + + sig do + params( + deployments: + T::Array[ + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::OrHash + ] + ).returns(T.attached_class) + end + def self.new(deployments:) + end + + sig do + override.returns( + { + deployments: + T::Array[ + Zavudev::Models::FunctionListDeploymentsResponse::Deployment + ] + } + ) + end + def to_hash + end + + class Deployment < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::FunctionListDeploymentsResponse::Deployment, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :bundle_size_bytes + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :deployed_at + + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_active + + sig { params(is_active: T::Boolean).void } + attr_writer :is_active + + # Stage of a function deployment. + sig do + returns( + T.nilable( + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::OrSymbol + ).void + end + attr_writer :status + + sig { returns(T.nilable(Integer)) } + attr_reader :version + + sig { params(version: Integer).void } + attr_writer :version + + sig do + params( + id: String, + bundle_size_bytes: T.nilable(Integer), + created_at: Time, + deployed_at: T.nilable(Time), + error_message: T.nilable(String), + is_active: T::Boolean, + status: + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::OrSymbol, + version: Integer + ).returns(T.attached_class) + end + def self.new( + id: nil, + bundle_size_bytes: nil, + created_at: nil, + deployed_at: nil, + error_message: nil, + is_active: nil, + # Stage of a function deployment. + status: nil, + version: nil + ) + end + + sig do + override.returns( + { + id: String, + bundle_size_bytes: T.nilable(Integer), + created_at: Time, + deployed_at: T.nilable(Time), + error_message: T.nilable(String), + is_active: T::Boolean, + status: + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::TaggedSymbol, + version: Integer + } + ) + end + def to_hash + end + + # Stage of a function deployment. + module Status + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::TaggedSymbol + ) + BUNDLING = + T.let( + :bundling, + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::TaggedSymbol + ) + UPLOADING = + T.let( + :uploading, + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::TaggedSymbol + ) + PUBLISHING = + T.let( + :publishing, + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::TaggedSymbol + ) + ACTIVE = + T.let( + :active, + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::TaggedSymbol + ) + SUPERSEDED = + T.let( + :superseded, + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/zavudev/models/function_list_event_types_params.rbi b/rbi/zavudev/models/function_list_event_types_params.rbi new file mode 100644 index 0000000..0bb44b6 --- /dev/null +++ b/rbi/zavudev/models/function_list_event_types_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Zavudev + module Models + class FunctionListEventTypesParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::FunctionListEventTypesParams, + Zavudev::Internal::AnyHash + ) + end + + sig do + params(request_options: Zavudev::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Zavudev::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/function_list_event_types_response.rbi b/rbi/zavudev/models/function_list_event_types_response.rbi new file mode 100644 index 0000000..818f580 --- /dev/null +++ b/rbi/zavudev/models/function_list_event_types_response.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Zavudev + module Models + class FunctionListEventTypesResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::FunctionListEventTypesResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(T::Array[String]) } + attr_accessor :events + + sig { params(events: T::Array[String]).returns(T.attached_class) } + def self.new(events:) + end + + sig { override.returns({ events: T::Array[String] }) } + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/function_rollback_deployment_params.rbi b/rbi/zavudev/models/function_rollback_deployment_params.rbi new file mode 100644 index 0000000..0ea65a3 --- /dev/null +++ b/rbi/zavudev/models/function_rollback_deployment_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Zavudev + module Models + class FunctionRollbackDeploymentParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::FunctionRollbackDeploymentParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :function_id + + # ID of the deployment to roll back to. + sig { returns(String) } + attr_accessor :deployment_id + + sig do + params( + function_id: String, + deployment_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + function_id:, + # ID of the deployment to roll back to. + deployment_id:, + request_options: {} + ) + end + + sig do + override.returns( + { + function_id: String, + deployment_id: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/function_rollback_deployment_response.rbi b/rbi/zavudev/models/function_rollback_deployment_response.rbi new file mode 100644 index 0000000..e630ba3 --- /dev/null +++ b/rbi/zavudev/models/function_rollback_deployment_response.rbi @@ -0,0 +1,240 @@ +# typed: strong + +module Zavudev + module Models + class FunctionRollbackDeploymentResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::FunctionRollbackDeploymentResponse, + Zavudev::Internal::AnyHash + ) + end + + sig do + returns(Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment) + end + attr_reader :deployment + + sig do + params( + deployment: + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::OrHash + ).void + end + attr_writer :deployment + + # The draft that was replaced, so a UI can offer to restore it. + sig { returns(T.nilable(T.anything)) } + attr_accessor :previous_draft + + sig { returns(T.nilable(Integer)) } + attr_reader :rolled_back_to_version + + sig { params(rolled_back_to_version: Integer).void } + attr_writer :rolled_back_to_version + + sig do + params( + deployment: + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::OrHash, + previous_draft: T.nilable(T.anything), + rolled_back_to_version: Integer + ).returns(T.attached_class) + end + def self.new( + deployment:, + # The draft that was replaced, so a UI can offer to restore it. + previous_draft: nil, + rolled_back_to_version: nil + ) + end + + sig do + override.returns( + { + deployment: + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment, + previous_draft: T.nilable(T.anything), + rolled_back_to_version: Integer + } + ) + end + def to_hash + end + + class Deployment < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :function_id + + # Stage of a function deployment. + sig do + returns( + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Monotonically increasing deployment version, starting at 1. + sig { returns(Integer) } + attr_accessor :version + + # What the build printed: dependency installation, the bundler's output, and the + # compiler's message when it failed. Returned when fetching a single deployment, + # omitted from the list. Read this first when a deploy fails — `errorMessage` is + # often the outer wrapper's summary, and the line that names the broken import or + # the syntax error is here. + sig { returns(T.nilable(String)) } + attr_accessor :build_logs + + # Size of the built bundle in bytes. Null until the build finishes. + sig { returns(T.nilable(Integer)) } + attr_accessor :bundle_bytes + + sig { returns(T.nilable(Time)) } + attr_accessor :deployed_at + + # Failure reason when status is 'failed'. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Total size of the deployed source tree in bytes. + sig { returns(T.nilable(Integer)) } + attr_accessor :source_code_bytes + + sig do + params( + id: String, + created_at: Time, + function_id: String, + status: + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::OrSymbol, + version: Integer, + build_logs: T.nilable(String), + bundle_bytes: T.nilable(Integer), + deployed_at: T.nilable(Time), + error_message: T.nilable(String), + source_code_bytes: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + function_id:, + # Stage of a function deployment. + status:, + # Monotonically increasing deployment version, starting at 1. + version:, + # What the build printed: dependency installation, the bundler's output, and the + # compiler's message when it failed. Returned when fetching a single deployment, + # omitted from the list. Read this first when a deploy fails — `errorMessage` is + # often the outer wrapper's summary, and the line that names the broken import or + # the syntax error is here. + build_logs: nil, + # Size of the built bundle in bytes. Null until the build finishes. + bundle_bytes: nil, + deployed_at: nil, + # Failure reason when status is 'failed'. + error_message: nil, + # Total size of the deployed source tree in bytes. + source_code_bytes: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + function_id: String, + status: + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::TaggedSymbol, + version: Integer, + build_logs: T.nilable(String), + bundle_bytes: T.nilable(Integer), + deployed_at: T.nilable(Time), + error_message: T.nilable(String), + source_code_bytes: T.nilable(Integer) + } + ) + end + def to_hash + end + + # Stage of a function deployment. + module Status + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::TaggedSymbol + ) + BUNDLING = + T.let( + :bundling, + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::TaggedSymbol + ) + UPLOADING = + T.let( + :uploading, + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::TaggedSymbol + ) + PUBLISHING = + T.let( + :publishing, + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::TaggedSymbol + ) + ACTIVE = + T.let( + :active, + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::TaggedSymbol + ) + SUPERSEDED = + T.let( + :superseded, + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/git_link_deploy_now_params.rbi b/rbi/zavudev/models/functions/git_link_deploy_now_params.rbi new file mode 100644 index 0000000..7ded08b --- /dev/null +++ b/rbi/zavudev/models/functions/git_link_deploy_now_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class GitLinkDeployNowParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Functions::GitLinkDeployNowParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :function_id + + sig do + params( + function_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(function_id:, request_options: {}) + end + + sig do + override.returns( + { function_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/git_link_deploy_now_response.rbi b/rbi/zavudev/models/functions/git_link_deploy_now_response.rbi new file mode 100644 index 0000000..3b4c2e9 --- /dev/null +++ b/rbi/zavudev/models/functions/git_link_deploy_now_response.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class GitLinkDeployNowResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::GitLinkDeployNowResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :scheduled + + sig { params(scheduled: T::Boolean).returns(T.attached_class) } + def self.new(scheduled:) + end + + sig { override.returns({ scheduled: T::Boolean }) } + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/git_link_link_params.rbi b/rbi/zavudev/models/functions/git_link_link_params.rbi new file mode 100644 index 0000000..62b072a --- /dev/null +++ b/rbi/zavudev/models/functions/git_link_link_params.rbi @@ -0,0 +1,87 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class GitLinkLinkParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Functions::GitLinkLinkParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :function_id + + sig { returns(String) } + attr_accessor :owner + + sig { returns(String) } + attr_accessor :repo + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :auto_deploy + + sig { params(auto_deploy: T::Boolean).void } + attr_writer :auto_deploy + + sig { returns(T.nilable(String)) } + attr_reader :branch + + sig { params(branch: String).void } + attr_writer :branch + + # Subdirectory holding the project, for monorepos. + sig { returns(T.nilable(String)) } + attr_reader :root_dir + + sig { params(root_dir: String).void } + attr_writer :root_dir + + sig do + params( + function_id: String, + owner: String, + repo: String, + auto_deploy: T::Boolean, + branch: String, + root_dir: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + function_id:, + owner:, + repo:, + auto_deploy: nil, + branch: nil, + # Subdirectory holding the project, for monorepos. + root_dir: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + function_id: String, + owner: String, + repo: String, + auto_deploy: T::Boolean, + branch: String, + root_dir: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/git_link_link_response.rbi b/rbi/zavudev/models/functions/git_link_link_response.rbi new file mode 100644 index 0000000..8fc8c14 --- /dev/null +++ b/rbi/zavudev/models/functions/git_link_link_response.rbi @@ -0,0 +1,360 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class GitLinkLinkResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::GitLinkLinkResponse, + Zavudev::Internal::AnyHash + ) + end + + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + sig { returns(Zavudev::Models::Functions::GitLinkLinkResponse::Link) } + attr_reader :link + + sig do + params( + link: Zavudev::Models::Functions::GitLinkLinkResponse::Link::OrHash + ).void + end + attr_writer :link + + # Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # where you add it to the repository yourself. + sig { returns(String) } + attr_accessor :webhook_url + + # Shared secret for the repository's webhook. **Returned only when creating a + # `manual` link, and only there** — every later read strips it, and re-linking + # mints a new one. Absent entirely on an `app` link, which needs no secret of its + # own. + sig { returns(T.nilable(String)) } + attr_reader :webhook_secret + + sig { params(webhook_secret: String).void } + attr_writer :webhook_secret + + sig do + params( + link: Zavudev::Models::Functions::GitLinkLinkResponse::Link::OrHash, + webhook_url: String, + webhook_secret: String + ).returns(T.attached_class) + end + def self.new( + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + link:, + # Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # where you add it to the repository yourself. + webhook_url:, + # Shared secret for the repository's webhook. **Returned only when creating a + # `manual` link, and only there** — every later read strips it, and re-linking + # mints a new one. Absent entirely on an `app` link, which needs no secret of its + # own. + webhook_secret: nil + ) + end + + sig do + override.returns( + { + link: Zavudev::Models::Functions::GitLinkLinkResponse::Link, + webhook_url: String, + webhook_secret: String + } + ) + end + def to_hash + end + + class Link < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::GitLinkLinkResponse::Link, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # When false the link is kept and pushes are ignored. + sig { returns(T::Boolean) } + attr_accessor :auto_deploy + + # Only pushes to this branch deploy. + sig { returns(String) } + attr_accessor :branch + + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + sig do + returns( + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Connection::TaggedSymbol + ) + end + attr_accessor :connection + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :function_id + + sig { returns(String) } + attr_accessor :owner + + sig do + returns( + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Provider::TaggedSymbol + ) + end + attr_accessor :provider + + sig { returns(String) } + attr_accessor :repo + + sig { returns(Time) } + attr_accessor :updated_at + + sig { returns(T.nilable(String)) } + attr_accessor :last_commit_message + + sig { returns(T.nilable(String)) } + attr_accessor :last_commit_sha + + sig { returns(T.nilable(Time)) } + attr_accessor :last_deploy_at + + # Why the last deploy failed. Null otherwise. + sig { returns(T.nilable(String)) } + attr_accessor :last_error + + sig do + returns( + T.nilable( + Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus::TaggedSymbol + ) + ) + end + attr_accessor :last_status + + # Subdirectory holding the project, for monorepos. Null when the project is at the + # repository root. + sig { returns(T.nilable(String)) } + attr_accessor :root_dir + + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + sig do + params( + id: String, + auto_deploy: T::Boolean, + branch: String, + connection: + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Connection::OrSymbol, + created_at: Time, + function_id: String, + owner: String, + provider: + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Provider::OrSymbol, + repo: String, + updated_at: Time, + last_commit_message: T.nilable(String), + last_commit_sha: T.nilable(String), + last_deploy_at: T.nilable(Time), + last_error: T.nilable(String), + last_status: + T.nilable( + Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus::OrSymbol + ), + root_dir: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + # When false the link is kept and pushes are ignored. + auto_deploy:, + # Only pushes to this branch deploy. + branch:, + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + connection:, + created_at:, + function_id:, + owner:, + provider:, + repo:, + updated_at:, + last_commit_message: nil, + last_commit_sha: nil, + last_deploy_at: nil, + # Why the last deploy failed. Null otherwise. + last_error: nil, + last_status: nil, + # Subdirectory holding the project, for monorepos. Null when the project is at the + # repository root. + root_dir: nil + ) + end + + sig do + override.returns( + { + id: String, + auto_deploy: T::Boolean, + branch: String, + connection: + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Connection::TaggedSymbol, + created_at: Time, + function_id: String, + owner: String, + provider: + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Provider::TaggedSymbol, + repo: String, + updated_at: Time, + last_commit_message: T.nilable(String), + last_commit_sha: T.nilable(String), + last_deploy_at: T.nilable(Time), + last_error: T.nilable(String), + last_status: + T.nilable( + Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus::TaggedSymbol + ), + root_dir: T.nilable(String) + } + ) + end + def to_hash + end + + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + module Connection + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Connection + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APP = + T.let( + :app, + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Connection::TaggedSymbol + ) + MANUAL = + T.let( + :manual, + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Connection::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Connection::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Provider + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Provider + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GITHUB = + T.let( + :github, + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Provider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::Functions::GitLinkLinkResponse::Link::Provider::TaggedSymbol + ] + ) + end + def self.values + end + end + + module LastStatus + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEPLOYING = + T.let( + :deploying, + Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus::TaggedSymbol + ) + DEPLOYED = + T.let( + :deployed, + Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::Functions::GitLinkLinkResponse::Link::LastStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/git_link_retrieve_params.rbi b/rbi/zavudev/models/functions/git_link_retrieve_params.rbi new file mode 100644 index 0000000..1ac5ae0 --- /dev/null +++ b/rbi/zavudev/models/functions/git_link_retrieve_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class GitLinkRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Functions::GitLinkRetrieveParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :function_id + + sig do + params( + function_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(function_id:, request_options: {}) + end + + sig do + override.returns( + { function_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/git_link_retrieve_response.rbi b/rbi/zavudev/models/functions/git_link_retrieve_response.rbi new file mode 100644 index 0000000..a3f5d1e --- /dev/null +++ b/rbi/zavudev/models/functions/git_link_retrieve_response.rbi @@ -0,0 +1,364 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class GitLinkRetrieveResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::GitLinkRetrieveResponse, + Zavudev::Internal::AnyHash + ) + end + + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + sig do + returns(Zavudev::Models::Functions::GitLinkRetrieveResponse::Link) + end + attr_reader :link + + sig do + params( + link: + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::OrHash + ).void + end + attr_writer :link + + # Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # where you add it to the repository yourself. + sig { returns(String) } + attr_accessor :webhook_url + + # Shared secret for the repository's webhook. **Returned only when creating a + # `manual` link, and only there** — every later read strips it, and re-linking + # mints a new one. Absent entirely on an `app` link, which needs no secret of its + # own. + sig { returns(T.nilable(String)) } + attr_reader :webhook_secret + + sig { params(webhook_secret: String).void } + attr_writer :webhook_secret + + sig do + params( + link: + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::OrHash, + webhook_url: String, + webhook_secret: String + ).returns(T.attached_class) + end + def self.new( + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + link:, + # Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # where you add it to the repository yourself. + webhook_url:, + # Shared secret for the repository's webhook. **Returned only when creating a + # `manual` link, and only there** — every later read strips it, and re-linking + # mints a new one. Absent entirely on an `app` link, which needs no secret of its + # own. + webhook_secret: nil + ) + end + + sig do + override.returns( + { + link: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link, + webhook_url: String, + webhook_secret: String + } + ) + end + def to_hash + end + + class Link < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # When false the link is kept and pushes are ignored. + sig { returns(T::Boolean) } + attr_accessor :auto_deploy + + # Only pushes to this branch deploy. + sig { returns(String) } + attr_accessor :branch + + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + sig do + returns( + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Connection::TaggedSymbol + ) + end + attr_accessor :connection + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :function_id + + sig { returns(String) } + attr_accessor :owner + + sig do + returns( + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Provider::TaggedSymbol + ) + end + attr_accessor :provider + + sig { returns(String) } + attr_accessor :repo + + sig { returns(Time) } + attr_accessor :updated_at + + sig { returns(T.nilable(String)) } + attr_accessor :last_commit_message + + sig { returns(T.nilable(String)) } + attr_accessor :last_commit_sha + + sig { returns(T.nilable(Time)) } + attr_accessor :last_deploy_at + + # Why the last deploy failed. Null otherwise. + sig { returns(T.nilable(String)) } + attr_accessor :last_error + + sig do + returns( + T.nilable( + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus::TaggedSymbol + ) + ) + end + attr_accessor :last_status + + # Subdirectory holding the project, for monorepos. Null when the project is at the + # repository root. + sig { returns(T.nilable(String)) } + attr_accessor :root_dir + + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + sig do + params( + id: String, + auto_deploy: T::Boolean, + branch: String, + connection: + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Connection::OrSymbol, + created_at: Time, + function_id: String, + owner: String, + provider: + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Provider::OrSymbol, + repo: String, + updated_at: Time, + last_commit_message: T.nilable(String), + last_commit_sha: T.nilable(String), + last_deploy_at: T.nilable(Time), + last_error: T.nilable(String), + last_status: + T.nilable( + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus::OrSymbol + ), + root_dir: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + # When false the link is kept and pushes are ignored. + auto_deploy:, + # Only pushes to this branch deploy. + branch:, + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + connection:, + created_at:, + function_id:, + owner:, + provider:, + repo:, + updated_at:, + last_commit_message: nil, + last_commit_sha: nil, + last_deploy_at: nil, + # Why the last deploy failed. Null otherwise. + last_error: nil, + last_status: nil, + # Subdirectory holding the project, for monorepos. Null when the project is at the + # repository root. + root_dir: nil + ) + end + + sig do + override.returns( + { + id: String, + auto_deploy: T::Boolean, + branch: String, + connection: + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Connection::TaggedSymbol, + created_at: Time, + function_id: String, + owner: String, + provider: + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Provider::TaggedSymbol, + repo: String, + updated_at: Time, + last_commit_message: T.nilable(String), + last_commit_sha: T.nilable(String), + last_deploy_at: T.nilable(Time), + last_error: T.nilable(String), + last_status: + T.nilable( + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus::TaggedSymbol + ), + root_dir: T.nilable(String) + } + ) + end + def to_hash + end + + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + module Connection + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Connection + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APP = + T.let( + :app, + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Connection::TaggedSymbol + ) + MANUAL = + T.let( + :manual, + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Connection::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Connection::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Provider + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Provider + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GITHUB = + T.let( + :github, + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Provider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::Provider::TaggedSymbol + ] + ) + end + def self.values + end + end + + module LastStatus + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEPLOYING = + T.let( + :deploying, + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus::TaggedSymbol + ) + DEPLOYED = + T.let( + :deployed, + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::LastStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/git_link_unlink_params.rbi b/rbi/zavudev/models/functions/git_link_unlink_params.rbi new file mode 100644 index 0000000..2c8ee54 --- /dev/null +++ b/rbi/zavudev/models/functions/git_link_unlink_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class GitLinkUnlinkParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Functions::GitLinkUnlinkParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :function_id + + sig do + params( + function_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(function_id:, request_options: {}) + end + + sig do + override.returns( + { function_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/git_link_update_params.rbi b/rbi/zavudev/models/functions/git_link_update_params.rbi new file mode 100644 index 0000000..3a34479 --- /dev/null +++ b/rbi/zavudev/models/functions/git_link_update_params.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class GitLinkUpdateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Functions::GitLinkUpdateParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :function_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :auto_deploy + + sig { params(auto_deploy: T::Boolean).void } + attr_writer :auto_deploy + + sig { returns(T.nilable(String)) } + attr_reader :branch + + sig { params(branch: String).void } + attr_writer :branch + + sig { returns(T.nilable(String)) } + attr_accessor :root_dir + + sig do + params( + function_id: String, + auto_deploy: T::Boolean, + branch: String, + root_dir: T.nilable(String), + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + function_id:, + auto_deploy: nil, + branch: nil, + root_dir: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + function_id: String, + auto_deploy: T::Boolean, + branch: String, + root_dir: T.nilable(String), + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/git_link_update_response.rbi b/rbi/zavudev/models/functions/git_link_update_response.rbi new file mode 100644 index 0000000..97e9fbf --- /dev/null +++ b/rbi/zavudev/models/functions/git_link_update_response.rbi @@ -0,0 +1,362 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class GitLinkUpdateResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::GitLinkUpdateResponse, + Zavudev::Internal::AnyHash + ) + end + + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + sig { returns(Zavudev::Models::Functions::GitLinkUpdateResponse::Link) } + attr_reader :link + + sig do + params( + link: + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::OrHash + ).void + end + attr_writer :link + + # Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # where you add it to the repository yourself. + sig { returns(String) } + attr_accessor :webhook_url + + # Shared secret for the repository's webhook. **Returned only when creating a + # `manual` link, and only there** — every later read strips it, and re-linking + # mints a new one. Absent entirely on an `app` link, which needs no secret of its + # own. + sig { returns(T.nilable(String)) } + attr_reader :webhook_secret + + sig { params(webhook_secret: String).void } + attr_writer :webhook_secret + + sig do + params( + link: + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::OrHash, + webhook_url: String, + webhook_secret: String + ).returns(T.attached_class) + end + def self.new( + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + link:, + # Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link, + # where you add it to the repository yourself. + webhook_url:, + # Shared secret for the repository's webhook. **Returned only when creating a + # `manual` link, and only there** — every later read strips it, and re-linking + # mints a new one. Absent entirely on an `app` link, which needs no secret of its + # own. + webhook_secret: nil + ) + end + + sig do + override.returns( + { + link: Zavudev::Models::Functions::GitLinkUpdateResponse::Link, + webhook_url: String, + webhook_secret: String + } + ) + end + def to_hash + end + + class Link < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::GitLinkUpdateResponse::Link, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # When false the link is kept and pushes are ignored. + sig { returns(T::Boolean) } + attr_accessor :auto_deploy + + # Only pushes to this branch deploy. + sig { returns(String) } + attr_accessor :branch + + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + sig do + returns( + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Connection::TaggedSymbol + ) + end + attr_accessor :connection + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :function_id + + sig { returns(String) } + attr_accessor :owner + + sig do + returns( + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Provider::TaggedSymbol + ) + end + attr_accessor :provider + + sig { returns(String) } + attr_accessor :repo + + sig { returns(Time) } + attr_accessor :updated_at + + sig { returns(T.nilable(String)) } + attr_accessor :last_commit_message + + sig { returns(T.nilable(String)) } + attr_accessor :last_commit_sha + + sig { returns(T.nilable(Time)) } + attr_accessor :last_deploy_at + + # Why the last deploy failed. Null otherwise. + sig { returns(T.nilable(String)) } + attr_accessor :last_error + + sig do + returns( + T.nilable( + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus::TaggedSymbol + ) + ) + end + attr_accessor :last_status + + # Subdirectory holding the project, for monorepos. Null when the project is at the + # repository root. + sig { returns(T.nilable(String)) } + attr_accessor :root_dir + + # A GitHub repository bound to a function. A push to `branch` deploys the + # function. A function holds at most one link. + sig do + params( + id: String, + auto_deploy: T::Boolean, + branch: String, + connection: + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Connection::OrSymbol, + created_at: Time, + function_id: String, + owner: String, + provider: + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Provider::OrSymbol, + repo: String, + updated_at: Time, + last_commit_message: T.nilable(String), + last_commit_sha: T.nilable(String), + last_deploy_at: T.nilable(Time), + last_error: T.nilable(String), + last_status: + T.nilable( + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus::OrSymbol + ), + root_dir: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + # When false the link is kept and pushes are ignored. + auto_deploy:, + # Only pushes to this branch deploy. + branch:, + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + connection:, + created_at:, + function_id:, + owner:, + provider:, + repo:, + updated_at:, + last_commit_message: nil, + last_commit_sha: nil, + last_deploy_at: nil, + # Why the last deploy failed. Null otherwise. + last_error: nil, + last_status: nil, + # Subdirectory holding the project, for monorepos. Null when the project is at the + # repository root. + root_dir: nil + ) + end + + sig do + override.returns( + { + id: String, + auto_deploy: T::Boolean, + branch: String, + connection: + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Connection::TaggedSymbol, + created_at: Time, + function_id: String, + owner: String, + provider: + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Provider::TaggedSymbol, + repo: String, + updated_at: Time, + last_commit_message: T.nilable(String), + last_commit_sha: T.nilable(String), + last_deploy_at: T.nilable(Time), + last_error: T.nilable(String), + last_status: + T.nilable( + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus::TaggedSymbol + ), + root_dir: T.nilable(String) + } + ) + end + def to_hash + end + + # How this link authenticates, decided by the server rather than by the caller. + # + # - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the + # app's webhook and private repositories work. Nothing to configure in the + # repository. + # - `manual`: no installation. The link carries its own secret and you add the + # webhook to the repository yourself. + module Connection + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Connection + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APP = + T.let( + :app, + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Connection::TaggedSymbol + ) + MANUAL = + T.let( + :manual, + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Connection::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Connection::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Provider + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Provider + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GITHUB = + T.let( + :github, + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Provider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::Provider::TaggedSymbol + ] + ) + end + def self.values + end + end + + module LastStatus + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEPLOYING = + T.let( + :deploying, + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus::TaggedSymbol + ) + DEPLOYED = + T.let( + :deployed, + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::Functions::GitLinkUpdateResponse::Link::LastStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/trigger_create_params.rbi b/rbi/zavudev/models/functions/trigger_create_params.rbi new file mode 100644 index 0000000..0d833f1 --- /dev/null +++ b/rbi/zavudev/models/functions/trigger_create_params.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class TriggerCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Functions::TriggerCreateParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :function_id + + # Event types to subscribe to. + sig { returns(T::Array[String]) } + attr_accessor :event_types + + # Senders to scope the triggers to. Use null for all senders. + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :sender_ids + + # Required when eventTypes includes `cron`: a 5-field cron expression (minute hour + # day-of-month month day-of-week), evaluated in UTC. + sig { returns(T.nilable(String)) } + attr_reader :cron + + sig { params(cron: String).void } + attr_writer :cron + + sig do + params( + function_id: String, + event_types: T::Array[String], + sender_ids: T::Array[T.nilable(String)], + cron: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + function_id:, + # Event types to subscribe to. + event_types:, + # Senders to scope the triggers to. Use null for all senders. + sender_ids:, + # Required when eventTypes includes `cron`: a 5-field cron expression (minute hour + # day-of-month month day-of-week), evaluated in UTC. + cron: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + function_id: String, + event_types: T::Array[String], + sender_ids: T::Array[T.nilable(String)], + cron: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/trigger_create_response.rbi b/rbi/zavudev/models/functions/trigger_create_response.rbi new file mode 100644 index 0000000..1e5d626 --- /dev/null +++ b/rbi/zavudev/models/functions/trigger_create_response.rbi @@ -0,0 +1,168 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class TriggerCreateResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::TriggerCreateResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :added + + # Number of triggers that already existed. + sig { returns(Integer) } + attr_accessor :skipped + + sig do + returns( + T::Array[Zavudev::Models::Functions::TriggerCreateResponse::Trigger] + ) + end + attr_accessor :triggers + + sig do + params( + added: Integer, + skipped: Integer, + triggers: + T::Array[ + Zavudev::Models::Functions::TriggerCreateResponse::Trigger::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + added:, + # Number of triggers that already existed. + skipped:, + triggers: + ) + end + + sig do + override.returns( + { + added: Integer, + skipped: Integer, + triggers: + T::Array[ + Zavudev::Models::Functions::TriggerCreateResponse::Trigger + ] + } + ) + end + def to_hash + end + + class Trigger < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::TriggerCreateResponse::Trigger, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T::Boolean) } + attr_accessor :active + + sig { returns(Time) } + attr_accessor :created_at + + # Event type that fires the function. See GET /v1/functions/event-types for the + # supported list. The special type `cron` fires on a schedule instead of a + # messaging event and carries a `cron` expression. + sig { returns(String) } + attr_accessor :event_type + + sig { returns(String) } + attr_accessor :function_id + + sig { returns(Time) } + attr_accessor :updated_at + + # 5-field cron expression (minute hour day-of-month month day-of-week), evaluated + # in UTC. Present only on `cron` triggers. + sig { returns(T.nilable(String)) } + attr_accessor :cron + + # Last time the schedule fired. Null until the first fire. + sig { returns(T.nilable(Time)) } + attr_accessor :last_run_at + + # Next scheduled fire time. Present only on `cron` triggers. + sig { returns(T.nilable(Time)) } + attr_accessor :next_run_at + + # Restrict the trigger to a single sender. Null means all senders in the project. + sig { returns(T.nilable(String)) } + attr_accessor :sender_id + + # A subscription that runs a Zavu Function when a messaging event fires. + sig do + params( + id: String, + active: T::Boolean, + created_at: Time, + event_type: String, + function_id: String, + updated_at: Time, + cron: T.nilable(String), + last_run_at: T.nilable(Time), + next_run_at: T.nilable(Time), + sender_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + active:, + created_at:, + # Event type that fires the function. See GET /v1/functions/event-types for the + # supported list. The special type `cron` fires on a schedule instead of a + # messaging event and carries a `cron` expression. + event_type:, + function_id:, + updated_at:, + # 5-field cron expression (minute hour day-of-month month day-of-week), evaluated + # in UTC. Present only on `cron` triggers. + cron: nil, + # Last time the schedule fired. Null until the first fire. + last_run_at: nil, + # Next scheduled fire time. Present only on `cron` triggers. + next_run_at: nil, + # Restrict the trigger to a single sender. Null means all senders in the project. + sender_id: nil + ) + end + + sig do + override.returns( + { + id: String, + active: T::Boolean, + created_at: Time, + event_type: String, + function_id: String, + updated_at: Time, + cron: T.nilable(String), + last_run_at: T.nilable(Time), + next_run_at: T.nilable(Time), + sender_id: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/trigger_delete_params.rbi b/rbi/zavudev/models/functions/trigger_delete_params.rbi new file mode 100644 index 0000000..309ab04 --- /dev/null +++ b/rbi/zavudev/models/functions/trigger_delete_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class TriggerDeleteParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Functions::TriggerDeleteParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :trigger_id + + sig do + params( + trigger_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(trigger_id:, request_options: {}) + end + + sig do + override.returns( + { trigger_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/trigger_list_params.rbi b/rbi/zavudev/models/functions/trigger_list_params.rbi new file mode 100644 index 0000000..f654bb6 --- /dev/null +++ b/rbi/zavudev/models/functions/trigger_list_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class TriggerListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Functions::TriggerListParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :function_id + + sig do + params( + function_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(function_id:, request_options: {}) + end + + sig do + override.returns( + { function_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/trigger_list_response.rbi b/rbi/zavudev/models/functions/trigger_list_response.rbi new file mode 100644 index 0000000..580842e --- /dev/null +++ b/rbi/zavudev/models/functions/trigger_list_response.rbi @@ -0,0 +1,152 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class TriggerListResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::TriggerListResponse, + Zavudev::Internal::AnyHash + ) + end + + sig do + returns( + T::Array[Zavudev::Models::Functions::TriggerListResponse::Trigger] + ) + end + attr_accessor :triggers + + sig do + params( + triggers: + T::Array[ + Zavudev::Models::Functions::TriggerListResponse::Trigger::OrHash + ] + ).returns(T.attached_class) + end + def self.new(triggers:) + end + + sig do + override.returns( + { + triggers: + T::Array[ + Zavudev::Models::Functions::TriggerListResponse::Trigger + ] + } + ) + end + def to_hash + end + + class Trigger < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::TriggerListResponse::Trigger, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T::Boolean) } + attr_accessor :active + + sig { returns(Time) } + attr_accessor :created_at + + # Event type that fires the function. See GET /v1/functions/event-types for the + # supported list. The special type `cron` fires on a schedule instead of a + # messaging event and carries a `cron` expression. + sig { returns(String) } + attr_accessor :event_type + + sig { returns(String) } + attr_accessor :function_id + + sig { returns(Time) } + attr_accessor :updated_at + + # 5-field cron expression (minute hour day-of-month month day-of-week), evaluated + # in UTC. Present only on `cron` triggers. + sig { returns(T.nilable(String)) } + attr_accessor :cron + + # Last time the schedule fired. Null until the first fire. + sig { returns(T.nilable(Time)) } + attr_accessor :last_run_at + + # Next scheduled fire time. Present only on `cron` triggers. + sig { returns(T.nilable(Time)) } + attr_accessor :next_run_at + + # Restrict the trigger to a single sender. Null means all senders in the project. + sig { returns(T.nilable(String)) } + attr_accessor :sender_id + + # A subscription that runs a Zavu Function when a messaging event fires. + sig do + params( + id: String, + active: T::Boolean, + created_at: Time, + event_type: String, + function_id: String, + updated_at: Time, + cron: T.nilable(String), + last_run_at: T.nilable(Time), + next_run_at: T.nilable(Time), + sender_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + active:, + created_at:, + # Event type that fires the function. See GET /v1/functions/event-types for the + # supported list. The special type `cron` fires on a schedule instead of a + # messaging event and carries a `cron` expression. + event_type:, + function_id:, + updated_at:, + # 5-field cron expression (minute hour day-of-month month day-of-week), evaluated + # in UTC. Present only on `cron` triggers. + cron: nil, + # Last time the schedule fired. Null until the first fire. + last_run_at: nil, + # Next scheduled fire time. Present only on `cron` triggers. + next_run_at: nil, + # Restrict the trigger to a single sender. Null means all senders in the project. + sender_id: nil + ) + end + + sig do + override.returns( + { + id: String, + active: T::Boolean, + created_at: Time, + event_type: String, + function_id: String, + updated_at: Time, + cron: T.nilable(String), + last_run_at: T.nilable(Time), + next_run_at: T.nilable(Time), + sender_id: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/trigger_update_params.rbi b/rbi/zavudev/models/functions/trigger_update_params.rbi new file mode 100644 index 0000000..1dd4418 --- /dev/null +++ b/rbi/zavudev/models/functions/trigger_update_params.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class TriggerUpdateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Functions::TriggerUpdateParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :trigger_id + + sig { returns(T::Boolean) } + attr_accessor :active + + sig do + params( + trigger_id: String, + active: T::Boolean, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(trigger_id:, active:, request_options: {}) + end + + sig do + override.returns( + { + trigger_id: String, + active: T::Boolean, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/functions/trigger_update_response.rbi b/rbi/zavudev/models/functions/trigger_update_response.rbi new file mode 100644 index 0000000..4aacac2 --- /dev/null +++ b/rbi/zavudev/models/functions/trigger_update_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Zavudev + module Models + module Functions + class TriggerUpdateResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Functions::TriggerUpdateResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :active + + sig { returns(T::Boolean) } + attr_accessor :ok + + sig do + params(active: T::Boolean, ok: T::Boolean).returns(T.attached_class) + end + def self.new(active:, ok:) + end + + sig { override.returns({ active: T::Boolean, ok: T::Boolean }) } + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/introspect_validate_email_params.rbi b/rbi/zavudev/models/introspect_validate_email_params.rbi new file mode 100644 index 0000000..11611d3 --- /dev/null +++ b/rbi/zavudev/models/introspect_validate_email_params.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Zavudev + module Models + class IntrospectValidateEmailParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::IntrospectValidateEmailParams, + Zavudev::Internal::AnyHash + ) + end + + # Single email address to validate. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Batch of email addresses to validate (max 100). + sig { returns(T.nilable(T::Array[String])) } + attr_reader :emails + + sig { params(emails: T::Array[String]).void } + attr_writer :emails + + sig do + params( + email: String, + emails: T::Array[String], + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Single email address to validate. + email: nil, + # Batch of email addresses to validate (max 100). + emails: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + email: String, + emails: T::Array[String], + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/introspect_validate_email_response.rbi b/rbi/zavudev/models/introspect_validate_email_response.rbi new file mode 100644 index 0000000..deda8ab --- /dev/null +++ b/rbi/zavudev/models/introspect_validate_email_response.rbi @@ -0,0 +1,328 @@ +# typed: strong + +module Zavudev + module Models + class IntrospectValidateEmailResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::IntrospectValidateEmailResponse, + Zavudev::Internal::AnyHash + ) + end + + # One result per submitted address, in the same order. + sig do + returns( + T::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result] + ) + end + attr_accessor :results + + sig { returns(Zavudev::Models::IntrospectValidateEmailResponse::Summary) } + attr_reader :summary + + sig do + params( + summary: + Zavudev::Models::IntrospectValidateEmailResponse::Summary::OrHash + ).void + end + attr_writer :summary + + sig do + params( + results: + T::Array[ + Zavudev::Models::IntrospectValidateEmailResponse::Result::OrHash + ], + summary: + Zavudev::Models::IntrospectValidateEmailResponse::Summary::OrHash + ).returns(T.attached_class) + end + def self.new( + # One result per submitted address, in the same order. + results:, + summary: + ) + end + + sig do + override.returns( + { + results: + T::Array[ + Zavudev::Models::IntrospectValidateEmailResponse::Result + ], + summary: Zavudev::Models::IntrospectValidateEmailResponse::Summary + } + ) + end + def to_hash + end + + class Result < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::IntrospectValidateEmailResponse::Result, + Zavudev::Internal::AnyHash + ) + end + + # Domain part of the address. Null when the syntax is invalid. + sig { returns(T.nilable(String)) } + attr_accessor :domain + + # The address exactly as submitted. + sig { returns(String) } + attr_accessor :email + + # Lowercased, trimmed form of the address. Null when the syntax is invalid. + sig { returns(T.nilable(String)) } + attr_accessor :normalized + + # Signals behind the verdict. Empty for a clean `deliverable` address. + sig do + returns( + T::Array[ + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ] + ) + end + attr_accessor :reasons + + # Validation verdict. + # + # - `deliverable`: nothing suggests the address will bounce. + # - `risky`: sendable, but a signal predicts elevated bounce/complaint odds (role + # address, disposable domain, MX-less domain, prior soft bounce). + # - `undeliverable`: will bounce or is blocked (invalid syntax, dead domain, or + # the address is on your suppression list after a hard bounce/complaint). + sig do + returns( + Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict::TaggedSymbol + ) + end + attr_accessor :verdict + + sig do + params( + domain: T.nilable(String), + email: String, + normalized: T.nilable(String), + reasons: + T::Array[ + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::OrSymbol + ], + verdict: + Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Domain part of the address. Null when the syntax is invalid. + domain:, + # The address exactly as submitted. + email:, + # Lowercased, trimmed form of the address. Null when the syntax is invalid. + normalized:, + # Signals behind the verdict. Empty for a clean `deliverable` address. + reasons:, + # Validation verdict. + # + # - `deliverable`: nothing suggests the address will bounce. + # - `risky`: sendable, but a signal predicts elevated bounce/complaint odds (role + # address, disposable domain, MX-less domain, prior soft bounce). + # - `undeliverable`: will bounce or is blocked (invalid syntax, dead domain, or + # the address is on your suppression list after a hard bounce/complaint). + verdict: + ) + end + + sig do + override.returns( + { + domain: T.nilable(String), + email: String, + normalized: T.nilable(String), + reasons: + T::Array[ + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ], + verdict: + Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict::TaggedSymbol + } + ) + end + def to_hash + end + + module Reason + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INVALID_SYNTAX = + T.let( + :invalid_syntax, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ) + DOMAIN_NOT_FOUND = + T.let( + :domain_not_found, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ) + DOMAIN_NO_MX = + T.let( + :domain_no_mx, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ) + DISPOSABLE_DOMAIN = + T.let( + :disposable_domain, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ) + ROLE_ADDRESS = + T.let( + :role_address, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ) + SUPPRESSED_HARD_BOUNCE = + T.let( + :suppressed_hard_bounce, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ) + SUPPRESSED_SOFT_BOUNCE = + T.let( + :suppressed_soft_bounce, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ) + SUPPRESSED_COMPLAINT = + T.let( + :suppressed_complaint, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ) + SUPPRESSED_MANUAL = + T.let( + :suppressed_manual, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ) + SUPPRESSED_UNSUBSCRIBE = + T.let( + :suppressed_unsubscribe, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::IntrospectValidateEmailResponse::Result::Reason::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Validation verdict. + # + # - `deliverable`: nothing suggests the address will bounce. + # - `risky`: sendable, but a signal predicts elevated bounce/complaint odds (role + # address, disposable domain, MX-less domain, prior soft bounce). + # - `undeliverable`: will bounce or is blocked (invalid syntax, dead domain, or + # the address is on your suppression list after a hard bounce/complaint). + module Verdict + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DELIVERABLE = + T.let( + :deliverable, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict::TaggedSymbol + ) + RISKY = + T.let( + :risky, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict::TaggedSymbol + ) + UNDELIVERABLE = + T.let( + :undeliverable, + Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Zavudev::Models::IntrospectValidateEmailResponse::Result::Verdict::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Summary < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::IntrospectValidateEmailResponse::Summary, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :deliverable + + sig { returns(Integer) } + attr_accessor :risky + + sig { returns(Integer) } + attr_accessor :total + + sig { returns(Integer) } + attr_accessor :undeliverable + + sig do + params( + deliverable: Integer, + risky: Integer, + total: Integer, + undeliverable: Integer + ).returns(T.attached_class) + end + def self.new(deliverable:, risky:, total:, undeliverable:) + end + + sig do + override.returns( + { + deliverable: Integer, + risky: Integer, + total: Integer, + undeliverable: Integer + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/message_list_attachments_params.rbi b/rbi/zavudev/models/message_list_attachments_params.rbi new file mode 100644 index 0000000..302fcac --- /dev/null +++ b/rbi/zavudev/models/message_list_attachments_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Zavudev + module Models + class MessageListAttachmentsParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::MessageListAttachmentsParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :message_id + + sig do + params( + message_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(message_id:, request_options: {}) + end + + sig do + override.returns( + { message_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/message_list_attachments_response.rbi b/rbi/zavudev/models/message_list_attachments_response.rbi new file mode 100644 index 0000000..0883d1c --- /dev/null +++ b/rbi/zavudev/models/message_list_attachments_response.rbi @@ -0,0 +1,136 @@ +# typed: strong + +module Zavudev + module Models + class MessageListAttachmentsResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::MessageListAttachmentsResponse, + Zavudev::Internal::AnyHash + ) + end + + sig do + returns(T::Array[Zavudev::Models::MessageListAttachmentsResponse::Item]) + end + attr_accessor :items + + sig do + params( + items: + T::Array[ + Zavudev::Models::MessageListAttachmentsResponse::Item::OrHash + ] + ).returns(T.attached_class) + end + def self.new(items:) + end + + sig do + override.returns( + { + items: + T::Array[Zavudev::Models::MessageListAttachmentsResponse::Item] + } + ) + end + def to_hash + end + + class Item < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::MessageListAttachmentsResponse::Item, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Content-ID for inline attachments (referenced in the HTML body as + # `cid:`). Null for regular attachments. + sig { returns(T.nilable(String)) } + attr_accessor :content_id + + sig { returns(Time) } + attr_accessor :created_at + + # Short-lived signed URL to download the attachment bytes. Freshly generated on + # each request and expires; do not cache it. Null if the stored file is no longer + # available. + sig { returns(T.nilable(String)) } + attr_accessor :download_url + + sig { returns(String) } + attr_accessor :filename + + # Whether the attachment is inline (embedded in the HTML body) rather than a + # regular attachment. + sig { returns(T::Boolean) } + attr_accessor :is_inline + + # MIME type of the attachment. + sig { returns(String) } + attr_accessor :mime_type + + # Size of the attachment in bytes. + sig { returns(Integer) } + attr_accessor :size + + # A stored file attachment for an email message (inbound or outbound). + sig do + params( + id: String, + content_id: T.nilable(String), + created_at: Time, + download_url: T.nilable(String), + filename: String, + is_inline: T::Boolean, + mime_type: String, + size: Integer + ).returns(T.attached_class) + end + def self.new( + id:, + # Content-ID for inline attachments (referenced in the HTML body as + # `cid:`). Null for regular attachments. + content_id:, + created_at:, + # Short-lived signed URL to download the attachment bytes. Freshly generated on + # each request and expires; do not cache it. Null if the stored file is no longer + # available. + download_url:, + filename:, + # Whether the attachment is inline (embedded in the HTML body) rather than a + # regular attachment. + is_inline:, + # MIME type of the attachment. + mime_type:, + # Size of the attachment in bytes. + size: + ) + end + + sig do + override.returns( + { + id: String, + content_id: T.nilable(String), + created_at: Time, + download_url: T.nilable(String), + filename: String, + is_inline: T::Boolean, + mime_type: String, + size: Integer + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_params.rbi b/rbi/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_params.rbi new file mode 100644 index 0000000..cba3fb4 --- /dev/null +++ b/rbi/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_params.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + class DocumentRetrieveDocumentParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Senders::Agent::KnowledgeBases::DocumentRetrieveDocumentParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :sender_id + + sig { returns(String) } + attr_accessor :kb_id + + sig { returns(String) } + attr_accessor :doc_id + + sig do + params( + sender_id: String, + kb_id: String, + doc_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(sender_id:, kb_id:, doc_id:, request_options: {}) + end + + sig do + override.returns( + { + sender_id: String, + kb_id: String, + doc_id: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rbi b/rbi/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rbi new file mode 100644 index 0000000..07defe1 --- /dev/null +++ b/rbi/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + class DocumentRetrieveDocumentResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentRetrieveDocumentResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(Zavudev::Senders::Agent::AgentDocument) } + attr_reader :document + + sig do + params( + document: Zavudev::Senders::Agent::AgentDocument::OrHash + ).void + end + attr_writer :document + + sig do + params( + document: Zavudev::Senders::Agent::AgentDocument::OrHash + ).returns(T.attached_class) + end + def self.new(document:) + end + + sig do + override.returns( + { document: Zavudev::Senders::Agent::AgentDocument } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rbi b/rbi/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rbi new file mode 100644 index 0000000..cb0264d --- /dev/null +++ b/rbi/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rbi @@ -0,0 +1,80 @@ +# typed: strong + +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + class DocumentUpdateDocumentParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Senders::Agent::KnowledgeBases::DocumentUpdateDocumentParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :sender_id + + sig { returns(String) } + attr_accessor :kb_id + + sig { returns(String) } + attr_accessor :doc_id + + sig { returns(T.nilable(String)) } + attr_reader :content + + sig { params(content: String).void } + attr_writer :content + + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + sig do + params( + sender_id: String, + kb_id: String, + doc_id: String, + content: String, + title: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + sender_id:, + kb_id:, + doc_id:, + content: nil, + title: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + sender_id: String, + kb_id: String, + doc_id: String, + content: String, + title: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rbi b/rbi/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rbi new file mode 100644 index 0000000..a3f3e1e --- /dev/null +++ b/rbi/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + class DocumentUpdateDocumentResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentUpdateDocumentResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(Zavudev::Senders::Agent::AgentDocument) } + attr_reader :document + + sig do + params( + document: Zavudev::Senders::Agent::AgentDocument::OrHash + ).void + end + attr_writer :document + + sig do + params( + document: Zavudev::Senders::Agent::AgentDocument::OrHash + ).returns(T.attached_class) + end + def self.new(document:) + end + + sig do + override.returns( + { document: Zavudev::Senders::Agent::AgentDocument } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/senders/agent/tool_list_test_runs_params.rbi b/rbi/zavudev/models/senders/agent/tool_list_test_runs_params.rbi new file mode 100644 index 0000000..21cba44 --- /dev/null +++ b/rbi/zavudev/models/senders/agent/tool_list_test_runs_params.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Zavudev + module Models + module Senders + module Agent + class ToolListTestRunsParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Senders::Agent::ToolListTestRunsParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :sender_id + + sig { returns(String) } + attr_accessor :tool_id + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig do + params( + sender_id: String, + tool_id: String, + limit: Integer, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(sender_id:, tool_id:, limit: nil, request_options: {}) + end + + sig do + override.returns( + { + sender_id: String, + tool_id: String, + limit: Integer, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/zavudev/models/senders/agent/tool_list_test_runs_response.rbi b/rbi/zavudev/models/senders/agent/tool_list_test_runs_response.rbi new file mode 100644 index 0000000..65ddda0 --- /dev/null +++ b/rbi/zavudev/models/senders/agent/tool_list_test_runs_response.rbi @@ -0,0 +1,152 @@ +# typed: strong + +module Zavudev + module Models + module Senders + module Agent + class ToolListTestRunsResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Senders::Agent::ToolListTestRunsResponse, + Zavudev::Internal::AnyHash + ) + end + + sig do + returns( + T::Array[ + Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item + ] + ) + end + attr_accessor :items + + sig do + params( + items: + T::Array[ + Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item::OrHash + ] + ).returns(T.attached_class) + end + def self.new(items:) + end + + sig do + override.returns( + { + items: + T::Array[ + Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item + ] + } + ) + end + def to_hash + end + + class Item < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(Integer) } + attr_accessor :duration_ms + + # Whether the tool returned without error. A tool that answered with a non-2xx + # status is a failed run, not an error of this endpoint. + sig { returns(T::Boolean) } + attr_accessor :success + + sig { returns(String) } + attr_accessor :tool_id + + # Why the run failed, when it did. + sig { returns(T.nilable(String)) } + attr_accessor :error + + # The parameters the tool was called with. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :params + + sig { params(params: T::Hash[Symbol, T.anything]).void } + attr_writer :params + + # The tool's response body, truncated. + sig { returns(T.nilable(String)) } + attr_accessor :response + + # HTTP status the tool's webhook returned. Absent for tools that do not go over + # HTTP. + sig { returns(T.nilable(Integer)) } + attr_accessor :status_code + + # One run of a tool triggered from the test endpoint. Recorded so a test is + # verifiable after the fact rather than only visible in the response. + sig do + params( + id: String, + created_at: Time, + duration_ms: Integer, + success: T::Boolean, + tool_id: String, + error: T.nilable(String), + params: T::Hash[Symbol, T.anything], + response: T.nilable(String), + status_code: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + duration_ms:, + # Whether the tool returned without error. A tool that answered with a non-2xx + # status is a failed run, not an error of this endpoint. + success:, + tool_id:, + # Why the run failed, when it did. + error: nil, + # The parameters the tool was called with. + params: nil, + # The tool's response body, truncated. + response: nil, + # HTTP status the tool's webhook returned. Absent for tools that do not go over + # HTTP. + status_code: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + duration_ms: Integer, + success: T::Boolean, + tool_id: String, + error: T.nilable(String), + params: T::Hash[Symbol, T.anything], + response: T.nilable(String), + status_code: T.nilable(Integer) + } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rbi b/rbi/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rbi new file mode 100644 index 0000000..79b6d26 --- /dev/null +++ b/rbi/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Zavudev + module Models + module Senders + module Agent + module Tools + class WebhookRotateSecretParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Senders::Agent::Tools::WebhookRotateSecretParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :sender_id + + sig { returns(String) } + attr_accessor :tool_id + + sig do + params( + sender_id: String, + tool_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(sender_id:, tool_id:, request_options: {}) + end + + sig do + override.returns( + { + sender_id: String, + tool_id: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/zavudev/models/senders/telegram_connect_params.rbi b/rbi/zavudev/models/senders/telegram_connect_params.rbi new file mode 100644 index 0000000..ad0861d --- /dev/null +++ b/rbi/zavudev/models/senders/telegram_connect_params.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Zavudev + module Models + module Senders + class TelegramConnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Senders::TelegramConnectParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :sender_id + + # Bot token from @BotFather. + sig { returns(String) } + attr_accessor :bot_token + + sig do + params( + sender_id: String, + bot_token: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + sender_id:, + # Bot token from @BotFather. + bot_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + sender_id: String, + bot_token: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/senders/telegram_connect_response.rbi b/rbi/zavudev/models/senders/telegram_connect_response.rbi new file mode 100644 index 0000000..ff3b097 --- /dev/null +++ b/rbi/zavudev/models/senders/telegram_connect_response.rbi @@ -0,0 +1,93 @@ +# typed: strong + +module Zavudev + module Models + module Senders + class TelegramConnectResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Senders::TelegramConnectResponse, + Zavudev::Internal::AnyHash + ) + end + + sig do + returns(Zavudev::Models::Senders::TelegramConnectResponse::Telegram) + end + attr_reader :telegram + + sig do + params( + telegram: + Zavudev::Models::Senders::TelegramConnectResponse::Telegram::OrHash + ).void + end + attr_writer :telegram + + sig do + params( + telegram: + Zavudev::Models::Senders::TelegramConnectResponse::Telegram::OrHash + ).returns(T.attached_class) + end + def self.new(telegram:) + end + + sig do + override.returns( + { + telegram: + Zavudev::Models::Senders::TelegramConnectResponse::Telegram + } + ) + end + def to_hash + end + + class Telegram < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::Senders::TelegramConnectResponse::Telegram, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :connected + + sig { returns(T.nilable(String)) } + attr_reader :bot_id + + sig { params(bot_id: String).void } + attr_writer :bot_id + + sig { returns(T.nilable(String)) } + attr_reader :bot_username + + sig { params(bot_username: String).void } + attr_writer :bot_username + + sig do + params( + connected: T::Boolean, + bot_id: String, + bot_username: String + ).returns(T.attached_class) + end + def self.new(connected:, bot_id: nil, bot_username: nil) + end + + sig do + override.returns( + { connected: T::Boolean, bot_id: String, bot_username: String } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/zavudev/models/senders/telegram_disconnect_params.rbi b/rbi/zavudev/models/senders/telegram_disconnect_params.rbi new file mode 100644 index 0000000..562ed93 --- /dev/null +++ b/rbi/zavudev/models/senders/telegram_disconnect_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Zavudev + module Models + module Senders + class TelegramDisconnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Zavudev::Senders::TelegramDisconnectParams, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :sender_id + + sig do + params( + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(sender_id:, request_options: {}) + end + + sig do + override.returns( + { sender_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/zavudev/models/template_sync_params.rbi b/rbi/zavudev/models/template_sync_params.rbi new file mode 100644 index 0000000..06eae7d --- /dev/null +++ b/rbi/zavudev/models/template_sync_params.rbi @@ -0,0 +1,45 @@ +# typed: strong + +module Zavudev + module Models + class TemplateSyncParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::TemplateSyncParams, Zavudev::Internal::AnyHash) + end + + # Sync only the WhatsApp Business Account attached to this sender. If omitted, + # every WhatsApp sender in the project is synced. + sig { returns(T.nilable(String)) } + attr_reader :sender_id + + sig { params(sender_id: String).void } + attr_writer :sender_id + + sig do + params( + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Sync only the WhatsApp Business Account attached to this sender. If omitted, + # every WhatsApp sender in the project is synced. + sender_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { sender_id: String, request_options: Zavudev::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/template_sync_response.rbi b/rbi/zavudev/models/template_sync_response.rbi new file mode 100644 index 0000000..c9bb402 --- /dev/null +++ b/rbi/zavudev/models/template_sync_response.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Zavudev + module Models + class TemplateSyncResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::TemplateSyncResponse, + Zavudev::Internal::AnyHash + ) + end + + # WhatsApp Business Accounts reconciled in this call. + sig { returns(Integer) } + attr_accessor :accounts_synced + + # Problems hit while syncing. Non-empty with a 200 means part of the sync did not + # complete — the rest still did. + sig { returns(T::Array[String]) } + attr_accessor :errors + + # Templates that existed on Meta and were created in Zavu by this call. + sig { returns(Integer) } + attr_accessor :imported + + # Existing Zavu templates that were matched to a Meta template by name and bound + # to its Meta ID. + sig { returns(Integer) } + attr_accessor :linked + + # Meta templates left alone: already linked to a Zavu template, or + # rejected/disabled on Meta. + sig { returns(Integer) } + attr_accessor :skipped + + # Templates whose approval status changed to match Meta. + sig { returns(Integer) } + attr_accessor :updated + + sig do + params( + accounts_synced: Integer, + errors: T::Array[String], + imported: Integer, + linked: Integer, + skipped: Integer, + updated: Integer + ).returns(T.attached_class) + end + def self.new( + # WhatsApp Business Accounts reconciled in this call. + accounts_synced:, + # Problems hit while syncing. Non-empty with a 200 means part of the sync did not + # complete — the rest still did. + errors:, + # Templates that existed on Meta and were created in Zavu by this call. + imported:, + # Existing Zavu templates that were matched to a Meta template by name and bound + # to its Meta ID. + linked:, + # Meta templates left alone: already linked to a Zavu template, or + # rejected/disabled on Meta. + skipped:, + # Templates whose approval status changed to match Meta. + updated: + ) + end + + sig do + override.returns( + { + accounts_synced: Integer, + errors: T::Array[String], + imported: Integer, + linked: Integer, + skipped: Integer, + updated: Integer + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/url_escalate_params.rbi b/rbi/zavudev/models/url_escalate_params.rbi new file mode 100644 index 0000000..14e8034 --- /dev/null +++ b/rbi/zavudev/models/url_escalate_params.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Zavudev + module Models + class URLEscalateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Zavudev::URLEscalateParams, Zavudev::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :url_id + + # Why the URL should be reviewed manually. + sig { returns(String) } + attr_accessor :reason + + sig do + params( + url_id: String, + reason: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + url_id:, + # Why the URL should be reviewed manually. + reason:, + request_options: {} + ) + end + + sig do + override.returns( + { + url_id: String, + reason: String, + request_options: Zavudev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/zavudev/models/url_escalate_response.rbi b/rbi/zavudev/models/url_escalate_response.rbi new file mode 100644 index 0000000..93157c9 --- /dev/null +++ b/rbi/zavudev/models/url_escalate_response.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Zavudev + module Models + class URLEscalateResponse < Zavudev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Zavudev::Models::URLEscalateResponse, + Zavudev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :message + + sig { returns(Zavudev::VerifiedURL) } + attr_reader :url + + sig { params(url: Zavudev::VerifiedURL::OrHash).void } + attr_writer :url + + sig do + params(message: String, url: Zavudev::VerifiedURL::OrHash).returns( + T.attached_class + ) + end + def self.new(message:, url:) + end + + sig { override.returns({ message: String, url: Zavudev::VerifiedURL }) } + def to_hash + end + end + end +end diff --git a/rbi/zavudev/resources/agent_templates.rbi b/rbi/zavudev/resources/agent_templates.rbi new file mode 100644 index 0000000..f81b4b6 --- /dev/null +++ b/rbi/zavudev/resources/agent_templates.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Zavudev + module Resources + class AgentTemplates + # Fetch a single factory agent fully rendered: the function files to scaffold (an + # `index.ts` that declares the agent with `defineAgent` and its skills with + # `defineTool`) plus the secrets it needs. This is what + # `npx zavudev agents pull ` writes to disk before `npx zavudev deploy`. + sig do + params( + template_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::AgentTemplateRetrieveResponse) + end + def retrieve(template_id, request_options: {}) + end + + # List the factory agents available to scaffold with `npx zavudev agents pull`. + # Each entry is a ready-made voice or text agent (system prompt, skills, and — for + # voice agents — a co-located voice config). + sig do + params(request_options: Zavudev::RequestOptions::OrHash).returns( + Zavudev::Models::AgentTemplateListResponse + ) + end + def list(request_options: {}) + end + + # @api private + sig { params(client: Zavudev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/zavudev/resources/agents.rbi b/rbi/zavudev/resources/agents.rbi new file mode 100644 index 0000000..3ecd967 --- /dev/null +++ b/rbi/zavudev/resources/agents.rbi @@ -0,0 +1,204 @@ +# typed: strong + +module Zavudev + module Resources + class Agents + sig { returns(Zavudev::Resources::Agents::Senders) } + attr_reader :senders + + # Create an agent without a sender. It is created disabled; connect a sender and + # enable it when you are ready for it to answer. + # + # **Sub-resources.** An agent's tools, flows and knowledge bases are reachable at + # `/v1/agents/{agentId}/tools`, `/v1/agents/{agentId}/flows` and + # `/v1/agents/{agentId}/knowledge-bases`, mirroring the sender-scoped routes + # documented under `/v1/senders/{senderId}/agent/...` exactly. Use the + # agent-scoped form while the agent has no sender: the sender-scoped one cannot + # address it. + sig do + params( + model: String, + name: String, + provider: Zavudev::Senders::AgentProvider::OrSymbol, + system_prompt: String, + context_window_messages: Integer, + include_contact_metadata: T::Boolean, + max_tokens: Integer, + temperature: Float, + trigger_on_channels: T::Array[String], + trigger_on_message_types: T::Array[String], + voice: Zavudev::AgentCreateParams::Voice::OrHash, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::AgentCreateResponse) + end + def create( + model:, + name:, + # LLM provider for the AI agent. + provider:, + system_prompt:, + context_window_messages: nil, + include_contact_metadata: nil, + max_tokens: nil, + temperature: nil, + trigger_on_channels: nil, + trigger_on_message_types: nil, + # Voice Agent configuration on a sender's AI agent. Controls how the agent behaves + # on inbound and outbound phone calls through Zavu's managed voice pipeline + # (speech recognition, the agent's LLM, and speech synthesis, with real-time + # interruption handling). Requires the Voice Agents feature to be enabled for your + # team. + voice: nil, + request_options: {} + ) + end + + # Get an agent + sig do + params( + agent_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::AgentRetrieveResponse) + end + def retrieve( + # Agent ID. + agent_id, + request_options: {} + ) + end + + # Update an agent + sig do + params( + agent_id: String, + api_key: String, + context_window_messages: Integer, + enabled: T::Boolean, + include_contact_metadata: T::Boolean, + max_tokens: T.nilable(Integer), + model: String, + name: String, + provider: Zavudev::Senders::AgentProvider::OrSymbol, + system_prompt: String, + temperature: T.nilable(Float), + trigger_on_channels: T::Array[String], + trigger_on_message_types: T::Array[String], + voice: Zavudev::AgentUpdateParams::Voice::OrHash, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::AgentUpdateResponse) + end + def update( + # Agent ID. + agent_id, + api_key: nil, + context_window_messages: nil, + enabled: nil, + include_contact_metadata: nil, + max_tokens: nil, + model: nil, + name: nil, + # LLM provider for the AI agent. + provider: nil, + system_prompt: nil, + temperature: nil, + trigger_on_channels: nil, + trigger_on_message_types: nil, + # Voice Agent configuration. Patch this object to enable voice, change the + # greeting, or adjust call limits. Requires the Voice Agents feature to be enabled + # for your team. + voice: nil, + request_options: {} + ) + end + + # Every agent in the project, newest first — including agents that are not + # connected to any sender yet, which the sender-scoped routes cannot reach. Each + # item carries `senderIds`, the senders the agent answers on. + sig do + params( + cursor: String, + limit: Integer, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Internal::Cursor[Zavudev::Senders::SendersAgent]) + end + def list(cursor: nil, limit: nil, request_options: {}) + end + + # Delete an agent + sig do + params( + agent_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).void + end + def delete( + # Agent ID. + agent_id, + request_options: {} + ) + end + + # The voices an agent can speak with, for `voice.ttsVoiceId`. Filter by `language` + # to get the ones that speak it; a voice can still be used with `language: auto`, + # where the agent follows the caller and keeps the chosen voice. + sig do + params( + language: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::AgentListVoicesResponse) + end + def list_voices( + # BCP-47 tag (`en`, `es`, `pt-BR`). Omit, or pass `auto`, for every voice. + language: nil, + request_options: {} + ) + end + + # Run the agent's prompt, model and knowledge base against a message and return + # the reply instead of delivering it. Writes nothing and charges nothing, so it is + # safe to call repeatedly while iterating on a prompt. + # + # Note that a dry run never **executes** tools — running them would cause real + # side effects. Live conversations on every channel do call them. When the agent + # has enabled tools, that gap is reported in `warnings` rather than silently + # producing an answer that looks like a tool call happened. + sig do + params( + agent_id: String, + message: String, + execute_tools: T::Boolean, + history: T::Array[Zavudev::AgentTestParams::History::OrHash], + use_knowledge_base: T::Boolean, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::AgentTestResponse) + end + def test_( + # Agent ID. + agent_id, + # What to say to the agent. + message:, + # Run the tools the agent calls instead of reporting the choice and stopping. + # + # Off by default because a tool handler talks to the outside world: a rehearsal + # that charges a card is not a rehearsal. Turn it on to exercise the loop that + # actually matters — the model picks a tool, the handler answers, the model + # replies with the result — without sending a message to anyone. What ran comes + # back in `executedToolCalls`. + execute_tools: nil, + # Prior turns, oldest first, to exercise multi-turn behaviour without persisting a + # thread. Trimmed to the agent's context window. + history: nil, + # Set false to skip retrieval and isolate prompt behaviour from the knowledge + # base. + use_knowledge_base: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Zavudev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/zavudev/resources/agents/senders.rbi b/rbi/zavudev/resources/agents/senders.rbi new file mode 100644 index 0000000..b8932ca --- /dev/null +++ b/rbi/zavudev/resources/agents/senders.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Zavudev + module Resources + class Agents + class Senders + # Make the agent answer on this sender. An agent can serve several senders; a + # sender answers with at most one agent, so connecting one that is already in use + # returns `400` naming the agent that holds it. + sig do + params( + agent_id: String, + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::Agents::SenderConnectResponse) + end + def connect( + # Agent ID. + agent_id, + # Sender to connect. + sender_id:, + request_options: {} + ) + end + + # Stop the agent answering on this sender. The agent's primary sender is part of + # the agent itself and cannot be disconnected here. + sig do + params( + sender_id: String, + agent_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).void + end + def disconnect( + sender_id, + # Agent ID. + agent_id:, + request_options: {} + ) + end + + # @api private + sig { params(client: Zavudev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/zavudev/resources/calls.rbi b/rbi/zavudev/resources/calls.rbi new file mode 100644 index 0000000..e011763 --- /dev/null +++ b/rbi/zavudev/resources/calls.rbi @@ -0,0 +1,123 @@ +# typed: strong + +module Zavudev + module Resources + class Calls + # Place an outbound voice call answered by the voice agent configured on the + # sender. Zavu dials the recipient and runs the conversation through its managed + # voice pipeline (speech recognition, the agent's LLM, and speech synthesis, with + # real-time interruption handling). + # + # **Requirements:** + # + # - The Voice Agents feature must be enabled for your team (otherwise `403`). + # - The sender's agent must have `voice.enabled` set to `true`. + # - Not available with test-mode API keys. + # + # **Billing:** Voice calls are billed per minute of connected time plus telephony, + # deducted from your prepaid balance. A short-duration estimate is reserved when + # the call is placed; you are charged for the actual duration when the call ends. + sig do + params( + to: String, + greeting: String, + language: String, + max_duration_minutes: Integer, + metadata: T::Hash[Symbol, String], + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::CallCreateResponse) + end + def create( + # Recipient phone number in E.164 format. + to:, + # Overrides the agent's configured greeting for this call only. + greeting: nil, + # Language the agent speaks on this call only, as a BCP-47 tag (`en`, `es`, + # `es-ES`, `pt-BR`), or `auto` to detect the caller's language and follow it. + # Overrides the agent's configured language for speech recognition, the agent's + # replies, and the synthesized voice. If the agent uses a custom voice you + # supplied, that voice is kept and only the language changes. When omitted, the + # agent's configured language is used. + language: nil, + # Overrides the agent's maximum call duration for this call only. + max_duration_minutes: nil, + # Arbitrary metadata to associate with the call. Returned on the call object and + # included in voice webhooks. + metadata: nil, + # Sender profile that places the call. Uses the project's default sender if + # omitted. The sender's agent must have voice enabled. + sender_id: nil, + request_options: {} + ) + end + + # Retrieve a single voice call, including its full transcript once the + # conversation has produced turns. + sig do + params( + call_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::CallRetrieveResponse) + end + def retrieve( + # Voice call ID. + call_id, + request_options: {} + ) + end + + # List voice calls for this project, most recent first. Transcripts are omitted + # from the list; fetch a single call to get its transcript. + sig do + params( + cursor: String, + direction: Zavudev::CallListParams::Direction::OrSymbol, + limit: Integer, + status: Zavudev::CallListParams::Status::OrSymbol, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Internal::Cursor[Zavudev::Models::CallListResponse]) + end + def list( + cursor: nil, + # Whether the call was placed by Zavu (outbound) or received from a caller + # (inbound). + direction: nil, + limit: nil, + # Lifecycle status of a voice call. + # + # - `queued`: outbound call created, not yet dialing. + # - `ringing`: dialing (outbound) or received and ringing (inbound). + # - `in_progress`: answered, the agent is connected. + # - `completed`: ended after a conversation. + # - `failed`: could not be completed. + # - `busy`: the line was busy. + # - `no_answer`: rang but was not answered. + # - `canceled`: canceled before it was answered. + status: nil, + request_options: {} + ) + end + + # End an active voice call. The call must still be ringing or in progress. Not + # available with test-mode API keys. + sig do + params( + call_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::CallHangupResponse) + end + def hangup( + # Voice call ID. + call_id, + request_options: {} + ) + end + + # @api private + sig { params(client: Zavudev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/zavudev/resources/conversations.rbi b/rbi/zavudev/resources/conversations.rbi new file mode 100644 index 0000000..a541bbb --- /dev/null +++ b/rbi/zavudev/resources/conversations.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Zavudev + module Resources + class Conversations + # Get conversation + sig do + params( + conversation_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::ConversationRetrieveResponse) + end + def retrieve(conversation_id, request_options: {}) + end + + # List inbox threads, most recently active first. A conversation groups every + # message with one contact across channels, which is what you need to build an + # inbox: `GET /v1/messages` returns a flat log with no thread to hang it on. + # + # Use `senderId` to scope the list to a single number, and `channel` to keep only + # threads that have carried that channel. + sig do + params( + channel: Zavudev::ConversationListParams::Channel::OrSymbol, + cursor: String, + limit: Integer, + search: String, + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns( + Zavudev::Internal::Cursor[Zavudev::Models::ConversationListResponse] + ) + end + def list( + # Keep only threads that have carried this channel. + channel: nil, + # Opaque cursor from a previous response's `nextCursor`. Do not construct it. + cursor: nil, + limit: nil, + # Search threads by identity: phone number (any format — `+1 (555) 123-4567` and + # `15551234567` both match), email address (full or local part), WhatsApp group + # subject, WhatsApp username, or BSUID. Matching is by whole word, with prefix + # matching on the last term, so `mar` finds `maria@example.com` and `+1555` finds + # `+15551234567`; a fragment from the middle or end of a number (`4567`) does not + # match. + # + # It does **not** search message bodies — only who the thread is with. + # + # Results come back ranked by relevance rather than by recency, so the usual "most + # recently active first" ordering does not apply while `q` is set. `senderId` and + # `channel` still narrow the results, and `cursor` paginates them as usual. An + # empty or whitespace-only `q` returns no items rather than the full list. + search: nil, + # Keep only threads last handled by this sender. + sender_id: nil, + request_options: {} + ) + end + + # Messages in this thread, newest first, across every channel it has carried. + # Reply with `POST /v1/messages`, passing the conversation's `senderId` as the + # `Zavu-Sender` header so the answer leaves from the number the contact already + # knows. + sig do + params( + conversation_id: String, + cursor: String, + limit: Integer, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Internal::Cursor[Zavudev::Message]) + end + def list_messages( + conversation_id, + # Opaque cursor from a previous response's `nextCursor`. + cursor: nil, + limit: nil, + request_options: {} + ) + end + + # Reset the thread's `unreadCount` to zero. Marks the thread read in your own + # inbox only: it does not send a read receipt to the contact. + sig do + params( + conversation_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::ConversationMarkAsReadResponse) + end + def mark_as_read(conversation_id, request_options: {}) + end + + # @api private + sig { params(client: Zavudev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/zavudev/resources/email_domains.rbi b/rbi/zavudev/resources/email_domains.rbi new file mode 100644 index 0000000..b4a055c --- /dev/null +++ b/rbi/zavudev/resources/email_domains.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module Zavudev + module Resources + class EmailDomains + # Add a domain to send email from. Returns the DNS records to publish (DKIM CNAMEs + # are required; SPF, DMARC, and MAIL FROM are recommended). Publish them at your + # DNS provider, then verify. + sig do + params( + domain: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::EmailDomainCreateResponse) + end + def create( + # Bare domain, e.g. example.com. + domain:, + request_options: {} + ) + end + + # Fetch a domain with its DNS records and current status. + sig do + params( + domain_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::EmailDomainRetrieveResponse) + end + def retrieve(domain_id, request_options: {}) + end + + # List email domains + sig do + params(request_options: Zavudev::RequestOptions::OrHash).returns( + Zavudev::Models::EmailDomainListResponse + ) + end + def list(request_options: {}) + end + + # Remove an email domain + sig do + params( + domain_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).void + end + def delete(domain_id, request_options: {}) + end + + # Re-check the domain's published DNS records and refresh its status. + sig do + params( + domain_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::EmailDomainVerifyResponse) + end + def verify(domain_id, request_options: {}) + end + + # @api private + sig { params(client: Zavudev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/zavudev/resources/functions.rbi b/rbi/zavudev/resources/functions.rbi index 426a59d..22f6d5a 100644 --- a/rbi/zavudev/resources/functions.rbi +++ b/rbi/zavudev/resources/functions.rbi @@ -6,6 +6,12 @@ module Zavudev sig { returns(Zavudev::Resources::Functions::Secrets) } attr_reader :secrets + sig { returns(Zavudev::Resources::Functions::Triggers) } + attr_reader :triggers + + sig { returns(Zavudev::Resources::Functions::GitLink) } + attr_reader :git_link + # Create a new Zavu Function. The function starts in `draft` status. A dedicated # API key is auto-provisioned and injected as the `ZAVU_API_KEY` secret so the # function can call back into the Zavu API without manual setup. @@ -190,6 +196,55 @@ module Zavudev ) end + # List a function's deployment history, newest first. Source code is omitted; + # fetch a single deployment via GET /v1/functions/deployments/{deploymentId} for + # full details. + sig do + params( + function_id: String, + limit: Integer, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::FunctionListDeploymentsResponse) + end + def list_deployments( + # Zavu Function ID. + function_id, + limit: nil, + request_options: {} + ) + end + + # List the event types a function trigger can subscribe to. Includes the special + # type `cron`, which fires on a schedule (see POST + # /v1/functions/{functionId}/triggers) rather than on a messaging event. + sig do + params(request_options: Zavudev::RequestOptions::OrHash).returns( + Zavudev::Models::FunctionListEventTypesResponse + ) + end + def list_event_types(request_options: {}) + end + + # Re-deploy a previous version by copying its source, dependencies, and runtime + # pin onto the function's draft, then deploying. Returns immediately with a + # deployment ID — poll GET /v1/functions/deployments/{deploymentId} until status + # is active or failed. Secrets are not rolled back. + sig do + params( + function_id: String, + deployment_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::FunctionRollbackDeploymentResponse) + end + def rollback_deployment( + # Zavu Function ID. + function_id, + # ID of the deployment to roll back to. + deployment_id:, + request_options: {} + ) + end + # Fetch invocation logs for a function. Logs are paginated via `nextToken`. Pass # `startTime` / `endTime` (Unix epoch milliseconds) to bound the window, or # `filterPattern` to filter messages. diff --git a/rbi/zavudev/resources/functions/git_link.rbi b/rbi/zavudev/resources/functions/git_link.rbi new file mode 100644 index 0000000..119a07a --- /dev/null +++ b/rbi/zavudev/resources/functions/git_link.rbi @@ -0,0 +1,116 @@ +# typed: strong + +module Zavudev + module Resources + class Functions + class GitLink + # The link and its last deploy. Never returns the webhook secret. + sig do + params( + function_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::Functions::GitLinkRetrieveResponse) + end + def retrieve( + # Zavu Function ID. + function_id, + request_options: {} + ) + end + + # Change the branch, the root directory, or whether pushes deploy. Pass at least + # one field. `rootDir: null` clears the subdirectory. + sig do + params( + function_id: String, + auto_deploy: T::Boolean, + branch: String, + root_dir: T.nilable(String), + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::Functions::GitLinkUpdateResponse) + end + def update( + # Zavu Function ID. + function_id, + auto_deploy: nil, + branch: nil, + root_dir: nil, + request_options: {} + ) + end + + # Fetch the linked branch and deploy it without waiting for a push. Returns + # immediately; follow the outcome with `GET /v1/functions/{functionId}/git-link`, + # whose `lastStatus` and `lastError` describe the run. + sig do + params( + function_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::Functions::GitLinkDeployNowResponse) + end + def deploy_now( + # Zavu Function ID. + function_id, + request_options: {} + ) + end + + # Bind a repository to this function so every push to `branch` deploys it. A + # function holds at most one link; linking again returns 400. + # + # **The server decides how the link authenticates.** If the project has the Zavu + # GitHub App installed, the link uses that installation: private repositories work + # and there is nothing to configure in the repository. Otherwise it falls back to + # a manual link and the response carries a `webhookSecret` you add to the + # repository yourself. `connection` says which one you got. + # + # The repository is not checked against GitHub here, because it cannot be: an + # owner/repo that does not exist, or that the installation cannot see, is accepted + # and fails on the first deploy with a fetch error. + sig do + params( + function_id: String, + owner: String, + repo: String, + auto_deploy: T::Boolean, + branch: String, + root_dir: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::Functions::GitLinkLinkResponse) + end + def link( + # Zavu Function ID. + function_id, + owner:, + repo:, + auto_deploy: nil, + branch: nil, + # Subdirectory holding the project, for monorepos. + root_dir: nil, + request_options: {} + ) + end + + # Remove the link. The function and its deployments stay. A manual webhook left in + # the repository stops being accepted, so remove it there too. + sig do + params( + function_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).void + end + def unlink( + # Zavu Function ID. + function_id, + request_options: {} + ) + end + + # @api private + sig { params(client: Zavudev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/zavudev/resources/functions/triggers.rbi b/rbi/zavudev/resources/functions/triggers.rbi new file mode 100644 index 0000000..044f449 --- /dev/null +++ b/rbi/zavudev/resources/functions/triggers.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Zavudev + module Resources + class Functions + class Triggers + # Subscribe a function to one or more event types, optionally scoped to specific + # senders. Provide eventTypes and senderIds (use null in senderIds for all + # senders); a trigger is created for each event type and sender combination. + # + # The special event type `cron` runs the function on a schedule instead of a + # messaging event: include a `cron` field with a 5-field UTC cron expression + # (minimum granularity one minute). A cron trigger ignores the sender axis, and a + # function may hold several cron triggers with different expressions. The function + # receives an event with `type: "cron"` and `data.cron`. + sig do + params( + function_id: String, + event_types: T::Array[String], + sender_ids: T::Array[T.nilable(String)], + cron: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::Functions::TriggerCreateResponse) + end + def create( + # Zavu Function ID. + function_id, + # Event types to subscribe to. + event_types:, + # Senders to scope the triggers to. Use null for all senders. + sender_ids:, + # Required when eventTypes includes `cron`: a 5-field cron expression (minute hour + # day-of-month month day-of-week), evaluated in UTC. + cron: nil, + request_options: {} + ) + end + + # Enable or disable a trigger + sig do + params( + trigger_id: String, + active: T::Boolean, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::Functions::TriggerUpdateResponse) + end + def update(trigger_id, active:, request_options: {}) + end + + # List function triggers + sig do + params( + function_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::Functions::TriggerListResponse) + end + def list( + # Zavu Function ID. + function_id, + request_options: {} + ) + end + + # Delete a trigger + sig do + params( + trigger_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).void + end + def delete(trigger_id, request_options: {}) + end + + # @api private + sig { params(client: Zavudev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/zavudev/resources/introspect.rbi b/rbi/zavudev/resources/introspect.rbi index a5382b6..e47de3d 100644 --- a/rbi/zavudev/resources/introspect.rbi +++ b/rbi/zavudev/resources/introspect.rbi @@ -3,6 +3,32 @@ module Zavudev module Resources class Introspect + # Heuristic email validation to run before sending: catches invalid syntax, dead + # domains (no MX/A records), disposable inboxes, role-based addresses (info@, + # contacto@, sales@), and addresses already on your project's suppression list. + # Use it to clean a list before a broadcast and keep your bounce rate low. + # + # No mailbox-level (SMTP) probe is performed, so a `deliverable` verdict is not a + # delivery guarantee — it means no negative signal was found. Treat `risky` + # addresses with care and drop `undeliverable` ones. + # + # Accepts a single `email` or an `emails` batch (max 100 per request). + sig do + params( + email: String, + emails: T::Array[String], + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::IntrospectValidateEmailResponse) + end + def validate_email( + # Single email address to validate. + email: nil, + # Batch of email addresses to validate (max 100). + emails: nil, + request_options: {} + ) + end + # Validate a phone number and check if a WhatsApp conversation window is open. sig do params( diff --git a/rbi/zavudev/resources/messages.rbi b/rbi/zavudev/resources/messages.rbi index 904f34c..ee4f9c4 100644 --- a/rbi/zavudev/resources/messages.rbi +++ b/rbi/zavudev/resources/messages.rbi @@ -36,6 +36,21 @@ module Zavudev ) end + # List the stored file attachments for an email message and get a short-lived + # signed `downloadUrl` for each. Works for both inbound emails (received via + # `message.inbound`) and outbound emails you sent with attachments. Messages + # without stored attachments (including SMS, WhatsApp, and other channels) return + # an empty list. Each `downloadUrl` is generated fresh per request and expires — + # fetch the file promptly and do not cache the URL. + sig do + params( + message_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::MessageListAttachmentsResponse) + end + def list_attachments(message_id, request_options: {}) + end + # Send an emoji reaction to an existing WhatsApp message. Reactions are only # supported for WhatsApp messages. sig do diff --git a/rbi/zavudev/resources/senders.rbi b/rbi/zavudev/resources/senders.rbi index 536966f..d295d7c 100644 --- a/rbi/zavudev/resources/senders.rbi +++ b/rbi/zavudev/resources/senders.rbi @@ -9,6 +9,9 @@ module Zavudev sig { returns(Zavudev::Resources::Senders::WhatsappSync) } attr_reader :whatsapp_sync + sig { returns(Zavudev::Resources::Senders::Telegram) } + attr_reader :telegram + # Create sender sig do params( diff --git a/rbi/zavudev/resources/senders/agent/knowledge_bases/documents.rbi b/rbi/zavudev/resources/senders/agent/knowledge_bases/documents.rbi index de7db17..d589a88 100644 --- a/rbi/zavudev/resources/senders/agent/knowledge_bases/documents.rbi +++ b/rbi/zavudev/resources/senders/agent/knowledge_bases/documents.rbi @@ -71,6 +71,54 @@ module Zavudev def delete(doc_id, sender_id:, kb_id:, request_options: {}) end + # Get a single document from a knowledge base. + sig do + params( + doc_id: String, + sender_id: String, + kb_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns( + Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentRetrieveDocumentResponse + ) + end + def retrieve_document( + doc_id, + sender_id:, + kb_id:, + request_options: {} + ) + end + + # Update a document's title or content. Updating content reprocesses the document + # for RAG. + sig do + params( + doc_id: String, + sender_id: String, + kb_id: String, + content: String, + title: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns( + Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentUpdateDocumentResponse + ) + end + def update_document( + # Path param + doc_id, + # Path param + sender_id:, + # Path param + kb_id:, + # Body param + content: nil, + # Body param + title: nil, + request_options: {} + ) + end + # @api private sig { params(client: Zavudev::Client).returns(T.attached_class) } def self.new(client:) diff --git a/rbi/zavudev/resources/senders/agent/tools.rbi b/rbi/zavudev/resources/senders/agent/tools.rbi index 264200c..d401714 100644 --- a/rbi/zavudev/resources/senders/agent/tools.rbi +++ b/rbi/zavudev/resources/senders/agent/tools.rbi @@ -5,6 +5,9 @@ module Zavudev class Senders class Agent class Tools + sig { returns(Zavudev::Resources::Senders::Agent::Tools::Webhook) } + attr_reader :webhook + # Create a new tool for an agent. Tools allow the agent to call external webhooks. sig do params( @@ -112,6 +115,28 @@ module Zavudev def delete(tool_id, sender_id:, request_options: {}) end + # Recent runs of this tool triggered from the test endpoint, newest first. Covers + # manual tests only: a tool called by an agent during a real conversation is not + # recorded here. + sig do + params( + tool_id: String, + sender_id: String, + limit: Integer, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::Senders::Agent::ToolListTestRunsResponse) + end + def list_test_runs( + # Path param + tool_id, + # Path param + sender_id:, + # Query param + limit: nil, + request_options: {} + ) + end + # Run a tool with the parameters you supply and return what it answered. # # The call is synchronous: the response carries the tool's status, body, and diff --git a/rbi/zavudev/resources/senders/agent/tools/webhook.rbi b/rbi/zavudev/resources/senders/agent/tools/webhook.rbi new file mode 100644 index 0000000..6eba65e --- /dev/null +++ b/rbi/zavudev/resources/senders/agent/tools/webhook.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Zavudev + module Resources + class Senders + class Agent + class Tools + class Webhook + # Generate a new signing secret for this tool. The previous one stops working on + # the next call, with no overlap, so update your endpoint first. The tool keeps + # its id, so flows that reference it by name are unaffected. + sig do + params( + tool_id: String, + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::WebhookSecretResponse) + end + def rotate_secret(tool_id, sender_id:, request_options: {}) + end + + # @api private + sig { params(client: Zavudev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end + end +end diff --git a/rbi/zavudev/resources/senders/telegram.rbi b/rbi/zavudev/resources/senders/telegram.rbi new file mode 100644 index 0000000..af0e798 --- /dev/null +++ b/rbi/zavudev/resources/senders/telegram.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Zavudev + module Resources + class Senders + class Telegram + # Connect a Telegram bot to a sender. Provide the bot token from @BotFather; Zavu + # validates it, registers the webhook, and routes the sender's Telegram messages + # through it. + sig do + params( + sender_id: String, + bot_token: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::Senders::TelegramConnectResponse) + end + def connect( + sender_id, + # Bot token from @BotFather. + bot_token:, + request_options: {} + ) + end + + # Disconnect Telegram from a sender and remove the webhook. + sig do + params( + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).void + end + def disconnect(sender_id, request_options: {}) + end + + # @api private + sig { params(client: Zavudev::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/zavudev/resources/templates.rbi b/rbi/zavudev/resources/templates.rbi index 05db13a..ba48b7a 100644 --- a/rbi/zavudev/resources/templates.rbi +++ b/rbi/zavudev/resources/templates.rbi @@ -106,6 +106,41 @@ module Zavudev ) end + # Reconcile this project's templates against WhatsApp. Two things happen per + # connected WhatsApp Business Account: templates that exist on Meta but not in + # Zavu are imported (or linked to an existing template with the same name), and + # the approval status of the templates Zavu already knows about is refreshed from + # Meta. + # + # This is what to call when a template was created outside Zavu — in Meta Business + # Manager, or by another tool — or when a `template.status_changed` webhook was + # missed and a template is stuck in `pending`. Status changes normally arrive by + # webhook; this endpoint is the recovery path and the only path for a template + # Zavu never created. + # + # Templates that Meta reports as rejected or disabled are not imported; they are + # counted in `skipped`. Existing local templates are matched first by Meta + # template ID, then by name. + # + # By default every sender in the project with a WhatsApp Business Account is + # synced. Pass `senderId` to sync only that sender's account. The call is + # synchronous — it waits for Meta and returns what changed — so it can take a few + # seconds per account. A failure on one account does not fail the request: it is + # reported in `errors` and the remaining accounts are still synced. + sig do + params( + sender_id: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::TemplateSyncResponse) + end + def sync( + # Sync only the WhatsApp Business Account attached to this sender. If omitted, + # every WhatsApp sender in the project is synced. + sender_id: nil, + request_options: {} + ) + end + # @api private sig { params(client: Zavudev::Client).returns(T.attached_class) } def self.new(client:) diff --git a/rbi/zavudev/resources/urls.rbi b/rbi/zavudev/resources/urls.rbi index d088754..469b0f8 100644 --- a/rbi/zavudev/resources/urls.rbi +++ b/rbi/zavudev/resources/urls.rbi @@ -3,6 +3,23 @@ module Zavudev module Resources class URLs + # Request manual review of a rejected URL. Only URLs in 'rejected' status can be + # escalated; the status then moves to 'escalated'. + sig do + params( + url_id: String, + reason: String, + request_options: Zavudev::RequestOptions::OrHash + ).returns(Zavudev::Models::URLEscalateResponse) + end + def escalate( + url_id, + # Why the URL should be reviewed manually. + reason:, + request_options: {} + ) + end + # List URLs that have been verified for this project. sig do params( diff --git a/sig/zavudev/client.rbs b/sig/zavudev/client.rbs index 296d40a..93e9a3c 100644 --- a/sig/zavudev/client.rbs +++ b/sig/zavudev/client.rbs @@ -42,6 +42,16 @@ module Zavudev attr_reader functions: Zavudev::Resources::Functions + attr_reader conversations: Zavudev::Resources::Conversations + + attr_reader calls: Zavudev::Resources::Calls + + attr_reader agent_templates: Zavudev::Resources::AgentTemplates + + attr_reader email_domains: Zavudev::Resources::EmailDomains + + attr_reader agents: Zavudev::Resources::Agents + private def auth_headers: -> ::Hash[String, String] def initialize: ( diff --git a/sig/zavudev/models.rbs b/sig/zavudev/models.rbs index 6c5a02e..9fad525 100644 --- a/sig/zavudev/models.rbs +++ b/sig/zavudev/models.rbs @@ -11,6 +11,26 @@ module Zavudev module AddressStatus = Zavudev::Models::AddressStatus + class AgentCreateParams = Zavudev::Models::AgentCreateParams + + class AgentDeleteParams = Zavudev::Models::AgentDeleteParams + + class AgentListParams = Zavudev::Models::AgentListParams + + class AgentListVoicesParams = Zavudev::Models::AgentListVoicesParams + + class AgentRetrieveParams = Zavudev::Models::AgentRetrieveParams + + module Agents = Zavudev::Models::Agents + + class AgentTemplateListParams = Zavudev::Models::AgentTemplateListParams + + class AgentTemplateRetrieveParams = Zavudev::Models::AgentTemplateRetrieveParams + + class AgentTestParams = Zavudev::Models::AgentTestParams + + class AgentUpdateParams = Zavudev::Models::AgentUpdateParams + class AvailablePhoneNumber = Zavudev::Models::AvailablePhoneNumber class BalanceRetrieveParams = Zavudev::Models::BalanceRetrieveParams @@ -55,6 +75,14 @@ module Zavudev class BroadcastUpdateParams = Zavudev::Models::BroadcastUpdateParams + class CallCreateParams = Zavudev::Models::CallCreateParams + + class CallHangupParams = Zavudev::Models::CallHangupParams + + class CallListParams = Zavudev::Models::CallListParams + + class CallRetrieveParams = Zavudev::Models::CallRetrieveParams + module Channel = Zavudev::Models::Channel class Contact = Zavudev::Models::Contact @@ -79,6 +107,24 @@ module Zavudev class ContactUpdateParams = Zavudev::Models::ContactUpdateParams + class ConversationListMessagesParams = Zavudev::Models::ConversationListMessagesParams + + class ConversationListParams = Zavudev::Models::ConversationListParams + + class ConversationMarkAsReadParams = Zavudev::Models::ConversationMarkAsReadParams + + class ConversationRetrieveParams = Zavudev::Models::ConversationRetrieveParams + + class EmailDomainCreateParams = Zavudev::Models::EmailDomainCreateParams + + class EmailDomainDeleteParams = Zavudev::Models::EmailDomainDeleteParams + + class EmailDomainListParams = Zavudev::Models::EmailDomainListParams + + class EmailDomainRetrieveParams = Zavudev::Models::EmailDomainRetrieveParams + + class EmailDomainVerifyParams = Zavudev::Models::EmailDomainVerifyParams + class FunctionCreateParams = Zavudev::Models::FunctionCreateParams class FunctionDeleteParams = Zavudev::Models::FunctionDeleteParams @@ -87,14 +133,22 @@ module Zavudev class FunctionGetDeploymentParams = Zavudev::Models::FunctionGetDeploymentParams + class FunctionListDeploymentsParams = Zavudev::Models::FunctionListDeploymentsParams + + class FunctionListEventTypesParams = Zavudev::Models::FunctionListEventTypesParams + class FunctionRetrieveParams = Zavudev::Models::FunctionRetrieveParams + class FunctionRollbackDeploymentParams = Zavudev::Models::FunctionRollbackDeploymentParams + module Functions = Zavudev::Models::Functions class FunctionTailLogsParams = Zavudev::Models::FunctionTailLogsParams class FunctionUpdateParams = Zavudev::Models::FunctionUpdateParams + class IntrospectValidateEmailParams = Zavudev::Models::IntrospectValidateEmailParams + class IntrospectValidatePhoneParams = Zavudev::Models::IntrospectValidatePhoneParams class Invitation = Zavudev::Models::Invitation @@ -115,6 +169,8 @@ module Zavudev class MessageContent = Zavudev::Models::MessageContent + class MessageListAttachmentsParams = Zavudev::Models::MessageListAttachmentsParams + class MessageListParams = Zavudev::Models::MessageListParams class MessageReactParams = Zavudev::Models::MessageReactParams @@ -231,6 +287,10 @@ module Zavudev class TemplateSubmitParams = Zavudev::Models::TemplateSubmitParams + class TemplateSyncParams = Zavudev::Models::TemplateSyncParams + + class URLEscalateParams = Zavudev::Models::URLEscalateParams + class URLListVerifiedParams = Zavudev::Models::URLListVerifiedParams class URLRetrieveDetailsParams = Zavudev::Models::URLRetrieveDetailsParams diff --git a/sig/zavudev/models/agent_create_params.rbs b/sig/zavudev/models/agent_create_params.rbs new file mode 100644 index 0000000..df39cb9 --- /dev/null +++ b/sig/zavudev/models/agent_create_params.rbs @@ -0,0 +1,234 @@ +module Zavudev + module Models + type agent_create_params = + { + model: String, + name: String, + provider: Zavudev::Models::Senders::agent_provider, + system_prompt: String, + context_window_messages: Integer, + include_contact_metadata: bool, + max_tokens: Integer, + temperature: Float, + trigger_on_channels: ::Array[String], + trigger_on_message_types: ::Array[String], + voice: Zavudev::AgentCreateParams::Voice + } + & Zavudev::Internal::Type::request_parameters + + class AgentCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor model: String + + attr_accessor name: String + + attr_accessor provider: Zavudev::Models::Senders::agent_provider + + attr_accessor system_prompt: String + + attr_reader context_window_messages: Integer? + + def context_window_messages=: (Integer) -> Integer + + attr_reader include_contact_metadata: bool? + + def include_contact_metadata=: (bool) -> bool + + attr_reader max_tokens: Integer? + + def max_tokens=: (Integer) -> Integer + + attr_reader temperature: Float? + + def temperature=: (Float) -> Float + + attr_reader trigger_on_channels: ::Array[String]? + + def trigger_on_channels=: (::Array[String]) -> ::Array[String] + + attr_reader trigger_on_message_types: ::Array[String]? + + def trigger_on_message_types=: (::Array[String]) -> ::Array[String] + + attr_reader voice: Zavudev::AgentCreateParams::Voice? + + def voice=: ( + Zavudev::AgentCreateParams::Voice + ) -> Zavudev::AgentCreateParams::Voice + + def initialize: ( + model: String, + name: String, + provider: Zavudev::Models::Senders::agent_provider, + system_prompt: String, + ?context_window_messages: Integer, + ?include_contact_metadata: bool, + ?max_tokens: Integer, + ?temperature: Float, + ?trigger_on_channels: ::Array[String], + ?trigger_on_message_types: ::Array[String], + ?voice: Zavudev::AgentCreateParams::Voice, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + model: String, + name: String, + provider: Zavudev::Models::Senders::agent_provider, + system_prompt: String, + context_window_messages: Integer, + include_contact_metadata: bool, + max_tokens: Integer, + temperature: Float, + trigger_on_channels: ::Array[String], + trigger_on_message_types: ::Array[String], + voice: Zavudev::AgentCreateParams::Voice, + request_options: Zavudev::RequestOptions + } + + type voice = + { + enabled: bool, + greeting: String, + greetings: ::Hash[Symbol, String], + interruptible: bool, + language: String, + max_call_duration_minutes: Integer, + max_idle_seconds: Integer, + model: String, + record_calls: bool, + stt_model: String, + stt_provider: String, + transfer_phone_number: String, + tts_provider: String, + tts_voice_id: String, + voicemail_action: Zavudev::Models::AgentCreateParams::Voice::voicemail_action, + voicemail_message: String, + voice_speed: Float + } + + class Voice < Zavudev::Internal::Type::BaseModel + attr_accessor enabled: bool + + attr_reader greeting: String? + + def greeting=: (String) -> String + + attr_reader greetings: ::Hash[Symbol, String]? + + def greetings=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] + + attr_reader interruptible: bool? + + def interruptible=: (bool) -> bool + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader max_call_duration_minutes: Integer? + + def max_call_duration_minutes=: (Integer) -> Integer + + attr_reader max_idle_seconds: Integer? + + def max_idle_seconds=: (Integer) -> Integer + + attr_reader model: String? + + def model=: (String) -> String + + attr_reader record_calls: bool? + + def record_calls=: (bool) -> bool + + attr_reader stt_model: String? + + def stt_model=: (String) -> String + + attr_reader stt_provider: String? + + def stt_provider=: (String) -> String + + attr_reader transfer_phone_number: String? + + def transfer_phone_number=: (String) -> String + + attr_reader tts_provider: String? + + def tts_provider=: (String) -> String + + attr_reader tts_voice_id: String? + + def tts_voice_id=: (String) -> String + + attr_reader voicemail_action: Zavudev::Models::AgentCreateParams::Voice::voicemail_action? + + def voicemail_action=: ( + Zavudev::Models::AgentCreateParams::Voice::voicemail_action + ) -> Zavudev::Models::AgentCreateParams::Voice::voicemail_action + + attr_reader voicemail_message: String? + + def voicemail_message=: (String) -> String + + attr_reader voice_speed: Float? + + def voice_speed=: (Float) -> Float + + def initialize: ( + enabled: bool, + ?greeting: String, + ?greetings: ::Hash[Symbol, String], + ?interruptible: bool, + ?language: String, + ?max_call_duration_minutes: Integer, + ?max_idle_seconds: Integer, + ?model: String, + ?record_calls: bool, + ?stt_model: String, + ?stt_provider: String, + ?transfer_phone_number: String, + ?tts_provider: String, + ?tts_voice_id: String, + ?voicemail_action: Zavudev::Models::AgentCreateParams::Voice::voicemail_action, + ?voicemail_message: String, + ?voice_speed: Float + ) -> void + + def to_hash: -> { + enabled: bool, + greeting: String, + greetings: ::Hash[Symbol, String], + interruptible: bool, + language: String, + max_call_duration_minutes: Integer, + max_idle_seconds: Integer, + model: String, + record_calls: bool, + stt_model: String, + stt_provider: String, + transfer_phone_number: String, + tts_provider: String, + tts_voice_id: String, + voicemail_action: Zavudev::Models::AgentCreateParams::Voice::voicemail_action, + voicemail_message: String, + voice_speed: Float + } + + type voicemail_action = :hangup | :leave_message + + module VoicemailAction + extend Zavudev::Internal::Type::Enum + + HANGUP: :hangup + LEAVE_MESSAGE: :leave_message + + def self?.values: -> ::Array[Zavudev::Models::AgentCreateParams::Voice::voicemail_action] + end + end + end + end +end diff --git a/sig/zavudev/models/agent_create_response.rbs b/sig/zavudev/models/agent_create_response.rbs new file mode 100644 index 0000000..4fb0c45 --- /dev/null +++ b/sig/zavudev/models/agent_create_response.rbs @@ -0,0 +1,13 @@ +module Zavudev + module Models + type agent_create_response = { agent: Zavudev::Senders::SendersAgent } + + class AgentCreateResponse < Zavudev::Internal::Type::BaseModel + attr_accessor agent: Zavudev::Senders::SendersAgent + + def initialize: (agent: Zavudev::Senders::SendersAgent) -> void + + def to_hash: -> { agent: Zavudev::Senders::SendersAgent } + end + end +end diff --git a/sig/zavudev/models/agent_delete_params.rbs b/sig/zavudev/models/agent_delete_params.rbs new file mode 100644 index 0000000..2d3f42b --- /dev/null +++ b/sig/zavudev/models/agent_delete_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type agent_delete_params = + { agent_id: String } & Zavudev::Internal::Type::request_parameters + + class AgentDeleteParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor agent_id: String + + def initialize: ( + agent_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + agent_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/agent_list_params.rbs b/sig/zavudev/models/agent_list_params.rbs new file mode 100644 index 0000000..4c3fcd1 --- /dev/null +++ b/sig/zavudev/models/agent_list_params.rbs @@ -0,0 +1,32 @@ +module Zavudev + module Models + type agent_list_params = + { cursor: String, limit: Integer } + & Zavudev::Internal::Type::request_parameters + + class AgentListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + def initialize: ( + ?cursor: String, + ?limit: Integer, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + cursor: String, + limit: Integer, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/agent_list_voices_params.rbs b/sig/zavudev/models/agent_list_voices_params.rbs new file mode 100644 index 0000000..892c2a2 --- /dev/null +++ b/sig/zavudev/models/agent_list_voices_params.rbs @@ -0,0 +1,25 @@ +module Zavudev + module Models + type agent_list_voices_params = + { language: String } & Zavudev::Internal::Type::request_parameters + + class AgentListVoicesParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_reader language: String? + + def language=: (String) -> String + + def initialize: ( + ?language: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + language: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/agent_list_voices_response.rbs b/sig/zavudev/models/agent_list_voices_response.rbs new file mode 100644 index 0000000..6729195 --- /dev/null +++ b/sig/zavudev/models/agent_list_voices_response.rbs @@ -0,0 +1,46 @@ +module Zavudev + module Models + type agent_list_voices_response = + { + items: ::Array[Zavudev::Models::AgentListVoicesResponse::Item], + languages: ::Array[String], + total: Integer + } + + class AgentListVoicesResponse < Zavudev::Internal::Type::BaseModel + attr_accessor items: ::Array[Zavudev::Models::AgentListVoicesResponse::Item] + + attr_accessor languages: ::Array[String] + + attr_reader total: Integer? + + def total=: (Integer) -> Integer + + def initialize: ( + items: ::Array[Zavudev::Models::AgentListVoicesResponse::Item], + languages: ::Array[String], + ?total: Integer + ) -> void + + def to_hash: -> { + items: ::Array[Zavudev::Models::AgentListVoicesResponse::Item], + languages: ::Array[String], + total: Integer + } + + type item = { id: String, language: String, name: String } + + class Item < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor language: String + + attr_accessor name: String + + def initialize: (id: String, language: String, name: String) -> void + + def to_hash: -> { id: String, language: String, name: String } + end + end + end +end diff --git a/sig/zavudev/models/agent_retrieve_params.rbs b/sig/zavudev/models/agent_retrieve_params.rbs new file mode 100644 index 0000000..0ee320f --- /dev/null +++ b/sig/zavudev/models/agent_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type agent_retrieve_params = + { agent_id: String } & Zavudev::Internal::Type::request_parameters + + class AgentRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor agent_id: String + + def initialize: ( + agent_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + agent_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/agent_retrieve_response.rbs b/sig/zavudev/models/agent_retrieve_response.rbs new file mode 100644 index 0000000..7fbac56 --- /dev/null +++ b/sig/zavudev/models/agent_retrieve_response.rbs @@ -0,0 +1,13 @@ +module Zavudev + module Models + type agent_retrieve_response = { agent: Zavudev::Senders::SendersAgent } + + class AgentRetrieveResponse < Zavudev::Internal::Type::BaseModel + attr_accessor agent: Zavudev::Senders::SendersAgent + + def initialize: (agent: Zavudev::Senders::SendersAgent) -> void + + def to_hash: -> { agent: Zavudev::Senders::SendersAgent } + end + end +end diff --git a/sig/zavudev/models/agent_template_list_params.rbs b/sig/zavudev/models/agent_template_list_params.rbs new file mode 100644 index 0000000..67664bd --- /dev/null +++ b/sig/zavudev/models/agent_template_list_params.rbs @@ -0,0 +1,15 @@ +module Zavudev + module Models + type agent_template_list_params = + { } & Zavudev::Internal::Type::request_parameters + + class AgentTemplateListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + def initialize: (?request_options: Zavudev::request_opts) -> void + + def to_hash: -> { request_options: Zavudev::RequestOptions } + end + end +end diff --git a/sig/zavudev/models/agent_template_list_response.rbs b/sig/zavudev/models/agent_template_list_response.rbs new file mode 100644 index 0000000..e17b221 --- /dev/null +++ b/sig/zavudev/models/agent_template_list_response.rbs @@ -0,0 +1,73 @@ +module Zavudev + module Models + type agent_template_list_response = + { items: ::Array[Zavudev::Models::AgentTemplateListResponse::Item] } + + class AgentTemplateListResponse < Zavudev::Internal::Type::BaseModel + attr_accessor items: ::Array[Zavudev::Models::AgentTemplateListResponse::Item] + + def initialize: ( + items: ::Array[Zavudev::Models::AgentTemplateListResponse::Item] + ) -> void + + def to_hash: -> { + items: ::Array[Zavudev::Models::AgentTemplateListResponse::Item] + } + + type item = + { + id: String, + category: Zavudev::Models::AgentTemplateListResponse::Item::category, + name: String, + summary: String, + tool_count: Integer, + voice: bool + } + + class Item < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor category: Zavudev::Models::AgentTemplateListResponse::Item::category + + attr_accessor name: String + + attr_accessor summary: String + + attr_accessor tool_count: Integer + + attr_accessor voice: bool + + def initialize: ( + id: String, + category: Zavudev::Models::AgentTemplateListResponse::Item::category, + name: String, + summary: String, + tool_count: Integer, + voice: bool + ) -> void + + def to_hash: -> { + id: String, + category: Zavudev::Models::AgentTemplateListResponse::Item::category, + name: String, + summary: String, + tool_count: Integer, + voice: bool + } + + type category = :sales | :support | :frontDesk | :ops + + module Category + extend Zavudev::Internal::Type::Enum + + SALES: :sales + SUPPORT: :support + FRONT_DESK: :frontDesk + OPS: :ops + + def self?.values: -> ::Array[Zavudev::Models::AgentTemplateListResponse::Item::category] + end + end + end + end +end diff --git a/sig/zavudev/models/agent_template_retrieve_params.rbs b/sig/zavudev/models/agent_template_retrieve_params.rbs new file mode 100644 index 0000000..f727186 --- /dev/null +++ b/sig/zavudev/models/agent_template_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type agent_template_retrieve_params = + { template_id: String } & Zavudev::Internal::Type::request_parameters + + class AgentTemplateRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor template_id: String + + def initialize: ( + template_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + template_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/agent_template_retrieve_response.rbs b/sig/zavudev/models/agent_template_retrieve_response.rbs new file mode 100644 index 0000000..dfa85c4 --- /dev/null +++ b/sig/zavudev/models/agent_template_retrieve_response.rbs @@ -0,0 +1,112 @@ +module Zavudev + module Models + type agent_template_retrieve_response = + { template: Zavudev::Models::AgentTemplateRetrieveResponse::Template } + + class AgentTemplateRetrieveResponse < Zavudev::Internal::Type::BaseModel + attr_accessor template: Zavudev::Models::AgentTemplateRetrieveResponse::Template + + def initialize: ( + template: Zavudev::Models::AgentTemplateRetrieveResponse::Template + ) -> void + + def to_hash: -> { + template: Zavudev::Models::AgentTemplateRetrieveResponse::Template + } + + type template = + { + id: String, + category: Zavudev::Models::AgentTemplateRetrieveResponse::Template::category, + default_slug: String, + dependencies: ::Hash[Symbol, String], + files: ::Array[Zavudev::Models::AgentTemplateRetrieveResponse::Template::File], + name: String, + required_secrets: ::Array[Zavudev::Models::AgentTemplateRetrieveResponse::Template::RequiredSecret], + summary: String, + voice: bool + } + + class Template < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor category: Zavudev::Models::AgentTemplateRetrieveResponse::Template::category + + attr_accessor default_slug: String + + attr_accessor dependencies: ::Hash[Symbol, String] + + attr_accessor files: ::Array[Zavudev::Models::AgentTemplateRetrieveResponse::Template::File] + + attr_accessor name: String + + attr_accessor required_secrets: ::Array[Zavudev::Models::AgentTemplateRetrieveResponse::Template::RequiredSecret] + + attr_accessor summary: String + + attr_accessor voice: bool + + def initialize: ( + id: String, + category: Zavudev::Models::AgentTemplateRetrieveResponse::Template::category, + default_slug: String, + dependencies: ::Hash[Symbol, String], + files: ::Array[Zavudev::Models::AgentTemplateRetrieveResponse::Template::File], + name: String, + required_secrets: ::Array[Zavudev::Models::AgentTemplateRetrieveResponse::Template::RequiredSecret], + summary: String, + voice: bool + ) -> void + + def to_hash: -> { + id: String, + category: Zavudev::Models::AgentTemplateRetrieveResponse::Template::category, + default_slug: String, + dependencies: ::Hash[Symbol, String], + files: ::Array[Zavudev::Models::AgentTemplateRetrieveResponse::Template::File], + name: String, + required_secrets: ::Array[Zavudev::Models::AgentTemplateRetrieveResponse::Template::RequiredSecret], + summary: String, + voice: bool + } + + type category = :sales | :support | :frontDesk | :ops + + module Category + extend Zavudev::Internal::Type::Enum + + SALES: :sales + SUPPORT: :support + FRONT_DESK: :frontDesk + OPS: :ops + + def self?.values: -> ::Array[Zavudev::Models::AgentTemplateRetrieveResponse::Template::category] + end + + type file = { content: String, path: String } + + class File < Zavudev::Internal::Type::BaseModel + attr_accessor content: String + + attr_accessor path: String + + def initialize: (content: String, path: String) -> void + + def to_hash: -> { content: String, path: String } + end + + type required_secret = { hint: String, key: String } + + class RequiredSecret < Zavudev::Internal::Type::BaseModel + attr_accessor hint: String + + attr_accessor key: String + + def initialize: (hint: String, key: String) -> void + + def to_hash: -> { hint: String, key: String } + end + end + end + end +end diff --git a/sig/zavudev/models/agent_test_params.rbs b/sig/zavudev/models/agent_test_params.rbs new file mode 100644 index 0000000..d3569ee --- /dev/null +++ b/sig/zavudev/models/agent_test_params.rbs @@ -0,0 +1,87 @@ +module Zavudev + module Models + type agent_test_params = + { + agent_id: String, + message: String, + execute_tools: bool, + history: ::Array[Zavudev::AgentTestParams::History], + use_knowledge_base: bool + } + & Zavudev::Internal::Type::request_parameters + + class AgentTestParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor agent_id: String + + attr_accessor message: String + + attr_reader execute_tools: bool? + + def execute_tools=: (bool) -> bool + + attr_reader history: ::Array[Zavudev::AgentTestParams::History]? + + def history=: ( + ::Array[Zavudev::AgentTestParams::History] + ) -> ::Array[Zavudev::AgentTestParams::History] + + attr_reader use_knowledge_base: bool? + + def use_knowledge_base=: (bool) -> bool + + def initialize: ( + agent_id: String, + message: String, + ?execute_tools: bool, + ?history: ::Array[Zavudev::AgentTestParams::History], + ?use_knowledge_base: bool, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + agent_id: String, + message: String, + execute_tools: bool, + history: ::Array[Zavudev::AgentTestParams::History], + use_knowledge_base: bool, + request_options: Zavudev::RequestOptions + } + + type history = + { + content: String, + role: Zavudev::Models::AgentTestParams::History::role + } + + class History < Zavudev::Internal::Type::BaseModel + attr_accessor content: String + + attr_accessor role: Zavudev::Models::AgentTestParams::History::role + + def initialize: ( + content: String, + role: Zavudev::Models::AgentTestParams::History::role + ) -> void + + def to_hash: -> { + content: String, + role: Zavudev::Models::AgentTestParams::History::role + } + + type role = :user | :assistant + + module Role + extend Zavudev::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + + def self?.values: -> ::Array[Zavudev::Models::AgentTestParams::History::role] + end + end + end + end +end diff --git a/sig/zavudev/models/agent_test_response.rbs b/sig/zavudev/models/agent_test_response.rbs new file mode 100644 index 0000000..043b3a3 --- /dev/null +++ b/sig/zavudev/models/agent_test_response.rbs @@ -0,0 +1,78 @@ +module Zavudev + module Models + type agent_test_response = + { + error: String?, + input_tokens: Integer, + knowledge_chunks_used: Integer, + latency_ms: Integer, + output_tokens: Integer, + success: bool, + text: String?, + warnings: ::Array[String], + executed_tool_calls: ::Array[Zavudev::Models::AgentTestResponse::ExecutedToolCall] + } + + class AgentTestResponse < Zavudev::Internal::Type::BaseModel + attr_accessor error: String? + + attr_accessor input_tokens: Integer + + attr_accessor knowledge_chunks_used: Integer + + attr_accessor latency_ms: Integer + + attr_accessor output_tokens: Integer + + attr_accessor success: bool + + attr_accessor text: String? + + attr_accessor warnings: ::Array[String] + + attr_reader executed_tool_calls: ::Array[Zavudev::Models::AgentTestResponse::ExecutedToolCall]? + + def executed_tool_calls=: ( + ::Array[Zavudev::Models::AgentTestResponse::ExecutedToolCall] + ) -> ::Array[Zavudev::Models::AgentTestResponse::ExecutedToolCall] + + def initialize: ( + error: String?, + input_tokens: Integer, + knowledge_chunks_used: Integer, + latency_ms: Integer, + output_tokens: Integer, + success: bool, + text: String?, + warnings: ::Array[String], + ?executed_tool_calls: ::Array[Zavudev::Models::AgentTestResponse::ExecutedToolCall] + ) -> void + + def to_hash: -> { + error: String?, + input_tokens: Integer, + knowledge_chunks_used: Integer, + latency_ms: Integer, + output_tokens: Integer, + success: bool, + text: String?, + warnings: ::Array[String], + executed_tool_calls: ::Array[Zavudev::Models::AgentTestResponse::ExecutedToolCall] + } + + type executed_tool_call = { name: String, ok: bool, error: String? } + + class ExecutedToolCall < Zavudev::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor ok: bool + + attr_accessor error: String? + + def initialize: (name: String, ok: bool, ?error: String?) -> void + + def to_hash: -> { name: String, ok: bool, error: String? } + end + end + end +end diff --git a/sig/zavudev/models/agent_update_params.rbs b/sig/zavudev/models/agent_update_params.rbs new file mode 100644 index 0000000..33c16ba --- /dev/null +++ b/sig/zavudev/models/agent_update_params.rbs @@ -0,0 +1,259 @@ +module Zavudev + module Models + type agent_update_params = + { + agent_id: String, + api_key: String, + context_window_messages: Integer, + enabled: bool, + include_contact_metadata: bool, + max_tokens: Integer?, + model: String, + name: String, + provider: Zavudev::Models::Senders::agent_provider, + system_prompt: String, + temperature: Float?, + trigger_on_channels: ::Array[String], + trigger_on_message_types: ::Array[String], + voice: Zavudev::AgentUpdateParams::Voice + } + & Zavudev::Internal::Type::request_parameters + + class AgentUpdateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor agent_id: String + + attr_reader api_key: String? + + def api_key=: (String) -> String + + attr_reader context_window_messages: Integer? + + def context_window_messages=: (Integer) -> Integer + + attr_reader enabled: bool? + + def enabled=: (bool) -> bool + + attr_reader include_contact_metadata: bool? + + def include_contact_metadata=: (bool) -> bool + + attr_accessor max_tokens: Integer? + + attr_reader model: String? + + def model=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader provider: Zavudev::Models::Senders::agent_provider? + + def provider=: ( + Zavudev::Models::Senders::agent_provider + ) -> Zavudev::Models::Senders::agent_provider + + attr_reader system_prompt: String? + + def system_prompt=: (String) -> String + + attr_accessor temperature: Float? + + attr_reader trigger_on_channels: ::Array[String]? + + def trigger_on_channels=: (::Array[String]) -> ::Array[String] + + attr_reader trigger_on_message_types: ::Array[String]? + + def trigger_on_message_types=: (::Array[String]) -> ::Array[String] + + attr_reader voice: Zavudev::AgentUpdateParams::Voice? + + def voice=: ( + Zavudev::AgentUpdateParams::Voice + ) -> Zavudev::AgentUpdateParams::Voice + + def initialize: ( + agent_id: String, + ?api_key: String, + ?context_window_messages: Integer, + ?enabled: bool, + ?include_contact_metadata: bool, + ?max_tokens: Integer?, + ?model: String, + ?name: String, + ?provider: Zavudev::Models::Senders::agent_provider, + ?system_prompt: String, + ?temperature: Float?, + ?trigger_on_channels: ::Array[String], + ?trigger_on_message_types: ::Array[String], + ?voice: Zavudev::AgentUpdateParams::Voice, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + agent_id: String, + api_key: String, + context_window_messages: Integer, + enabled: bool, + include_contact_metadata: bool, + max_tokens: Integer?, + model: String, + name: String, + provider: Zavudev::Models::Senders::agent_provider, + system_prompt: String, + temperature: Float?, + trigger_on_channels: ::Array[String], + trigger_on_message_types: ::Array[String], + voice: Zavudev::AgentUpdateParams::Voice, + request_options: Zavudev::RequestOptions + } + + type voice = + { + enabled: bool, + greeting: String, + greetings: ::Hash[Symbol, String], + interruptible: bool, + language: String, + max_call_duration_minutes: Integer, + max_idle_seconds: Integer, + model: String, + record_calls: bool, + stt_model: String, + stt_provider: String, + transfer_phone_number: String, + tts_provider: String, + tts_voice_id: String, + voicemail_action: Zavudev::Models::AgentUpdateParams::Voice::voicemail_action, + voicemail_message: String, + voice_speed: Float + } + + class Voice < Zavudev::Internal::Type::BaseModel + attr_accessor enabled: bool + + attr_reader greeting: String? + + def greeting=: (String) -> String + + attr_reader greetings: ::Hash[Symbol, String]? + + def greetings=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] + + attr_reader interruptible: bool? + + def interruptible=: (bool) -> bool + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader max_call_duration_minutes: Integer? + + def max_call_duration_minutes=: (Integer) -> Integer + + attr_reader max_idle_seconds: Integer? + + def max_idle_seconds=: (Integer) -> Integer + + attr_reader model: String? + + def model=: (String) -> String + + attr_reader record_calls: bool? + + def record_calls=: (bool) -> bool + + attr_reader stt_model: String? + + def stt_model=: (String) -> String + + attr_reader stt_provider: String? + + def stt_provider=: (String) -> String + + attr_reader transfer_phone_number: String? + + def transfer_phone_number=: (String) -> String + + attr_reader tts_provider: String? + + def tts_provider=: (String) -> String + + attr_reader tts_voice_id: String? + + def tts_voice_id=: (String) -> String + + attr_reader voicemail_action: Zavudev::Models::AgentUpdateParams::Voice::voicemail_action? + + def voicemail_action=: ( + Zavudev::Models::AgentUpdateParams::Voice::voicemail_action + ) -> Zavudev::Models::AgentUpdateParams::Voice::voicemail_action + + attr_reader voicemail_message: String? + + def voicemail_message=: (String) -> String + + attr_reader voice_speed: Float? + + def voice_speed=: (Float) -> Float + + def initialize: ( + enabled: bool, + ?greeting: String, + ?greetings: ::Hash[Symbol, String], + ?interruptible: bool, + ?language: String, + ?max_call_duration_minutes: Integer, + ?max_idle_seconds: Integer, + ?model: String, + ?record_calls: bool, + ?stt_model: String, + ?stt_provider: String, + ?transfer_phone_number: String, + ?tts_provider: String, + ?tts_voice_id: String, + ?voicemail_action: Zavudev::Models::AgentUpdateParams::Voice::voicemail_action, + ?voicemail_message: String, + ?voice_speed: Float + ) -> void + + def to_hash: -> { + enabled: bool, + greeting: String, + greetings: ::Hash[Symbol, String], + interruptible: bool, + language: String, + max_call_duration_minutes: Integer, + max_idle_seconds: Integer, + model: String, + record_calls: bool, + stt_model: String, + stt_provider: String, + transfer_phone_number: String, + tts_provider: String, + tts_voice_id: String, + voicemail_action: Zavudev::Models::AgentUpdateParams::Voice::voicemail_action, + voicemail_message: String, + voice_speed: Float + } + + type voicemail_action = :hangup | :leave_message + + module VoicemailAction + extend Zavudev::Internal::Type::Enum + + HANGUP: :hangup + LEAVE_MESSAGE: :leave_message + + def self?.values: -> ::Array[Zavudev::Models::AgentUpdateParams::Voice::voicemail_action] + end + end + end + end +end diff --git a/sig/zavudev/models/agent_update_response.rbs b/sig/zavudev/models/agent_update_response.rbs new file mode 100644 index 0000000..5ff3f58 --- /dev/null +++ b/sig/zavudev/models/agent_update_response.rbs @@ -0,0 +1,13 @@ +module Zavudev + module Models + type agent_update_response = { agent: Zavudev::Senders::SendersAgent } + + class AgentUpdateResponse < Zavudev::Internal::Type::BaseModel + attr_accessor agent: Zavudev::Senders::SendersAgent + + def initialize: (agent: Zavudev::Senders::SendersAgent) -> void + + def to_hash: -> { agent: Zavudev::Senders::SendersAgent } + end + end +end diff --git a/sig/zavudev/models/agents/sender_connect_params.rbs b/sig/zavudev/models/agents/sender_connect_params.rbs new file mode 100644 index 0000000..a5a6cec --- /dev/null +++ b/sig/zavudev/models/agents/sender_connect_params.rbs @@ -0,0 +1,30 @@ +module Zavudev + module Models + module Agents + type sender_connect_params = + { agent_id: String, sender_id: String } + & Zavudev::Internal::Type::request_parameters + + class SenderConnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor agent_id: String + + attr_accessor sender_id: String + + def initialize: ( + agent_id: String, + sender_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + agent_id: String, + sender_id: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/agents/sender_connect_response.rbs b/sig/zavudev/models/agents/sender_connect_response.rbs new file mode 100644 index 0000000..806d603 --- /dev/null +++ b/sig/zavudev/models/agents/sender_connect_response.rbs @@ -0,0 +1,15 @@ +module Zavudev + module Models + module Agents + type sender_connect_response = { agent: Zavudev::Senders::SendersAgent } + + class SenderConnectResponse < Zavudev::Internal::Type::BaseModel + attr_accessor agent: Zavudev::Senders::SendersAgent + + def initialize: (agent: Zavudev::Senders::SendersAgent) -> void + + def to_hash: -> { agent: Zavudev::Senders::SendersAgent } + end + end + end +end diff --git a/sig/zavudev/models/agents/sender_disconnect_params.rbs b/sig/zavudev/models/agents/sender_disconnect_params.rbs new file mode 100644 index 0000000..558292e --- /dev/null +++ b/sig/zavudev/models/agents/sender_disconnect_params.rbs @@ -0,0 +1,30 @@ +module Zavudev + module Models + module Agents + type sender_disconnect_params = + { agent_id: String, sender_id: String } + & Zavudev::Internal::Type::request_parameters + + class SenderDisconnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor agent_id: String + + attr_accessor sender_id: String + + def initialize: ( + agent_id: String, + sender_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + agent_id: String, + sender_id: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/call_create_params.rbs b/sig/zavudev/models/call_create_params.rbs new file mode 100644 index 0000000..457cc7a --- /dev/null +++ b/sig/zavudev/models/call_create_params.rbs @@ -0,0 +1,61 @@ +module Zavudev + module Models + type call_create_params = + { + to: String, + greeting: String, + language: String, + max_duration_minutes: Integer, + metadata: ::Hash[Symbol, String], + sender_id: String + } + & Zavudev::Internal::Type::request_parameters + + class CallCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor to: String + + attr_reader greeting: String? + + def greeting=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader max_duration_minutes: Integer? + + def max_duration_minutes=: (Integer) -> Integer + + attr_reader metadata: ::Hash[Symbol, String]? + + def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] + + attr_reader sender_id: String? + + def sender_id=: (String) -> String + + def initialize: ( + to: String, + ?greeting: String, + ?language: String, + ?max_duration_minutes: Integer, + ?metadata: ::Hash[Symbol, String], + ?sender_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + to: String, + greeting: String, + language: String, + max_duration_minutes: Integer, + metadata: ::Hash[Symbol, String], + sender_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/call_create_response.rbs b/sig/zavudev/models/call_create_response.rbs new file mode 100644 index 0000000..20b5b89 --- /dev/null +++ b/sig/zavudev/models/call_create_response.rbs @@ -0,0 +1,194 @@ +module Zavudev + module Models + type call_create_response = + { call: Zavudev::Models::CallCreateResponse::Call } + + class CallCreateResponse < Zavudev::Internal::Type::BaseModel + attr_accessor call: Zavudev::Models::CallCreateResponse::Call + + def initialize: (call: Zavudev::Models::CallCreateResponse::Call) -> void + + def to_hash: -> { call: Zavudev::Models::CallCreateResponse::Call } + + type call = + { + id: String, + created_at: Time, + direction: Zavudev::Models::CallCreateResponse::Call::direction, + from: String, + status: Zavudev::Models::CallCreateResponse::Call::status, + to: String, + answered_at: Time?, + cost: Float?, + duration_seconds: Integer?, + ended_at: Time?, + end_reason: String?, + metadata: ::Hash[Symbol, String], + transcript: ::Array[Zavudev::Models::CallCreateResponse::Call::Transcript], + turn_count: Integer?, + updated_at: Time + } + + class Call < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor direction: Zavudev::Models::CallCreateResponse::Call::direction + + attr_accessor from: String + + attr_accessor status: Zavudev::Models::CallCreateResponse::Call::status + + attr_accessor to: String + + attr_accessor answered_at: Time? + + attr_accessor cost: Float? + + attr_accessor duration_seconds: Integer? + + attr_accessor ended_at: Time? + + attr_accessor end_reason: String? + + attr_reader metadata: ::Hash[Symbol, String]? + + def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] + + attr_reader transcript: ::Array[Zavudev::Models::CallCreateResponse::Call::Transcript]? + + def transcript=: ( + ::Array[Zavudev::Models::CallCreateResponse::Call::Transcript] + ) -> ::Array[Zavudev::Models::CallCreateResponse::Call::Transcript] + + attr_accessor turn_count: Integer? + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + created_at: Time, + direction: Zavudev::Models::CallCreateResponse::Call::direction, + from: String, + status: Zavudev::Models::CallCreateResponse::Call::status, + to: String, + ?answered_at: Time?, + ?cost: Float?, + ?duration_seconds: Integer?, + ?ended_at: Time?, + ?end_reason: String?, + ?metadata: ::Hash[Symbol, String], + ?transcript: ::Array[Zavudev::Models::CallCreateResponse::Call::Transcript], + ?turn_count: Integer?, + ?updated_at: Time + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + direction: Zavudev::Models::CallCreateResponse::Call::direction, + from: String, + status: Zavudev::Models::CallCreateResponse::Call::status, + to: String, + answered_at: Time?, + cost: Float?, + duration_seconds: Integer?, + ended_at: Time?, + end_reason: String?, + metadata: ::Hash[Symbol, String], + transcript: ::Array[Zavudev::Models::CallCreateResponse::Call::Transcript], + turn_count: Integer?, + updated_at: Time + } + + type direction = :inbound | :outbound + + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND: :inbound + OUTBOUND: :outbound + + def self?.values: -> ::Array[Zavudev::Models::CallCreateResponse::Call::direction] + end + + type status = + :queued + | :ringing + | :in_progress + | :completed + | :failed + | :busy + | :no_answer + | :canceled + + module Status + extend Zavudev::Internal::Type::Enum + + QUEUED: :queued + RINGING: :ringing + IN_PROGRESS: :in_progress + COMPLETED: :completed + FAILED: :failed + BUSY: :busy + NO_ANSWER: :no_answer + CANCELED: :canceled + + def self?.values: -> ::Array[Zavudev::Models::CallCreateResponse::Call::status] + end + + type transcript = + { + role: Zavudev::Models::CallCreateResponse::Call::Transcript::role, + seq: Integer, + text: String, + ended_at: Time?, + started_at: Time? + } + + class Transcript < Zavudev::Internal::Type::BaseModel + attr_accessor role: Zavudev::Models::CallCreateResponse::Call::Transcript::role + + attr_accessor seq: Integer + + attr_accessor text: String + + attr_accessor ended_at: Time? + + attr_accessor started_at: Time? + + def initialize: ( + role: Zavudev::Models::CallCreateResponse::Call::Transcript::role, + seq: Integer, + text: String, + ?ended_at: Time?, + ?started_at: Time? + ) -> void + + def to_hash: -> { + role: Zavudev::Models::CallCreateResponse::Call::Transcript::role, + seq: Integer, + text: String, + ended_at: Time?, + started_at: Time? + } + + type role = :user | :assistant | :tool + + module Role + extend Zavudev::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + TOOL: :tool + + def self?.values: -> ::Array[Zavudev::Models::CallCreateResponse::Call::Transcript::role] + end + end + end + end + end +end diff --git a/sig/zavudev/models/call_hangup_params.rbs b/sig/zavudev/models/call_hangup_params.rbs new file mode 100644 index 0000000..80da4aa --- /dev/null +++ b/sig/zavudev/models/call_hangup_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type call_hangup_params = + { call_id: String } & Zavudev::Internal::Type::request_parameters + + class CallHangupParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor call_id: String + + def initialize: ( + call_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + call_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/call_hangup_response.rbs b/sig/zavudev/models/call_hangup_response.rbs new file mode 100644 index 0000000..66939f5 --- /dev/null +++ b/sig/zavudev/models/call_hangup_response.rbs @@ -0,0 +1,194 @@ +module Zavudev + module Models + type call_hangup_response = + { call: Zavudev::Models::CallHangupResponse::Call } + + class CallHangupResponse < Zavudev::Internal::Type::BaseModel + attr_accessor call: Zavudev::Models::CallHangupResponse::Call + + def initialize: (call: Zavudev::Models::CallHangupResponse::Call) -> void + + def to_hash: -> { call: Zavudev::Models::CallHangupResponse::Call } + + type call = + { + id: String, + created_at: Time, + direction: Zavudev::Models::CallHangupResponse::Call::direction, + from: String, + status: Zavudev::Models::CallHangupResponse::Call::status, + to: String, + answered_at: Time?, + cost: Float?, + duration_seconds: Integer?, + ended_at: Time?, + end_reason: String?, + metadata: ::Hash[Symbol, String], + transcript: ::Array[Zavudev::Models::CallHangupResponse::Call::Transcript], + turn_count: Integer?, + updated_at: Time + } + + class Call < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor direction: Zavudev::Models::CallHangupResponse::Call::direction + + attr_accessor from: String + + attr_accessor status: Zavudev::Models::CallHangupResponse::Call::status + + attr_accessor to: String + + attr_accessor answered_at: Time? + + attr_accessor cost: Float? + + attr_accessor duration_seconds: Integer? + + attr_accessor ended_at: Time? + + attr_accessor end_reason: String? + + attr_reader metadata: ::Hash[Symbol, String]? + + def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] + + attr_reader transcript: ::Array[Zavudev::Models::CallHangupResponse::Call::Transcript]? + + def transcript=: ( + ::Array[Zavudev::Models::CallHangupResponse::Call::Transcript] + ) -> ::Array[Zavudev::Models::CallHangupResponse::Call::Transcript] + + attr_accessor turn_count: Integer? + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + created_at: Time, + direction: Zavudev::Models::CallHangupResponse::Call::direction, + from: String, + status: Zavudev::Models::CallHangupResponse::Call::status, + to: String, + ?answered_at: Time?, + ?cost: Float?, + ?duration_seconds: Integer?, + ?ended_at: Time?, + ?end_reason: String?, + ?metadata: ::Hash[Symbol, String], + ?transcript: ::Array[Zavudev::Models::CallHangupResponse::Call::Transcript], + ?turn_count: Integer?, + ?updated_at: Time + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + direction: Zavudev::Models::CallHangupResponse::Call::direction, + from: String, + status: Zavudev::Models::CallHangupResponse::Call::status, + to: String, + answered_at: Time?, + cost: Float?, + duration_seconds: Integer?, + ended_at: Time?, + end_reason: String?, + metadata: ::Hash[Symbol, String], + transcript: ::Array[Zavudev::Models::CallHangupResponse::Call::Transcript], + turn_count: Integer?, + updated_at: Time + } + + type direction = :inbound | :outbound + + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND: :inbound + OUTBOUND: :outbound + + def self?.values: -> ::Array[Zavudev::Models::CallHangupResponse::Call::direction] + end + + type status = + :queued + | :ringing + | :in_progress + | :completed + | :failed + | :busy + | :no_answer + | :canceled + + module Status + extend Zavudev::Internal::Type::Enum + + QUEUED: :queued + RINGING: :ringing + IN_PROGRESS: :in_progress + COMPLETED: :completed + FAILED: :failed + BUSY: :busy + NO_ANSWER: :no_answer + CANCELED: :canceled + + def self?.values: -> ::Array[Zavudev::Models::CallHangupResponse::Call::status] + end + + type transcript = + { + role: Zavudev::Models::CallHangupResponse::Call::Transcript::role, + seq: Integer, + text: String, + ended_at: Time?, + started_at: Time? + } + + class Transcript < Zavudev::Internal::Type::BaseModel + attr_accessor role: Zavudev::Models::CallHangupResponse::Call::Transcript::role + + attr_accessor seq: Integer + + attr_accessor text: String + + attr_accessor ended_at: Time? + + attr_accessor started_at: Time? + + def initialize: ( + role: Zavudev::Models::CallHangupResponse::Call::Transcript::role, + seq: Integer, + text: String, + ?ended_at: Time?, + ?started_at: Time? + ) -> void + + def to_hash: -> { + role: Zavudev::Models::CallHangupResponse::Call::Transcript::role, + seq: Integer, + text: String, + ended_at: Time?, + started_at: Time? + } + + type role = :user | :assistant | :tool + + module Role + extend Zavudev::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + TOOL: :tool + + def self?.values: -> ::Array[Zavudev::Models::CallHangupResponse::Call::Transcript::role] + end + end + end + end + end +end diff --git a/sig/zavudev/models/call_list_params.rbs b/sig/zavudev/models/call_list_params.rbs new file mode 100644 index 0000000..c1974a0 --- /dev/null +++ b/sig/zavudev/models/call_list_params.rbs @@ -0,0 +1,89 @@ +module Zavudev + module Models + type call_list_params = + { + cursor: String, + direction: Zavudev::Models::CallListParams::direction, + limit: Integer, + status: Zavudev::Models::CallListParams::status + } + & Zavudev::Internal::Type::request_parameters + + class CallListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader direction: Zavudev::Models::CallListParams::direction? + + def direction=: ( + Zavudev::Models::CallListParams::direction + ) -> Zavudev::Models::CallListParams::direction + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader status: Zavudev::Models::CallListParams::status? + + def status=: ( + Zavudev::Models::CallListParams::status + ) -> Zavudev::Models::CallListParams::status + + def initialize: ( + ?cursor: String, + ?direction: Zavudev::Models::CallListParams::direction, + ?limit: Integer, + ?status: Zavudev::Models::CallListParams::status, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + cursor: String, + direction: Zavudev::Models::CallListParams::direction, + limit: Integer, + status: Zavudev::Models::CallListParams::status, + request_options: Zavudev::RequestOptions + } + + type direction = :inbound | :outbound + + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND: :inbound + OUTBOUND: :outbound + + def self?.values: -> ::Array[Zavudev::Models::CallListParams::direction] + end + + type status = + :queued + | :ringing + | :in_progress + | :completed + | :failed + | :busy + | :no_answer + | :canceled + + module Status + extend Zavudev::Internal::Type::Enum + + QUEUED: :queued + RINGING: :ringing + IN_PROGRESS: :in_progress + COMPLETED: :completed + FAILED: :failed + BUSY: :busy + NO_ANSWER: :no_answer + CANCELED: :canceled + + def self?.values: -> ::Array[Zavudev::Models::CallListParams::status] + end + end + end +end diff --git a/sig/zavudev/models/call_list_response.rbs b/sig/zavudev/models/call_list_response.rbs new file mode 100644 index 0000000..f38a0ea --- /dev/null +++ b/sig/zavudev/models/call_list_response.rbs @@ -0,0 +1,183 @@ +module Zavudev + module Models + type call_list_response = + { + id: String, + created_at: Time, + direction: Zavudev::Models::CallListResponse::direction, + from: String, + status: Zavudev::Models::CallListResponse::status, + to: String, + answered_at: Time?, + cost: Float?, + duration_seconds: Integer?, + ended_at: Time?, + end_reason: String?, + metadata: ::Hash[Symbol, String], + transcript: ::Array[Zavudev::Models::CallListResponse::Transcript], + turn_count: Integer?, + updated_at: Time + } + + class CallListResponse < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor direction: Zavudev::Models::CallListResponse::direction + + attr_accessor from: String + + attr_accessor status: Zavudev::Models::CallListResponse::status + + attr_accessor to: String + + attr_accessor answered_at: Time? + + attr_accessor cost: Float? + + attr_accessor duration_seconds: Integer? + + attr_accessor ended_at: Time? + + attr_accessor end_reason: String? + + attr_reader metadata: ::Hash[Symbol, String]? + + def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] + + attr_reader transcript: ::Array[Zavudev::Models::CallListResponse::Transcript]? + + def transcript=: ( + ::Array[Zavudev::Models::CallListResponse::Transcript] + ) -> ::Array[Zavudev::Models::CallListResponse::Transcript] + + attr_accessor turn_count: Integer? + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + created_at: Time, + direction: Zavudev::Models::CallListResponse::direction, + from: String, + status: Zavudev::Models::CallListResponse::status, + to: String, + ?answered_at: Time?, + ?cost: Float?, + ?duration_seconds: Integer?, + ?ended_at: Time?, + ?end_reason: String?, + ?metadata: ::Hash[Symbol, String], + ?transcript: ::Array[Zavudev::Models::CallListResponse::Transcript], + ?turn_count: Integer?, + ?updated_at: Time + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + direction: Zavudev::Models::CallListResponse::direction, + from: String, + status: Zavudev::Models::CallListResponse::status, + to: String, + answered_at: Time?, + cost: Float?, + duration_seconds: Integer?, + ended_at: Time?, + end_reason: String?, + metadata: ::Hash[Symbol, String], + transcript: ::Array[Zavudev::Models::CallListResponse::Transcript], + turn_count: Integer?, + updated_at: Time + } + + type direction = :inbound | :outbound + + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND: :inbound + OUTBOUND: :outbound + + def self?.values: -> ::Array[Zavudev::Models::CallListResponse::direction] + end + + type status = + :queued + | :ringing + | :in_progress + | :completed + | :failed + | :busy + | :no_answer + | :canceled + + module Status + extend Zavudev::Internal::Type::Enum + + QUEUED: :queued + RINGING: :ringing + IN_PROGRESS: :in_progress + COMPLETED: :completed + FAILED: :failed + BUSY: :busy + NO_ANSWER: :no_answer + CANCELED: :canceled + + def self?.values: -> ::Array[Zavudev::Models::CallListResponse::status] + end + + type transcript = + { + role: Zavudev::Models::CallListResponse::Transcript::role, + seq: Integer, + text: String, + ended_at: Time?, + started_at: Time? + } + + class Transcript < Zavudev::Internal::Type::BaseModel + attr_accessor role: Zavudev::Models::CallListResponse::Transcript::role + + attr_accessor seq: Integer + + attr_accessor text: String + + attr_accessor ended_at: Time? + + attr_accessor started_at: Time? + + def initialize: ( + role: Zavudev::Models::CallListResponse::Transcript::role, + seq: Integer, + text: String, + ?ended_at: Time?, + ?started_at: Time? + ) -> void + + def to_hash: -> { + role: Zavudev::Models::CallListResponse::Transcript::role, + seq: Integer, + text: String, + ended_at: Time?, + started_at: Time? + } + + type role = :user | :assistant | :tool + + module Role + extend Zavudev::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + TOOL: :tool + + def self?.values: -> ::Array[Zavudev::Models::CallListResponse::Transcript::role] + end + end + end + end +end diff --git a/sig/zavudev/models/call_retrieve_params.rbs b/sig/zavudev/models/call_retrieve_params.rbs new file mode 100644 index 0000000..21b1d5f --- /dev/null +++ b/sig/zavudev/models/call_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type call_retrieve_params = + { call_id: String } & Zavudev::Internal::Type::request_parameters + + class CallRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor call_id: String + + def initialize: ( + call_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + call_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/call_retrieve_response.rbs b/sig/zavudev/models/call_retrieve_response.rbs new file mode 100644 index 0000000..010596e --- /dev/null +++ b/sig/zavudev/models/call_retrieve_response.rbs @@ -0,0 +1,196 @@ +module Zavudev + module Models + type call_retrieve_response = + { call: Zavudev::Models::CallRetrieveResponse::Call } + + class CallRetrieveResponse < Zavudev::Internal::Type::BaseModel + attr_accessor call: Zavudev::Models::CallRetrieveResponse::Call + + def initialize: ( + call: Zavudev::Models::CallRetrieveResponse::Call + ) -> void + + def to_hash: -> { call: Zavudev::Models::CallRetrieveResponse::Call } + + type call = + { + id: String, + created_at: Time, + direction: Zavudev::Models::CallRetrieveResponse::Call::direction, + from: String, + status: Zavudev::Models::CallRetrieveResponse::Call::status, + to: String, + answered_at: Time?, + cost: Float?, + duration_seconds: Integer?, + ended_at: Time?, + end_reason: String?, + metadata: ::Hash[Symbol, String], + transcript: ::Array[Zavudev::Models::CallRetrieveResponse::Call::Transcript], + turn_count: Integer?, + updated_at: Time + } + + class Call < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor direction: Zavudev::Models::CallRetrieveResponse::Call::direction + + attr_accessor from: String + + attr_accessor status: Zavudev::Models::CallRetrieveResponse::Call::status + + attr_accessor to: String + + attr_accessor answered_at: Time? + + attr_accessor cost: Float? + + attr_accessor duration_seconds: Integer? + + attr_accessor ended_at: Time? + + attr_accessor end_reason: String? + + attr_reader metadata: ::Hash[Symbol, String]? + + def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] + + attr_reader transcript: ::Array[Zavudev::Models::CallRetrieveResponse::Call::Transcript]? + + def transcript=: ( + ::Array[Zavudev::Models::CallRetrieveResponse::Call::Transcript] + ) -> ::Array[Zavudev::Models::CallRetrieveResponse::Call::Transcript] + + attr_accessor turn_count: Integer? + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + created_at: Time, + direction: Zavudev::Models::CallRetrieveResponse::Call::direction, + from: String, + status: Zavudev::Models::CallRetrieveResponse::Call::status, + to: String, + ?answered_at: Time?, + ?cost: Float?, + ?duration_seconds: Integer?, + ?ended_at: Time?, + ?end_reason: String?, + ?metadata: ::Hash[Symbol, String], + ?transcript: ::Array[Zavudev::Models::CallRetrieveResponse::Call::Transcript], + ?turn_count: Integer?, + ?updated_at: Time + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + direction: Zavudev::Models::CallRetrieveResponse::Call::direction, + from: String, + status: Zavudev::Models::CallRetrieveResponse::Call::status, + to: String, + answered_at: Time?, + cost: Float?, + duration_seconds: Integer?, + ended_at: Time?, + end_reason: String?, + metadata: ::Hash[Symbol, String], + transcript: ::Array[Zavudev::Models::CallRetrieveResponse::Call::Transcript], + turn_count: Integer?, + updated_at: Time + } + + type direction = :inbound | :outbound + + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND: :inbound + OUTBOUND: :outbound + + def self?.values: -> ::Array[Zavudev::Models::CallRetrieveResponse::Call::direction] + end + + type status = + :queued + | :ringing + | :in_progress + | :completed + | :failed + | :busy + | :no_answer + | :canceled + + module Status + extend Zavudev::Internal::Type::Enum + + QUEUED: :queued + RINGING: :ringing + IN_PROGRESS: :in_progress + COMPLETED: :completed + FAILED: :failed + BUSY: :busy + NO_ANSWER: :no_answer + CANCELED: :canceled + + def self?.values: -> ::Array[Zavudev::Models::CallRetrieveResponse::Call::status] + end + + type transcript = + { + role: Zavudev::Models::CallRetrieveResponse::Call::Transcript::role, + seq: Integer, + text: String, + ended_at: Time?, + started_at: Time? + } + + class Transcript < Zavudev::Internal::Type::BaseModel + attr_accessor role: Zavudev::Models::CallRetrieveResponse::Call::Transcript::role + + attr_accessor seq: Integer + + attr_accessor text: String + + attr_accessor ended_at: Time? + + attr_accessor started_at: Time? + + def initialize: ( + role: Zavudev::Models::CallRetrieveResponse::Call::Transcript::role, + seq: Integer, + text: String, + ?ended_at: Time?, + ?started_at: Time? + ) -> void + + def to_hash: -> { + role: Zavudev::Models::CallRetrieveResponse::Call::Transcript::role, + seq: Integer, + text: String, + ended_at: Time?, + started_at: Time? + } + + type role = :user | :assistant | :tool + + module Role + extend Zavudev::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + TOOL: :tool + + def self?.values: -> ::Array[Zavudev::Models::CallRetrieveResponse::Call::Transcript::role] + end + end + end + end + end +end diff --git a/sig/zavudev/models/conversation_list_messages_params.rbs b/sig/zavudev/models/conversation_list_messages_params.rbs new file mode 100644 index 0000000..e93ea64 --- /dev/null +++ b/sig/zavudev/models/conversation_list_messages_params.rbs @@ -0,0 +1,36 @@ +module Zavudev + module Models + type conversation_list_messages_params = + { conversation_id: String, cursor: String, limit: Integer } + & Zavudev::Internal::Type::request_parameters + + class ConversationListMessagesParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor conversation_id: String + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + def initialize: ( + conversation_id: String, + ?cursor: String, + ?limit: Integer, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + conversation_id: String, + cursor: String, + limit: Integer, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/conversation_list_params.rbs b/sig/zavudev/models/conversation_list_params.rbs new file mode 100644 index 0000000..7a460d9 --- /dev/null +++ b/sig/zavudev/models/conversation_list_params.rbs @@ -0,0 +1,83 @@ +module Zavudev + module Models + type conversation_list_params = + { + channel: Zavudev::Models::ConversationListParams::channel, + cursor: String, + limit: Integer, + search: String, + sender_id: String + } + & Zavudev::Internal::Type::request_parameters + + class ConversationListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_reader channel: Zavudev::Models::ConversationListParams::channel? + + def channel=: ( + Zavudev::Models::ConversationListParams::channel + ) -> Zavudev::Models::ConversationListParams::channel + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader search: String? + + def search=: (String) -> String + + attr_reader sender_id: String? + + def sender_id=: (String) -> String + + def initialize: ( + ?channel: Zavudev::Models::ConversationListParams::channel, + ?cursor: String, + ?limit: Integer, + ?search: String, + ?sender_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + channel: Zavudev::Models::ConversationListParams::channel, + cursor: String, + limit: Integer, + search: String, + sender_id: String, + request_options: Zavudev::RequestOptions + } + + type channel = + :sms + | :sms_oneway + | :whatsapp + | :email + | :telegram + | :instagram + | :messenger + | :voice + + module Channel + extend Zavudev::Internal::Type::Enum + + SMS: :sms + SMS_ONEWAY: :sms_oneway + WHATSAPP: :whatsapp + EMAIL: :email + TELEGRAM: :telegram + INSTAGRAM: :instagram + MESSENGER: :messenger + VOICE: :voice + + def self?.values: -> ::Array[Zavudev::Models::ConversationListParams::channel] + end + end + end +end diff --git a/sig/zavudev/models/conversation_list_response.rbs b/sig/zavudev/models/conversation_list_response.rbs new file mode 100644 index 0000000..9c9a1ab --- /dev/null +++ b/sig/zavudev/models/conversation_list_response.rbs @@ -0,0 +1,184 @@ +module Zavudev + module Models + type conversation_list_response = + { + id: String, + channels: ::Array[String], + contact_identifier: String, + created_at: Time, + last_message: Zavudev::Models::ConversationListResponse::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: Zavudev::Models::ConversationListResponse::Group, + sender_id: String, + whatsapp: Zavudev::Models::ConversationListResponse::Whatsapp + } + + class ConversationListResponse < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor channels: ::Array[String] + + attr_accessor contact_identifier: String + + attr_accessor created_at: Time + + attr_accessor last_message: Zavudev::Models::ConversationListResponse::LastMessage + + attr_accessor message_count: Integer + + attr_accessor unread_count: Integer + + attr_accessor updated_at: Time + + attr_reader contact_id: String? + + def contact_id=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader group: Zavudev::Models::ConversationListResponse::Group? + + def group=: ( + Zavudev::Models::ConversationListResponse::Group + ) -> Zavudev::Models::ConversationListResponse::Group + + attr_reader sender_id: String? + + def sender_id=: (String) -> String + + attr_reader whatsapp: Zavudev::Models::ConversationListResponse::Whatsapp? + + def whatsapp=: ( + Zavudev::Models::ConversationListResponse::Whatsapp + ) -> Zavudev::Models::ConversationListResponse::Whatsapp + + def initialize: ( + id: String, + channels: ::Array[String], + contact_identifier: String, + created_at: Time, + last_message: Zavudev::Models::ConversationListResponse::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + ?contact_id: String, + ?email: String, + ?group: Zavudev::Models::ConversationListResponse::Group, + ?sender_id: String, + ?whatsapp: Zavudev::Models::ConversationListResponse::Whatsapp + ) -> void + + def to_hash: -> { + id: String, + channels: ::Array[String], + contact_identifier: String, + created_at: Time, + last_message: Zavudev::Models::ConversationListResponse::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: Zavudev::Models::ConversationListResponse::Group, + sender_id: String, + whatsapp: Zavudev::Models::ConversationListResponse::Whatsapp + } + + type last_message = + { + id: String, + at: Time, + channel: Zavudev::Models::channel, + direction: Zavudev::Models::ConversationListResponse::LastMessage::direction, + text: String + } + + class LastMessage < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor at: Time + + attr_accessor channel: Zavudev::Models::channel + + attr_accessor direction: Zavudev::Models::ConversationListResponse::LastMessage::direction + + attr_accessor text: String + + def initialize: ( + id: String, + at: Time, + channel: Zavudev::Models::channel, + direction: Zavudev::Models::ConversationListResponse::LastMessage::direction, + text: String + ) -> void + + def to_hash: -> { + id: String, + at: Time, + channel: Zavudev::Models::channel, + direction: Zavudev::Models::ConversationListResponse::LastMessage::direction, + text: String + } + + type direction = :inbound | :outbound + + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND: :inbound + OUTBOUND: :outbound + + def self?.values: -> ::Array[Zavudev::Models::ConversationListResponse::LastMessage::direction] + end + end + + type group = { id: String, participant_count: Integer, subject: String } + + class Group < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_reader participant_count: Integer? + + def participant_count=: (Integer) -> Integer + + attr_reader subject: String? + + def subject=: (String) -> String + + def initialize: ( + id: String, + ?participant_count: Integer, + ?subject: String + ) -> void + + def to_hash: -> { + id: String, + participant_count: Integer, + subject: String + } + end + + type whatsapp = { bsuid: String, username: String } + + class Whatsapp < Zavudev::Internal::Type::BaseModel + attr_reader bsuid: String? + + def bsuid=: (String) -> String + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: (?bsuid: String, ?username: String) -> void + + def to_hash: -> { bsuid: String, username: String } + end + end + end +end diff --git a/sig/zavudev/models/conversation_mark_as_read_params.rbs b/sig/zavudev/models/conversation_mark_as_read_params.rbs new file mode 100644 index 0000000..696007c --- /dev/null +++ b/sig/zavudev/models/conversation_mark_as_read_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type conversation_mark_as_read_params = + { conversation_id: String } & Zavudev::Internal::Type::request_parameters + + class ConversationMarkAsReadParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor conversation_id: String + + def initialize: ( + conversation_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + conversation_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/conversation_mark_as_read_response.rbs b/sig/zavudev/models/conversation_mark_as_read_response.rbs new file mode 100644 index 0000000..1a02b51 --- /dev/null +++ b/sig/zavudev/models/conversation_mark_as_read_response.rbs @@ -0,0 +1,201 @@ +module Zavudev + module Models + type conversation_mark_as_read_response = + { + conversation: Zavudev::Models::ConversationMarkAsReadResponse::Conversation + } + + class ConversationMarkAsReadResponse < Zavudev::Internal::Type::BaseModel + attr_accessor conversation: Zavudev::Models::ConversationMarkAsReadResponse::Conversation + + def initialize: ( + conversation: Zavudev::Models::ConversationMarkAsReadResponse::Conversation + ) -> void + + def to_hash: -> { + conversation: Zavudev::Models::ConversationMarkAsReadResponse::Conversation + } + + type conversation = + { + id: String, + channels: ::Array[String], + contact_identifier: String, + created_at: Time, + last_message: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group, + sender_id: String, + whatsapp: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp + } + + class Conversation < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor channels: ::Array[String] + + attr_accessor contact_identifier: String + + attr_accessor created_at: Time + + attr_accessor last_message: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage + + attr_accessor message_count: Integer + + attr_accessor unread_count: Integer + + attr_accessor updated_at: Time + + attr_reader contact_id: String? + + def contact_id=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader group: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group? + + def group=: ( + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group + ) -> Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group + + attr_reader sender_id: String? + + def sender_id=: (String) -> String + + attr_reader whatsapp: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp? + + def whatsapp=: ( + Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp + ) -> Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp + + def initialize: ( + id: String, + channels: ::Array[String], + contact_identifier: String, + created_at: Time, + last_message: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + ?contact_id: String, + ?email: String, + ?group: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group, + ?sender_id: String, + ?whatsapp: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp + ) -> void + + def to_hash: -> { + id: String, + channels: ::Array[String], + contact_identifier: String, + created_at: Time, + last_message: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Group, + sender_id: String, + whatsapp: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::Whatsapp + } + + type last_message = + { + id: String, + at: Time, + channel: Zavudev::Models::channel, + direction: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::direction, + text: String + } + + class LastMessage < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor at: Time + + attr_accessor channel: Zavudev::Models::channel + + attr_accessor direction: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::direction + + attr_accessor text: String + + def initialize: ( + id: String, + at: Time, + channel: Zavudev::Models::channel, + direction: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::direction, + text: String + ) -> void + + def to_hash: -> { + id: String, + at: Time, + channel: Zavudev::Models::channel, + direction: Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::direction, + text: String + } + + type direction = :inbound | :outbound + + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND: :inbound + OUTBOUND: :outbound + + def self?.values: -> ::Array[Zavudev::Models::ConversationMarkAsReadResponse::Conversation::LastMessage::direction] + end + end + + type group = { id: String, participant_count: Integer, subject: String } + + class Group < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_reader participant_count: Integer? + + def participant_count=: (Integer) -> Integer + + attr_reader subject: String? + + def subject=: (String) -> String + + def initialize: ( + id: String, + ?participant_count: Integer, + ?subject: String + ) -> void + + def to_hash: -> { + id: String, + participant_count: Integer, + subject: String + } + end + + type whatsapp = { bsuid: String, username: String } + + class Whatsapp < Zavudev::Internal::Type::BaseModel + attr_reader bsuid: String? + + def bsuid=: (String) -> String + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: (?bsuid: String, ?username: String) -> void + + def to_hash: -> { bsuid: String, username: String } + end + end + end + end +end diff --git a/sig/zavudev/models/conversation_retrieve_params.rbs b/sig/zavudev/models/conversation_retrieve_params.rbs new file mode 100644 index 0000000..af9e74a --- /dev/null +++ b/sig/zavudev/models/conversation_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type conversation_retrieve_params = + { conversation_id: String } & Zavudev::Internal::Type::request_parameters + + class ConversationRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor conversation_id: String + + def initialize: ( + conversation_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + conversation_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/conversation_retrieve_response.rbs b/sig/zavudev/models/conversation_retrieve_response.rbs new file mode 100644 index 0000000..d551954 --- /dev/null +++ b/sig/zavudev/models/conversation_retrieve_response.rbs @@ -0,0 +1,201 @@ +module Zavudev + module Models + type conversation_retrieve_response = + { + conversation: Zavudev::Models::ConversationRetrieveResponse::Conversation + } + + class ConversationRetrieveResponse < Zavudev::Internal::Type::BaseModel + attr_accessor conversation: Zavudev::Models::ConversationRetrieveResponse::Conversation + + def initialize: ( + conversation: Zavudev::Models::ConversationRetrieveResponse::Conversation + ) -> void + + def to_hash: -> { + conversation: Zavudev::Models::ConversationRetrieveResponse::Conversation + } + + type conversation = + { + id: String, + channels: ::Array[String], + contact_identifier: String, + created_at: Time, + last_message: Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: Zavudev::Models::ConversationRetrieveResponse::Conversation::Group, + sender_id: String, + whatsapp: Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp + } + + class Conversation < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor channels: ::Array[String] + + attr_accessor contact_identifier: String + + attr_accessor created_at: Time + + attr_accessor last_message: Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage + + attr_accessor message_count: Integer + + attr_accessor unread_count: Integer + + attr_accessor updated_at: Time + + attr_reader contact_id: String? + + def contact_id=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader group: Zavudev::Models::ConversationRetrieveResponse::Conversation::Group? + + def group=: ( + Zavudev::Models::ConversationRetrieveResponse::Conversation::Group + ) -> Zavudev::Models::ConversationRetrieveResponse::Conversation::Group + + attr_reader sender_id: String? + + def sender_id=: (String) -> String + + attr_reader whatsapp: Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp? + + def whatsapp=: ( + Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp + ) -> Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp + + def initialize: ( + id: String, + channels: ::Array[String], + contact_identifier: String, + created_at: Time, + last_message: Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + ?contact_id: String, + ?email: String, + ?group: Zavudev::Models::ConversationRetrieveResponse::Conversation::Group, + ?sender_id: String, + ?whatsapp: Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp + ) -> void + + def to_hash: -> { + id: String, + channels: ::Array[String], + contact_identifier: String, + created_at: Time, + last_message: Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String, + email: String, + group: Zavudev::Models::ConversationRetrieveResponse::Conversation::Group, + sender_id: String, + whatsapp: Zavudev::Models::ConversationRetrieveResponse::Conversation::Whatsapp + } + + type last_message = + { + id: String, + at: Time, + channel: Zavudev::Models::channel, + direction: Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::direction, + text: String + } + + class LastMessage < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor at: Time + + attr_accessor channel: Zavudev::Models::channel + + attr_accessor direction: Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::direction + + attr_accessor text: String + + def initialize: ( + id: String, + at: Time, + channel: Zavudev::Models::channel, + direction: Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::direction, + text: String + ) -> void + + def to_hash: -> { + id: String, + at: Time, + channel: Zavudev::Models::channel, + direction: Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::direction, + text: String + } + + type direction = :inbound | :outbound + + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND: :inbound + OUTBOUND: :outbound + + def self?.values: -> ::Array[Zavudev::Models::ConversationRetrieveResponse::Conversation::LastMessage::direction] + end + end + + type group = { id: String, participant_count: Integer, subject: String } + + class Group < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_reader participant_count: Integer? + + def participant_count=: (Integer) -> Integer + + attr_reader subject: String? + + def subject=: (String) -> String + + def initialize: ( + id: String, + ?participant_count: Integer, + ?subject: String + ) -> void + + def to_hash: -> { + id: String, + participant_count: Integer, + subject: String + } + end + + type whatsapp = { bsuid: String, username: String } + + class Whatsapp < Zavudev::Internal::Type::BaseModel + attr_reader bsuid: String? + + def bsuid=: (String) -> String + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: (?bsuid: String, ?username: String) -> void + + def to_hash: -> { bsuid: String, username: String } + end + end + end + end +end diff --git a/sig/zavudev/models/email_domain_create_params.rbs b/sig/zavudev/models/email_domain_create_params.rbs new file mode 100644 index 0000000..15d0136 --- /dev/null +++ b/sig/zavudev/models/email_domain_create_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type email_domain_create_params = + { domain: String } & Zavudev::Internal::Type::request_parameters + + class EmailDomainCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor domain: String + + def initialize: ( + domain: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + domain: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/email_domain_create_response.rbs b/sig/zavudev/models/email_domain_create_response.rbs new file mode 100644 index 0000000..61397fa --- /dev/null +++ b/sig/zavudev/models/email_domain_create_response.rbs @@ -0,0 +1,116 @@ +module Zavudev + module Models + type email_domain_create_response = + { domain: Zavudev::Models::EmailDomainCreateResponse::Domain } + + class EmailDomainCreateResponse < Zavudev::Internal::Type::BaseModel + attr_accessor domain: Zavudev::Models::EmailDomainCreateResponse::Domain + + def initialize: ( + domain: Zavudev::Models::EmailDomainCreateResponse::Domain + ) -> void + + def to_hash: -> { + domain: Zavudev::Models::EmailDomainCreateResponse::Domain + } + + type domain = + { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: ::Array[Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord] + } + + class Domain < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor dkim_status: String + + attr_accessor domain: String + + attr_accessor status: String + + attr_reader dns_records: ::Array[Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord]? + + def dns_records=: ( + ::Array[Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord] + ) -> ::Array[Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord] + + def initialize: ( + id: String, + dkim_status: String, + domain: String, + status: String, + ?dns_records: ::Array[Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord] + ) -> void + + def to_hash: -> { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: ::Array[Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord] + } + + type dns_record = + { + name: String, + purpose: Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::purpose, + required: bool, + type: String, + value: String, + priority: Integer + } + + class DNSRecord < Zavudev::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor purpose: Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::purpose + + attr_accessor required: bool + + attr_accessor type: String + + attr_accessor value: String + + attr_reader priority: Integer? + + def priority=: (Integer) -> Integer + + def initialize: ( + name: String, + purpose: Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::purpose, + required: bool, + type: String, + value: String, + ?priority: Integer + ) -> void + + def to_hash: -> { + name: String, + purpose: Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::purpose, + required: bool, + type: String, + value: String, + priority: Integer + } + + type purpose = :dkim | :spf | :dmarc | :mail_from + + module Purpose + extend Zavudev::Internal::Type::Enum + + DKIM: :dkim + SPF: :spf + DMARC: :dmarc + MAIL_FROM: :mail_from + + def self?.values: -> ::Array[Zavudev::Models::EmailDomainCreateResponse::Domain::DNSRecord::purpose] + end + end + end + end + end +end diff --git a/sig/zavudev/models/email_domain_delete_params.rbs b/sig/zavudev/models/email_domain_delete_params.rbs new file mode 100644 index 0000000..c975cc0 --- /dev/null +++ b/sig/zavudev/models/email_domain_delete_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type email_domain_delete_params = + { domain_id: String } & Zavudev::Internal::Type::request_parameters + + class EmailDomainDeleteParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor domain_id: String + + def initialize: ( + domain_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + domain_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/email_domain_list_params.rbs b/sig/zavudev/models/email_domain_list_params.rbs new file mode 100644 index 0000000..debe16d --- /dev/null +++ b/sig/zavudev/models/email_domain_list_params.rbs @@ -0,0 +1,15 @@ +module Zavudev + module Models + type email_domain_list_params = + { } & Zavudev::Internal::Type::request_parameters + + class EmailDomainListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + def initialize: (?request_options: Zavudev::request_opts) -> void + + def to_hash: -> { request_options: Zavudev::RequestOptions } + end + end +end diff --git a/sig/zavudev/models/email_domain_list_response.rbs b/sig/zavudev/models/email_domain_list_response.rbs new file mode 100644 index 0000000..5a06c36 --- /dev/null +++ b/sig/zavudev/models/email_domain_list_response.rbs @@ -0,0 +1,116 @@ +module Zavudev + module Models + type email_domain_list_response = + { items: ::Array[Zavudev::Models::EmailDomainListResponse::Item] } + + class EmailDomainListResponse < Zavudev::Internal::Type::BaseModel + attr_accessor items: ::Array[Zavudev::Models::EmailDomainListResponse::Item] + + def initialize: ( + items: ::Array[Zavudev::Models::EmailDomainListResponse::Item] + ) -> void + + def to_hash: -> { + items: ::Array[Zavudev::Models::EmailDomainListResponse::Item] + } + + type item = + { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: ::Array[Zavudev::Models::EmailDomainListResponse::Item::DNSRecord] + } + + class Item < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor dkim_status: String + + attr_accessor domain: String + + attr_accessor status: String + + attr_reader dns_records: ::Array[Zavudev::Models::EmailDomainListResponse::Item::DNSRecord]? + + def dns_records=: ( + ::Array[Zavudev::Models::EmailDomainListResponse::Item::DNSRecord] + ) -> ::Array[Zavudev::Models::EmailDomainListResponse::Item::DNSRecord] + + def initialize: ( + id: String, + dkim_status: String, + domain: String, + status: String, + ?dns_records: ::Array[Zavudev::Models::EmailDomainListResponse::Item::DNSRecord] + ) -> void + + def to_hash: -> { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: ::Array[Zavudev::Models::EmailDomainListResponse::Item::DNSRecord] + } + + type dns_record = + { + name: String, + purpose: Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::purpose, + required: bool, + type: String, + value: String, + priority: Integer + } + + class DNSRecord < Zavudev::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor purpose: Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::purpose + + attr_accessor required: bool + + attr_accessor type: String + + attr_accessor value: String + + attr_reader priority: Integer? + + def priority=: (Integer) -> Integer + + def initialize: ( + name: String, + purpose: Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::purpose, + required: bool, + type: String, + value: String, + ?priority: Integer + ) -> void + + def to_hash: -> { + name: String, + purpose: Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::purpose, + required: bool, + type: String, + value: String, + priority: Integer + } + + type purpose = :dkim | :spf | :dmarc | :mail_from + + module Purpose + extend Zavudev::Internal::Type::Enum + + DKIM: :dkim + SPF: :spf + DMARC: :dmarc + MAIL_FROM: :mail_from + + def self?.values: -> ::Array[Zavudev::Models::EmailDomainListResponse::Item::DNSRecord::purpose] + end + end + end + end + end +end diff --git a/sig/zavudev/models/email_domain_retrieve_params.rbs b/sig/zavudev/models/email_domain_retrieve_params.rbs new file mode 100644 index 0000000..0bd3b80 --- /dev/null +++ b/sig/zavudev/models/email_domain_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type email_domain_retrieve_params = + { domain_id: String } & Zavudev::Internal::Type::request_parameters + + class EmailDomainRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor domain_id: String + + def initialize: ( + domain_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + domain_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/email_domain_retrieve_response.rbs b/sig/zavudev/models/email_domain_retrieve_response.rbs new file mode 100644 index 0000000..69005c0 --- /dev/null +++ b/sig/zavudev/models/email_domain_retrieve_response.rbs @@ -0,0 +1,116 @@ +module Zavudev + module Models + type email_domain_retrieve_response = + { domain: Zavudev::Models::EmailDomainRetrieveResponse::Domain } + + class EmailDomainRetrieveResponse < Zavudev::Internal::Type::BaseModel + attr_accessor domain: Zavudev::Models::EmailDomainRetrieveResponse::Domain + + def initialize: ( + domain: Zavudev::Models::EmailDomainRetrieveResponse::Domain + ) -> void + + def to_hash: -> { + domain: Zavudev::Models::EmailDomainRetrieveResponse::Domain + } + + type domain = + { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: ::Array[Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord] + } + + class Domain < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor dkim_status: String + + attr_accessor domain: String + + attr_accessor status: String + + attr_reader dns_records: ::Array[Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord]? + + def dns_records=: ( + ::Array[Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord] + ) -> ::Array[Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord] + + def initialize: ( + id: String, + dkim_status: String, + domain: String, + status: String, + ?dns_records: ::Array[Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord] + ) -> void + + def to_hash: -> { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: ::Array[Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord] + } + + type dns_record = + { + name: String, + purpose: Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::purpose, + required: bool, + type: String, + value: String, + priority: Integer + } + + class DNSRecord < Zavudev::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor purpose: Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::purpose + + attr_accessor required: bool + + attr_accessor type: String + + attr_accessor value: String + + attr_reader priority: Integer? + + def priority=: (Integer) -> Integer + + def initialize: ( + name: String, + purpose: Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::purpose, + required: bool, + type: String, + value: String, + ?priority: Integer + ) -> void + + def to_hash: -> { + name: String, + purpose: Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::purpose, + required: bool, + type: String, + value: String, + priority: Integer + } + + type purpose = :dkim | :spf | :dmarc | :mail_from + + module Purpose + extend Zavudev::Internal::Type::Enum + + DKIM: :dkim + SPF: :spf + DMARC: :dmarc + MAIL_FROM: :mail_from + + def self?.values: -> ::Array[Zavudev::Models::EmailDomainRetrieveResponse::Domain::DNSRecord::purpose] + end + end + end + end + end +end diff --git a/sig/zavudev/models/email_domain_verify_params.rbs b/sig/zavudev/models/email_domain_verify_params.rbs new file mode 100644 index 0000000..7f404b4 --- /dev/null +++ b/sig/zavudev/models/email_domain_verify_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type email_domain_verify_params = + { domain_id: String } & Zavudev::Internal::Type::request_parameters + + class EmailDomainVerifyParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor domain_id: String + + def initialize: ( + domain_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + domain_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/email_domain_verify_response.rbs b/sig/zavudev/models/email_domain_verify_response.rbs new file mode 100644 index 0000000..58e1344 --- /dev/null +++ b/sig/zavudev/models/email_domain_verify_response.rbs @@ -0,0 +1,116 @@ +module Zavudev + module Models + type email_domain_verify_response = + { domain: Zavudev::Models::EmailDomainVerifyResponse::Domain } + + class EmailDomainVerifyResponse < Zavudev::Internal::Type::BaseModel + attr_accessor domain: Zavudev::Models::EmailDomainVerifyResponse::Domain + + def initialize: ( + domain: Zavudev::Models::EmailDomainVerifyResponse::Domain + ) -> void + + def to_hash: -> { + domain: Zavudev::Models::EmailDomainVerifyResponse::Domain + } + + type domain = + { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: ::Array[Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord] + } + + class Domain < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor dkim_status: String + + attr_accessor domain: String + + attr_accessor status: String + + attr_reader dns_records: ::Array[Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord]? + + def dns_records=: ( + ::Array[Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord] + ) -> ::Array[Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord] + + def initialize: ( + id: String, + dkim_status: String, + domain: String, + status: String, + ?dns_records: ::Array[Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord] + ) -> void + + def to_hash: -> { + id: String, + dkim_status: String, + domain: String, + status: String, + dns_records: ::Array[Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord] + } + + type dns_record = + { + name: String, + purpose: Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::purpose, + required: bool, + type: String, + value: String, + priority: Integer + } + + class DNSRecord < Zavudev::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor purpose: Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::purpose + + attr_accessor required: bool + + attr_accessor type: String + + attr_accessor value: String + + attr_reader priority: Integer? + + def priority=: (Integer) -> Integer + + def initialize: ( + name: String, + purpose: Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::purpose, + required: bool, + type: String, + value: String, + ?priority: Integer + ) -> void + + def to_hash: -> { + name: String, + purpose: Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::purpose, + required: bool, + type: String, + value: String, + priority: Integer + } + + type purpose = :dkim | :spf | :dmarc | :mail_from + + module Purpose + extend Zavudev::Internal::Type::Enum + + DKIM: :dkim + SPF: :spf + DMARC: :dmarc + MAIL_FROM: :mail_from + + def self?.values: -> ::Array[Zavudev::Models::EmailDomainVerifyResponse::Domain::DNSRecord::purpose] + end + end + end + end + end +end diff --git a/sig/zavudev/models/function_list_deployments_params.rbs b/sig/zavudev/models/function_list_deployments_params.rbs new file mode 100644 index 0000000..43f184c --- /dev/null +++ b/sig/zavudev/models/function_list_deployments_params.rbs @@ -0,0 +1,30 @@ +module Zavudev + module Models + type function_list_deployments_params = + { function_id: String, limit: Integer } + & Zavudev::Internal::Type::request_parameters + + class FunctionListDeploymentsParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor function_id: String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + def initialize: ( + function_id: String, + ?limit: Integer, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + function_id: String, + limit: Integer, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/function_list_deployments_response.rbs b/sig/zavudev/models/function_list_deployments_response.rbs new file mode 100644 index 0000000..7a5e899 --- /dev/null +++ b/sig/zavudev/models/function_list_deployments_response.rbs @@ -0,0 +1,107 @@ +module Zavudev + module Models + type function_list_deployments_response = + { + deployments: ::Array[Zavudev::Models::FunctionListDeploymentsResponse::Deployment] + } + + class FunctionListDeploymentsResponse < Zavudev::Internal::Type::BaseModel + attr_accessor deployments: ::Array[Zavudev::Models::FunctionListDeploymentsResponse::Deployment] + + def initialize: ( + deployments: ::Array[Zavudev::Models::FunctionListDeploymentsResponse::Deployment] + ) -> void + + def to_hash: -> { + deployments: ::Array[Zavudev::Models::FunctionListDeploymentsResponse::Deployment] + } + + type deployment = + { + id: String, + bundle_size_bytes: Integer?, + created_at: Time, + deployed_at: Time?, + error_message: String?, + is_active: bool, + status: Zavudev::Models::FunctionListDeploymentsResponse::Deployment::status, + version: Integer + } + + class Deployment < Zavudev::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor bundle_size_bytes: Integer? + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_accessor deployed_at: Time? + + attr_accessor error_message: String? + + attr_reader is_active: bool? + + def is_active=: (bool) -> bool + + attr_reader status: Zavudev::Models::FunctionListDeploymentsResponse::Deployment::status? + + def status=: ( + Zavudev::Models::FunctionListDeploymentsResponse::Deployment::status + ) -> Zavudev::Models::FunctionListDeploymentsResponse::Deployment::status + + attr_reader version: Integer? + + def version=: (Integer) -> Integer + + def initialize: ( + ?id: String, + ?bundle_size_bytes: Integer?, + ?created_at: Time, + ?deployed_at: Time?, + ?error_message: String?, + ?is_active: bool, + ?status: Zavudev::Models::FunctionListDeploymentsResponse::Deployment::status, + ?version: Integer + ) -> void + + def to_hash: -> { + id: String, + bundle_size_bytes: Integer?, + created_at: Time, + deployed_at: Time?, + error_message: String?, + is_active: bool, + status: Zavudev::Models::FunctionListDeploymentsResponse::Deployment::status, + version: Integer + } + + type status = + :pending + | :bundling + | :uploading + | :publishing + | :active + | :failed + | :superseded + + module Status + extend Zavudev::Internal::Type::Enum + + PENDING: :pending + BUNDLING: :bundling + UPLOADING: :uploading + PUBLISHING: :publishing + ACTIVE: :active + FAILED: :failed + SUPERSEDED: :superseded + + def self?.values: -> ::Array[Zavudev::Models::FunctionListDeploymentsResponse::Deployment::status] + end + end + end + end +end diff --git a/sig/zavudev/models/function_list_event_types_params.rbs b/sig/zavudev/models/function_list_event_types_params.rbs new file mode 100644 index 0000000..cb0a15a --- /dev/null +++ b/sig/zavudev/models/function_list_event_types_params.rbs @@ -0,0 +1,15 @@ +module Zavudev + module Models + type function_list_event_types_params = + { } & Zavudev::Internal::Type::request_parameters + + class FunctionListEventTypesParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + def initialize: (?request_options: Zavudev::request_opts) -> void + + def to_hash: -> { request_options: Zavudev::RequestOptions } + end + end +end diff --git a/sig/zavudev/models/function_list_event_types_response.rbs b/sig/zavudev/models/function_list_event_types_response.rbs new file mode 100644 index 0000000..faf2420 --- /dev/null +++ b/sig/zavudev/models/function_list_event_types_response.rbs @@ -0,0 +1,13 @@ +module Zavudev + module Models + type function_list_event_types_response = { events: ::Array[String] } + + class FunctionListEventTypesResponse < Zavudev::Internal::Type::BaseModel + attr_accessor events: ::Array[String] + + def initialize: (events: ::Array[String]) -> void + + def to_hash: -> { events: ::Array[String] } + end + end +end diff --git a/sig/zavudev/models/function_rollback_deployment_params.rbs b/sig/zavudev/models/function_rollback_deployment_params.rbs new file mode 100644 index 0000000..f7a12f0 --- /dev/null +++ b/sig/zavudev/models/function_rollback_deployment_params.rbs @@ -0,0 +1,28 @@ +module Zavudev + module Models + type function_rollback_deployment_params = + { function_id: String, deployment_id: String } + & Zavudev::Internal::Type::request_parameters + + class FunctionRollbackDeploymentParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor function_id: String + + attr_accessor deployment_id: String + + def initialize: ( + function_id: String, + deployment_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + function_id: String, + deployment_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/function_rollback_deployment_response.rbs b/sig/zavudev/models/function_rollback_deployment_response.rbs new file mode 100644 index 0000000..62373a4 --- /dev/null +++ b/sig/zavudev/models/function_rollback_deployment_response.rbs @@ -0,0 +1,117 @@ +module Zavudev + module Models + type function_rollback_deployment_response = + { + deployment: Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment, + previous_draft: top?, + rolled_back_to_version: Integer + } + + class FunctionRollbackDeploymentResponse < Zavudev::Internal::Type::BaseModel + attr_accessor deployment: Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment + + attr_accessor previous_draft: top? + + attr_reader rolled_back_to_version: Integer? + + def rolled_back_to_version=: (Integer) -> Integer + + def initialize: ( + deployment: Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment, + ?previous_draft: top?, + ?rolled_back_to_version: Integer + ) -> void + + def to_hash: -> { + deployment: Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment, + previous_draft: top?, + rolled_back_to_version: Integer + } + + type deployment = + { + id: String, + created_at: Time, + function_id: String, + status: Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::status, + version: Integer, + build_logs: String?, + bundle_bytes: Integer?, + deployed_at: Time?, + error_message: String?, + source_code_bytes: Integer? + } + + class Deployment < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor function_id: String + + attr_accessor status: Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::status + + attr_accessor version: Integer + + attr_accessor build_logs: String? + + attr_accessor bundle_bytes: Integer? + + attr_accessor deployed_at: Time? + + attr_accessor error_message: String? + + attr_accessor source_code_bytes: Integer? + + def initialize: ( + id: String, + created_at: Time, + function_id: String, + status: Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::status, + version: Integer, + ?build_logs: String?, + ?bundle_bytes: Integer?, + ?deployed_at: Time?, + ?error_message: String?, + ?source_code_bytes: Integer? + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + function_id: String, + status: Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::status, + version: Integer, + build_logs: String?, + bundle_bytes: Integer?, + deployed_at: Time?, + error_message: String?, + source_code_bytes: Integer? + } + + type status = + :pending + | :bundling + | :uploading + | :publishing + | :active + | :failed + | :superseded + + module Status + extend Zavudev::Internal::Type::Enum + + PENDING: :pending + BUNDLING: :bundling + UPLOADING: :uploading + PUBLISHING: :publishing + ACTIVE: :active + FAILED: :failed + SUPERSEDED: :superseded + + def self?.values: -> ::Array[Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment::status] + end + end + end + end +end diff --git a/sig/zavudev/models/functions/git_link_deploy_now_params.rbs b/sig/zavudev/models/functions/git_link_deploy_now_params.rbs new file mode 100644 index 0000000..e979fae --- /dev/null +++ b/sig/zavudev/models/functions/git_link_deploy_now_params.rbs @@ -0,0 +1,25 @@ +module Zavudev + module Models + module Functions + type git_link_deploy_now_params = + { function_id: String } & Zavudev::Internal::Type::request_parameters + + class GitLinkDeployNowParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor function_id: String + + def initialize: ( + function_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + function_id: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/functions/git_link_deploy_now_response.rbs b/sig/zavudev/models/functions/git_link_deploy_now_response.rbs new file mode 100644 index 0000000..ea4a391 --- /dev/null +++ b/sig/zavudev/models/functions/git_link_deploy_now_response.rbs @@ -0,0 +1,15 @@ +module Zavudev + module Models + module Functions + type git_link_deploy_now_response = { scheduled: bool } + + class GitLinkDeployNowResponse < Zavudev::Internal::Type::BaseModel + attr_accessor scheduled: bool + + def initialize: (scheduled: bool) -> void + + def to_hash: -> { scheduled: bool } + end + end + end +end diff --git a/sig/zavudev/models/functions/git_link_link_params.rbs b/sig/zavudev/models/functions/git_link_link_params.rbs new file mode 100644 index 0000000..15a147f --- /dev/null +++ b/sig/zavudev/models/functions/git_link_link_params.rbs @@ -0,0 +1,59 @@ +module Zavudev + module Models + module Functions + type git_link_link_params = + { + function_id: String, + owner: String, + repo: String, + auto_deploy: bool, + branch: String, + root_dir: String + } + & Zavudev::Internal::Type::request_parameters + + class GitLinkLinkParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor function_id: String + + attr_accessor owner: String + + attr_accessor repo: String + + attr_reader auto_deploy: bool? + + def auto_deploy=: (bool) -> bool + + attr_reader branch: String? + + def branch=: (String) -> String + + attr_reader root_dir: String? + + def root_dir=: (String) -> String + + def initialize: ( + function_id: String, + owner: String, + repo: String, + ?auto_deploy: bool, + ?branch: String, + ?root_dir: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + function_id: String, + owner: String, + repo: String, + auto_deploy: bool, + branch: String, + root_dir: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/functions/git_link_link_response.rbs b/sig/zavudev/models/functions/git_link_link_response.rbs new file mode 100644 index 0000000..c43db35 --- /dev/null +++ b/sig/zavudev/models/functions/git_link_link_response.rbs @@ -0,0 +1,159 @@ +module Zavudev + module Models + module Functions + type git_link_link_response = + { + link: Zavudev::Models::Functions::GitLinkLinkResponse::Link, + webhook_url: String, + webhook_secret: String + } + + class GitLinkLinkResponse < Zavudev::Internal::Type::BaseModel + attr_accessor link: Zavudev::Models::Functions::GitLinkLinkResponse::Link + + attr_accessor webhook_url: String + + attr_reader webhook_secret: String? + + def webhook_secret=: (String) -> String + + def initialize: ( + link: Zavudev::Models::Functions::GitLinkLinkResponse::Link, + webhook_url: String, + ?webhook_secret: String + ) -> void + + def to_hash: -> { + link: Zavudev::Models::Functions::GitLinkLinkResponse::Link, + webhook_url: String, + webhook_secret: String + } + + type link = + { + id: String, + auto_deploy: bool, + branch: String, + connection: Zavudev::Models::Functions::GitLinkLinkResponse::Link::connection, + created_at: Time, + function_id: String, + owner: String, + provider: Zavudev::Models::Functions::GitLinkLinkResponse::Link::provider, + repo: String, + updated_at: Time, + last_commit_message: String?, + last_commit_sha: String?, + last_deploy_at: Time?, + last_error: String?, + last_status: Zavudev::Models::Functions::GitLinkLinkResponse::Link::last_status?, + root_dir: String? + } + + class Link < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor auto_deploy: bool + + attr_accessor branch: String + + attr_accessor connection: Zavudev::Models::Functions::GitLinkLinkResponse::Link::connection + + attr_accessor created_at: Time + + attr_accessor function_id: String + + attr_accessor owner: String + + attr_accessor provider: Zavudev::Models::Functions::GitLinkLinkResponse::Link::provider + + attr_accessor repo: String + + attr_accessor updated_at: Time + + attr_accessor last_commit_message: String? + + attr_accessor last_commit_sha: String? + + attr_accessor last_deploy_at: Time? + + attr_accessor last_error: String? + + attr_accessor last_status: Zavudev::Models::Functions::GitLinkLinkResponse::Link::last_status? + + attr_accessor root_dir: String? + + def initialize: ( + id: String, + auto_deploy: bool, + branch: String, + connection: Zavudev::Models::Functions::GitLinkLinkResponse::Link::connection, + created_at: Time, + function_id: String, + owner: String, + provider: Zavudev::Models::Functions::GitLinkLinkResponse::Link::provider, + repo: String, + updated_at: Time, + ?last_commit_message: String?, + ?last_commit_sha: String?, + ?last_deploy_at: Time?, + ?last_error: String?, + ?last_status: Zavudev::Models::Functions::GitLinkLinkResponse::Link::last_status?, + ?root_dir: String? + ) -> void + + def to_hash: -> { + id: String, + auto_deploy: bool, + branch: String, + connection: Zavudev::Models::Functions::GitLinkLinkResponse::Link::connection, + created_at: Time, + function_id: String, + owner: String, + provider: Zavudev::Models::Functions::GitLinkLinkResponse::Link::provider, + repo: String, + updated_at: Time, + last_commit_message: String?, + last_commit_sha: String?, + last_deploy_at: Time?, + last_error: String?, + last_status: Zavudev::Models::Functions::GitLinkLinkResponse::Link::last_status?, + root_dir: String? + } + + type connection = :app | :manual + + module Connection + extend Zavudev::Internal::Type::Enum + + APP: :app + MANUAL: :manual + + def self?.values: -> ::Array[Zavudev::Models::Functions::GitLinkLinkResponse::Link::connection] + end + + type provider = :github + + module Provider + extend Zavudev::Internal::Type::Enum + + GITHUB: :github + + def self?.values: -> ::Array[Zavudev::Models::Functions::GitLinkLinkResponse::Link::provider] + end + + type last_status = :deploying | :deployed | :failed + + module LastStatus + extend Zavudev::Internal::Type::Enum + + DEPLOYING: :deploying + DEPLOYED: :deployed + FAILED: :failed + + def self?.values: -> ::Array[Zavudev::Models::Functions::GitLinkLinkResponse::Link::last_status] + end + end + end + end + end +end diff --git a/sig/zavudev/models/functions/git_link_retrieve_params.rbs b/sig/zavudev/models/functions/git_link_retrieve_params.rbs new file mode 100644 index 0000000..7544a6f --- /dev/null +++ b/sig/zavudev/models/functions/git_link_retrieve_params.rbs @@ -0,0 +1,25 @@ +module Zavudev + module Models + module Functions + type git_link_retrieve_params = + { function_id: String } & Zavudev::Internal::Type::request_parameters + + class GitLinkRetrieveParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor function_id: String + + def initialize: ( + function_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + function_id: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/functions/git_link_retrieve_response.rbs b/sig/zavudev/models/functions/git_link_retrieve_response.rbs new file mode 100644 index 0000000..fc13b16 --- /dev/null +++ b/sig/zavudev/models/functions/git_link_retrieve_response.rbs @@ -0,0 +1,159 @@ +module Zavudev + module Models + module Functions + type git_link_retrieve_response = + { + link: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link, + webhook_url: String, + webhook_secret: String + } + + class GitLinkRetrieveResponse < Zavudev::Internal::Type::BaseModel + attr_accessor link: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link + + attr_accessor webhook_url: String + + attr_reader webhook_secret: String? + + def webhook_secret=: (String) -> String + + def initialize: ( + link: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link, + webhook_url: String, + ?webhook_secret: String + ) -> void + + def to_hash: -> { + link: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link, + webhook_url: String, + webhook_secret: String + } + + type link = + { + id: String, + auto_deploy: bool, + branch: String, + connection: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::connection, + created_at: Time, + function_id: String, + owner: String, + provider: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::provider, + repo: String, + updated_at: Time, + last_commit_message: String?, + last_commit_sha: String?, + last_deploy_at: Time?, + last_error: String?, + last_status: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::last_status?, + root_dir: String? + } + + class Link < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor auto_deploy: bool + + attr_accessor branch: String + + attr_accessor connection: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::connection + + attr_accessor created_at: Time + + attr_accessor function_id: String + + attr_accessor owner: String + + attr_accessor provider: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::provider + + attr_accessor repo: String + + attr_accessor updated_at: Time + + attr_accessor last_commit_message: String? + + attr_accessor last_commit_sha: String? + + attr_accessor last_deploy_at: Time? + + attr_accessor last_error: String? + + attr_accessor last_status: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::last_status? + + attr_accessor root_dir: String? + + def initialize: ( + id: String, + auto_deploy: bool, + branch: String, + connection: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::connection, + created_at: Time, + function_id: String, + owner: String, + provider: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::provider, + repo: String, + updated_at: Time, + ?last_commit_message: String?, + ?last_commit_sha: String?, + ?last_deploy_at: Time?, + ?last_error: String?, + ?last_status: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::last_status?, + ?root_dir: String? + ) -> void + + def to_hash: -> { + id: String, + auto_deploy: bool, + branch: String, + connection: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::connection, + created_at: Time, + function_id: String, + owner: String, + provider: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::provider, + repo: String, + updated_at: Time, + last_commit_message: String?, + last_commit_sha: String?, + last_deploy_at: Time?, + last_error: String?, + last_status: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::last_status?, + root_dir: String? + } + + type connection = :app | :manual + + module Connection + extend Zavudev::Internal::Type::Enum + + APP: :app + MANUAL: :manual + + def self?.values: -> ::Array[Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::connection] + end + + type provider = :github + + module Provider + extend Zavudev::Internal::Type::Enum + + GITHUB: :github + + def self?.values: -> ::Array[Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::provider] + end + + type last_status = :deploying | :deployed | :failed + + module LastStatus + extend Zavudev::Internal::Type::Enum + + DEPLOYING: :deploying + DEPLOYED: :deployed + FAILED: :failed + + def self?.values: -> ::Array[Zavudev::Models::Functions::GitLinkRetrieveResponse::Link::last_status] + end + end + end + end + end +end diff --git a/sig/zavudev/models/functions/git_link_unlink_params.rbs b/sig/zavudev/models/functions/git_link_unlink_params.rbs new file mode 100644 index 0000000..5f38346 --- /dev/null +++ b/sig/zavudev/models/functions/git_link_unlink_params.rbs @@ -0,0 +1,25 @@ +module Zavudev + module Models + module Functions + type git_link_unlink_params = + { function_id: String } & Zavudev::Internal::Type::request_parameters + + class GitLinkUnlinkParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor function_id: String + + def initialize: ( + function_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + function_id: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/functions/git_link_update_params.rbs b/sig/zavudev/models/functions/git_link_update_params.rbs new file mode 100644 index 0000000..55ca9bd --- /dev/null +++ b/sig/zavudev/models/functions/git_link_update_params.rbs @@ -0,0 +1,47 @@ +module Zavudev + module Models + module Functions + type git_link_update_params = + { + function_id: String, + auto_deploy: bool, + branch: String, + root_dir: String? + } + & Zavudev::Internal::Type::request_parameters + + class GitLinkUpdateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor function_id: String + + attr_reader auto_deploy: bool? + + def auto_deploy=: (bool) -> bool + + attr_reader branch: String? + + def branch=: (String) -> String + + attr_accessor root_dir: String? + + def initialize: ( + function_id: String, + ?auto_deploy: bool, + ?branch: String, + ?root_dir: String?, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + function_id: String, + auto_deploy: bool, + branch: String, + root_dir: String?, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/functions/git_link_update_response.rbs b/sig/zavudev/models/functions/git_link_update_response.rbs new file mode 100644 index 0000000..47496ad --- /dev/null +++ b/sig/zavudev/models/functions/git_link_update_response.rbs @@ -0,0 +1,159 @@ +module Zavudev + module Models + module Functions + type git_link_update_response = + { + link: Zavudev::Models::Functions::GitLinkUpdateResponse::Link, + webhook_url: String, + webhook_secret: String + } + + class GitLinkUpdateResponse < Zavudev::Internal::Type::BaseModel + attr_accessor link: Zavudev::Models::Functions::GitLinkUpdateResponse::Link + + attr_accessor webhook_url: String + + attr_reader webhook_secret: String? + + def webhook_secret=: (String) -> String + + def initialize: ( + link: Zavudev::Models::Functions::GitLinkUpdateResponse::Link, + webhook_url: String, + ?webhook_secret: String + ) -> void + + def to_hash: -> { + link: Zavudev::Models::Functions::GitLinkUpdateResponse::Link, + webhook_url: String, + webhook_secret: String + } + + type link = + { + id: String, + auto_deploy: bool, + branch: String, + connection: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::connection, + created_at: Time, + function_id: String, + owner: String, + provider: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::provider, + repo: String, + updated_at: Time, + last_commit_message: String?, + last_commit_sha: String?, + last_deploy_at: Time?, + last_error: String?, + last_status: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::last_status?, + root_dir: String? + } + + class Link < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor auto_deploy: bool + + attr_accessor branch: String + + attr_accessor connection: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::connection + + attr_accessor created_at: Time + + attr_accessor function_id: String + + attr_accessor owner: String + + attr_accessor provider: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::provider + + attr_accessor repo: String + + attr_accessor updated_at: Time + + attr_accessor last_commit_message: String? + + attr_accessor last_commit_sha: String? + + attr_accessor last_deploy_at: Time? + + attr_accessor last_error: String? + + attr_accessor last_status: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::last_status? + + attr_accessor root_dir: String? + + def initialize: ( + id: String, + auto_deploy: bool, + branch: String, + connection: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::connection, + created_at: Time, + function_id: String, + owner: String, + provider: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::provider, + repo: String, + updated_at: Time, + ?last_commit_message: String?, + ?last_commit_sha: String?, + ?last_deploy_at: Time?, + ?last_error: String?, + ?last_status: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::last_status?, + ?root_dir: String? + ) -> void + + def to_hash: -> { + id: String, + auto_deploy: bool, + branch: String, + connection: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::connection, + created_at: Time, + function_id: String, + owner: String, + provider: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::provider, + repo: String, + updated_at: Time, + last_commit_message: String?, + last_commit_sha: String?, + last_deploy_at: Time?, + last_error: String?, + last_status: Zavudev::Models::Functions::GitLinkUpdateResponse::Link::last_status?, + root_dir: String? + } + + type connection = :app | :manual + + module Connection + extend Zavudev::Internal::Type::Enum + + APP: :app + MANUAL: :manual + + def self?.values: -> ::Array[Zavudev::Models::Functions::GitLinkUpdateResponse::Link::connection] + end + + type provider = :github + + module Provider + extend Zavudev::Internal::Type::Enum + + GITHUB: :github + + def self?.values: -> ::Array[Zavudev::Models::Functions::GitLinkUpdateResponse::Link::provider] + end + + type last_status = :deploying | :deployed | :failed + + module LastStatus + extend Zavudev::Internal::Type::Enum + + DEPLOYING: :deploying + DEPLOYED: :deployed + FAILED: :failed + + def self?.values: -> ::Array[Zavudev::Models::Functions::GitLinkUpdateResponse::Link::last_status] + end + end + end + end + end +end diff --git a/sig/zavudev/models/functions/trigger_create_params.rbs b/sig/zavudev/models/functions/trigger_create_params.rbs new file mode 100644 index 0000000..1baa722 --- /dev/null +++ b/sig/zavudev/models/functions/trigger_create_params.rbs @@ -0,0 +1,45 @@ +module Zavudev + module Models + module Functions + type trigger_create_params = + { + function_id: String, + event_types: ::Array[String], + sender_ids: ::Array[String?], + cron: String + } + & Zavudev::Internal::Type::request_parameters + + class TriggerCreateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor function_id: String + + attr_accessor event_types: ::Array[String] + + attr_accessor sender_ids: ::Array[String?] + + attr_reader cron: String? + + def cron=: (String) -> String + + def initialize: ( + function_id: String, + event_types: ::Array[String], + sender_ids: ::Array[String?], + ?cron: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + function_id: String, + event_types: ::Array[String], + sender_ids: ::Array[String?], + cron: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/functions/trigger_create_response.rbs b/sig/zavudev/models/functions/trigger_create_response.rbs new file mode 100644 index 0000000..5e88dc5 --- /dev/null +++ b/sig/zavudev/models/functions/trigger_create_response.rbs @@ -0,0 +1,94 @@ +module Zavudev + module Models + module Functions + type trigger_create_response = + { + added: Integer, + skipped: Integer, + triggers: ::Array[Zavudev::Models::Functions::TriggerCreateResponse::Trigger] + } + + class TriggerCreateResponse < Zavudev::Internal::Type::BaseModel + attr_accessor added: Integer + + attr_accessor skipped: Integer + + attr_accessor triggers: ::Array[Zavudev::Models::Functions::TriggerCreateResponse::Trigger] + + def initialize: ( + added: Integer, + skipped: Integer, + triggers: ::Array[Zavudev::Models::Functions::TriggerCreateResponse::Trigger] + ) -> void + + def to_hash: -> { + added: Integer, + skipped: Integer, + triggers: ::Array[Zavudev::Models::Functions::TriggerCreateResponse::Trigger] + } + + type trigger = + { + id: String, + active: bool, + created_at: Time, + event_type: String, + function_id: String, + updated_at: Time, + cron: String?, + last_run_at: Time?, + next_run_at: Time?, + sender_id: String? + } + + class Trigger < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor active: bool + + attr_accessor created_at: Time + + attr_accessor event_type: String + + attr_accessor function_id: String + + attr_accessor updated_at: Time + + attr_accessor cron: String? + + attr_accessor last_run_at: Time? + + attr_accessor next_run_at: Time? + + attr_accessor sender_id: String? + + def initialize: ( + id: String, + active: bool, + created_at: Time, + event_type: String, + function_id: String, + updated_at: Time, + ?cron: String?, + ?last_run_at: Time?, + ?next_run_at: Time?, + ?sender_id: String? + ) -> void + + def to_hash: -> { + id: String, + active: bool, + created_at: Time, + event_type: String, + function_id: String, + updated_at: Time, + cron: String?, + last_run_at: Time?, + next_run_at: Time?, + sender_id: String? + } + end + end + end + end +end diff --git a/sig/zavudev/models/functions/trigger_delete_params.rbs b/sig/zavudev/models/functions/trigger_delete_params.rbs new file mode 100644 index 0000000..2ef5130 --- /dev/null +++ b/sig/zavudev/models/functions/trigger_delete_params.rbs @@ -0,0 +1,25 @@ +module Zavudev + module Models + module Functions + type trigger_delete_params = + { trigger_id: String } & Zavudev::Internal::Type::request_parameters + + class TriggerDeleteParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor trigger_id: String + + def initialize: ( + trigger_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + trigger_id: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/functions/trigger_list_params.rbs b/sig/zavudev/models/functions/trigger_list_params.rbs new file mode 100644 index 0000000..eb23c87 --- /dev/null +++ b/sig/zavudev/models/functions/trigger_list_params.rbs @@ -0,0 +1,25 @@ +module Zavudev + module Models + module Functions + type trigger_list_params = + { function_id: String } & Zavudev::Internal::Type::request_parameters + + class TriggerListParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor function_id: String + + def initialize: ( + function_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + function_id: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/functions/trigger_list_response.rbs b/sig/zavudev/models/functions/trigger_list_response.rbs new file mode 100644 index 0000000..77f9d4f --- /dev/null +++ b/sig/zavudev/models/functions/trigger_list_response.rbs @@ -0,0 +1,84 @@ +module Zavudev + module Models + module Functions + type trigger_list_response = + { + triggers: ::Array[Zavudev::Models::Functions::TriggerListResponse::Trigger] + } + + class TriggerListResponse < Zavudev::Internal::Type::BaseModel + attr_accessor triggers: ::Array[Zavudev::Models::Functions::TriggerListResponse::Trigger] + + def initialize: ( + triggers: ::Array[Zavudev::Models::Functions::TriggerListResponse::Trigger] + ) -> void + + def to_hash: -> { + triggers: ::Array[Zavudev::Models::Functions::TriggerListResponse::Trigger] + } + + type trigger = + { + id: String, + active: bool, + created_at: Time, + event_type: String, + function_id: String, + updated_at: Time, + cron: String?, + last_run_at: Time?, + next_run_at: Time?, + sender_id: String? + } + + class Trigger < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor active: bool + + attr_accessor created_at: Time + + attr_accessor event_type: String + + attr_accessor function_id: String + + attr_accessor updated_at: Time + + attr_accessor cron: String? + + attr_accessor last_run_at: Time? + + attr_accessor next_run_at: Time? + + attr_accessor sender_id: String? + + def initialize: ( + id: String, + active: bool, + created_at: Time, + event_type: String, + function_id: String, + updated_at: Time, + ?cron: String?, + ?last_run_at: Time?, + ?next_run_at: Time?, + ?sender_id: String? + ) -> void + + def to_hash: -> { + id: String, + active: bool, + created_at: Time, + event_type: String, + function_id: String, + updated_at: Time, + cron: String?, + last_run_at: Time?, + next_run_at: Time?, + sender_id: String? + } + end + end + end + end +end diff --git a/sig/zavudev/models/functions/trigger_update_params.rbs b/sig/zavudev/models/functions/trigger_update_params.rbs new file mode 100644 index 0000000..1c086d5 --- /dev/null +++ b/sig/zavudev/models/functions/trigger_update_params.rbs @@ -0,0 +1,30 @@ +module Zavudev + module Models + module Functions + type trigger_update_params = + { trigger_id: String, active: bool } + & Zavudev::Internal::Type::request_parameters + + class TriggerUpdateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor trigger_id: String + + attr_accessor active: bool + + def initialize: ( + trigger_id: String, + active: bool, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + trigger_id: String, + active: bool, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/functions/trigger_update_response.rbs b/sig/zavudev/models/functions/trigger_update_response.rbs new file mode 100644 index 0000000..8b65e6d --- /dev/null +++ b/sig/zavudev/models/functions/trigger_update_response.rbs @@ -0,0 +1,17 @@ +module Zavudev + module Models + module Functions + type trigger_update_response = { active: bool, ok: bool } + + class TriggerUpdateResponse < Zavudev::Internal::Type::BaseModel + attr_accessor active: bool + + attr_accessor ok: bool + + def initialize: (active: bool, ok: bool) -> void + + def to_hash: -> { active: bool, ok: bool } + end + end + end +end diff --git a/sig/zavudev/models/introspect_validate_email_params.rbs b/sig/zavudev/models/introspect_validate_email_params.rbs new file mode 100644 index 0000000..ac918c5 --- /dev/null +++ b/sig/zavudev/models/introspect_validate_email_params.rbs @@ -0,0 +1,32 @@ +module Zavudev + module Models + type introspect_validate_email_params = + { email: String, emails: ::Array[String] } + & Zavudev::Internal::Type::request_parameters + + class IntrospectValidateEmailParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader emails: ::Array[String]? + + def emails=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?email: String, + ?emails: ::Array[String], + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + email: String, + emails: ::Array[String], + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/introspect_validate_email_response.rbs b/sig/zavudev/models/introspect_validate_email_response.rbs new file mode 100644 index 0000000..bc1eb06 --- /dev/null +++ b/sig/zavudev/models/introspect_validate_email_response.rbs @@ -0,0 +1,135 @@ +module Zavudev + module Models + type introspect_validate_email_response = + { + results: ::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result], + summary: Zavudev::Models::IntrospectValidateEmailResponse::Summary + } + + class IntrospectValidateEmailResponse < Zavudev::Internal::Type::BaseModel + attr_accessor results: ::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result] + + attr_accessor summary: Zavudev::Models::IntrospectValidateEmailResponse::Summary + + def initialize: ( + results: ::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result], + summary: Zavudev::Models::IntrospectValidateEmailResponse::Summary + ) -> void + + def to_hash: -> { + results: ::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result], + summary: Zavudev::Models::IntrospectValidateEmailResponse::Summary + } + + type result = + { + domain: String?, + email: String, + normalized: String?, + reasons: ::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result::reason], + verdict: Zavudev::Models::IntrospectValidateEmailResponse::Result::verdict + } + + class Result < Zavudev::Internal::Type::BaseModel + attr_accessor domain: String? + + attr_accessor email: String + + attr_accessor normalized: String? + + attr_accessor reasons: ::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result::reason] + + attr_accessor verdict: Zavudev::Models::IntrospectValidateEmailResponse::Result::verdict + + def initialize: ( + domain: String?, + email: String, + normalized: String?, + reasons: ::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result::reason], + verdict: Zavudev::Models::IntrospectValidateEmailResponse::Result::verdict + ) -> void + + def to_hash: -> { + domain: String?, + email: String, + normalized: String?, + reasons: ::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result::reason], + verdict: Zavudev::Models::IntrospectValidateEmailResponse::Result::verdict + } + + type reason = + :invalid_syntax + | :domain_not_found + | :domain_no_mx + | :disposable_domain + | :role_address + | :suppressed_hard_bounce + | :suppressed_soft_bounce + | :suppressed_complaint + | :suppressed_manual + | :suppressed_unsubscribe + + module Reason + extend Zavudev::Internal::Type::Enum + + INVALID_SYNTAX: :invalid_syntax + DOMAIN_NOT_FOUND: :domain_not_found + DOMAIN_NO_MX: :domain_no_mx + DISPOSABLE_DOMAIN: :disposable_domain + ROLE_ADDRESS: :role_address + SUPPRESSED_HARD_BOUNCE: :suppressed_hard_bounce + SUPPRESSED_SOFT_BOUNCE: :suppressed_soft_bounce + SUPPRESSED_COMPLAINT: :suppressed_complaint + SUPPRESSED_MANUAL: :suppressed_manual + SUPPRESSED_UNSUBSCRIBE: :suppressed_unsubscribe + + def self?.values: -> ::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result::reason] + end + + type verdict = :deliverable | :risky | :undeliverable + + module Verdict + extend Zavudev::Internal::Type::Enum + + DELIVERABLE: :deliverable + RISKY: :risky + UNDELIVERABLE: :undeliverable + + def self?.values: -> ::Array[Zavudev::Models::IntrospectValidateEmailResponse::Result::verdict] + end + end + + type summary = + { + deliverable: Integer, + risky: Integer, + total: Integer, + undeliverable: Integer + } + + class Summary < Zavudev::Internal::Type::BaseModel + attr_accessor deliverable: Integer + + attr_accessor risky: Integer + + attr_accessor total: Integer + + attr_accessor undeliverable: Integer + + def initialize: ( + deliverable: Integer, + risky: Integer, + total: Integer, + undeliverable: Integer + ) -> void + + def to_hash: -> { + deliverable: Integer, + risky: Integer, + total: Integer, + undeliverable: Integer + } + end + end + end +end diff --git a/sig/zavudev/models/message_list_attachments_params.rbs b/sig/zavudev/models/message_list_attachments_params.rbs new file mode 100644 index 0000000..fe9ba08 --- /dev/null +++ b/sig/zavudev/models/message_list_attachments_params.rbs @@ -0,0 +1,23 @@ +module Zavudev + module Models + type message_list_attachments_params = + { message_id: String } & Zavudev::Internal::Type::request_parameters + + class MessageListAttachmentsParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor message_id: String + + def initialize: ( + message_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + message_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/message_list_attachments_response.rbs b/sig/zavudev/models/message_list_attachments_response.rbs new file mode 100644 index 0000000..33ad57f --- /dev/null +++ b/sig/zavudev/models/message_list_attachments_response.rbs @@ -0,0 +1,70 @@ +module Zavudev + module Models + type message_list_attachments_response = + { items: ::Array[Zavudev::Models::MessageListAttachmentsResponse::Item] } + + class MessageListAttachmentsResponse < Zavudev::Internal::Type::BaseModel + attr_accessor items: ::Array[Zavudev::Models::MessageListAttachmentsResponse::Item] + + def initialize: ( + items: ::Array[Zavudev::Models::MessageListAttachmentsResponse::Item] + ) -> void + + def to_hash: -> { + items: ::Array[Zavudev::Models::MessageListAttachmentsResponse::Item] + } + + type item = + { + id: String, + content_id: String?, + created_at: Time, + download_url: String?, + filename: String, + is_inline: bool, + mime_type: String, + size: Integer + } + + class Item < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor content_id: String? + + attr_accessor created_at: Time + + attr_accessor download_url: String? + + attr_accessor filename: String + + attr_accessor is_inline: bool + + attr_accessor mime_type: String + + attr_accessor size: Integer + + def initialize: ( + id: String, + content_id: String?, + created_at: Time, + download_url: String?, + filename: String, + is_inline: bool, + mime_type: String, + size: Integer + ) -> void + + def to_hash: -> { + id: String, + content_id: String?, + created_at: Time, + download_url: String?, + filename: String, + is_inline: bool, + mime_type: String, + size: Integer + } + end + end + end +end diff --git a/sig/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_params.rbs b/sig/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_params.rbs new file mode 100644 index 0000000..1406312 --- /dev/null +++ b/sig/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_params.rbs @@ -0,0 +1,38 @@ +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + type document_retrieve_document_params = + { sender_id: String, kb_id: String, doc_id: String } + & Zavudev::Internal::Type::request_parameters + + class DocumentRetrieveDocumentParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor sender_id: String + + attr_accessor kb_id: String + + attr_accessor doc_id: String + + def initialize: ( + sender_id: String, + kb_id: String, + doc_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + sender_id: String, + kb_id: String, + doc_id: String, + request_options: Zavudev::RequestOptions + } + end + end + end + end + end +end diff --git a/sig/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rbs b/sig/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rbs new file mode 100644 index 0000000..a807408 --- /dev/null +++ b/sig/zavudev/models/senders/agent/knowledge_bases/document_retrieve_document_response.rbs @@ -0,0 +1,22 @@ +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + type document_retrieve_document_response = + { document: Zavudev::Senders::Agent::AgentDocument } + + class DocumentRetrieveDocumentResponse < Zavudev::Internal::Type::BaseModel + attr_accessor document: Zavudev::Senders::Agent::AgentDocument + + def initialize: ( + document: Zavudev::Senders::Agent::AgentDocument + ) -> void + + def to_hash: -> { document: Zavudev::Senders::Agent::AgentDocument } + end + end + end + end + end +end diff --git a/sig/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rbs b/sig/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rbs new file mode 100644 index 0000000..a4b03fe --- /dev/null +++ b/sig/zavudev/models/senders/agent/knowledge_bases/document_update_document_params.rbs @@ -0,0 +1,56 @@ +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + type document_update_document_params = + { + sender_id: String, + kb_id: String, + doc_id: String, + content: String, + title: String + } + & Zavudev::Internal::Type::request_parameters + + class DocumentUpdateDocumentParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor sender_id: String + + attr_accessor kb_id: String + + attr_accessor doc_id: String + + attr_reader content: String? + + def content=: (String) -> String + + attr_reader title: String? + + def title=: (String) -> String + + def initialize: ( + sender_id: String, + kb_id: String, + doc_id: String, + ?content: String, + ?title: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + sender_id: String, + kb_id: String, + doc_id: String, + content: String, + title: String, + request_options: Zavudev::RequestOptions + } + end + end + end + end + end +end diff --git a/sig/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rbs b/sig/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rbs new file mode 100644 index 0000000..6652ad7 --- /dev/null +++ b/sig/zavudev/models/senders/agent/knowledge_bases/document_update_document_response.rbs @@ -0,0 +1,22 @@ +module Zavudev + module Models + module Senders + module Agent + module KnowledgeBases + type document_update_document_response = + { document: Zavudev::Senders::Agent::AgentDocument } + + class DocumentUpdateDocumentResponse < Zavudev::Internal::Type::BaseModel + attr_accessor document: Zavudev::Senders::Agent::AgentDocument + + def initialize: ( + document: Zavudev::Senders::Agent::AgentDocument + ) -> void + + def to_hash: -> { document: Zavudev::Senders::Agent::AgentDocument } + end + end + end + end + end +end diff --git a/sig/zavudev/models/senders/agent/tool_list_test_runs_params.rbs b/sig/zavudev/models/senders/agent/tool_list_test_runs_params.rbs new file mode 100644 index 0000000..c6bfe06 --- /dev/null +++ b/sig/zavudev/models/senders/agent/tool_list_test_runs_params.rbs @@ -0,0 +1,38 @@ +module Zavudev + module Models + module Senders + module Agent + type tool_list_test_runs_params = + { sender_id: String, tool_id: String, limit: Integer } + & Zavudev::Internal::Type::request_parameters + + class ToolListTestRunsParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor sender_id: String + + attr_accessor tool_id: String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + def initialize: ( + sender_id: String, + tool_id: String, + ?limit: Integer, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + sender_id: String, + tool_id: String, + limit: Integer, + request_options: Zavudev::RequestOptions + } + end + end + end + end +end diff --git a/sig/zavudev/models/senders/agent/tool_list_test_runs_response.rbs b/sig/zavudev/models/senders/agent/tool_list_test_runs_response.rbs new file mode 100644 index 0000000..4769e8b --- /dev/null +++ b/sig/zavudev/models/senders/agent/tool_list_test_runs_response.rbs @@ -0,0 +1,83 @@ +module Zavudev + module Models + module Senders + module Agent + type tool_list_test_runs_response = + { + items: ::Array[Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item] + } + + class ToolListTestRunsResponse < Zavudev::Internal::Type::BaseModel + attr_accessor items: ::Array[Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item] + + def initialize: ( + items: ::Array[Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item] + ) -> void + + def to_hash: -> { + items: ::Array[Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item] + } + + type item = + { + id: String, + created_at: Time, + duration_ms: Integer, + success: bool, + tool_id: String, + error: String?, + params: ::Hash[Symbol, top], + response: String?, + status_code: Integer? + } + + class Item < Zavudev::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor duration_ms: Integer + + attr_accessor success: bool + + attr_accessor tool_id: String + + attr_accessor error: String? + + attr_reader params: ::Hash[Symbol, top]? + + def params=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_accessor response: String? + + attr_accessor status_code: Integer? + + def initialize: ( + id: String, + created_at: Time, + duration_ms: Integer, + success: bool, + tool_id: String, + ?error: String?, + ?params: ::Hash[Symbol, top], + ?response: String?, + ?status_code: Integer? + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + duration_ms: Integer, + success: bool, + tool_id: String, + error: String?, + params: ::Hash[Symbol, top], + response: String?, + status_code: Integer? + } + end + end + end + end + end +end diff --git a/sig/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rbs b/sig/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rbs new file mode 100644 index 0000000..1bd131b --- /dev/null +++ b/sig/zavudev/models/senders/agent/tools/webhook_rotate_secret_params.rbs @@ -0,0 +1,34 @@ +module Zavudev + module Models + module Senders + module Agent + module Tools + type webhook_rotate_secret_params = + { sender_id: String, tool_id: String } + & Zavudev::Internal::Type::request_parameters + + class WebhookRotateSecretParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor sender_id: String + + attr_accessor tool_id: String + + def initialize: ( + sender_id: String, + tool_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + sender_id: String, + tool_id: String, + request_options: Zavudev::RequestOptions + } + end + end + end + end + end +end diff --git a/sig/zavudev/models/senders/telegram_connect_params.rbs b/sig/zavudev/models/senders/telegram_connect_params.rbs new file mode 100644 index 0000000..f9ee71d --- /dev/null +++ b/sig/zavudev/models/senders/telegram_connect_params.rbs @@ -0,0 +1,30 @@ +module Zavudev + module Models + module Senders + type telegram_connect_params = + { sender_id: String, bot_token: String } + & Zavudev::Internal::Type::request_parameters + + class TelegramConnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor sender_id: String + + attr_accessor bot_token: String + + def initialize: ( + sender_id: String, + bot_token: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + sender_id: String, + bot_token: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/senders/telegram_connect_response.rbs b/sig/zavudev/models/senders/telegram_connect_response.rbs new file mode 100644 index 0000000..5b0de45 --- /dev/null +++ b/sig/zavudev/models/senders/telegram_connect_response.rbs @@ -0,0 +1,49 @@ +module Zavudev + module Models + module Senders + type telegram_connect_response = + { + telegram: Zavudev::Models::Senders::TelegramConnectResponse::Telegram + } + + class TelegramConnectResponse < Zavudev::Internal::Type::BaseModel + attr_accessor telegram: Zavudev::Models::Senders::TelegramConnectResponse::Telegram + + def initialize: ( + telegram: Zavudev::Models::Senders::TelegramConnectResponse::Telegram + ) -> void + + def to_hash: -> { + telegram: Zavudev::Models::Senders::TelegramConnectResponse::Telegram + } + + type telegram = + { connected: bool, bot_id: String, bot_username: String } + + class Telegram < Zavudev::Internal::Type::BaseModel + attr_accessor connected: bool + + attr_reader bot_id: String? + + def bot_id=: (String) -> String + + attr_reader bot_username: String? + + def bot_username=: (String) -> String + + def initialize: ( + connected: bool, + ?bot_id: String, + ?bot_username: String + ) -> void + + def to_hash: -> { + connected: bool, + bot_id: String, + bot_username: String + } + end + end + end + end +end diff --git a/sig/zavudev/models/senders/telegram_disconnect_params.rbs b/sig/zavudev/models/senders/telegram_disconnect_params.rbs new file mode 100644 index 0000000..41f9751 --- /dev/null +++ b/sig/zavudev/models/senders/telegram_disconnect_params.rbs @@ -0,0 +1,25 @@ +module Zavudev + module Models + module Senders + type telegram_disconnect_params = + { sender_id: String } & Zavudev::Internal::Type::request_parameters + + class TelegramDisconnectParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor sender_id: String + + def initialize: ( + sender_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + sender_id: String, + request_options: Zavudev::RequestOptions + } + end + end + end +end diff --git a/sig/zavudev/models/template_sync_params.rbs b/sig/zavudev/models/template_sync_params.rbs new file mode 100644 index 0000000..833dbc8 --- /dev/null +++ b/sig/zavudev/models/template_sync_params.rbs @@ -0,0 +1,25 @@ +module Zavudev + module Models + type template_sync_params = + { sender_id: String } & Zavudev::Internal::Type::request_parameters + + class TemplateSyncParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_reader sender_id: String? + + def sender_id=: (String) -> String + + def initialize: ( + ?sender_id: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + sender_id: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/template_sync_response.rbs b/sig/zavudev/models/template_sync_response.rbs new file mode 100644 index 0000000..6b83b79 --- /dev/null +++ b/sig/zavudev/models/template_sync_response.rbs @@ -0,0 +1,45 @@ +module Zavudev + module Models + type template_sync_response = + { + accounts_synced: Integer, + errors: ::Array[String], + imported: Integer, + linked: Integer, + skipped: Integer, + updated: Integer + } + + class TemplateSyncResponse < Zavudev::Internal::Type::BaseModel + attr_accessor accounts_synced: Integer + + attr_accessor errors: ::Array[String] + + attr_accessor imported: Integer + + attr_accessor linked: Integer + + attr_accessor skipped: Integer + + attr_accessor updated: Integer + + def initialize: ( + accounts_synced: Integer, + errors: ::Array[String], + imported: Integer, + linked: Integer, + skipped: Integer, + updated: Integer + ) -> void + + def to_hash: -> { + accounts_synced: Integer, + errors: ::Array[String], + imported: Integer, + linked: Integer, + skipped: Integer, + updated: Integer + } + end + end +end diff --git a/sig/zavudev/models/url_escalate_params.rbs b/sig/zavudev/models/url_escalate_params.rbs new file mode 100644 index 0000000..2f4e921 --- /dev/null +++ b/sig/zavudev/models/url_escalate_params.rbs @@ -0,0 +1,28 @@ +module Zavudev + module Models + type url_escalate_params = + { url_id: String, reason: String } + & Zavudev::Internal::Type::request_parameters + + class URLEscalateParams < Zavudev::Internal::Type::BaseModel + extend Zavudev::Internal::Type::RequestParameters::Converter + include Zavudev::Internal::Type::RequestParameters + + attr_accessor url_id: String + + attr_accessor reason: String + + def initialize: ( + url_id: String, + reason: String, + ?request_options: Zavudev::request_opts + ) -> void + + def to_hash: -> { + url_id: String, + reason: String, + request_options: Zavudev::RequestOptions + } + end + end +end diff --git a/sig/zavudev/models/url_escalate_response.rbs b/sig/zavudev/models/url_escalate_response.rbs new file mode 100644 index 0000000..2a982d5 --- /dev/null +++ b/sig/zavudev/models/url_escalate_response.rbs @@ -0,0 +1,15 @@ +module Zavudev + module Models + type url_escalate_response = { message: String, url: Zavudev::VerifiedURL } + + class URLEscalateResponse < Zavudev::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor url: Zavudev::VerifiedURL + + def initialize: (message: String, url: Zavudev::VerifiedURL) -> void + + def to_hash: -> { message: String, url: Zavudev::VerifiedURL } + end + end +end diff --git a/sig/zavudev/resources/agent_templates.rbs b/sig/zavudev/resources/agent_templates.rbs new file mode 100644 index 0000000..82e80aa --- /dev/null +++ b/sig/zavudev/resources/agent_templates.rbs @@ -0,0 +1,16 @@ +module Zavudev + module Resources + class AgentTemplates + def retrieve: ( + String template_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::AgentTemplateRetrieveResponse + + def list: ( + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::AgentTemplateListResponse + + def initialize: (client: Zavudev::Client) -> void + end + end +end diff --git a/sig/zavudev/resources/agents.rbs b/sig/zavudev/resources/agents.rbs new file mode 100644 index 0000000..bd07e7b --- /dev/null +++ b/sig/zavudev/resources/agents.rbs @@ -0,0 +1,72 @@ +module Zavudev + module Resources + class Agents + attr_reader senders: Zavudev::Resources::Agents::Senders + + def create: ( + model: String, + name: String, + provider: Zavudev::Models::Senders::agent_provider, + system_prompt: String, + ?context_window_messages: Integer, + ?include_contact_metadata: bool, + ?max_tokens: Integer, + ?temperature: Float, + ?trigger_on_channels: ::Array[String], + ?trigger_on_message_types: ::Array[String], + ?voice: Zavudev::AgentCreateParams::Voice, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::AgentCreateResponse + + def retrieve: ( + String agent_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::AgentRetrieveResponse + + def update: ( + String agent_id, + ?api_key: String, + ?context_window_messages: Integer, + ?enabled: bool, + ?include_contact_metadata: bool, + ?max_tokens: Integer?, + ?model: String, + ?name: String, + ?provider: Zavudev::Models::Senders::agent_provider, + ?system_prompt: String, + ?temperature: Float?, + ?trigger_on_channels: ::Array[String], + ?trigger_on_message_types: ::Array[String], + ?voice: Zavudev::AgentUpdateParams::Voice, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::AgentUpdateResponse + + def list: ( + ?cursor: String, + ?limit: Integer, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Internal::Cursor[Zavudev::Senders::SendersAgent] + + def delete: ( + String agent_id, + ?request_options: Zavudev::request_opts + ) -> nil + + def list_voices: ( + ?language: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::AgentListVoicesResponse + + def test_: ( + String agent_id, + message: String, + ?execute_tools: bool, + ?history: ::Array[Zavudev::AgentTestParams::History], + ?use_knowledge_base: bool, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::AgentTestResponse + + def initialize: (client: Zavudev::Client) -> void + end + end +end diff --git a/sig/zavudev/resources/agents/senders.rbs b/sig/zavudev/resources/agents/senders.rbs new file mode 100644 index 0000000..c6f1500 --- /dev/null +++ b/sig/zavudev/resources/agents/senders.rbs @@ -0,0 +1,21 @@ +module Zavudev + module Resources + class Agents + class Senders + def connect: ( + String agent_id, + sender_id: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Agents::SenderConnectResponse + + def disconnect: ( + String sender_id, + agent_id: String, + ?request_options: Zavudev::request_opts + ) -> nil + + def initialize: (client: Zavudev::Client) -> void + end + end + end +end diff --git a/sig/zavudev/resources/calls.rbs b/sig/zavudev/resources/calls.rbs new file mode 100644 index 0000000..d3fec0f --- /dev/null +++ b/sig/zavudev/resources/calls.rbs @@ -0,0 +1,35 @@ +module Zavudev + module Resources + class Calls + def create: ( + to: String, + ?greeting: String, + ?language: String, + ?max_duration_minutes: Integer, + ?metadata: ::Hash[Symbol, String], + ?sender_id: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::CallCreateResponse + + def retrieve: ( + String call_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::CallRetrieveResponse + + def list: ( + ?cursor: String, + ?direction: Zavudev::Models::CallListParams::direction, + ?limit: Integer, + ?status: Zavudev::Models::CallListParams::status, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Internal::Cursor[Zavudev::Models::CallListResponse] + + def hangup: ( + String call_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::CallHangupResponse + + def initialize: (client: Zavudev::Client) -> void + end + end +end diff --git a/sig/zavudev/resources/conversations.rbs b/sig/zavudev/resources/conversations.rbs new file mode 100644 index 0000000..de9cadb --- /dev/null +++ b/sig/zavudev/resources/conversations.rbs @@ -0,0 +1,33 @@ +module Zavudev + module Resources + class Conversations + def retrieve: ( + String conversation_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::ConversationRetrieveResponse + + def list: ( + ?channel: Zavudev::Models::ConversationListParams::channel, + ?cursor: String, + ?limit: Integer, + ?search: String, + ?sender_id: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Internal::Cursor[Zavudev::Models::ConversationListResponse] + + def list_messages: ( + String conversation_id, + ?cursor: String, + ?limit: Integer, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Internal::Cursor[Zavudev::Message] + + def mark_as_read: ( + String conversation_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::ConversationMarkAsReadResponse + + def initialize: (client: Zavudev::Client) -> void + end + end +end diff --git a/sig/zavudev/resources/email_domains.rbs b/sig/zavudev/resources/email_domains.rbs new file mode 100644 index 0000000..3fb3625 --- /dev/null +++ b/sig/zavudev/resources/email_domains.rbs @@ -0,0 +1,31 @@ +module Zavudev + module Resources + class EmailDomains + def create: ( + domain: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::EmailDomainCreateResponse + + def retrieve: ( + String domain_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::EmailDomainRetrieveResponse + + def list: ( + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::EmailDomainListResponse + + def delete: ( + String domain_id, + ?request_options: Zavudev::request_opts + ) -> nil + + def verify: ( + String domain_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::EmailDomainVerifyResponse + + def initialize: (client: Zavudev::Client) -> void + end + end +end diff --git a/sig/zavudev/resources/functions.rbs b/sig/zavudev/resources/functions.rbs index c279919..d7f4f58 100644 --- a/sig/zavudev/resources/functions.rbs +++ b/sig/zavudev/resources/functions.rbs @@ -3,6 +3,10 @@ module Zavudev class Functions attr_reader secrets: Zavudev::Resources::Functions::Secrets + attr_reader triggers: Zavudev::Resources::Functions::Triggers + + attr_reader git_link: Zavudev::Resources::Functions::GitLink + def create: ( name: String, slug: String, @@ -52,6 +56,22 @@ module Zavudev ?request_options: Zavudev::request_opts ) -> Zavudev::Models::FunctionGetDeploymentResponse + def list_deployments: ( + String function_id, + ?limit: Integer, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::FunctionListDeploymentsResponse + + def list_event_types: ( + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::FunctionListEventTypesResponse + + def rollback_deployment: ( + String function_id, + deployment_id: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::FunctionRollbackDeploymentResponse + def tail_logs: ( String function_id, ?end_time: Integer, diff --git a/sig/zavudev/resources/functions/git_link.rbs b/sig/zavudev/resources/functions/git_link.rbs new file mode 100644 index 0000000..707e4dc --- /dev/null +++ b/sig/zavudev/resources/functions/git_link.rbs @@ -0,0 +1,42 @@ +module Zavudev + module Resources + class Functions + class GitLink + def retrieve: ( + String function_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Functions::GitLinkRetrieveResponse + + def update: ( + String function_id, + ?auto_deploy: bool, + ?branch: String, + ?root_dir: String?, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Functions::GitLinkUpdateResponse + + def deploy_now: ( + String function_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Functions::GitLinkDeployNowResponse + + def link: ( + String function_id, + owner: String, + repo: String, + ?auto_deploy: bool, + ?branch: String, + ?root_dir: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Functions::GitLinkLinkResponse + + def unlink: ( + String function_id, + ?request_options: Zavudev::request_opts + ) -> nil + + def initialize: (client: Zavudev::Client) -> void + end + end + end +end diff --git a/sig/zavudev/resources/functions/triggers.rbs b/sig/zavudev/resources/functions/triggers.rbs new file mode 100644 index 0000000..d01390a --- /dev/null +++ b/sig/zavudev/resources/functions/triggers.rbs @@ -0,0 +1,33 @@ +module Zavudev + module Resources + class Functions + class Triggers + def create: ( + String function_id, + event_types: ::Array[String], + sender_ids: ::Array[String?], + ?cron: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Functions::TriggerCreateResponse + + def update: ( + String trigger_id, + active: bool, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Functions::TriggerUpdateResponse + + def list: ( + String function_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Functions::TriggerListResponse + + def delete: ( + String trigger_id, + ?request_options: Zavudev::request_opts + ) -> nil + + def initialize: (client: Zavudev::Client) -> void + end + end + end +end diff --git a/sig/zavudev/resources/introspect.rbs b/sig/zavudev/resources/introspect.rbs index 9585e9f..1da16d8 100644 --- a/sig/zavudev/resources/introspect.rbs +++ b/sig/zavudev/resources/introspect.rbs @@ -1,6 +1,12 @@ module Zavudev module Resources class Introspect + def validate_email: ( + ?email: String, + ?emails: ::Array[String], + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::IntrospectValidateEmailResponse + def validate_phone: ( phone_number: String, ?request_options: Zavudev::request_opts diff --git a/sig/zavudev/resources/messages.rbs b/sig/zavudev/resources/messages.rbs index a701949..7295efa 100644 --- a/sig/zavudev/resources/messages.rbs +++ b/sig/zavudev/resources/messages.rbs @@ -15,6 +15,11 @@ module Zavudev ?request_options: Zavudev::request_opts ) -> Zavudev::Internal::Cursor[Zavudev::Message] + def list_attachments: ( + String message_id, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::MessageListAttachmentsResponse + def react: ( String message_id, emoji: String, diff --git a/sig/zavudev/resources/senders.rbs b/sig/zavudev/resources/senders.rbs index 3c706ef..86b5e21 100644 --- a/sig/zavudev/resources/senders.rbs +++ b/sig/zavudev/resources/senders.rbs @@ -5,6 +5,8 @@ module Zavudev attr_reader whatsapp_sync: Zavudev::Resources::Senders::WhatsappSync + attr_reader telegram: Zavudev::Resources::Senders::Telegram + def create: ( name: String, ?email_address: String, diff --git a/sig/zavudev/resources/senders/agent/knowledge_bases/documents.rbs b/sig/zavudev/resources/senders/agent/knowledge_bases/documents.rbs index 50d7525..072b616 100644 --- a/sig/zavudev/resources/senders/agent/knowledge_bases/documents.rbs +++ b/sig/zavudev/resources/senders/agent/knowledge_bases/documents.rbs @@ -27,6 +27,22 @@ module Zavudev ?request_options: Zavudev::request_opts ) -> nil + def retrieve_document: ( + String doc_id, + sender_id: String, + kb_id: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentRetrieveDocumentResponse + + def update_document: ( + String doc_id, + sender_id: String, + kb_id: String, + ?content: String, + ?title: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentUpdateDocumentResponse + def initialize: (client: Zavudev::Client) -> void end end diff --git a/sig/zavudev/resources/senders/agent/tools.rbs b/sig/zavudev/resources/senders/agent/tools.rbs index b369b03..d687fe7 100644 --- a/sig/zavudev/resources/senders/agent/tools.rbs +++ b/sig/zavudev/resources/senders/agent/tools.rbs @@ -3,6 +3,8 @@ module Zavudev class Senders class Agent class Tools + attr_reader webhook: Zavudev::Resources::Senders::Agent::Tools::Webhook + def create: ( String sender_id, description: String, @@ -46,6 +48,13 @@ module Zavudev ?request_options: Zavudev::request_opts ) -> nil + def list_test_runs: ( + String tool_id, + sender_id: String, + ?limit: Integer, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Senders::Agent::ToolListTestRunsResponse + def test_: ( String tool_id, sender_id: String, diff --git a/sig/zavudev/resources/senders/agent/tools/webhook.rbs b/sig/zavudev/resources/senders/agent/tools/webhook.rbs new file mode 100644 index 0000000..a982bce --- /dev/null +++ b/sig/zavudev/resources/senders/agent/tools/webhook.rbs @@ -0,0 +1,19 @@ +module Zavudev + module Resources + class Senders + class Agent + class Tools + class Webhook + def rotate_secret: ( + String tool_id, + sender_id: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::WebhookSecretResponse + + def initialize: (client: Zavudev::Client) -> void + end + end + end + end + end +end diff --git a/sig/zavudev/resources/senders/telegram.rbs b/sig/zavudev/resources/senders/telegram.rbs new file mode 100644 index 0000000..a49e1da --- /dev/null +++ b/sig/zavudev/resources/senders/telegram.rbs @@ -0,0 +1,20 @@ +module Zavudev + module Resources + class Senders + class Telegram + def connect: ( + String sender_id, + bot_token: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::Senders::TelegramConnectResponse + + def disconnect: ( + String sender_id, + ?request_options: Zavudev::request_opts + ) -> nil + + def initialize: (client: Zavudev::Client) -> void + end + end + end +end diff --git a/sig/zavudev/resources/templates.rbs b/sig/zavudev/resources/templates.rbs index 63c8b3f..04fa859 100644 --- a/sig/zavudev/resources/templates.rbs +++ b/sig/zavudev/resources/templates.rbs @@ -42,6 +42,11 @@ module Zavudev ?request_options: Zavudev::request_opts ) -> Zavudev::Template + def sync: ( + ?sender_id: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::TemplateSyncResponse + def initialize: (client: Zavudev::Client) -> void end end diff --git a/sig/zavudev/resources/urls.rbs b/sig/zavudev/resources/urls.rbs index 4b69afb..660b4ea 100644 --- a/sig/zavudev/resources/urls.rbs +++ b/sig/zavudev/resources/urls.rbs @@ -1,6 +1,12 @@ module Zavudev module Resources class URLs + def escalate: ( + String url_id, + reason: String, + ?request_options: Zavudev::request_opts + ) -> Zavudev::Models::URLEscalateResponse + def list_verified: ( ?cursor: String, ?limit: Integer, diff --git a/test/zavudev/resource_namespaces.rb b/test/zavudev/resource_namespaces.rb index 2d092b3..9980f6f 100644 --- a/test/zavudev/resource_namespaces.rb +++ b/test/zavudev/resource_namespaces.rb @@ -6,6 +6,12 @@ module Resources module Agent module KnowledgeBases end + + module Tools + end + end + + module Agents end module Broadcasts @@ -32,11 +38,17 @@ module Senders module Agent module KnowledgeBases end + + module Tools + end end end module SubAccounts end + + module Tools + end end end end diff --git a/test/zavudev/resources/agent_templates_test.rb b/test/zavudev/resources/agent_templates_test.rb new file mode 100644 index 0000000..3617ef5 --- /dev/null +++ b/test/zavudev/resources/agent_templates_test.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Zavudev::Test::Resources::AgentTemplatesTest < Zavudev::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @zavudev.agent_templates.retrieve("fermi") + + assert_pattern do + response => Zavudev::Models::AgentTemplateRetrieveResponse + end + + assert_pattern do + response => { + template: Zavudev::Models::AgentTemplateRetrieveResponse::Template + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @zavudev.agent_templates.list + + assert_pattern do + response => Zavudev::Models::AgentTemplateListResponse + end + + assert_pattern do + response => { + items: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::AgentTemplateListResponse::Item]) + } + end + end +end diff --git a/test/zavudev/resources/agents/senders_test.rb b/test/zavudev/resources/agents/senders_test.rb new file mode 100644 index 0000000..0275185 --- /dev/null +++ b/test/zavudev/resources/agents/senders_test.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Zavudev::Test::Resources::Agents::SendersTest < Zavudev::Test::ResourceTest + def test_connect_required_params + skip("Mock server tests are disabled") + + response = @zavudev.agents.senders.connect("agentId", sender_id: "senderId") + + assert_pattern do + response => Zavudev::Models::Agents::SenderConnectResponse + end + + assert_pattern do + response => { + agent: Zavudev::Senders::SendersAgent + } + end + end + + def test_disconnect_required_params + skip("Mock server tests are disabled") + + response = @zavudev.agents.senders.disconnect("senderId", agent_id: "agentId") + + assert_pattern do + response => nil + end + end +end diff --git a/test/zavudev/resources/agents_test.rb b/test/zavudev/resources/agents_test.rb new file mode 100644 index 0000000..8f96e25 --- /dev/null +++ b/test/zavudev/resources/agents_test.rb @@ -0,0 +1,146 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Zavudev::Test::Resources::AgentsTest < Zavudev::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = + @zavudev.agents.create(model: "model", name: "name", provider: :openai, system_prompt: "systemPrompt") + + assert_pattern do + response => Zavudev::Models::AgentCreateResponse + end + + assert_pattern do + response => { + agent: Zavudev::Senders::SendersAgent + } + end + end + + def test_retrieve + skip("Mock server tests are disabled") + + response = @zavudev.agents.retrieve("agentId") + + assert_pattern do + response => Zavudev::Models::AgentRetrieveResponse + end + + assert_pattern do + response => { + agent: Zavudev::Senders::SendersAgent + } + end + end + + def test_update + skip("Mock server tests are disabled") + + response = @zavudev.agents.update("agentId") + + assert_pattern do + response => Zavudev::Models::AgentUpdateResponse + end + + assert_pattern do + response => { + agent: Zavudev::Senders::SendersAgent + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @zavudev.agents.list + + assert_pattern do + response => Zavudev::Internal::Cursor + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Zavudev::Senders::SendersAgent + end + + assert_pattern do + row => { + id: String, + created_at: Time, + enabled: Zavudev::Internal::Type::Boolean, + model: String, + name: String, + provider: Zavudev::Senders::AgentProvider, + sender_id: String, + system_prompt: String, + updated_at: Time, + context_window_messages: Integer | nil, + include_contact_metadata: Zavudev::Internal::Type::Boolean | nil, + max_tokens: Integer | nil, + sender_ids: ^(Zavudev::Internal::Type::ArrayOf[String]) | nil, + stats: Zavudev::Senders::SendersAgent::Stats | nil, + temperature: Float | nil, + trigger_on_channels: ^(Zavudev::Internal::Type::ArrayOf[String]) | nil, + trigger_on_message_types: ^(Zavudev::Internal::Type::ArrayOf[String]) | nil, + voice: Zavudev::Senders::SendersAgent::Voice | nil + } + end + end + + def test_delete + skip("Mock server tests are disabled") + + response = @zavudev.agents.delete("agentId") + + assert_pattern do + response => nil + end + end + + def test_list_voices + skip("Mock server tests are disabled") + + response = @zavudev.agents.list_voices + + assert_pattern do + response => Zavudev::Models::AgentListVoicesResponse + end + + assert_pattern do + response => { + items: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::AgentListVoicesResponse::Item]), + languages: ^(Zavudev::Internal::Type::ArrayOf[String]), + total: Integer | nil + } + end + end + + def test_test__required_params + skip("Mock server tests are disabled") + + response = @zavudev.agents.test_("agentId", message: "Where is order ORD-12345?") + + assert_pattern do + response => Zavudev::Models::AgentTestResponse + end + + assert_pattern do + response => { + error: String | nil, + input_tokens: Integer, + knowledge_chunks_used: Integer, + latency_ms: Integer, + output_tokens: Integer, + success: Zavudev::Internal::Type::Boolean, + text: String | nil, + warnings: ^(Zavudev::Internal::Type::ArrayOf[String]), + executed_tool_calls: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::AgentTestResponse::ExecutedToolCall]) | nil + } + end + end +end diff --git a/test/zavudev/resources/calls_test.rb b/test/zavudev/resources/calls_test.rb new file mode 100644 index 0000000..60f132c --- /dev/null +++ b/test/zavudev/resources/calls_test.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Zavudev::Test::Resources::CallsTest < Zavudev::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = @zavudev.calls.create(to: "+56912345678") + + assert_pattern do + response => Zavudev::Models::CallCreateResponse + end + + assert_pattern do + response => { + call: Zavudev::Models::CallCreateResponse::Call + } + end + end + + def test_retrieve + skip("Mock server tests are disabled") + + response = @zavudev.calls.retrieve("callId") + + assert_pattern do + response => Zavudev::Models::CallRetrieveResponse + end + + assert_pattern do + response => { + call: Zavudev::Models::CallRetrieveResponse::Call + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @zavudev.calls.list + + assert_pattern do + response => Zavudev::Internal::Cursor + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Zavudev::Models::CallListResponse + end + + assert_pattern do + row => { + id: String, + created_at: Time, + direction: Zavudev::Models::CallListResponse::Direction, + from: String, + status: Zavudev::Models::CallListResponse::Status, + to: String, + answered_at: Time | nil, + cost: Float | nil, + duration_seconds: Integer | nil, + ended_at: Time | nil, + end_reason: String | nil, + metadata: ^(Zavudev::Internal::Type::HashOf[String]) | nil, + transcript: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::CallListResponse::Transcript]) | nil, + turn_count: Integer | nil, + updated_at: Time | nil + } + end + end + + def test_hangup + skip("Mock server tests are disabled") + + response = @zavudev.calls.hangup("callId") + + assert_pattern do + response => Zavudev::Models::CallHangupResponse + end + + assert_pattern do + response => { + call: Zavudev::Models::CallHangupResponse::Call + } + end + end +end diff --git a/test/zavudev/resources/conversations_test.rb b/test/zavudev/resources/conversations_test.rb new file mode 100644 index 0000000..05d8b18 --- /dev/null +++ b/test/zavudev/resources/conversations_test.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Zavudev::Test::Resources::ConversationsTest < Zavudev::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @zavudev.conversations.retrieve("conversationId") + + assert_pattern do + response => Zavudev::Models::ConversationRetrieveResponse + end + + assert_pattern do + response => { + conversation: Zavudev::Models::ConversationRetrieveResponse::Conversation + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @zavudev.conversations.list + + assert_pattern do + response => Zavudev::Internal::Cursor + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Zavudev::Models::ConversationListResponse + end + + assert_pattern do + row => { + id: String, + channels: ^(Zavudev::Internal::Type::ArrayOf[String]), + contact_identifier: String, + created_at: Time, + last_message: Zavudev::Models::ConversationListResponse::LastMessage, + message_count: Integer, + unread_count: Integer, + updated_at: Time, + contact_id: String | nil, + email: String | nil, + group: Zavudev::Models::ConversationListResponse::Group | nil, + sender_id: String | nil, + whatsapp: Zavudev::Models::ConversationListResponse::Whatsapp | nil + } + end + end + + def test_list_messages + skip("Mock server tests are disabled") + + response = @zavudev.conversations.list_messages("conversationId") + + assert_pattern do + response => Zavudev::Internal::Cursor + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Zavudev::Message + end + + assert_pattern do + row => { + id: String, + channel: Zavudev::Channel, + created_at: Time, + message_type: Zavudev::MessageType, + status: Zavudev::MessageStatus, + to: String, + content: Zavudev::MessageContent | nil, + conversation_id: String | nil, + cost: Float | nil, + cost_provider: Float | nil, + cost_total: Float | nil, + error_code: String | nil, + error_message: String | nil, + from: String | nil, + metadata: ^(Zavudev::Internal::Type::HashOf[String]) | nil, + provider_message_id: String | nil, + sender_id: String | nil, + text: String | nil, + updated_at: Time | nil + } + end + end + + def test_mark_as_read + skip("Mock server tests are disabled") + + response = @zavudev.conversations.mark_as_read("conversationId") + + assert_pattern do + response => Zavudev::Models::ConversationMarkAsReadResponse + end + + assert_pattern do + response => { + conversation: Zavudev::Models::ConversationMarkAsReadResponse::Conversation + } + end + end +end diff --git a/test/zavudev/resources/email_domains_test.rb b/test/zavudev/resources/email_domains_test.rb new file mode 100644 index 0000000..0de5020 --- /dev/null +++ b/test/zavudev/resources/email_domains_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Zavudev::Test::Resources::EmailDomainsTest < Zavudev::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = @zavudev.email_domains.create(domain: "example.com") + + assert_pattern do + response => Zavudev::Models::EmailDomainCreateResponse + end + + assert_pattern do + response => { + domain: Zavudev::Models::EmailDomainCreateResponse::Domain + } + end + end + + def test_retrieve + skip("Mock server tests are disabled") + + response = @zavudev.email_domains.retrieve("domainId") + + assert_pattern do + response => Zavudev::Models::EmailDomainRetrieveResponse + end + + assert_pattern do + response => { + domain: Zavudev::Models::EmailDomainRetrieveResponse::Domain + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @zavudev.email_domains.list + + assert_pattern do + response => Zavudev::Models::EmailDomainListResponse + end + + assert_pattern do + response => { + items: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::EmailDomainListResponse::Item]) + } + end + end + + def test_delete + skip("Mock server tests are disabled") + + response = @zavudev.email_domains.delete("domainId") + + assert_pattern do + response => nil + end + end + + def test_verify + skip("Mock server tests are disabled") + + response = @zavudev.email_domains.verify("domainId") + + assert_pattern do + response => Zavudev::Models::EmailDomainVerifyResponse + end + + assert_pattern do + response => { + domain: Zavudev::Models::EmailDomainVerifyResponse::Domain + } + end + end +end diff --git a/test/zavudev/resources/functions/git_link_test.rb b/test/zavudev/resources/functions/git_link_test.rb new file mode 100644 index 0000000..3c9bfb0 --- /dev/null +++ b/test/zavudev/resources/functions/git_link_test.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Zavudev::Test::Resources::Functions::GitLinkTest < Zavudev::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @zavudev.functions.git_link.retrieve("functionId") + + assert_pattern do + response => Zavudev::Models::Functions::GitLinkRetrieveResponse + end + + assert_pattern do + response => { + link: Zavudev::Models::Functions::GitLinkRetrieveResponse::Link, + webhook_url: String, + webhook_secret: String | nil + } + end + end + + def test_update + skip("Mock server tests are disabled") + + response = @zavudev.functions.git_link.update("functionId") + + assert_pattern do + response => Zavudev::Models::Functions::GitLinkUpdateResponse + end + + assert_pattern do + response => { + link: Zavudev::Models::Functions::GitLinkUpdateResponse::Link, + webhook_url: String, + webhook_secret: String | nil + } + end + end + + def test_deploy_now + skip("Mock server tests are disabled") + + response = @zavudev.functions.git_link.deploy_now("functionId") + + assert_pattern do + response => Zavudev::Models::Functions::GitLinkDeployNowResponse + end + + assert_pattern do + response => { + scheduled: Zavudev::Internal::Type::Boolean + } + end + end + + def test_link_required_params + skip("Mock server tests are disabled") + + response = @zavudev.functions.git_link.link("functionId", owner: "acme", repo: "order-bot") + + assert_pattern do + response => Zavudev::Models::Functions::GitLinkLinkResponse + end + + assert_pattern do + response => { + link: Zavudev::Models::Functions::GitLinkLinkResponse::Link, + webhook_url: String, + webhook_secret: String | nil + } + end + end + + def test_unlink + skip("Mock server tests are disabled") + + response = @zavudev.functions.git_link.unlink("functionId") + + assert_pattern do + response => nil + end + end +end diff --git a/test/zavudev/resources/functions/triggers_test.rb b/test/zavudev/resources/functions/triggers_test.rb new file mode 100644 index 0000000..78c5f72 --- /dev/null +++ b/test/zavudev/resources/functions/triggers_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Zavudev::Test::Resources::Functions::TriggersTest < Zavudev::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = + @zavudev.functions.triggers.create("functionId", event_types: ["message.inbound"], sender_ids: [nil]) + + assert_pattern do + response => Zavudev::Models::Functions::TriggerCreateResponse + end + + assert_pattern do + response => { + added: Integer, + skipped: Integer, + triggers: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::Functions::TriggerCreateResponse::Trigger]) + } + end + end + + def test_update_required_params + skip("Mock server tests are disabled") + + response = @zavudev.functions.triggers.update("triggerId", active: true) + + assert_pattern do + response => Zavudev::Models::Functions::TriggerUpdateResponse + end + + assert_pattern do + response => { + active: Zavudev::Internal::Type::Boolean, + ok: Zavudev::Internal::Type::Boolean + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @zavudev.functions.triggers.list("functionId") + + assert_pattern do + response => Zavudev::Models::Functions::TriggerListResponse + end + + assert_pattern do + response => { + triggers: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::Functions::TriggerListResponse::Trigger]) + } + end + end + + def test_delete + skip("Mock server tests are disabled") + + response = @zavudev.functions.triggers.delete("triggerId") + + assert_pattern do + response => nil + end + end +end diff --git a/test/zavudev/resources/functions_test.rb b/test/zavudev/resources/functions_test.rb index cd5cab7..52cff9b 100644 --- a/test/zavudev/resources/functions_test.rb +++ b/test/zavudev/resources/functions_test.rb @@ -101,6 +101,56 @@ def test_get_deployment end end + def test_list_deployments + skip("Mock server tests are disabled") + + response = @zavudev.functions.list_deployments("functionId") + + assert_pattern do + response => Zavudev::Models::FunctionListDeploymentsResponse + end + + assert_pattern do + response => { + deployments: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::FunctionListDeploymentsResponse::Deployment]) + } + end + end + + def test_list_event_types + skip("Mock server tests are disabled") + + response = @zavudev.functions.list_event_types + + assert_pattern do + response => Zavudev::Models::FunctionListEventTypesResponse + end + + assert_pattern do + response => { + events: ^(Zavudev::Internal::Type::ArrayOf[String]) + } + end + end + + def test_rollback_deployment_required_params + skip("Mock server tests are disabled") + + response = @zavudev.functions.rollback_deployment("functionId", deployment_id: "fnd_abc123") + + assert_pattern do + response => Zavudev::Models::FunctionRollbackDeploymentResponse + end + + assert_pattern do + response => { + deployment: Zavudev::Models::FunctionRollbackDeploymentResponse::Deployment, + previous_draft: Zavudev::Internal::Type::Unknown | nil, + rolled_back_to_version: Integer | nil + } + end + end + def test_tail_logs skip("Mock server tests are disabled") diff --git a/test/zavudev/resources/introspect_test.rb b/test/zavudev/resources/introspect_test.rb index 69e85b9..c56a476 100644 --- a/test/zavudev/resources/introspect_test.rb +++ b/test/zavudev/resources/introspect_test.rb @@ -3,6 +3,23 @@ require_relative "../test_helper" class Zavudev::Test::Resources::IntrospectTest < Zavudev::Test::ResourceTest + def test_validate_email + skip("Mock server tests are disabled") + + response = @zavudev.introspect.validate_email + + assert_pattern do + response => Zavudev::Models::IntrospectValidateEmailResponse + end + + assert_pattern do + response => { + results: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::IntrospectValidateEmailResponse::Result]), + summary: Zavudev::Models::IntrospectValidateEmailResponse::Summary + } + end + end + def test_validate_phone_required_params skip("Mock server tests are disabled") diff --git a/test/zavudev/resources/messages_test.rb b/test/zavudev/resources/messages_test.rb index e4955ca..e016428 100644 --- a/test/zavudev/resources/messages_test.rb +++ b/test/zavudev/resources/messages_test.rb @@ -60,6 +60,22 @@ def test_list end end + def test_list_attachments + skip("Mock server tests are disabled") + + response = @zavudev.messages.list_attachments("messageId") + + assert_pattern do + response => Zavudev::Models::MessageListAttachmentsResponse + end + + assert_pattern do + response => { + items: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::MessageListAttachmentsResponse::Item]) + } + end + end + def test_react_required_params skip("Mock server tests are disabled") diff --git a/test/zavudev/resources/senders/agent/knowledge_bases/documents_test.rb b/test/zavudev/resources/senders/agent/knowledge_bases/documents_test.rb index 42ff119..c001931 100644 --- a/test/zavudev/resources/senders/agent/knowledge_bases/documents_test.rb +++ b/test/zavudev/resources/senders/agent/knowledge_bases/documents_test.rb @@ -65,4 +65,46 @@ def test_delete_required_params response => nil end end + + def test_retrieve_document_required_params + skip("Mock server tests are disabled") + + response = + @zavudev.senders.agent.knowledge_bases.documents.retrieve_document( + "docId", + sender_id: "senderId", + kb_id: "kbId" + ) + + assert_pattern do + response => Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentRetrieveDocumentResponse + end + + assert_pattern do + response => { + document: Zavudev::Senders::Agent::AgentDocument + } + end + end + + def test_update_document_required_params + skip("Mock server tests are disabled") + + response = + @zavudev.senders.agent.knowledge_bases.documents.update_document( + "docId", + sender_id: "senderId", + kb_id: "kbId" + ) + + assert_pattern do + response => Zavudev::Models::Senders::Agent::KnowledgeBases::DocumentUpdateDocumentResponse + end + + assert_pattern do + response => { + document: Zavudev::Senders::Agent::AgentDocument + } + end + end end diff --git a/test/zavudev/resources/senders/agent/tools/webhook_test.rb b/test/zavudev/resources/senders/agent/tools/webhook_test.rb new file mode 100644 index 0000000..e87a4d4 --- /dev/null +++ b/test/zavudev/resources/senders/agent/tools/webhook_test.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require_relative "../../../../test_helper" + +class Zavudev::Test::Resources::Senders::Agent::Tools::WebhookTest < Zavudev::Test::ResourceTest + def test_rotate_secret_required_params + skip("Mock server tests are disabled") + + response = @zavudev.senders.agent.tools.webhook.rotate_secret("toolId", sender_id: "senderId") + + assert_pattern do + response => Zavudev::WebhookSecretResponse + end + + assert_pattern do + response => { + secret: String + } + end + end +end diff --git a/test/zavudev/resources/senders/agent/tools_test.rb b/test/zavudev/resources/senders/agent/tools_test.rb index 5017eba..ea26d07 100644 --- a/test/zavudev/resources/senders/agent/tools_test.rb +++ b/test/zavudev/resources/senders/agent/tools_test.rb @@ -100,6 +100,22 @@ def test_delete_required_params end end + def test_list_test_runs_required_params + skip("Mock server tests are disabled") + + response = @zavudev.senders.agent.tools.list_test_runs("toolId", sender_id: "senderId") + + assert_pattern do + response => Zavudev::Models::Senders::Agent::ToolListTestRunsResponse + end + + assert_pattern do + response => { + items: ^(Zavudev::Internal::Type::ArrayOf[Zavudev::Models::Senders::Agent::ToolListTestRunsResponse::Item]) + } + end + end + def test_test__required_params skip("Mock server tests are disabled") diff --git a/test/zavudev/resources/senders/telegram_test.rb b/test/zavudev/resources/senders/telegram_test.rb new file mode 100644 index 0000000..f63b23e --- /dev/null +++ b/test/zavudev/resources/senders/telegram_test.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Zavudev::Test::Resources::Senders::TelegramTest < Zavudev::Test::ResourceTest + def test_connect_required_params + skip("Mock server tests are disabled") + + response = @zavudev.senders.telegram.connect("senderId", bot_token: "botToken") + + assert_pattern do + response => Zavudev::Models::Senders::TelegramConnectResponse + end + + assert_pattern do + response => { + telegram: Zavudev::Models::Senders::TelegramConnectResponse::Telegram + } + end + end + + def test_disconnect + skip("Mock server tests are disabled") + + response = @zavudev.senders.telegram.disconnect("senderId") + + assert_pattern do + response => nil + end + end +end diff --git a/test/zavudev/resources/templates_test.rb b/test/zavudev/resources/templates_test.rb index d91ba63..63b84cd 100644 --- a/test/zavudev/resources/templates_test.rb +++ b/test/zavudev/resources/templates_test.rb @@ -160,4 +160,25 @@ def test_submit_required_params } end end + + def test_sync + skip("Mock server tests are disabled") + + response = @zavudev.templates.sync + + assert_pattern do + response => Zavudev::Models::TemplateSyncResponse + end + + assert_pattern do + response => { + accounts_synced: Integer, + errors: ^(Zavudev::Internal::Type::ArrayOf[String]), + imported: Integer, + linked: Integer, + skipped: Integer, + updated: Integer + } + end + end end diff --git a/test/zavudev/resources/urls_test.rb b/test/zavudev/resources/urls_test.rb index e44de30..3b61d3a 100644 --- a/test/zavudev/resources/urls_test.rb +++ b/test/zavudev/resources/urls_test.rb @@ -3,6 +3,24 @@ require_relative "../test_helper" class Zavudev::Test::Resources::URLsTest < Zavudev::Test::ResourceTest + def test_escalate_required_params + skip("Mock server tests are disabled") + + response = + @zavudev.urls.escalate("urlId", reason: "This is our official landing page and was rejected in error.") + + assert_pattern do + response => Zavudev::Models::URLEscalateResponse + end + + assert_pattern do + response => { + message: String, + url: Zavudev::VerifiedURL + } + end + end + def test_list_verified skip("Mock server tests are disabled") From 0a813584f16f93728514cab57cd3c1e814f45044 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 03:34:56 +0000 Subject: [PATCH 09/17] feat(api): api update --- .stats.yml | 4 +-- lib/zavudev/models/message.rb | 25 ++++++++++++++++- rbi/zavudev/models/message.rbi | 29 ++++++++++++++++++++ sig/zavudev/models/message.rbs | 16 +++++++++++ test/zavudev/resources/conversations_test.rb | 1 + test/zavudev/resources/messages_test.rb | 1 + 6 files changed, 73 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 906e6fe..5417f7d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 184 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-ba782c22cc1b237327afbf2aeffb453185cec9513d918b5a0fdc7e7233320c9b.yml -openapi_spec_hash: 410cb45b6fa3a8a1f3da3aba50accbdc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-7b2243278dffd1b709f9ea780bc7584f0040597d2f2429d583e0c12ddce900f7.yml +openapi_spec_hash: e23f8e081ded5104745133cfd4d48a48 config_hash: 261e1b852ca7f8364e4a283a3edd350a diff --git a/lib/zavudev/models/message.rb b/lib/zavudev/models/message.rb index da092a6..9c49e4e 100644 --- a/lib/zavudev/models/message.rb +++ b/lib/zavudev/models/message.rb @@ -20,6 +20,13 @@ class Message < Zavudev::Internal::Type::BaseModel # @return [Time] required :created_at, Time, api_name: :createdAt + # @!attribute direction + # Who sent the message. Needed to render a thread: `status` cannot tell the two + # apart, because an inbound message is also stored as `delivered`. + # + # @return [Symbol, Zavudev::Models::Message::Direction] + required :direction, enum: -> { Zavudev::Message::Direction } + # @!attribute message_type # Type of message. Non-text types are supported by WhatsApp and Telegram (varies # by type). @@ -127,7 +134,7 @@ class Message < Zavudev::Internal::Type::BaseModel # @return [Time, nil] optional :updated_at, Time, api_name: :updatedAt - # @!method initialize(id:, channel:, created_at:, message_type:, status:, to:, content: nil, conversation_id: nil, cost: nil, cost_provider: nil, cost_total: nil, error_code: nil, error_message: nil, from: nil, metadata: nil, provider_message_id: nil, sender_id: nil, text: nil, updated_at: nil) + # @!method initialize(id:, channel:, created_at:, direction:, message_type:, status:, to:, content: nil, conversation_id: nil, cost: nil, cost_provider: nil, cost_total: nil, error_code: nil, error_message: nil, from: nil, metadata: nil, provider_message_id: nil, sender_id: nil, text: nil, updated_at: nil) # Some parameter documentations has been truncated, see {Zavudev::Models::Message} # for more details. # @@ -137,6 +144,8 @@ class Message < Zavudev::Internal::Type::BaseModel # # @param created_at [Time] # + # @param direction [Symbol, Zavudev::Models::Message::Direction] Who sent the message. Needed to render a thread: `status` cannot tell the two ap + # # @param message_type [Symbol, Zavudev::Models::MessageType] Type of message. Non-text types are supported by WhatsApp and Telegram (varies b # # @param status [Symbol, Zavudev::Models::MessageStatus] @@ -168,6 +177,20 @@ class Message < Zavudev::Internal::Type::BaseModel # @param text [String] Text content or caption. # # @param updated_at [Time] + + # Who sent the message. Needed to render a thread: `status` cannot tell the two + # apart, because an inbound message is also stored as `delivered`. + # + # @see Zavudev::Models::Message#direction + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND = :inbound + OUTBOUND = :outbound + + # @!method self.values + # @return [Array] + end end end end diff --git a/rbi/zavudev/models/message.rbi b/rbi/zavudev/models/message.rbi index 8ac01bb..afc26ee 100644 --- a/rbi/zavudev/models/message.rbi +++ b/rbi/zavudev/models/message.rbi @@ -16,6 +16,11 @@ module Zavudev sig { returns(Time) } attr_accessor :created_at + # Who sent the message. Needed to render a thread: `status` cannot tell the two + # apart, because an inbound message is also stored as `delivered`. + sig { returns(Zavudev::Message::Direction::TaggedSymbol) } + attr_accessor :direction + # Type of message. Non-text types are supported by WhatsApp and Telegram (varies # by type). # @@ -120,6 +125,7 @@ module Zavudev id: String, channel: Zavudev::Channel::OrSymbol, created_at: Time, + direction: Zavudev::Message::Direction::OrSymbol, message_type: Zavudev::MessageType::OrSymbol, status: Zavudev::MessageStatus::OrSymbol, to: String, @@ -143,6 +149,9 @@ module Zavudev # Delivery channel. Use 'auto' for intelligent routing. channel:, created_at:, + # Who sent the message. Needed to render a thread: `status` cannot tell the two + # apart, because an inbound message is also stored as `delivered`. + direction:, # Type of message. Non-text types are supported by WhatsApp and Telegram (varies # by type). # @@ -195,6 +204,7 @@ module Zavudev id: String, channel: Zavudev::Channel::TaggedSymbol, created_at: Time, + direction: Zavudev::Message::Direction::TaggedSymbol, message_type: Zavudev::MessageType::TaggedSymbol, status: Zavudev::MessageStatus::TaggedSymbol, to: String, @@ -216,6 +226,25 @@ module Zavudev end def to_hash end + + # Who sent the message. Needed to render a thread: `status` cannot tell the two + # apart, because an inbound message is also stored as `delivered`. + module Direction + extend Zavudev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Zavudev::Message::Direction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INBOUND = T.let(:inbound, Zavudev::Message::Direction::TaggedSymbol) + OUTBOUND = T.let(:outbound, Zavudev::Message::Direction::TaggedSymbol) + + sig do + override.returns(T::Array[Zavudev::Message::Direction::TaggedSymbol]) + end + def self.values + end + end end end end diff --git a/sig/zavudev/models/message.rbs b/sig/zavudev/models/message.rbs index daee2e0..96a6549 100644 --- a/sig/zavudev/models/message.rbs +++ b/sig/zavudev/models/message.rbs @@ -5,6 +5,7 @@ module Zavudev id: String, channel: Zavudev::Models::channel, created_at: Time, + direction: Zavudev::Models::Message::direction, message_type: Zavudev::Models::message_type, status: Zavudev::Models::message_status, to: String, @@ -30,6 +31,8 @@ module Zavudev attr_accessor created_at: Time + attr_accessor direction: Zavudev::Models::Message::direction + attr_accessor message_type: Zavudev::Models::message_type attr_accessor status: Zavudev::Models::message_status @@ -82,6 +85,7 @@ module Zavudev id: String, channel: Zavudev::Models::channel, created_at: Time, + direction: Zavudev::Models::Message::direction, message_type: Zavudev::Models::message_type, status: Zavudev::Models::message_status, to: String, @@ -104,6 +108,7 @@ module Zavudev id: String, channel: Zavudev::Models::channel, created_at: Time, + direction: Zavudev::Models::Message::direction, message_type: Zavudev::Models::message_type, status: Zavudev::Models::message_status, to: String, @@ -121,6 +126,17 @@ module Zavudev text: String, updated_at: Time } + + type direction = :inbound | :outbound + + module Direction + extend Zavudev::Internal::Type::Enum + + INBOUND: :inbound + OUTBOUND: :outbound + + def self?.values: -> ::Array[Zavudev::Models::Message::direction] + end end end end diff --git a/test/zavudev/resources/conversations_test.rb b/test/zavudev/resources/conversations_test.rb index 05d8b18..5045a1b 100644 --- a/test/zavudev/resources/conversations_test.rb +++ b/test/zavudev/resources/conversations_test.rb @@ -75,6 +75,7 @@ def test_list_messages id: String, channel: Zavudev::Channel, created_at: Time, + direction: Zavudev::Message::Direction, message_type: Zavudev::MessageType, status: Zavudev::MessageStatus, to: String, diff --git a/test/zavudev/resources/messages_test.rb b/test/zavudev/resources/messages_test.rb index e016428..a2739fd 100644 --- a/test/zavudev/resources/messages_test.rb +++ b/test/zavudev/resources/messages_test.rb @@ -40,6 +40,7 @@ def test_list id: String, channel: Zavudev::Channel, created_at: Time, + direction: Zavudev::Message::Direction, message_type: Zavudev::MessageType, status: Zavudev::MessageStatus, to: String, From 7dd2286c0d534729ba105579ccfa2910368de335 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 16:19:09 +0000 Subject: [PATCH 10/17] feat(api): api update --- .stats.yml | 6 +- lib/zavudev.rb | 1 - lib/zavudev/models.rb | 2 - lib/zavudev/models/contact.rb | 10 +--- ...contact_dismiss_merge_suggestion_params.rb | 20 ------- lib/zavudev/models/contact_list_params.rb | 45 ++++++++++++++- lib/zavudev/models/contact_update_params.rb | 15 ++++- lib/zavudev/resources/contacts.rb | 42 +++++++------- rbi/zavudev/models.rbi | 3 - rbi/zavudev/models/contact.rbi | 11 ---- ...ontact_dismiss_merge_suggestion_params.rbi | 38 ------------- rbi/zavudev/models/contact_list_params.rbi | 56 +++++++++++++++++++ rbi/zavudev/models/contact_update_params.rbi | 12 ++++ rbi/zavudev/resources/contacts.rbi | 45 +++++++++++---- sig/zavudev/models.rbs | 2 - sig/zavudev/models/contact.rbs | 7 --- ...ontact_dismiss_merge_suggestion_params.rbs | 23 -------- sig/zavudev/models/contact_list_params.rbs | 20 ++++++- sig/zavudev/models/contact_update_params.rbs | 5 ++ sig/zavudev/resources/contacts.rbs | 8 +-- test/zavudev/resources/contacts_test.rb | 16 ------ 21 files changed, 208 insertions(+), 179 deletions(-) delete mode 100644 lib/zavudev/models/contact_dismiss_merge_suggestion_params.rb delete mode 100644 rbi/zavudev/models/contact_dismiss_merge_suggestion_params.rbi delete mode 100644 sig/zavudev/models/contact_dismiss_merge_suggestion_params.rbs diff --git a/.stats.yml b/.stats.yml index 5417f7d..618b580 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 184 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-7b2243278dffd1b709f9ea780bc7584f0040597d2f2429d583e0c12ddce900f7.yml -openapi_spec_hash: e23f8e081ded5104745133cfd4d48a48 +configured_endpoints: 183 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-30be71f9a3d5d52fd31a10576b5379ae0bda99f204ced399108c62b9d5bbf632.yml +openapi_spec_hash: 3431ff6e6857c1472891ec1c15c9f142 config_hash: 261e1b852ca7f8364e4a283a3edd350a diff --git a/lib/zavudev.rb b/lib/zavudev.rb index d89d2ea..994816c 100644 --- a/lib/zavudev.rb +++ b/lib/zavudev.rb @@ -127,7 +127,6 @@ require_relative "zavudev/models/contact_channel" require_relative "zavudev/models/contact_create_params" require_relative "zavudev/models/contact_delete_params" -require_relative "zavudev/models/contact_dismiss_merge_suggestion_params" require_relative "zavudev/models/contact_list_params" require_relative "zavudev/models/contact_merge_params" require_relative "zavudev/models/contact_retrieve_by_phone_params" diff --git a/lib/zavudev/models.rb b/lib/zavudev/models.rb index ed1d04f..e36f3a5 100644 --- a/lib/zavudev/models.rb +++ b/lib/zavudev/models.rb @@ -133,8 +133,6 @@ module Zavudev ContactDeleteParams = Zavudev::Models::ContactDeleteParams - ContactDismissMergeSuggestionParams = Zavudev::Models::ContactDismissMergeSuggestionParams - ContactListParams = Zavudev::Models::ContactListParams ContactMergeParams = Zavudev::Models::ContactMergeParams diff --git a/lib/zavudev/models/contact.rb b/lib/zavudev/models/contact.rb index d134718..9eb18dc 100644 --- a/lib/zavudev/models/contact.rb +++ b/lib/zavudev/models/contact.rb @@ -78,18 +78,12 @@ class Contact < Zavudev::Internal::Type::BaseModel # @return [String, nil] optional :profile_name, String, api_name: :profileName, nil?: true - # @!attribute suggested_merge_with - # ID of a contact suggested for merging. - # - # @return [String, nil] - optional :suggested_merge_with, String, api_name: :suggestedMergeWith - # @!attribute updated_at # # @return [Time, nil] optional :updated_at, Time, api_name: :updatedAt - # @!method initialize(id:, available_channels:, created_at:, metadata:, verified:, channels: nil, country_code: nil, default_channel: nil, display_name: nil, phone_number: nil, primary_email: nil, primary_phone: nil, profile_name: nil, suggested_merge_with: nil, updated_at: nil) + # @!method initialize(id:, available_channels:, created_at:, metadata:, verified:, channels: nil, country_code: nil, default_channel: nil, display_name: nil, phone_number: nil, primary_email: nil, primary_phone: nil, profile_name: nil, updated_at: nil) # @param id [String] # # @param available_channels [Array] List of available messaging channels for this contact. @@ -116,8 +110,6 @@ class Contact < Zavudev::Internal::Type::BaseModel # # @param profile_name [String, nil] Contact's WhatsApp profile name. Only available for WhatsApp contacts. # - # @param suggested_merge_with [String] ID of a contact suggested for merging. - # # @param updated_at [Time] # Preferred channel for this contact. diff --git a/lib/zavudev/models/contact_dismiss_merge_suggestion_params.rb b/lib/zavudev/models/contact_dismiss_merge_suggestion_params.rb deleted file mode 100644 index c042b98..0000000 --- a/lib/zavudev/models/contact_dismiss_merge_suggestion_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module Zavudev - module Models - # @see Zavudev::Resources::Contacts#dismiss_merge_suggestion - class ContactDismissMergeSuggestionParams < Zavudev::Internal::Type::BaseModel - extend Zavudev::Internal::Type::RequestParameters::Converter - include Zavudev::Internal::Type::RequestParameters - - # @!attribute contact_id - # - # @return [String] - required :contact_id, String - - # @!method initialize(contact_id:, request_options: {}) - # @param contact_id [String] - # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/zavudev/models/contact_list_params.rb b/lib/zavudev/models/contact_list_params.rb index c202a02..c8dca7c 100644 --- a/lib/zavudev/models/contact_list_params.rb +++ b/lib/zavudev/models/contact_list_params.rb @@ -8,6 +8,7 @@ class ContactListParams < Zavudev::Internal::Type::BaseModel include Zavudev::Internal::Type::RequestParameters # @!attribute cursor + # Opaque cursor from a previous response's `nextCursor`. Do not construct it. # # @return [String, nil] optional :cursor, String @@ -18,14 +19,52 @@ class ContactListParams < Zavudev::Internal::Type::BaseModel optional :limit, Integer # @!attribute phone_number + # Exact match on the contact's primary phone number, in E.164. # # @return [String, nil] optional :phone_number, String - # @!method initialize(cursor: nil, limit: nil, phone_number: nil, request_options: {}) - # @param cursor [String] + # @!attribute search + # Free-text match over the contact's name (`displayName` and the WhatsApp profile + # name), phone numbers and email addresses. Case- and accent-insensitive. A phone + # number matches on a trailing fragment too, so `5551234` finds `+14155551234`. + # + # Contacts created automatically from an inbound message have no `displayName` — + # they are matched by their identifier until you set one with + # `PATCH /v1/contacts/{contactId}`. + # + # Results come back in relevance order rather than newest-first. `cursor` is + # opaque in both modes; pass back exactly what the previous response returned, and + # start a new pagination run when the search term changes. + # + # @return [String, nil] + optional :search, String + + # @!attribute tag + # Tag name. Repeatable: `?tag=vip&tag=chile` returns contacts carrying **every** + # tag given, not any of them — the same rule the dashboard filter applies. + # + # Tags are matched by name, case-insensitively. An unknown tag returns 400 rather + # than being ignored, because a typo that silently matched every contact would be + # a worse answer than an error. + # + # @return [Array, nil] + optional :tag, Zavudev::Internal::Type::ArrayOf[String] + + # @!method initialize(cursor: nil, limit: nil, phone_number: nil, search: nil, tag: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ContactListParams} for more details. + # + # @param cursor [String] Opaque cursor from a previous response's `nextCursor`. Do not construct it. + # # @param limit [Integer] - # @param phone_number [String] + # + # @param phone_number [String] Exact match on the contact's primary phone number, in E.164. + # + # @param search [String] Free-text match over the contact's name (`displayName` and the WhatsApp profile + # + # @param tag [Array] Tag name. Repeatable: `?tag=vip&tag=chile` returns contacts carrying **every** t + # # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/zavudev/models/contact_update_params.rb b/lib/zavudev/models/contact_update_params.rb index f9feda1..30b804d 100644 --- a/lib/zavudev/models/contact_update_params.rb +++ b/lib/zavudev/models/contact_update_params.rb @@ -21,16 +21,29 @@ class ContactUpdateParams < Zavudev::Internal::Type::BaseModel api_name: :defaultChannel, nil?: true + # @!attribute display_name + # Human-readable name for this contact. Set to null to clear it and fall back to + # the contact's identifier. Contacts created automatically from an inbound message + # have no display name until you set one. + # + # @return [String, nil] + optional :display_name, String, api_name: :displayName, nil?: true + # @!attribute metadata # # @return [Hash{Symbol=>String}, nil] optional :metadata, Zavudev::Internal::Type::HashOf[String] - # @!method initialize(contact_id:, default_channel: nil, metadata: nil, request_options: {}) + # @!method initialize(contact_id:, default_channel: nil, display_name: nil, metadata: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ContactUpdateParams} for more details. + # # @param contact_id [String] # # @param default_channel [Symbol, Zavudev::Models::ContactUpdateParams::DefaultChannel, nil] Preferred channel for this contact. Set to null to clear. # + # @param display_name [String, nil] Human-readable name for this contact. Set to null to clear it and fall back to t + # # @param metadata [Hash{Symbol=>String}] # # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/zavudev/resources/contacts.rb b/lib/zavudev/resources/contacts.rb index fab7c4a..04056d3 100644 --- a/lib/zavudev/resources/contacts.rb +++ b/lib/zavudev/resources/contacts.rb @@ -51,14 +51,19 @@ def retrieve(contact_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ContactUpdateParams} for more details. + # # Update contact # - # @overload update(contact_id, default_channel: nil, metadata: nil, request_options: {}) + # @overload update(contact_id, default_channel: nil, display_name: nil, metadata: nil, request_options: {}) # # @param contact_id [String] # # @param default_channel [Symbol, Zavudev::Models::ContactUpdateParams::DefaultChannel, nil] Preferred channel for this contact. Set to null to clear. # + # @param display_name [String, nil] Human-readable name for this contact. Set to null to clear it and fall back to t + # # @param metadata [Hash{Symbol=>String}] # # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] @@ -77,13 +82,23 @@ def update(contact_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {Zavudev::Models::ContactListParams} for more details. + # # List contacts with their communication channels. # - # @overload list(cursor: nil, limit: nil, phone_number: nil, request_options: {}) + # @overload list(cursor: nil, limit: nil, phone_number: nil, search: nil, tag: nil, request_options: {}) + # + # @param cursor [String] Opaque cursor from a previous response's `nextCursor`. Do not construct it. # - # @param cursor [String] # @param limit [Integer] - # @param phone_number [String] + # + # @param phone_number [String] Exact match on the contact's primary phone number, in E.164. + # + # @param search [String] Free-text match over the contact's name (`displayName` and the WhatsApp profile + # + # @param tag [Array] Tag name. Repeatable: `?tag=vip&tag=chile` returns contacts carrying **every** t + # # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [Zavudev::Internal::Cursor] @@ -126,25 +141,6 @@ def delete(contact_id, params = {}) ) end - # Dismiss the merge suggestion for a contact. - # - # @overload dismiss_merge_suggestion(contact_id, request_options: {}) - # - # @param contact_id [String] - # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [nil] - # - # @see Zavudev::Models::ContactDismissMergeSuggestionParams - def dismiss_merge_suggestion(contact_id, params = {}) - @client.request( - method: :delete, - path: ["v1/contacts/%1$s/merge-suggestion", contact_id], - model: NilClass, - options: params[:request_options] - ) - end - # Some parameter documentations has been truncated, see # {Zavudev::Models::ContactMergeParams} for more details. # diff --git a/rbi/zavudev/models.rbi b/rbi/zavudev/models.rbi index 09270c3..4e6e65c 100644 --- a/rbi/zavudev/models.rbi +++ b/rbi/zavudev/models.rbi @@ -95,9 +95,6 @@ module Zavudev ContactDeleteParams = Zavudev::Models::ContactDeleteParams - ContactDismissMergeSuggestionParams = - Zavudev::Models::ContactDismissMergeSuggestionParams - ContactListParams = Zavudev::Models::ContactListParams ContactMergeParams = Zavudev::Models::ContactMergeParams diff --git a/rbi/zavudev/models/contact.rbi b/rbi/zavudev/models/contact.rbi index 9a64102..5d607e5 100644 --- a/rbi/zavudev/models/contact.rbi +++ b/rbi/zavudev/models/contact.rbi @@ -77,13 +77,6 @@ module Zavudev sig { returns(T.nilable(String)) } attr_accessor :profile_name - # ID of a contact suggested for merging. - sig { returns(T.nilable(String)) } - attr_reader :suggested_merge_with - - sig { params(suggested_merge_with: String).void } - attr_writer :suggested_merge_with - sig { returns(T.nilable(Time)) } attr_reader :updated_at @@ -105,7 +98,6 @@ module Zavudev primary_email: String, primary_phone: String, profile_name: T.nilable(String), - suggested_merge_with: String, updated_at: Time ).returns(T.attached_class) end @@ -132,8 +124,6 @@ module Zavudev primary_phone: nil, # Contact's WhatsApp profile name. Only available for WhatsApp contacts. profile_name: nil, - # ID of a contact suggested for merging. - suggested_merge_with: nil, updated_at: nil ) end @@ -154,7 +144,6 @@ module Zavudev primary_email: String, primary_phone: String, profile_name: T.nilable(String), - suggested_merge_with: String, updated_at: Time } ) diff --git a/rbi/zavudev/models/contact_dismiss_merge_suggestion_params.rbi b/rbi/zavudev/models/contact_dismiss_merge_suggestion_params.rbi deleted file mode 100644 index 8c446f9..0000000 --- a/rbi/zavudev/models/contact_dismiss_merge_suggestion_params.rbi +++ /dev/null @@ -1,38 +0,0 @@ -# typed: strong - -module Zavudev - module Models - class ContactDismissMergeSuggestionParams < Zavudev::Internal::Type::BaseModel - extend Zavudev::Internal::Type::RequestParameters::Converter - include Zavudev::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - Zavudev::ContactDismissMergeSuggestionParams, - Zavudev::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :contact_id - - sig do - params( - contact_id: String, - request_options: Zavudev::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new(contact_id:, request_options: {}) - end - - sig do - override.returns( - { contact_id: String, request_options: Zavudev::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/zavudev/models/contact_list_params.rbi b/rbi/zavudev/models/contact_list_params.rbi index 05bbc40..d6227c9 100644 --- a/rbi/zavudev/models/contact_list_params.rbi +++ b/rbi/zavudev/models/contact_list_params.rbi @@ -11,6 +11,7 @@ module Zavudev T.any(Zavudev::ContactListParams, Zavudev::Internal::AnyHash) end + # Opaque cursor from a previous response's `nextCursor`. Do not construct it. sig { returns(T.nilable(String)) } attr_reader :cursor @@ -23,24 +24,77 @@ module Zavudev sig { params(limit: Integer).void } attr_writer :limit + # Exact match on the contact's primary phone number, in E.164. sig { returns(T.nilable(String)) } attr_reader :phone_number sig { params(phone_number: String).void } attr_writer :phone_number + # Free-text match over the contact's name (`displayName` and the WhatsApp profile + # name), phone numbers and email addresses. Case- and accent-insensitive. A phone + # number matches on a trailing fragment too, so `5551234` finds `+14155551234`. + # + # Contacts created automatically from an inbound message have no `displayName` — + # they are matched by their identifier until you set one with + # `PATCH /v1/contacts/{contactId}`. + # + # Results come back in relevance order rather than newest-first. `cursor` is + # opaque in both modes; pass back exactly what the previous response returned, and + # start a new pagination run when the search term changes. + sig { returns(T.nilable(String)) } + attr_reader :search + + sig { params(search: String).void } + attr_writer :search + + # Tag name. Repeatable: `?tag=vip&tag=chile` returns contacts carrying **every** + # tag given, not any of them — the same rule the dashboard filter applies. + # + # Tags are matched by name, case-insensitively. An unknown tag returns 400 rather + # than being ignored, because a typo that silently matched every contact would be + # a worse answer than an error. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tag + + sig { params(tag: T::Array[String]).void } + attr_writer :tag + sig do params( cursor: String, limit: Integer, phone_number: String, + search: String, + tag: T::Array[String], request_options: Zavudev::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + # Opaque cursor from a previous response's `nextCursor`. Do not construct it. cursor: nil, limit: nil, + # Exact match on the contact's primary phone number, in E.164. phone_number: nil, + # Free-text match over the contact's name (`displayName` and the WhatsApp profile + # name), phone numbers and email addresses. Case- and accent-insensitive. A phone + # number matches on a trailing fragment too, so `5551234` finds `+14155551234`. + # + # Contacts created automatically from an inbound message have no `displayName` — + # they are matched by their identifier until you set one with + # `PATCH /v1/contacts/{contactId}`. + # + # Results come back in relevance order rather than newest-first. `cursor` is + # opaque in both modes; pass back exactly what the previous response returned, and + # start a new pagination run when the search term changes. + search: nil, + # Tag name. Repeatable: `?tag=vip&tag=chile` returns contacts carrying **every** + # tag given, not any of them — the same rule the dashboard filter applies. + # + # Tags are matched by name, case-insensitively. An unknown tag returns 400 rather + # than being ignored, because a typo that silently matched every contact would be + # a worse answer than an error. + tag: nil, request_options: {} ) end @@ -51,6 +105,8 @@ module Zavudev cursor: String, limit: Integer, phone_number: String, + search: String, + tag: T::Array[String], request_options: Zavudev::RequestOptions } ) diff --git a/rbi/zavudev/models/contact_update_params.rbi b/rbi/zavudev/models/contact_update_params.rbi index dcb76a4..97a1ed5 100644 --- a/rbi/zavudev/models/contact_update_params.rbi +++ b/rbi/zavudev/models/contact_update_params.rbi @@ -22,6 +22,12 @@ module Zavudev end attr_accessor :default_channel + # Human-readable name for this contact. Set to null to clear it and fall back to + # the contact's identifier. Contacts created automatically from an inbound message + # have no display name until you set one. + sig { returns(T.nilable(String)) } + attr_accessor :display_name + sig { returns(T.nilable(T::Hash[Symbol, String])) } attr_reader :metadata @@ -33,6 +39,7 @@ module Zavudev contact_id: String, default_channel: T.nilable(Zavudev::ContactUpdateParams::DefaultChannel::OrSymbol), + display_name: T.nilable(String), metadata: T::Hash[Symbol, String], request_options: Zavudev::RequestOptions::OrHash ).returns(T.attached_class) @@ -41,6 +48,10 @@ module Zavudev contact_id:, # Preferred channel for this contact. Set to null to clear. default_channel: nil, + # Human-readable name for this contact. Set to null to clear it and fall back to + # the contact's identifier. Contacts created automatically from an inbound message + # have no display name until you set one. + display_name: nil, metadata: nil, request_options: {} ) @@ -52,6 +63,7 @@ module Zavudev contact_id: String, default_channel: T.nilable(Zavudev::ContactUpdateParams::DefaultChannel::OrSymbol), + display_name: T.nilable(String), metadata: T::Hash[Symbol, String], request_options: Zavudev::RequestOptions } diff --git a/rbi/zavudev/resources/contacts.rbi b/rbi/zavudev/resources/contacts.rbi index d1d3ac5..f556205 100644 --- a/rbi/zavudev/resources/contacts.rbi +++ b/rbi/zavudev/resources/contacts.rbi @@ -42,6 +42,7 @@ module Zavudev contact_id: String, default_channel: T.nilable(Zavudev::ContactUpdateParams::DefaultChannel::OrSymbol), + display_name: T.nilable(String), metadata: T::Hash[Symbol, String], request_options: Zavudev::RequestOptions::OrHash ).returns(Zavudev::Contact) @@ -50,6 +51,10 @@ module Zavudev contact_id, # Preferred channel for this contact. Set to null to clear. default_channel: nil, + # Human-readable name for this contact. Set to null to clear it and fall back to + # the contact's identifier. Contacts created automatically from an inbound message + # have no display name until you set one. + display_name: nil, metadata: nil, request_options: {} ) @@ -61,10 +66,38 @@ module Zavudev cursor: String, limit: Integer, phone_number: String, + search: String, + tag: T::Array[String], request_options: Zavudev::RequestOptions::OrHash ).returns(Zavudev::Internal::Cursor[Zavudev::Contact]) end - def list(cursor: nil, limit: nil, phone_number: nil, request_options: {}) + def list( + # Opaque cursor from a previous response's `nextCursor`. Do not construct it. + cursor: nil, + limit: nil, + # Exact match on the contact's primary phone number, in E.164. + phone_number: nil, + # Free-text match over the contact's name (`displayName` and the WhatsApp profile + # name), phone numbers and email addresses. Case- and accent-insensitive. A phone + # number matches on a trailing fragment too, so `5551234` finds `+14155551234`. + # + # Contacts created automatically from an inbound message have no `displayName` — + # they are matched by their identifier until you set one with + # `PATCH /v1/contacts/{contactId}`. + # + # Results come back in relevance order rather than newest-first. `cursor` is + # opaque in both modes; pass back exactly what the previous response returned, and + # start a new pagination run when the search term changes. + search: nil, + # Tag name. Repeatable: `?tag=vip&tag=chile` returns contacts carrying **every** + # tag given, not any of them — the same rule the dashboard filter applies. + # + # Tags are matched by name, case-insensitively. An unknown tag returns 400 rather + # than being ignored, because a typo that silently matched every contact would be + # a worse answer than an error. + tag: nil, + request_options: {} + ) end # Permanently delete a contact and its communication channels. Implements @@ -82,16 +115,6 @@ module Zavudev def delete(contact_id, request_options: {}) end - # Dismiss the merge suggestion for a contact. - sig do - params( - contact_id: String, - request_options: Zavudev::RequestOptions::OrHash - ).void - end - def dismiss_merge_suggestion(contact_id, request_options: {}) - end - # Merge a source contact into this contact. All channels from the source contact # will be moved to the target contact, and the source contact will be marked as # merged. diff --git a/sig/zavudev/models.rbs b/sig/zavudev/models.rbs index 9fad525..f6c0b99 100644 --- a/sig/zavudev/models.rbs +++ b/sig/zavudev/models.rbs @@ -93,8 +93,6 @@ module Zavudev class ContactDeleteParams = Zavudev::Models::ContactDeleteParams - class ContactDismissMergeSuggestionParams = Zavudev::Models::ContactDismissMergeSuggestionParams - class ContactListParams = Zavudev::Models::ContactListParams class ContactMergeParams = Zavudev::Models::ContactMergeParams diff --git a/sig/zavudev/models/contact.rbs b/sig/zavudev/models/contact.rbs index bd910b3..b5404d4 100644 --- a/sig/zavudev/models/contact.rbs +++ b/sig/zavudev/models/contact.rbs @@ -15,7 +15,6 @@ module Zavudev primary_email: String, primary_phone: String, profile_name: String?, - suggested_merge_with: String, updated_at: Time } @@ -64,10 +63,6 @@ module Zavudev attr_accessor profile_name: String? - attr_reader suggested_merge_with: String? - - def suggested_merge_with=: (String) -> String - attr_reader updated_at: Time? def updated_at=: (Time) -> Time @@ -86,7 +81,6 @@ module Zavudev ?primary_email: String, ?primary_phone: String, ?profile_name: String?, - ?suggested_merge_with: String, ?updated_at: Time ) -> void @@ -104,7 +98,6 @@ module Zavudev primary_email: String, primary_phone: String, profile_name: String?, - suggested_merge_with: String, updated_at: Time } diff --git a/sig/zavudev/models/contact_dismiss_merge_suggestion_params.rbs b/sig/zavudev/models/contact_dismiss_merge_suggestion_params.rbs deleted file mode 100644 index bc0bde2..0000000 --- a/sig/zavudev/models/contact_dismiss_merge_suggestion_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module Zavudev - module Models - type contact_dismiss_merge_suggestion_params = - { contact_id: String } & Zavudev::Internal::Type::request_parameters - - class ContactDismissMergeSuggestionParams < Zavudev::Internal::Type::BaseModel - extend Zavudev::Internal::Type::RequestParameters::Converter - include Zavudev::Internal::Type::RequestParameters - - attr_accessor contact_id: String - - def initialize: ( - contact_id: String, - ?request_options: Zavudev::request_opts - ) -> void - - def to_hash: -> { - contact_id: String, - request_options: Zavudev::RequestOptions - } - end - end -end diff --git a/sig/zavudev/models/contact_list_params.rbs b/sig/zavudev/models/contact_list_params.rbs index 5d3fce7..7cf3736 100644 --- a/sig/zavudev/models/contact_list_params.rbs +++ b/sig/zavudev/models/contact_list_params.rbs @@ -1,7 +1,13 @@ module Zavudev module Models type contact_list_params = - { cursor: String, limit: Integer, phone_number: String } + { + cursor: String, + limit: Integer, + phone_number: String, + search: String, + tag: ::Array[String] + } & Zavudev::Internal::Type::request_parameters class ContactListParams < Zavudev::Internal::Type::BaseModel @@ -20,10 +26,20 @@ module Zavudev def phone_number=: (String) -> String + attr_reader search: String? + + def search=: (String) -> String + + attr_reader tag: ::Array[String]? + + def tag=: (::Array[String]) -> ::Array[String] + def initialize: ( ?cursor: String, ?limit: Integer, ?phone_number: String, + ?search: String, + ?tag: ::Array[String], ?request_options: Zavudev::request_opts ) -> void @@ -31,6 +47,8 @@ module Zavudev cursor: String, limit: Integer, phone_number: String, + search: String, + tag: ::Array[String], request_options: Zavudev::RequestOptions } end diff --git a/sig/zavudev/models/contact_update_params.rbs b/sig/zavudev/models/contact_update_params.rbs index a0fb1e1..cf21540 100644 --- a/sig/zavudev/models/contact_update_params.rbs +++ b/sig/zavudev/models/contact_update_params.rbs @@ -4,6 +4,7 @@ module Zavudev { contact_id: String, default_channel: Zavudev::Models::ContactUpdateParams::default_channel?, + display_name: String?, metadata: ::Hash[Symbol, String] } & Zavudev::Internal::Type::request_parameters @@ -16,6 +17,8 @@ module Zavudev attr_accessor default_channel: Zavudev::Models::ContactUpdateParams::default_channel? + attr_accessor display_name: String? + attr_reader metadata: ::Hash[Symbol, String]? def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] @@ -23,6 +26,7 @@ module Zavudev def initialize: ( contact_id: String, ?default_channel: Zavudev::Models::ContactUpdateParams::default_channel?, + ?display_name: String?, ?metadata: ::Hash[Symbol, String], ?request_options: Zavudev::request_opts ) -> void @@ -30,6 +34,7 @@ module Zavudev def to_hash: -> { contact_id: String, default_channel: Zavudev::Models::ContactUpdateParams::default_channel?, + display_name: String?, metadata: ::Hash[Symbol, String], request_options: Zavudev::RequestOptions } diff --git a/sig/zavudev/resources/contacts.rbs b/sig/zavudev/resources/contacts.rbs index 3777cc9..3a4b3f5 100644 --- a/sig/zavudev/resources/contacts.rbs +++ b/sig/zavudev/resources/contacts.rbs @@ -18,6 +18,7 @@ module Zavudev def update: ( String contact_id, ?default_channel: Zavudev::Models::ContactUpdateParams::default_channel?, + ?display_name: String?, ?metadata: ::Hash[Symbol, String], ?request_options: Zavudev::request_opts ) -> Zavudev::Contact @@ -26,6 +27,8 @@ module Zavudev ?cursor: String, ?limit: Integer, ?phone_number: String, + ?search: String, + ?tag: ::Array[String], ?request_options: Zavudev::request_opts ) -> Zavudev::Internal::Cursor[Zavudev::Contact] @@ -34,11 +37,6 @@ module Zavudev ?request_options: Zavudev::request_opts ) -> nil - def dismiss_merge_suggestion: ( - String contact_id, - ?request_options: Zavudev::request_opts - ) -> nil - def merge: ( String contact_id, source_contact_id: String, diff --git a/test/zavudev/resources/contacts_test.rb b/test/zavudev/resources/contacts_test.rb index 97fee8d..9a4156f 100644 --- a/test/zavudev/resources/contacts_test.rb +++ b/test/zavudev/resources/contacts_test.rb @@ -27,7 +27,6 @@ def test_create_required_params primary_email: String | nil, primary_phone: String | nil, profile_name: String | nil, - suggested_merge_with: String | nil, updated_at: Time | nil } end @@ -57,7 +56,6 @@ def test_retrieve primary_email: String | nil, primary_phone: String | nil, profile_name: String | nil, - suggested_merge_with: String | nil, updated_at: Time | nil } end @@ -87,7 +85,6 @@ def test_update primary_email: String | nil, primary_phone: String | nil, profile_name: String | nil, - suggested_merge_with: String | nil, updated_at: Time | nil } end @@ -124,7 +121,6 @@ def test_list primary_email: String | nil, primary_phone: String | nil, profile_name: String | nil, - suggested_merge_with: String | nil, updated_at: Time | nil } end @@ -140,16 +136,6 @@ def test_delete end end - def test_dismiss_merge_suggestion - skip("Mock server tests are disabled") - - response = @zavudev.contacts.dismiss_merge_suggestion("contactId") - - assert_pattern do - response => nil - end - end - def test_merge_required_params skip("Mock server tests are disabled") @@ -174,7 +160,6 @@ def test_merge_required_params primary_email: String | nil, primary_phone: String | nil, profile_name: String | nil, - suggested_merge_with: String | nil, updated_at: Time | nil } end @@ -204,7 +189,6 @@ def test_retrieve_by_phone primary_email: String | nil, primary_phone: String | nil, profile_name: String | nil, - suggested_merge_with: String | nil, updated_at: Time | nil } end From c22d5f2e1830e823b653b8ff46eb4abb4021832f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 19:51:28 +0000 Subject: [PATCH 11/17] feat(api): api update --- .stats.yml | 4 ++-- lib/zavudev/resources/number_10dlc/brands.rb | 15 ++++++++++----- lib/zavudev/resources/number_10dlc/campaigns.rb | 15 ++++++++------- rbi/zavudev/resources/number_10dlc/brands.rbi | 15 ++++++++++----- rbi/zavudev/resources/number_10dlc/campaigns.rbi | 15 ++++++++------- 5 files changed, 38 insertions(+), 26 deletions(-) diff --git a/.stats.yml b/.stats.yml index 618b580..f32ec4b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 183 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-30be71f9a3d5d52fd31a10576b5379ae0bda99f204ced399108c62b9d5bbf632.yml -openapi_spec_hash: 3431ff6e6857c1472891ec1c15c9f142 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-4cbd2b04d9be8798b6440cddaebc2165d90c058b424912ab80c766bcab22752f.yml +openapi_spec_hash: 0d325247718f16700baef5ada4936a34 config_hash: 261e1b852ca7f8364e4a283a3edd350a diff --git a/lib/zavudev/resources/number_10dlc/brands.rb b/lib/zavudev/resources/number_10dlc/brands.rb index 0340c53..cdffb1a 100644 --- a/lib/zavudev/resources/number_10dlc/brands.rb +++ b/lib/zavudev/resources/number_10dlc/brands.rb @@ -198,11 +198,16 @@ def list_use_cases(params = {}) end # Submit a draft brand to The Campaign Registry (TCR) for vetting. The brand must - # be in draft status. TCR's one-time $4 brand registration fee is charged from - # your balance at submission (passed through at cost) and refunded if the carrier - # rejects the registration. A team that already paid this fee through the - # compliance flow is not charged again. Campaign registration is billed separately - # when a campaign is submitted. + # be in draft status, and the team must have an approved Business Verification + # (KYB) — carriers register a brand against a vetted legal entity, so submitting + # without one returns `403` with code `kyb_required`. + # + # TCR's one-time $4 brand registration fee is charged from your balance at + # submission (passed through at cost) and refunded if the carrier rejects the + # registration. The fee is per BRAND: a team registering a second legal entity + # pays it again. A brand already paid for through the compliance flow is not + # charged twice. Campaign registration is billed separately when a campaign is + # submitted. # # @overload submit(brand_id, request_options: {}) # diff --git a/lib/zavudev/resources/number_10dlc/campaigns.rb b/lib/zavudev/resources/number_10dlc/campaigns.rb index 0fc7ba0..75edbc3 100644 --- a/lib/zavudev/resources/number_10dlc/campaigns.rb +++ b/lib/zavudev/resources/number_10dlc/campaigns.rb @@ -170,13 +170,14 @@ def delete(campaign_id, params = {}) ) end - # Submit a draft campaign for carrier review. The campaign must be in draft status - # and its brand must be verified. TCR's one-time registration fee is charged from - # your balance at submission ($15 for standard use cases, $2 for LOW_VOLUME), - # passed through at cost and refunded if the carrier rejects it. Once approved, - # the campaign's monthly TCR fee ($10 standard, $2 LOW_VOLUME) is charged from - # your balance while the campaign is active — see registrationCostCents and - # monthlyFeeCents on the campaign object. + # The team must have an approved Business Verification (KYB): submitting without + # one returns `403` with code `kyb_required`. Submit a draft campaign for carrier + # review. The campaign must be in draft status and its brand must be verified. + # TCR's one-time registration fee is charged from your balance at submission ($15 + # for standard use cases, $2 for LOW_VOLUME), passed through at cost and refunded + # if the carrier rejects it. Once approved, the campaign's monthly TCR fee ($10 + # standard, $2 LOW_VOLUME) is charged from your balance while the campaign is + # active — see registrationCostCents and monthlyFeeCents on the campaign object. # # @overload submit(campaign_id, request_options: {}) # diff --git a/rbi/zavudev/resources/number_10dlc/brands.rbi b/rbi/zavudev/resources/number_10dlc/brands.rbi index 07b6340..1d3fd96 100644 --- a/rbi/zavudev/resources/number_10dlc/brands.rbi +++ b/rbi/zavudev/resources/number_10dlc/brands.rbi @@ -159,11 +159,16 @@ module Zavudev end # Submit a draft brand to The Campaign Registry (TCR) for vetting. The brand must - # be in draft status. TCR's one-time $4 brand registration fee is charged from - # your balance at submission (passed through at cost) and refunded if the carrier - # rejects the registration. A team that already paid this fee through the - # compliance flow is not charged again. Campaign registration is billed separately - # when a campaign is submitted. + # be in draft status, and the team must have an approved Business Verification + # (KYB) — carriers register a brand against a vetted legal entity, so submitting + # without one returns `403` with code `kyb_required`. + # + # TCR's one-time $4 brand registration fee is charged from your balance at + # submission (passed through at cost) and refunded if the carrier rejects the + # registration. The fee is per BRAND: a team registering a second legal entity + # pays it again. A brand already paid for through the compliance flow is not + # charged twice. Campaign registration is billed separately when a campaign is + # submitted. sig do params( brand_id: String, diff --git a/rbi/zavudev/resources/number_10dlc/campaigns.rbi b/rbi/zavudev/resources/number_10dlc/campaigns.rbi index c96fd7b..4222e42 100644 --- a/rbi/zavudev/resources/number_10dlc/campaigns.rbi +++ b/rbi/zavudev/resources/number_10dlc/campaigns.rbi @@ -137,13 +137,14 @@ module Zavudev ) end - # Submit a draft campaign for carrier review. The campaign must be in draft status - # and its brand must be verified. TCR's one-time registration fee is charged from - # your balance at submission ($15 for standard use cases, $2 for LOW_VOLUME), - # passed through at cost and refunded if the carrier rejects it. Once approved, - # the campaign's monthly TCR fee ($10 standard, $2 LOW_VOLUME) is charged from - # your balance while the campaign is active — see registrationCostCents and - # monthlyFeeCents on the campaign object. + # The team must have an approved Business Verification (KYB): submitting without + # one returns `403` with code `kyb_required`. Submit a draft campaign for carrier + # review. The campaign must be in draft status and its brand must be verified. + # TCR's one-time registration fee is charged from your balance at submission ($15 + # for standard use cases, $2 for LOW_VOLUME), passed through at cost and refunded + # if the carrier rejects it. Once approved, the campaign's monthly TCR fee ($10 + # standard, $2 LOW_VOLUME) is charged from your balance while the campaign is + # active — see registrationCostCents and monthlyFeeCents on the campaign object. sig do params( campaign_id: String, From 2823225b563ed109ae8dd09073c3c1cf37cbe529 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 12:16:04 +0000 Subject: [PATCH 12/17] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f32ec4b..ed9df4a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 183 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-4cbd2b04d9be8798b6440cddaebc2165d90c058b424912ab80c766bcab22752f.yml -openapi_spec_hash: 0d325247718f16700baef5ada4936a34 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-861b30c9e6830b4768809d1d84b325ca4f8f322da3229d92dbc9551b0200d86b.yml +openapi_spec_hash: c2f328bfd5c3d225bc96e9abe43a51cd config_hash: 261e1b852ca7f8364e4a283a3edd350a From b5b33a9ff3b882bc2b01abb7bfec04ddfcaa542d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 12:38:30 +0000 Subject: [PATCH 13/17] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ed9df4a..31aa0a9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 183 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-861b30c9e6830b4768809d1d84b325ca4f8f322da3229d92dbc9551b0200d86b.yml -openapi_spec_hash: c2f328bfd5c3d225bc96e9abe43a51cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-b9de268c0618a8d5541bebde820c239719d088b9931f19a4a188a607a052ca58.yml +openapi_spec_hash: 78dde7ad15bcc3b85db07afa17fdab7f config_hash: 261e1b852ca7f8364e4a283a3edd350a From 2b28cafa9edc0428d5b36be3c2cd3f4ae23b0c0d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 13:38:32 +0000 Subject: [PATCH 14/17] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 31aa0a9..a17d0c5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 183 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-b9de268c0618a8d5541bebde820c239719d088b9931f19a4a188a607a052ca58.yml -openapi_spec_hash: 78dde7ad15bcc3b85db07afa17fdab7f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-ceb3ca773122a62795ca60eb454f3023561a2df0363673ae4e8fa842bced7bc2.yml +openapi_spec_hash: 450f6c41ae300571671b45b28611d0ee config_hash: 261e1b852ca7f8364e4a283a3edd350a From 4dd9bd16d0984ca18b228ad0e857db573a5cd444 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 29 Aug 2026 04:09:59 +0000 Subject: [PATCH 15/17] feat(api): api update --- .stats.yml | 4 ++-- lib/zavudev/resources/broadcasts.rb | 25 ++++++++++++++--------- lib/zavudev/resources/calls.rb | 9 +++++++++ lib/zavudev/resources/messages.rb | 30 ++++++++++++++++++++++++++++ rbi/zavudev/resources/broadcasts.rbi | 25 ++++++++++++++--------- rbi/zavudev/resources/calls.rbi | 9 +++++++++ rbi/zavudev/resources/messages.rbi | 30 ++++++++++++++++++++++++++++ 7 files changed, 112 insertions(+), 20 deletions(-) diff --git a/.stats.yml b/.stats.yml index a17d0c5..6c58be4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 183 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-ceb3ca773122a62795ca60eb454f3023561a2df0363673ae4e8fa842bced7bc2.yml -openapi_spec_hash: 450f6c41ae300571671b45b28611d0ee +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-3c2c3dadcbcc8bb98070da5fc5d671816152c2304f02905d5eaacae39aa3093a.yml +openapi_spec_hash: ef0d31201ff8b374aefddca6a6329ab6 config_hash: 261e1b852ca7f8364e4a283a3edd350a diff --git a/lib/zavudev/resources/broadcasts.rb b/lib/zavudev/resources/broadcasts.rb index f6d45c8..3dd43a9 100644 --- a/lib/zavudev/resources/broadcasts.rb +++ b/lib/zavudev/resources/broadcasts.rb @@ -255,15 +255,22 @@ def retry_review(broadcast_id, params = {}) # Start sending the broadcast immediately or schedule for later. # - # **Verification is required to send, except on WhatsApp.** On every channel other - # than `whatsapp`, the team must have completed both identity verification (KYC) - # and business verification (KYB); passing one is not enough. A `whatsapp` - # broadcast requires neither: it can only be built on a template, and Meta vets - # the business and the content when it approves that template, so an unapproved - # template is refused instead. `smart` is not exempt — it can route a contact to - # SMS or email. Drafts can be created, edited and kept without any check. Every - # send path — dashboard, API and CLI alike — enforces the same rule, returning - # `403` with code `kyc_required` or `kyb_required` for whichever is outstanding. + # **The account must be past the sandbox level to send, except on WhatsApp.** An + # account that has verified nothing is refused with `403` and code `kyc_required` + # on every channel other than `whatsapp`. Any one of these lifts it: identity + # verification (KYC), a saved payment method, a settled deposit, or a paid plan. + # Business verification (KYB) is not required to broadcast; it gates 10DLC + # registration only. A `whatsapp` broadcast is exempt: it can only be built on a + # template, and Meta vets the business and the content when it approves that + # template, so an unapproved template is refused instead. `smart` is not exempt, + # since it can route a contact to SMS or email. Drafts can be created, edited and + # kept without any check. Every send path (dashboard, API and CLI) enforces the + # same rule. + # + # **Daily ceilings apply per recipient.** Each message a broadcast sends counts + # against the channel's daily ceiling (see `POST /v1/messages`). Once the ceiling + # is reached, the remaining recipients are marked `failed` with `errorCode` + # `DAILY_LIMIT_EXCEEDED`; they are not retried the next day. # # **Review depends on the channel, and cannot be bypassed.** A draft is submitted # to automated content review here; it does not go straight out. A WhatsApp diff --git a/lib/zavudev/resources/calls.rb b/lib/zavudev/resources/calls.rb index 11bc1f8..8d2c71a 100644 --- a/lib/zavudev/resources/calls.rb +++ b/lib/zavudev/resources/calls.rb @@ -14,6 +14,15 @@ class Calls # **Requirements:** # # - The Voice Agents feature must be enabled for your team (otherwise `403`). + # - An account that has verified nothing may only call the phone numbers the + # project has verified (`403` with code `destination_not_verified`, and + # `details.verifiedNumbers` lists them), and at most 5 calls a day (`429` with + # code `daily_limit_exceeded`). A number is verified from the dashboard's + # Sandbox screen by sending the pre-filled WhatsApp message from that phone; the + # same verification covers SMS and calls. Verify your identity, add a payment + # method, settle a deposit or subscribe to call any destination. That raises the + # ceiling to 50 calls a day on Free; paid plans have no daily call ceiling. Full + # reference: https://docs.zavu.dev/concepts/sending-limits # - The sender's agent must have `voice.enabled` set to `true`. # - Not available with test-mode API keys. # diff --git a/lib/zavudev/resources/messages.rb b/lib/zavudev/resources/messages.rb index cc1dd94..c8ecf66 100644 --- a/lib/zavudev/resources/messages.rb +++ b/lib/zavudev/resources/messages.rb @@ -140,6 +140,36 @@ def react(message_id, params) # 100/day. Teams on earlier plans keep their original email quotas instead # - SMS and voice are billed per message from your balance on every plan # + # **Account verification and daily limits:** + # + # - A brand-new account can send on every channel immediately, but `sms`, + # `sms_oneway` and `voice` reach only the phone numbers the project has + # verified. Sending elsewhere returns `403` with code + # `destination_not_verified`; `details.verifiedNumbers` lists the numbers that + # are reachable. A number is verified from the dashboard's Sandbox screen: + # generate a code and send the pre-filled WhatsApp message from that phone to + # Zavu's sandbox number. One verification covers WhatsApp, SMS and calls, up to + # 5 numbers per project. To send to any destination, do any one of these: verify + # your identity, add a payment method, settle a deposit, or subscribe to a paid + # plan. Business verification (KYB) is never required to send + # - Daily ceilings apply per channel group and rise with verification. An account + # that has verified nothing: 25/day across `sms` + `sms_oneway`, 5/day for + # `voice`, 100/day across WhatsApp, Telegram, Instagram and Messenger combined. + # Past that floor: 200/day for SMS, or 10,000/day once identity or business + # verification is approved (or a higher limit agreed for your account); 50/day + # voice and 250/day conversational on Free. **Paid plans have no voice or + # conversational daily ceiling.** Over a ceiling, sends return `429` with code + # `daily_limit_exceeded` and `details.limit`; the count resets at 00:00 UTC + # - The daily ceiling never reduces the monthly allowance: 100/day on the + # conversational group still reaches the 2,000 monthly A2P messages Free + # includes + # - Email needs no account verification here: a sender with a verified domain + # sends from day one, within the plan quota (100/day and 3,000/month on Free). + # Over the daily quota it returns `429` with code `daily_limit_exceeded`. Email + # broadcasts are the exception: they need the account past the sandbox level, + # see `POST /v1/broadcasts/{broadcastId}/send` + # - Full reference: https://docs.zavu.dev/concepts/sending-limits + # # **Email recipient pre-flight:** Email messages are validated automatically # before dispatch. Sends that would be a guaranteed hard bounce are failed instead # of sent, protecting your bounce rate: the message transitions to `failed` diff --git a/rbi/zavudev/resources/broadcasts.rbi b/rbi/zavudev/resources/broadcasts.rbi index f5ab730..d073fe4 100644 --- a/rbi/zavudev/resources/broadcasts.rbi +++ b/rbi/zavudev/resources/broadcasts.rbi @@ -176,15 +176,22 @@ module Zavudev # Start sending the broadcast immediately or schedule for later. # - # **Verification is required to send, except on WhatsApp.** On every channel other - # than `whatsapp`, the team must have completed both identity verification (KYC) - # and business verification (KYB); passing one is not enough. A `whatsapp` - # broadcast requires neither: it can only be built on a template, and Meta vets - # the business and the content when it approves that template, so an unapproved - # template is refused instead. `smart` is not exempt — it can route a contact to - # SMS or email. Drafts can be created, edited and kept without any check. Every - # send path — dashboard, API and CLI alike — enforces the same rule, returning - # `403` with code `kyc_required` or `kyb_required` for whichever is outstanding. + # **The account must be past the sandbox level to send, except on WhatsApp.** An + # account that has verified nothing is refused with `403` and code `kyc_required` + # on every channel other than `whatsapp`. Any one of these lifts it: identity + # verification (KYC), a saved payment method, a settled deposit, or a paid plan. + # Business verification (KYB) is not required to broadcast; it gates 10DLC + # registration only. A `whatsapp` broadcast is exempt: it can only be built on a + # template, and Meta vets the business and the content when it approves that + # template, so an unapproved template is refused instead. `smart` is not exempt, + # since it can route a contact to SMS or email. Drafts can be created, edited and + # kept without any check. Every send path (dashboard, API and CLI) enforces the + # same rule. + # + # **Daily ceilings apply per recipient.** Each message a broadcast sends counts + # against the channel's daily ceiling (see `POST /v1/messages`). Once the ceiling + # is reached, the remaining recipients are marked `failed` with `errorCode` + # `DAILY_LIMIT_EXCEEDED`; they are not retried the next day. # # **Review depends on the channel, and cannot be bypassed.** A draft is submitted # to automated content review here; it does not go straight out. A WhatsApp diff --git a/rbi/zavudev/resources/calls.rbi b/rbi/zavudev/resources/calls.rbi index e011763..8fd778f 100644 --- a/rbi/zavudev/resources/calls.rbi +++ b/rbi/zavudev/resources/calls.rbi @@ -11,6 +11,15 @@ module Zavudev # **Requirements:** # # - The Voice Agents feature must be enabled for your team (otherwise `403`). + # - An account that has verified nothing may only call the phone numbers the + # project has verified (`403` with code `destination_not_verified`, and + # `details.verifiedNumbers` lists them), and at most 5 calls a day (`429` with + # code `daily_limit_exceeded`). A number is verified from the dashboard's + # Sandbox screen by sending the pre-filled WhatsApp message from that phone; the + # same verification covers SMS and calls. Verify your identity, add a payment + # method, settle a deposit or subscribe to call any destination. That raises the + # ceiling to 50 calls a day on Free; paid plans have no daily call ceiling. Full + # reference: https://docs.zavu.dev/concepts/sending-limits # - The sender's agent must have `voice.enabled` set to `true`. # - Not available with test-mode API keys. # diff --git a/rbi/zavudev/resources/messages.rbi b/rbi/zavudev/resources/messages.rbi index ee4f9c4..df92960 100644 --- a/rbi/zavudev/resources/messages.rbi +++ b/rbi/zavudev/resources/messages.rbi @@ -100,6 +100,36 @@ module Zavudev # 100/day. Teams on earlier plans keep their original email quotas instead # - SMS and voice are billed per message from your balance on every plan # + # **Account verification and daily limits:** + # + # - A brand-new account can send on every channel immediately, but `sms`, + # `sms_oneway` and `voice` reach only the phone numbers the project has + # verified. Sending elsewhere returns `403` with code + # `destination_not_verified`; `details.verifiedNumbers` lists the numbers that + # are reachable. A number is verified from the dashboard's Sandbox screen: + # generate a code and send the pre-filled WhatsApp message from that phone to + # Zavu's sandbox number. One verification covers WhatsApp, SMS and calls, up to + # 5 numbers per project. To send to any destination, do any one of these: verify + # your identity, add a payment method, settle a deposit, or subscribe to a paid + # plan. Business verification (KYB) is never required to send + # - Daily ceilings apply per channel group and rise with verification. An account + # that has verified nothing: 25/day across `sms` + `sms_oneway`, 5/day for + # `voice`, 100/day across WhatsApp, Telegram, Instagram and Messenger combined. + # Past that floor: 200/day for SMS, or 10,000/day once identity or business + # verification is approved (or a higher limit agreed for your account); 50/day + # voice and 250/day conversational on Free. **Paid plans have no voice or + # conversational daily ceiling.** Over a ceiling, sends return `429` with code + # `daily_limit_exceeded` and `details.limit`; the count resets at 00:00 UTC + # - The daily ceiling never reduces the monthly allowance: 100/day on the + # conversational group still reaches the 2,000 monthly A2P messages Free + # includes + # - Email needs no account verification here: a sender with a verified domain + # sends from day one, within the plan quota (100/day and 3,000/month on Free). + # Over the daily quota it returns `429` with code `daily_limit_exceeded`. Email + # broadcasts are the exception: they need the account past the sandbox level, + # see `POST /v1/broadcasts/{broadcastId}/send` + # - Full reference: https://docs.zavu.dev/concepts/sending-limits + # # **Email recipient pre-flight:** Email messages are validated automatically # before dispatch. Sends that would be a guaranteed hard bounce are failed instead # of sent, protecting your bounce rate: the message transitions to `failed` From 4770bcfeaac29d10aee8c07e912a852e20b7586c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 31 Aug 2026 15:58:55 +0000 Subject: [PATCH 16/17] feat(api): api update --- .stats.yml | 4 ++-- lib/zavudev/resources/broadcasts.rb | 14 +++++++------- lib/zavudev/resources/messages.rb | 2 +- rbi/zavudev/resources/broadcasts.rbi | 14 +++++++------- rbi/zavudev/resources/messages.rbi | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6c58be4..d9f73e8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 183 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-3c2c3dadcbcc8bb98070da5fc5d671816152c2304f02905d5eaacae39aa3093a.yml -openapi_spec_hash: ef0d31201ff8b374aefddca6a6329ab6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-fc96dae99e9649b4cfb99002b7dfee6480114b8dda4ff136541533c9c9069118.yml +openapi_spec_hash: 3c2c8da8c73cdd7e656b7f2c06cc01b4 config_hash: 261e1b852ca7f8364e4a283a3edd350a diff --git a/lib/zavudev/resources/broadcasts.rb b/lib/zavudev/resources/broadcasts.rb index 3dd43a9..d183f8c 100644 --- a/lib/zavudev/resources/broadcasts.rb +++ b/lib/zavudev/resources/broadcasts.rb @@ -255,13 +255,13 @@ def retry_review(broadcast_id, params = {}) # Start sending the broadcast immediately or schedule for later. # - # **The account must be past the sandbox level to send, except on WhatsApp.** An - # account that has verified nothing is refused with `403` and code `kyc_required` - # on every channel other than `whatsapp`. Any one of these lifts it: identity - # verification (KYC), a saved payment method, a settled deposit, or a paid plan. - # Business verification (KYB) is not required to broadcast; it gates 10DLC - # registration only. A `whatsapp` broadcast is exempt: it can only be built on a - # template, and Meta vets the business and the content when it approves that + # **The account must be past the unverified level to send, except on WhatsApp.** + # An account that has verified nothing is refused with `403` and code + # `kyc_required` on every channel other than `whatsapp`. Any one of these lifts + # it: identity verification (KYC), a saved payment method, a settled deposit, or a + # paid plan. Business verification (KYB) is not required to broadcast; it gates + # 10DLC registration only. A `whatsapp` broadcast is exempt: it can only be built + # on a template, and Meta vets the business and the content when it approves that # template, so an unapproved template is refused instead. `smart` is not exempt, # since it can route a contact to SMS or email. Drafts can be created, edited and # kept without any check. Every send path (dashboard, API and CLI) enforces the diff --git a/lib/zavudev/resources/messages.rb b/lib/zavudev/resources/messages.rb index c8ecf66..338cdec 100644 --- a/lib/zavudev/resources/messages.rb +++ b/lib/zavudev/resources/messages.rb @@ -166,7 +166,7 @@ def react(message_id, params) # - Email needs no account verification here: a sender with a verified domain # sends from day one, within the plan quota (100/day and 3,000/month on Free). # Over the daily quota it returns `429` with code `daily_limit_exceeded`. Email - # broadcasts are the exception: they need the account past the sandbox level, + # broadcasts are the exception: they need the account past the unverified level, # see `POST /v1/broadcasts/{broadcastId}/send` # - Full reference: https://docs.zavu.dev/concepts/sending-limits # diff --git a/rbi/zavudev/resources/broadcasts.rbi b/rbi/zavudev/resources/broadcasts.rbi index d073fe4..05f31ce 100644 --- a/rbi/zavudev/resources/broadcasts.rbi +++ b/rbi/zavudev/resources/broadcasts.rbi @@ -176,13 +176,13 @@ module Zavudev # Start sending the broadcast immediately or schedule for later. # - # **The account must be past the sandbox level to send, except on WhatsApp.** An - # account that has verified nothing is refused with `403` and code `kyc_required` - # on every channel other than `whatsapp`. Any one of these lifts it: identity - # verification (KYC), a saved payment method, a settled deposit, or a paid plan. - # Business verification (KYB) is not required to broadcast; it gates 10DLC - # registration only. A `whatsapp` broadcast is exempt: it can only be built on a - # template, and Meta vets the business and the content when it approves that + # **The account must be past the unverified level to send, except on WhatsApp.** + # An account that has verified nothing is refused with `403` and code + # `kyc_required` on every channel other than `whatsapp`. Any one of these lifts + # it: identity verification (KYC), a saved payment method, a settled deposit, or a + # paid plan. Business verification (KYB) is not required to broadcast; it gates + # 10DLC registration only. A `whatsapp` broadcast is exempt: it can only be built + # on a template, and Meta vets the business and the content when it approves that # template, so an unapproved template is refused instead. `smart` is not exempt, # since it can route a contact to SMS or email. Drafts can be created, edited and # kept without any check. Every send path (dashboard, API and CLI) enforces the diff --git a/rbi/zavudev/resources/messages.rbi b/rbi/zavudev/resources/messages.rbi index df92960..8677127 100644 --- a/rbi/zavudev/resources/messages.rbi +++ b/rbi/zavudev/resources/messages.rbi @@ -126,7 +126,7 @@ module Zavudev # - Email needs no account verification here: a sender with a verified domain # sends from day one, within the plan quota (100/day and 3,000/month on Free). # Over the daily quota it returns `429` with code `daily_limit_exceeded`. Email - # broadcasts are the exception: they need the account past the sandbox level, + # broadcasts are the exception: they need the account past the unverified level, # see `POST /v1/broadcasts/{broadcastId}/send` # - Full reference: https://docs.zavu.dev/concepts/sending-limits # From cd97d57b5e41f01ae82831146d45f4c91784e5bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 31 Aug 2026 15:59:24 +0000 Subject: [PATCH 17/17] release: 0.21.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/zavudev/version.rb | 2 +- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0c2ecec..86b0e83 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.20.0" + ".": "0.21.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6151f15..864a332 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.21.0 (2026-08-31) + +Full Changelog: [v0.20.0...v0.21.0](https://github.com/zavudev/sdk-ruby/compare/v0.20.0...v0.21.0) + +### Features + +* **api:** api update ([4770bcf](https://github.com/zavudev/sdk-ruby/commit/4770bcfeaac29d10aee8c07e912a852e20b7586c)) +* **api:** api update ([4dd9bd1](https://github.com/zavudev/sdk-ruby/commit/4dd9bd16d0984ca18b228ad0e857db573a5cd444)) +* **api:** api update ([c22d5f2](https://github.com/zavudev/sdk-ruby/commit/c22d5f2e1830e823b653b8ff46eb4abb4021832f)) +* **api:** api update ([7dd2286](https://github.com/zavudev/sdk-ruby/commit/7dd2286c0d534729ba105579ccfa2910368de335)) +* **api:** api update ([0a81358](https://github.com/zavudev/sdk-ruby/commit/0a813584f16f93728514cab57cd3c1e814f45044)) +* **api:** api update ([8f1f608](https://github.com/zavudev/sdk-ruby/commit/8f1f6083aff8b3568b7b7841f496e6dcd7076475)) +* **api:** api update ([c919d2a](https://github.com/zavudev/sdk-ruby/commit/c919d2a0db7c65ce8e53dfa329b42111e0afa123)) +* **api:** manual updates ([83ed616](https://github.com/zavudev/sdk-ruby/commit/83ed616d532968a4b64a248b6efeb870c383c417)) + ## 0.20.0 (2026-08-11) Full Changelog: [v0.19.0...v0.20.0](https://github.com/zavudev/sdk-ruby/compare/v0.19.0...v0.20.0) diff --git a/Gemfile.lock b/Gemfile.lock index 8de1051..3b487f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - zavudev (0.20.0) + zavudev (0.21.0) cgi connection_pool diff --git a/README.md b/README.md index 0e7adc4..7db178a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "zavudev", "~> 0.20.0" +gem "zavudev", "~> 0.21.0" ``` diff --git a/lib/zavudev/version.rb b/lib/zavudev/version.rb index bbd174b..ae50b9c 100644 --- a/lib/zavudev/version.rb +++ b/lib/zavudev/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Zavudev - VERSION = "0.20.0" + VERSION = "0.21.0" end