Net-Async-Slack

 view release on metacpan or  search on metacpan

lib/Net/Async/Slack/Commands.pm  view on Meta::CPAN

Takes the following named parameters:

=over 4

=item * C<external_unique_id> - An ID supplied by the 3rd-party Call provider. It must be unique across all Calls from that service. (string, required)

=item * C<external_display_id> - An optional, human-readable ID supplied by the 3rd-party Call provider. If supplied, this ID will be displayed in the Call object. (string, optional)

=item * C<join_url> - The URL required for a client to join the Call. (string, required)

=item * C<desktop_app_join_url> - When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL. (string, optional)

=item * C<date_start> - Call start time in UTC UNIX timestamp format (integer, optional)

=item * C<title> - The name of the Call. (string, optional)

=item * C<created_by> - The valid Slack user ID of the user who created this Call. When this method is called with a user token, the `created_by` field is optional and defaults to the authed user of the token. Otherwise, the field is required. (strin...

=item * C<users> - The list of users to register as participants in the Call. [Read more on how to specify users here](/apis/calls#users). (string, optional)

=back

lib/Net/Async/Slack/Commands.pm  view on Meta::CPAN

Resolves to a structure representing the response.

=cut

async sub calls_add {
    my ($self, %args) = @_;
    my $uri = $self->endpoint(
        'calls_add',
    );
    my $content = encode_json_utf8({
        %args{grep { exists $args{$_} } qw(external_unique_id external_display_id join_url desktop_app_join_url date_start title created_by users)}
    });
    my ($res) = await $self->http_post(
        $uri,
        $content,
        content_type => 'application/json; charset=utf-8',
    );
    die $res unless $res->{ok};
    return $res;
}

lib/Net/Async/Slack/Commands.pm  view on Meta::CPAN

Takes the following named parameters:

=over 4

=item * C<id> - `id` returned by the [`calls.add`](/methods/calls.add) method. (string, required)

=item * C<title> - The name of the Call. (string, optional)

=item * C<join_url> - The URL required for a client to join the Call. (string, optional)

=item * C<desktop_app_join_url> - When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL. (string, optional)

=back

Resolves to a structure representing the response.

=cut

async sub calls_update {
    my ($self, %args) = @_;
    my $uri = $self->endpoint(
        'calls_update',
    );
    my $content = encode_json_utf8({
        %args{grep { exists $args{$_} } qw(id title join_url desktop_app_join_url)}
    });
    my ($res) = await $self->http_post(
        $uri,
        $content,
        content_type => 'application/json; charset=utf-8',
    );
    die $res unless $res->{ok};
    return $res;
}



( run in 0.273 second using v1.01-cache-2.11-cpan-299005ec8e3 )