Class: Zavudev::Resources::Invitations
- Inherits:
-
Object
- Object
- Zavudev::Resources::Invitations
- Defined in:
- lib/zavudev/resources/invitations.rb,
sig/zavudev/resources/invitations.rbs
Instance Method Summary collapse
-
#cancel(invitation_id, request_options: {}) ⇒ Zavudev::Models::InvitationCancelResponse
Cancel an active invitation.
-
#create(allowed_phone_countries: nil, client_email: nil, client_name: nil, client_phone: nil, connection_type: nil, expires_in_days: nil, phone_number_id: nil, request_options: {}) ⇒ Zavudev::Models::InvitationCreateResponse
Some parameter documentations has been truncated, see Models::InvitationCreateParams for more details.
-
#initialize(client:) ⇒ Invitations
constructor
private
A new instance of Invitations.
-
#list(cursor: nil, limit: nil, status: nil, request_options: {}) ⇒ Zavudev::Internal::Cursor<Zavudev::Models::Invitation>
Some parameter documentations has been truncated, see Models::InvitationListParams for more details.
-
#retrieve(invitation_id, request_options: {}) ⇒ Zavudev::Models::InvitationRetrieveResponse
Get invitation.
Constructor Details
#initialize(client:) ⇒ Invitations
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Invitations.
130 131 132 |
# File 'lib/zavudev/resources/invitations.rb', line 130 def initialize(client:) @client = client end |
Instance Method Details
#cancel(invitation_id, request_options: {}) ⇒ Zavudev::Models::InvitationCancelResponse
Cancel an active invitation. The client will no longer be able to use the invitation link.
118 119 120 121 122 123 124 125 |
# File 'lib/zavudev/resources/invitations.rb', line 118 def cancel(invitation_id, params = {}) @client.request( method: :post, path: ["v1/invitations/%1$s/cancel", invitation_id], model: Zavudev::Models::InvitationCancelResponse, options: params[:request_options] ) end |
#create(allowed_phone_countries: nil, client_email: nil, client_name: nil, client_phone: nil, connection_type: nil, expires_in_days: nil, phone_number_id: nil, request_options: {}) ⇒ Zavudev::Models::InvitationCreateResponse
Some parameter documentations has been truncated, see Models::InvitationCreateParams for more details.
Create a partner invitation link for a client to connect a Meta channel. The
client opens the returned url and authorizes with Meta; the resulting sender
is created in your project when they finish, and the invitation transitions to
completed.
connectionType picks the channel:
whatsapp_waba(default): Meta's embedded signup links an official WhatsApp Business Account.messenger: the client picks a Facebook Page they administer; its Messenger inbox (including Marketplace chats) is routed to Zavu.
One invitation connects one channel — create one per channel to onboard a client
on several. phoneNumberId and allowedPhoneCountries apply to whatsapp_waba
only.
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/zavudev/resources/invitations.rb', line 46 def create(params = {}) parsed, = Zavudev::InvitationCreateParams.dump_request(params) @client.request( method: :post, path: "v1/invitations", body: parsed, model: Zavudev::Models::InvitationCreateResponse, options: ) end |
#list(cursor: nil, limit: nil, status: nil, request_options: {}) ⇒ Zavudev::Internal::Cursor<Zavudev::Models::Invitation>
Some parameter documentations has been truncated, see Models::InvitationListParams for more details.
List partner invitations for this project.
94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/zavudev/resources/invitations.rb', line 94 def list(params = {}) parsed, = Zavudev::InvitationListParams.dump_request(params) query = Zavudev::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v1/invitations", query: query, page: Zavudev::Internal::Cursor, model: Zavudev::Invitation, options: ) end |
#retrieve(invitation_id, request_options: {}) ⇒ Zavudev::Models::InvitationRetrieveResponse
Get invitation
67 68 69 70 71 72 73 74 |
# File 'lib/zavudev/resources/invitations.rb', line 67 def retrieve(invitation_id, params = {}) @client.request( method: :get, path: ["v1/invitations/%1$s", invitation_id], model: Zavudev::Models::InvitationRetrieveResponse, options: params[:request_options] ) end |