NAME

WWW::SFDC::Metadata - Interface to the Salesforce.com Metadata API

VERSION

version 0.37

SYNOPSIS

 my $client = WWW::SFDC->new(
   username => 'foo',
   password => 'bar',
   url => 'https://login.salesforce.com'
 )->Metadata;

 my $manifest = $client->listMetadata(
   {type => "CustomObject"},
   {type => "Report", folder => "FooReports"}
 );

 my $base64zipstring = $client->retrieveMetadata(
   $manifest
 );

 $client->deployMetadata(
   $base64zipstring,
   {checkOnly => 'true'}
 );

For more in-depth examples, see t/WWW/SFDC/Metadata.t

METHODS

listMetadata(@queries)

Accepts a list of types and folders, such as

$session->Metadata->listMetadata( {type => "CustomObject"}, {type => "Report", folder => "FooReports"} );

and generates a list of file names suitable for turning into a WWW::SFDC::Manifest.

retrieveMetadata($manifest)

Sets up a retrieval from then checks it until done. Returns the same data as checkRetrieval. Requires a manifest of the form:

 my $manifest = {
   "ApexClass" => ["MyApexClass"],
   "CustomObject" => ["*", "Account", "User", 'Opportunity"],
   "Profile" => ["*"]
  };

This method handles starting the retrieval, and polls until it completes, then returns the a string which is the base64 encoded .zip file containing the data.

deployMetadata $zipString, \%deployOptions

Takes a base64 zip file and deploys it. Deploy options will be passed verbatim into the request; see the metadata developer guide for a description.

Returns a WWW::SFDC::Metadata::DeployResult containing the result of the operation. You must manually check whether this succeeded!

deployRecentValidation $id

Calls deployRecentValidation with your successfully-validated deployment.

describeMetadata

Returns a describeMetadataResult hashref as specified by Salesforce.com. WWW::SFDC::Constants consumes this object to provide utility methods.

BUGS

Please report any bugs or feature requests at https://github.com/sophos/WWW-SFDC/issues.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc WWW::SFDC::Metadata

You can also look for information at https://github.com/sophos/WWW-SFDC

AUTHOR

Alexander Brett <alexander.brett@sophos.com> http://alexander-brett.co.uk

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Sophos Limited https://www.sophos.com/.

This is free software, licensed under:

  The MIT (X11) License

The full text of the license can be found in the LICENSE file included with this distribution.