NAME

JMAP::Tester::Response - what you get in reply to a succesful JMAP request

VERSION

version 0.007

OVERVIEW

A JMAP::Tester::Response object represents the successful response to a JMAP call. It is a successful JMAP::Tester::Result.

A Response is used mostly to contain the responses to the individual methods passed in the request.

METHODS

sentence

my $sentence = $response->sentence($n);

This method returns the nth Sentence of the response.

single_sentence

my $sentence = $response->single_sentence;
my $sentence = $response->single_sentence($name);

This method returns the only Sentence of the response, raising an exception if there's more than one Sentence. If $name is given, an exception is raised if the Sentence's name doesn't match the given name.

paragraph

my $para = $response->paragraph($n);

This method returns the nth Paragraph of the response.

assert_n_paragraphs

my ($p1, $p2, ...) = $response->assert_n_paragraphs($n);

This method returns all the paragraphs in the response, as long as there are exactly $n. Otherwise, it throws an exception.

paragraph_by_client_id

my $para = $response->paragraph_by_client_id($cid);

This returns the paragraph for the given client id. If there is no paragraph for that client id, an empty list is returned.

as_struct

as_stripped_struct

This method returns an arrayref of arrayrefs, holding the data returned by the JMAP server. With as_struct, some of the JSON data may be in objects provided by JSON::Typist. If you'd prefer raw data, use the as_stripped_struct form.

as_pairs

as_stripped_pairs

These methods do the same thing as as_struct and <as_stripped_struct>, but omit client ids.

AUTHOR

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by FastMail, Ltd.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.