line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## Stripe API - ~/lib/Net/API/Stripe/Order/SKU/Inventory.pm |
3
|
|
|
|
|
|
|
## Version v0.100.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2019 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <@sitael.tokyo.deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2019/11/02 |
7
|
|
|
|
|
|
|
## Modified 2020/05/15 |
8
|
|
|
|
|
|
|
## |
9
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
package Net::API::Stripe::Order::SKU::Inventory; |
11
|
|
|
|
|
|
|
BEGIN |
12
|
|
|
|
|
|
|
{ |
13
|
1
|
|
|
1
|
|
849
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
14
|
1
|
|
|
1
|
|
5
|
use parent qw( Net::API::Stripe::Generic ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
15
|
1
|
|
|
1
|
|
132
|
our( $VERSION ) = 'v0.100.0'; |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
0
|
1
|
|
sub quantity { shift->_set_get_scalar( 'quantity', @_ ); } |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
1
|
|
sub type { shift->_set_get_scalar( 'type', @_ ); } |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
0
|
1
|
|
sub value { shift->_set_get_scalar( 'value', @_ ); } |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=encoding utf8 |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Net::API::Stripe::Order::SKU::Inventory - A Stripe SKU Inventory Object |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $inv = $stripe->sku->inventory({ |
37
|
|
|
|
|
|
|
quantity => 2, |
38
|
|
|
|
|
|
|
type => 'infinite', |
39
|
|
|
|
|
|
|
value => undef, |
40
|
|
|
|
|
|
|
}); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 VERSION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
v0.100.0 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 DESCRIPTION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Description of the SKUâs inventory. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
This is instantiated by method B<inventory> in module L<Net::API::Stripe::Order::SKU> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=over 4 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=item B<new>( %ARG ) |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Creates a new L<Net::API::Stripe::Order::SKU::Inventory> object. |
59
|
|
|
|
|
|
|
It may also take an hash like arguments, that also are method of the same name. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=back |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 METHODS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=over 4 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item B<quantity> positive integer or zero |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
The count of inventory available. Will be present if and only if type is finite. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item B<type> string |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Inventory type. Possible values are finite, bucket (not quantified), and infinite. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item B<value> string |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
An indicator of the inventory available. Possible values are in_stock, limited, and out_of_stock. Will be present if and only if type is bucket. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=back |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 API SAMPLE |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
{ |
84
|
|
|
|
|
|
|
"id": "sku_fake123456789", |
85
|
|
|
|
|
|
|
"object": "sku", |
86
|
|
|
|
|
|
|
"active": true, |
87
|
|
|
|
|
|
|
"attributes": { |
88
|
|
|
|
|
|
|
"size": "Medium", |
89
|
|
|
|
|
|
|
"gender": "Unisex" |
90
|
|
|
|
|
|
|
}, |
91
|
|
|
|
|
|
|
"created": 1571480453, |
92
|
|
|
|
|
|
|
"currency": "jpy", |
93
|
|
|
|
|
|
|
"image": null, |
94
|
|
|
|
|
|
|
"inventory": { |
95
|
|
|
|
|
|
|
"quantity": 50, |
96
|
|
|
|
|
|
|
"type": "finite", |
97
|
|
|
|
|
|
|
"value": null |
98
|
|
|
|
|
|
|
}, |
99
|
|
|
|
|
|
|
"livemode": false, |
100
|
|
|
|
|
|
|
"metadata": {}, |
101
|
|
|
|
|
|
|
"package_dimensions": null, |
102
|
|
|
|
|
|
|
"price": 1500, |
103
|
|
|
|
|
|
|
"product": "prod_fake123456789", |
104
|
|
|
|
|
|
|
"updated": 1571480453 |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 HISTORY |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head2 v0.1 |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Initial version |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 AUTHOR |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 SEE ALSO |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
Stripe API documentation: |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
L<https://stripe.com/docs/api> |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Copyright (c) 2019-2020 DEGUEST Pte. Ltd. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
128
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=cut |
131
|
|
|
|
|
|
|
|