————# Licensed under the Upwork's API Terms of Use;
# you may not use this file except in compliance with the Terms.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author:: Maksym Novozhylov (mnovozhilov@upwork.com)
# Copyright:: Copyright 2015(c) Upwork.com
# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
package
Net::Upwork::API::Routers::Workdays;
use
strict;
use
warnings;
=pod
=head1 NAME
Auth
=head1 FUNCTIONS
=over 4
=item new($api)
Create a new object for accessing Auth API
B<Parameters>
$api
API object
=cut
sub
new {
my
(
$class
,
$api
) =
@_
;
return
Net::Upwork::API::init_router(
$class
,
$api
, ENTRY_POINT);
}
=item get_by_company
Get Workdays by Company
B<Parameters>
$company
Company ID
$from_date
Start date
$till_date
End date
$params
Hash of parameters
B<Return value>
JSON response as a string
=cut
sub
get_by_company {
my
$self
=
shift
;
my
$company
=
shift
;
my
$from_date
=
shift
;
my
$till_date
=
shift
;
my
%params
=
@_
;
return
$self
->client()->get(
"/team/v2/workdays/companies/"
.
$company
.
"/"
.
$from_date
.
","
.
$till_date
,
%params
);
}
=item get_by_contract
Get Workdays by Contract
B<Parameters>
$contract
Contract ID
$from_date
Start date
$till_date
End date
$params
Hash of parameters
B<Return value>
JSON response as a string
=cut
sub
get_by_contract {
my
$self
=
shift
;
my
$contract
=
shift
;
my
$from_date
=
shift
;
my
$till_date
=
shift
;
my
%params
=
@_
;
return
$self
->client()->get(
"/team/v2/workdays/contracts/"
.
$contract
.
"/"
.
$from_date
.
","
.
$till_date
,
%params
);
}
=back
=head1 AUTHOR
Maksym Novozhylov C<< <mnovozhilov@upwork.com> >>
=head1 COPYRIGHT
Copyright E<copy> Upwork Global Corp., 2015
=cut
1;