Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision eca75f82

Von Jan Büren vor etwa 1 Jahr hinzugefügt

  • ID eca75f821b11f1fdb3b21e43c50c3216702b79b3
  • Vorgänger 4ad6c50e
  • Nachfolger f4a87e7a

kix18: Neue Methode get_ticket

Unterschiede anzeigen:

SL/KIX18Client.pm
return $params{article}{TicketID};
}
sub get_ticket {
my ($self) = shift;
die "Invalid connection state" unless $self->connector->can('GET');
validate(
@_, {
ticket_id => 1,
}
);
my %params = @_;
my $ret = _decode_and_status_code($self->connector->GET("tickets/$params{ticket_id}"));
return $ret;
}
sub create_ticket {
my ($self) = shift;
die "Invalid connection state" unless $self->connector->can('POST');
......
Body => 1,
Channel => { type => SCALAR, default => 'note' },
Charset => { type => SCALAR, default => 'utf-8' },
MimeType => { type => SCALAR, default => 'text/plain', },
ContentType => { type => SCALAR, default => 'text/plain; charset=utf-8' },
MimeType => { type => SCALAR, default => 'text/html', },
ContentType => { type => SCALAR, default => 'text/html; charset=utf-8' },
TicketID => { callbacks => {
'is an integer' => sub {
......
# therefore the defaults need to be defined again:
$params{Channel} //= 'note';
$params{Charset} //= 'utf-8';
$params{MimeType} //= 'text/plain';
$params{ContentType} //= 'text/plain; charset=utf-8';
$params{MimeType} //= 'text/html';
$params{ContentType} //= 'text/html; charset=utf-8';
my %a_params = ();
foreach (keys %params) {
......
my ($ret) = @_;
die t8("Unsuccessful HTTP return code: #1 Details: #2", $ret->responseCode(), $ret->responseContent())
unless $ret->responseCode() == 201;
unless $ret->responseCode() == 201 || $ret->responseCode() == 200;
try {
return decode_json($ret->responseContent());
......
=over 4
=item C<get_ticket $ticket_id>
Gets the specific ticket with $ticket_id and returns all standard ticket data
as a nested hash structure.
=item C<create_ticket $Title>
Creates a Ticket with the named param Title. Returns the ID of the created Ticket.

Auch abrufbar als: Unified diff