File Coverage

blib/lib/WWW/TypePad/Relationships.pm
Criterion Covered Total %
statement 15 34 44.1
branch n/a
condition n/a
subroutine 5 10 50.0
pod 4 5 80.0
total 24 49 48.9


line stmt bran cond sub pod time code
1             package WWW::TypePad::Relationships;
2              
3 1     1   6 use strict;
  1         7  
  1         732  
4 1     1   7 use warnings;
  1         2  
  1         58  
5              
6             # Install an accessor into WWW::TypePad to access an instance of this class
7             # bound to the WWW::TypePad instance.
8 0     0 0   sub WWW::TypePad::relationships { __PACKAGE__->new( base => $_[0] ) }
9              
10             ### BEGIN auto-generated
11             ### This is an automatically generated code, do not edit!
12             ### Scroll down to look for END to add additional methods
13              
14             =pod
15              
16             =head1 NAME
17              
18             WWW::TypePad::Relationships - Relationships API methods
19              
20             =head1 METHODS
21              
22             =cut
23              
24 1     1   6 use strict;
  1         2  
  1         24  
25 1     1   6 use Any::Moose;
  1         1  
  1         10  
26             extends 'WWW::TypePad::Noun';
27              
28 1     1   1273 use Carp ();
  1         3  
  1         298  
29              
30              
31             =pod
32              
33             =over 4
34              
35              
36             =item get
37              
38             my $res = $tp->relationships->get($id);
39              
40             Get basic information about the selected relationship.
41              
42             Returns Relationship which contains following properties.
43              
44             =over 8
45              
46             =item id
47              
48             (string) A URI that serves as a globally unique identifier for the relationship.
49              
50             =item urlId
51              
52             (string) A string containing the canonical identifier that can be used to identify this object in URLs. This can be used to recognise where the same relationship is returned in response to different requests, and as a mapping key for an application's local data store.
53              
54             =item source
55              
56             (Entity) The source entity of the relationship.
57              
58             =item target
59              
60             (Entity) The target entity of the relationship.
61              
62             =item status
63              
64             (RelationshipStatus) An object describing all the types of relationship that currently exist between the source and target objects.
65              
66             =item created
67              
68             (mapEdatetimeE) A mapping of the relationship types present between the source and target objects to the times those types of relationship were established. The keys of the map are the relationship type URIs present in the relationship's MEstatusE property; the values are W3CDTF timestamps for the times those relationship edges were created.
69              
70              
71             =back
72              
73             =cut
74              
75             sub get {
76 0     0 1   my $api = shift;
77 0           my @args;
78 0           push @args, shift; # id
79 0           my $uri = sprintf '/relationships/%s.json', @args;
80 0           $api->base->call("GET", $uri, @_);
81             }
82              
83              
84             =pod
85              
86              
87              
88             =item get_status
89              
90             my $res = $tp->relationships->get_status($id);
91              
92             Get the status information for the selected relationship, including its types.
93              
94             Returns RelationshipStatus which contains following properties.
95              
96             =over 8
97              
98             =item types
99              
100             (arrayEstringE) A list of relationship type URIs describing the types of the related relationship.
101              
102              
103             =back
104              
105             =cut
106              
107             sub get_status {
108 0     0 1   my $api = shift;
109 0           my @args;
110 0           push @args, shift; # id
111 0           my $uri = sprintf '/relationships/%s/status.json', @args;
112 0           $api->base->call("GET", $uri, @_);
113             }
114              
115              
116             sub status {
117 0     0 1   my $self = shift;
118 0           Carp::carp("'status' is deprecated. Use 'get_status' instead.");
119 0           $self->get_status(@_);
120             }
121              
122             =pod
123              
124              
125              
126             =item put_status
127              
128             my $res = $tp->relationships->put_status($id);
129              
130             Change the status information for the selected relationship, including its types.
131              
132             Returns RelationshipStatus which contains following properties.
133              
134             =over 8
135              
136             =item types
137              
138             (arrayEstringE) A list of relationship type URIs describing the types of the related relationship.
139              
140              
141             =back
142              
143             =cut
144              
145             sub put_status {
146 0     0 1   my $api = shift;
147 0           my @args;
148 0           push @args, shift; # id
149 0           my $uri = sprintf '/relationships/%s/status.json', @args;
150 0           $api->base->call("PUT", $uri, @_);
151             }
152              
153              
154             =pod
155              
156             =back
157              
158             =cut
159              
160             ### END auto-generated
161              
162             1;