| 1 | package Yahoo::Marketing::VaultService; | ||
| 2 | # Copyright (c) 2009 Yahoo! Inc. All rights reserved. | ||
| 3 | # The copyrights to the contents of this file are licensed under the Perl Artistic License (ver. 15 Aug 1997) | ||
| 4 | |||
| 5 | 1 | ▶ | use strict; use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | ▶ | use base qw/Yahoo::Marketing::Service/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | use YAML qw/LoadFile/; | ||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | Yahoo::Marketing::VaultService - an object that provides access to Yahoo Marketing's Vault SOAP Service. | ||
| 14 | |||
| 15 | =cut | ||
| 16 | |||
| 17 | =head1 SYNOPSIS | ||
| 18 | |||
| 19 | See EWS documentation online for available SOAP methods: | ||
| 20 | |||
| 21 | L<http://searchmarketing.yahoo.com/developer/docs/V7/reference/services/VaultService.php> | ||
| 22 | |||
| 23 | Also see perldoc Yahoo::Marketing::Service for functionality common to all service modules. | ||
| 24 | |||
| 25 | |||
| 26 | |||
| 27 | =head2 new | ||
| 28 | |||
| 29 | Creates a new instance | ||
| 30 | |||
| 31 | =cut | ||
| 32 | |||
| 33 | =head2 use_location_service | ||
| 34 | |||
| 35 | Overrides get/set method to always return 0. I.E. never use LocationService for VaultService calls | ||
| 36 | |||
| 37 | =cut | ||
| 38 | |||
| 39 | sub use_location_service { | ||
| 40 | return 0; | ||
| 41 | } | ||
| 42 | |||
| 43 | =head2 parse_config | ||
| 44 | |||
| 45 | set endpoint to vault_endpoint from config, if it exists | ||
| 46 | |||
| 47 | =cut | ||
| 48 | |||
| 49 | sub parse_config { | ||
| 50 | my ( $self, %args ) = @_; | ||
| 51 | |||
| 52 | $self->SUPER::parse_config( %args ); | ||
| 53 | |||
| 54 | $args{ path } = 'yahoo-marketing.yml' unless defined $args{ path }; | ||
| 55 | $args{ section } = 'default' unless defined $args{ section }; | ||
| 56 | |||
| 57 | my $config = LoadFile( $args{ path } ); | ||
| 58 | |||
| 59 | my $vault_endpoint = $config->{ $args{ 'section' } }->{ vault_endpoint }; | ||
| 60 | |||
| 61 | $self->endpoint( $vault_endpoint ) if defined $vault_endpoint; | ||
| 62 | } | ||
| 63 | |||
| 64 | |||
| 65 | 1; | ||