The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WWW::Google::C2DM::Response - Response Object

SYNOPSIS

  my $res = WWW::Google::C2DM::Response->new(
      is_success    => 1,
      code          => 200,
      message       => 'OK',
      http_response => $http_response_object,
      params        => { ... },
  );

DESCRIPTION

WWW::Google::C2DM::Response is a WWW::Google::C2DM internal class.

METHODS

new(%args)

Creates a new instance.

is_success()

  $res->is_success ? 1 : 0;

is_error()

  $res->is_error ? 1 : 0;

has_error()

Alias of is_error().

code()

HTTP Response code.

  say $res->code;

message()

HTTP Response message.

  say $res->message;

status_line()

Return value is a string that contains the code() and message().

  say $res->status_line; # eq say $res->code, ' ', $res->message;

http_response()

Original HTTP Response object.

  my $http_response = $res->http_response;
  say $http_response->as_string;

res()

Alias of http_response().

error_code()

C2DM error code. SEE ALSO http://code.google.com/intl/ja/android/c2dm/#push

  use WWW::Google::C2DM::Constants qw(:error_code);
  if ($res->error_code eq QuotaExceeded) {
     ...
  }

id()

Response id parameter.

  say $res->id;

params()

Response parameters in HASHREF.

  say $res->params->{id};

AUTHOR

xaicron <xaicron@cpan.org>

COPYRIGHT

Copyright 2011 - xaicron

LICENSE

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

SEE ALSO