| 1 | package WebService::MyGengo::LanguagePair; | ||
| 2 | |||
| 3 | use Moose; | ||
| 4 | use namespace::autoclean; | ||
| 5 | |||
| 6 | BEGIN { extends 'WebService::MyGengo::Base' }; | ||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | WebService::MyGengo::LanguagePair - An object representing a Src -> Dst translation language pair in the myGengo system | ||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | my $pairs = $client->get_service_language_pairs( 'en' ); | ||
| 15 | printf("Hey, I can translate from %s to %s\n", $_->lc_src, $_->lc_tgt) | ||
| 16 | foreach @$pairs; | ||
| 17 | |||
| 18 | =head1 ATTRIBUTES | ||
| 19 | |||
| 20 | =head2 lc_src (Str) | ||
| 21 | |||
| 22 | The 2-character ISO code for the source language. | ||
| 23 | |||
| 24 | =cut | ||
| 25 | has 'lc_src' => ( | ||
| 26 | is => 'ro' | ||
| 27 | , isa => 'WebService::MyGengo::LanguageCode' | ||
| 28 | , required => 1 | ||
| 29 | ); | ||
| 30 | |||
| 31 | =head2 lc_tgt (Str) | ||
| 32 | |||
| 33 | The 2-character ISO code for the target language. | ||
| 34 | |||
| 35 | =cut | ||
| 36 | has 'lc_tgt' => ( | ||
| 37 | is => 'ro' | ||
| 38 | , isa => 'WebService::MyGengo::LanguageCode' | ||
| 39 | , required => 1 | ||
| 40 | ); | ||
| 41 | |||
| 42 | =head2 tier (Str) | ||
| 43 | |||
| 44 | The tier of service for this translation. | ||
| 45 | |||
| 46 | Legal values are: machine, standard, pro, ultra, ultra_pro | ||
| 47 | |||
| 48 | =cut | ||
| 49 | has 'tier' => ( | ||
| 50 | is => 'ro' | ||
| 51 | , isa => 'WebService::MyGengo::Tier' | ||
| 52 | , required => 1 | ||
| 53 | ); | ||
| 54 | |||
| 55 | =head2 unit_price (Num) | ||
| 56 | |||
| 57 | A decimal figure representing the per-unit translation price, in USD. | ||
| 58 | |||
| 59 | =cut | ||
| 60 | has 'unit_price' => ( | ||
| 61 | is => 'ro' | ||
| 62 | , isa => 'WebService::MyGengo::Num' | ||
| 63 | , required => 1 | ||
| 64 | ); | ||
| 65 | |||
| 66 | |||
| 67 | __PACKAGE__->meta->make_immutable(); | ||
| 68 | 1; | ||
| 69 | |||
| 70 | #=head2 TODO | ||
| 71 | # | ||
| 72 | # * Provide accessors to retrieve L<WebService::MyGengo::Language> objects for each of the languages | ||
| 73 | # | ||
| 74 | =head2 SEE ALSO | ||
| 75 | |||
| 76 | L<http://mygengo.com/api/developer-docs/methods/translate-service-language-pairs-get/> | ||
| 77 | |||
| 78 | =head1 AUTHOR | ||
| 79 | |||
| 80 | Nathaniel Heinrichs | ||
| 81 | |||
| 82 | =head1 LICENSE | ||
| 83 | |||
| 84 | Copyright (c) 2011, Nathaniel Heinrichs <nheinric-at-cpan.org>. | ||
| 85 | All rights reserved. | ||
| 86 | |||
| 87 | This library is free software. You can redistribute it and/or modify | ||
| 88 | it under the same terms as Perl itself. | ||
| 89 | |||
| 90 | =cut |