diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3017fbc1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ + +rolluptool/.project + +rolluptool/.settings/com.salesforce.ide.core.prefs + +rolluptool/salesforce.schema + +rolluptool/Referenced Packages/ + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..9e968fc6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: java +sudo: false +branches: + only: + - master +env: + global: + - secure: "OmrJ9gTiMzTIWzO2X3vGIx1Yp7HnDY1SBsKChBcYhtb0G6XVlpit0GnkbSozEwnInATwC2XjrIwpliUJNizWuYhpwoH9r/iCVU7qG4MCYEVtFaDQmnPXeTvSOs5peC5tor0r6UkjiHIUF4WorFNidGXqXrCxGciF8RyV76ouuew=" + - secure: "B6Uu3RCXUcXmQEedqGoYDVhmw5x8glATC7aquVSg/zbVOqc2W118Rhu0a0NK3DHLmtwlx8lyj3bGCph3LAJ1raQ0wyb7X5nsC/v1T1Z4gRo8nLjD1aYZiot2l7iwOSK6YN0mYwvIxjGo29AUL+wQXPxw2lj/MhO+LuIGh6bBliQ=" +script: + - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ant -lib lib/ant-salesforce.jar -Dsf.username=${SFUSER} -Dsf.password=${SFPWD} deployRunAllTests || [ "${TRAVIS_PULL_REQUEST}" != "false" ]' + - '[ "${TRAVIS_PULL_REQUEST}" != "false" ] && ant -lib lib/ant-salesforce.jar -Dsf.username=${SFUSER} -Dsf.password=${SFPWD} validateAllTests || [ "${TRAVIS_PULL_REQUEST}" = "false" ]' diff --git a/README.markdown b/README.markdown index 859c99b2..b1864e83 100644 --- a/README.markdown +++ b/README.markdown @@ -1,6 +1,8 @@ Declarative Rollups for Lookups! ================================ +[![Build Status](https://travis-ci.org/afawcett/declarative-lookup-rollup-summaries.svg)](https://travis-ci.org/afawcett/declarative-lookup-rollup-summaries) + Features Summary ---------------- @@ -9,15 +11,26 @@ Features Summary - Define filter criteria on rollups for example Rollup Amount on Opportunity onto Account for Closed Won - Supports Realtime, Scheduled and Developer API modes - Open source, available in code and managed package form. -- Managed package has passed Salesforce Security Review and is Aloha enabled (does not consume app, tab limits) +- Managed package has passed [Salesforce Security Review and is Aloha enabled](https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B45gWEAR) (does not consume app, tab limits) +- **NEW** Supports Custom Metadata, rollups can be included in Change Sets and Packages for easier deployment Please refer to the blog posts below for more detailed information. +Community +--------- + +This is a community driven tool, please help support it, share your experiences in this [Chatter group](https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000009O5p). + Documentation ------------- -The tool has been feature in a number of blog entries as it has evolved... +The tool has been featured in a number of blog entries as it has evolved... +- [Declarative Rollup Tool Summer (2016) Release](https://andyinthecloud.com/2016/06/19/declarative-rollup-tool-summer-release/) +- [Rollups and Cross Object Formula Fields](http://andyinthecloud.com/2016/02/13/rollups-and-cross-object-formula-fields/) +- [Packaging and Installing Rollups](https://andyinthecloud.com/2016/01/24/packaging-and-installing-rollups/) +- [Declarative Lookup Rollup Summary Tool and Custom Metadata](http://andyinthecloud.com/2015/12/24/declarative-lookup-rollup-summary-tool-and-custom-metadata/) +- [Declarative Lookup Rollup Summaries – Spring’15 Release](http://andyinthecloud.com/2015/02/16/declarative-lookup-rollup-summaries-tool-dlrs-spring15-release/) - [A Declarative Rollup Summary Tool for Force.com Lookup Relationships](https://developer.salesforce.com/page/Declarative_Rollup_Summary_Tool_for_Force.com_Lookup_Relationships) - [Account Hierarchy Rollups #ClicksNotCode](http://andyinthecloud.com/2014/05/08/account-hierarchy-rollups-clicksnotcode/) - [New Release: Declarative Rollup Summary Tool Community Powered!](http://andyinthecloud.com/2014/04/09/new-declarative-rollup-tool-release-community-powered/) @@ -38,12 +51,14 @@ Implementation Considerations Usage Information and Known Issues ---------------------------------- -- This tool uses [SOQL Aggregate](http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_agg_fns.htm) queries and is subject to [platform limitations](http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm). This basically means... -- For each rollup, there is a maximum of 50,000 child relation records that can be summarised each time child record/s insert/update/delete operations are made (which may process several configured rollups). The rollup processes children to rollup by their parent record relationship and an optional further filter if provided. Meaning so long as this relationship does not result in more than 50,000 child records per parent parent record it will be successful. Take a look at this [blog post](http://andyinthecloud.com/2014/02/09/new-release-spring14-declarative-rollup-summary-tool/) which describes some new configuration settings (see bottom of blog post) to help calibrate the tool when running the Scheduled or Calculate jobs to help work within the 50,000 row limit. -- For performance reasons ensure the fields used are indexed (lookups are by default) and also any fields used in the filter criteria. This can be very important as without this, a full table scan will occur when the platform executes the SOQL and cause performance issues. For more information from Salesforce please see [here](http://wiki.developerforce.com/page/Best_Practices_for_Deployments_with_Large_Data_Volumes) and [here](http://blogs.developerforce.com/engineering/2013/02/force-com-soql-best-practices-nulls-and-formula-fields.html). -- When using the Realtime mode, Formula fields as fields to aggregate are not supported (validation will be added in a future release to block this). To work around this, either switch to Scheduled mode or in Relatime mode use a Workflow Field Update to copy the formula field value to a physical field and reference that. -- While the tool can be installed and enabled directly in production, sandbox testing is still strongly recommended. -- Professional Edition is not supported, due to the Metadata API used by the tool not being available in this edition. +- **Platform SOQL Limits**. This tool uses [SOQL Aggregate](http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_agg_fns.htm) queries and is subject to [platform limitations](http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm). This basically means... +- **Deployment issues into Production**. This tool dynamically deploys a small trigger and test class to the org. This is subject to the same rules and compliances as as a regular human developer. The generate test class, can in some cases be to simplisitc to get code coverage, requiring at present a developer to assist with the deployment, especially to production. There is more details on how to look for this scenario and how to workaround it, as well as future thoughts [here](https://github.com/afawcett/declarative-lookup-rollup-summaries/wiki/Challenges-with-Code-Coverage). +- **Volume Considerations**. For each rollup, there is a maximum of 50,000 child relation records that can be summarised each time child record/s insert/update/delete operations are made (which may process several configured rollups). The rollup processes children to rollup by their parent record relationship and an optional further filter if provided. Meaning so long as this relationship does not result in more than 50,000 child records per parent parent record it will be successful. Take a look at this [blog post](http://andyinthecloud.com/2014/02/09/new-release-spring14-declarative-rollup-summary-tool/) which describes some new configuration settings (see bottom of blog post) to help calibrate the tool when running the Scheduled or Calculate jobs to help work within the 50,000 row limit. +- **Indexing Fields**. For performance reasons ensure the fields used are indexed (lookups are by default) and also any fields used in the filter criteria. This can be very important as without this, a full table scan will occur when the platform executes the SOQL and cause performance issues. For more information from Salesforce please see [here](http://wiki.developerforce.com/page/Best_Practices_for_Deployments_with_Large_Data_Volumes) and [here](http://blogs.developerforce.com/engineering/2013/02/force-com-soql-best-practices-nulls-and-formula-fields.html). +- **Realtime Mode and Formula Fields**. When using the Realtime mode, Formula fields as fields to aggregate are not supported (validation will be added in a future release to block this). To work around this, either switch to Scheduled mode or in Relatime mode use a Workflow Field Update to copy the formula field value to a physical field and reference that. +- **Sandbox Testing**. While the tool can be installed and enabled directly in production, sandbox testing is still strongly recommended. +- **Professional Edition**. Professional Edition is not supported, due to the Metadata API used by the tool not being available in this edition. +- **INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=**. This can occur when your using the Manage Child Trigger button or editing rollups via the Manage Lookup Rollup Summaries tab. Solution is to disable the 'Lock sessions to the IP address from which they they originated.' setting under Session Settings under Setup. Salesforce documentation notes the following 'This option can inhibit various applications and mobile devices.'. Note this issue only applies while configuration changes are being made with the tool, especially via the Manage Lookup Rollup Summaries (see release notes v2.0). Once rollups are configured this issue does not apply during rollup calculations. Please feel free to raise feedback and issues via the **Github Issues** page [here](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues). @@ -52,13 +67,210 @@ Packaged Release History You can install a packaged version of the tool into your production org (sandbox testing as always recommended). Check the limatations and known issues above first! -**Latest Version 1.16** +**Latest Release Version 2.5** +________________________________ + +Package [Product URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000MXVO), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000MXVO) + +- Bug [After Delete trigger for merging fails when new dlrs added](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/371) +- Bug [Should not need to mark Active to do a manual Calculation](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/359) +- Bug [Apex Scheduler Day of Week Drop down is a day out](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/349) +- Bug [Merging lead causes Permission to create dlrs__LookupRollupSummary__c error](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/345) +- Enhancement [Support ContentNote rollups (upgraded to API 37.0)](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/351) + +**Release Version 2.4.2** +_________________________ + +Package [Product URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000ka9e), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000ka9e) + +- Bug [Install failed 2.4 update - New dependency on LookupChild's Sharing mode in Apex Unit Test](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/344) + +**Release Version 2.4.1** +_________________________ + +Package [Product URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000ka90), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000ka90) + +**Documentation:** See [Declarative Rollup Tool Summer (2016) Release](https://andyinthecloud.com/2016/06/19/declarative-rollup-tool-summer-release/) + +- Bug [Installation Issue - The user license doesn't allow the permission: Read All dlrs__LookupRollupCalculateJob__c](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/331) +- Enhancement [Roll Up just for few number of records](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/315) +- Enhancement [Support for rollups on Account when doing Merge Account](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/303) +- Enhancement [Add support for ALL ROWS](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/267) +- Enhancement [Scheduled Calculate Custom Settings](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/265) +- Enhancement [Open Activities still associated to the Converted Lead](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/164) +- Enhancement [Remove from Lookup Rollup Summary Schedule Items when Parent is deleted](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/147) + +**Version 2.3** +_______________ + +Package [Product URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000cBqJ), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000cBqJ) + +- Bug [Attempt to de-reference a null object from RollupJob (as seen on Apex Jobs page)](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/318) +- Bug [SP(), BR(), TB() not working in 2.2](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/291) +- Bug [Calculation Id not populating in Version 2.1](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/280) +- Bug [Validation Errors 'ENTITY_IS_DELETED' While Saving when Parent gets Deleted As Well](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/39) + +**Version 2.2** +_______________ + +Package [Product URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000cBh0), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000cBh0) + +- Bug [multiple criteria fields don't work anymore.](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/281) +- Enhancement [Add support for space & tab in concat delimiter](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/278) thanks to [jondavis9898](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues?q=is%3Aissue+is%3Aopen+author%3Ajondavis9898) +- Enhancement [Multiple BR() for Concatenate](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/258) + +**Version 2.1** +______________________________ + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000cBgv), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000cBgv) + +- Bug [Manage Lookup Rollup Summaries produces error CurrencyIsoCode not valid](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/273) + +**Version 2.0** +________________________ + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000cBgl), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000cBgl) + +- Enhancement [Support for Custom Metadata](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/242) (Pilot). See [Declarative Lookup Rollup Summary Tool and Custom Metadata](http://andyinthecloud.com/2015/12/24/declarative-lookup-rollup-summary-tool-and-custom-metadata/) for more information. + +**UPGRADE NOTE:** There is a new **Manage Lookup Rollup Summaries** tab to support Custom Metadata support. + +**Known Current Limitiations of Custom Metadata Support** +- Ability to override the generated Apex Test code is not supported (due to platform restriction) +- Aesthetic case adjustment for object field API names will not be performed, e.g. account would not change to Account +- When you Undeploy via Manage Child Triggers button, Active Custom Metadata based rollups are not automatically deactivated, please deactivate manually via unticking the Active checkbox. +- Advanced Rollup UI is not currently available, this will be integrated at a later date +- Description field is limited to only 255 characters (due to platform restriction) +- List View support is available under Setup, Custom Metadata Types, Manage Records but does not invoke the new UI for editing + +**Version 1.25** +________________ + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000cBPs), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000cBPs) + +- Enhancement [Allow First/Last Summaries to work on Id and Reference Fields](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/264) thanks to [Christian Carter](https://github.com/cdcarter). +- Enhancement [Nightly Scheduled RollupJob running, but Summaries not updating](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/142), thanks to [frontendloader](https://github.com/frontendloader). + +**UPDATE NOTE:** There is a new **Schedule Calculate** button to add to the object Layout, see screenshots below. + +![New Calc Screen Button](https://raw.githubusercontent.com/afawcett/declarative-lookup-rollup-summaries/master/images/newscheduledcalcbutton.png) + +This will show the following UI related to the enhancement above. + +![New Calc Screen](https://raw.githubusercontent.com/afawcett/declarative-lookup-rollup-summaries/master/images/newscheduledcalc.png) + +**Version 1.24** +________________ + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QgPw), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QgPw) + +- Bug fix [Rollup not recalculated when order by field changes](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/240) +- Bug fix [Concatenation Rollups order maybe none Deterministic - Consider moving order by from LREngine.RollupSummaryField to LREngine.Context](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/239) +- Enhancement [Enhance Order by to allow multiple fields and specify ASC/DESC](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/216) + +**IMPORTANT NOTE:** This release improves the query optimisation within the tool when there are multiple rollups. There is also a small change in behaviour from previous releases, relating to default ordering. If you have been using concat, first or last operations and have not specified explicit order by on the rollup, you must do from now on, it no longer defaults to the field to rollup. In prior releases the behaviour of this operation may or may not have been consistantly working as expected, depending on the existance of one or more rollups. + +**Version 1.23** +________________ + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QgAc), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QgAc) + +- Enhancement for [Add developer API to mirror triggerHandler behavior](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/236) +- Enhancement for [Advanced Rollup API Reqiurement: Count of Child on Parent, Child Re-parent, Old Parent Count not Correct](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/167) +- Bug fix for [Reduced number of queries when object name case differs across rollups : Multiple LRE Contexts when rollup definition only differs by case](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/229) +- Bug fix for [Master records updated when related records have not changed ](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/226) +- Bug fix for [Different order by on same relationship field results in incorrect result](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/222) +- Bug fix for [Rollup Summary validations not being enforced on updates after fflib upgrade ](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/212) + +**Version 1.22** +_______________________ + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000Qg9t), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000Qg9t) + +- Enhancement for [Ability to enable SeeAllData in the generated tests](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/202) +- Bug fix for [Error with multi-currency](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/204) +- Bug fix for [Some of the new fields in the last release are not in the Manage Rollup Permission Set](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/201) + +If you are upgrading, you will need to make the following changes to the Layout. +- Add **Test Code See All Data** field to the layout + +**Version 1.21** +_______________________ + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QfxT), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QfxT) + +- Enhancement for [Can't get Apex Trigger to Deploy in Production](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/199) +- Enhancement for [Implement the new test level features in Summer 15 to deploy triggers faster](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/190) +- Enhancement for [Allow users to edit child records without needing access to Rollup Summary object](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/162) +- Fix for [First error: Invalid Id when in Scheduled Mode](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/185) +- Fix for [Duplicate Field Selected error message](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/155) + +If you are upgrading, you will need to make the following changes to the Layout. +- Add **Test Code** field to the layout + +**Version 1.20** +_______________________ + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QfxO), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QfxO) + +- Enhancement for [Private Objects / Sharing Rule](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/183) +- Enhancement for [Allow Master Records To Be Filtered During Calculate](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/179) thanks to [Christian G. Warden](https://github.com/cwarden) +- Fix for [Some tests have hard-coded namespace](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/175) thanks to [Christian G. Warden](https://github.com/cwarden) +- Fix for [Rollup fails when child field is Multi-select picklist and is null](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/150) thanks to [Daniel Hoechst](https://github.com/dhoechst) + +If you are upgrading, you will need to make the following changes to the Layout. +- Add **Calculation Sharing Mode** field to the layout + +![Calculation Sharing Mode](https://cloud.githubusercontent.com/assets/1167760/7896771/29740d96-06bd-11e5-926f-a6fc402c85b1.png) + +**Version 1.19** +_______________________ + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QewZ), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QewZ) + +- Fix for [Concatenate Distinct Duplicates Values When Rolling up Multi-Select Picklists](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/128) +- Enhancement for [Improve trigger test deployment failure reporting when Code coverage error received](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/122) +- Fix for [Currency Fields in the Rollup causing the issues - "Master and detail fields must be the same field type (or text based) for First or Last operations"](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/121) + +**Version 1.18** +_______________________ + +Read more about this releae [here](http://andyinthecloud.com/2015/02/16/declarative-lookup-rollup-summaries-tool-dlrs-spring15-release/). + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeuE), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeuE) + +- Debug added for bug [Unable to connect to the Salesforce Metadata API](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/110) +- Enhancement [How to rollup count of unique values](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/99) +- Enhancement [Rollup picklist or text values?](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/76) +- Enhancement [Filter by last create date](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/79) +- Enhancement [Support for Lightning Process Builder](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/117) + +If you are upgrading, you will need to make the following changes to the Layout and Picklists. +- Add **Lookup Rollup Summary Unique Name**, **Concatenate Delimiter**, **Field to Order By** fields to the layout +- Add **Count Distinct**, **Concatenate**, **Concatenate Distinct**, **First** and **Last** picklist items to **Aggregate Operation** +- Add **Process Builder** picklist item to **Calculation Mode** + +**Version 1.17** +________________ + +Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000Qeej), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000Qeej) + +- Fix for [Exception when saving a new rollup when the child object is invalid](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/115) +- Enhancement for [Validate the Rollup Criteria on Save ](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/108) +- Enhancement for [Suggestion: Add 'Description' field to Lookup Rollup Summary SObject](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/90) (requires manually adding to Layout for upgrades) +- Fix for [Null object error - Aggregating null currency field on child](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/107) also same fix for [System.NullPointerException: Attempt to de-reference a null object - Error - Post v1.14 Upgrade](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/95) +- Fix for [Salesforce Standard Order object OpportunityID field not recognized](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/98) +- Upgrade to API 32 (sees new Standard objects) related to attempted fix for [Error "Object does not exist" for CombinedAttachment](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/103) + +**Version 1.16** +________________ Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeZ0), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeZ0) - Fix for [RollupJob error: Cannot have more than 10 chunks in a single operation](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/51), thanks to [David Carter](https://github.com/dcarter). **Version 1.15** +________________ Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeSJ), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeSJ) @@ -68,6 +280,7 @@ Package [Production URL](https://login.salesforce.com/packaging/installPackage.a - Fix for [Support installation without having to have Ideas enabled](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/33) **Version 1.14** +________________ Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeNs), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeNs) @@ -76,12 +289,14 @@ Package [Production URL](https://login.salesforce.com/packaging/installPackage.a - Fix for [Multiple rollups on same field fail to execute](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/85) **Version 1.13** +________________ Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeLD), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeLD) - Fix for [Apex Error Query Exception](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/83) **Version 1.12** +________________ Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeFj), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QeFj) @@ -89,22 +304,23 @@ Package [Production URL](https://login.salesforce.com/packaging/installPackage.a - Fix for [Currency Conversion?](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/57), special thanks to [Anthony Heber](https://github.com/aheber) for submitting the enhancement to [LREngine](https://github.com/abhinavguptas/Salesforce-Lookup-Rollup-Summaries) to fix this. The result of the child aggregation is converted to the parent record currency if the child field being aggregated is a Currency type and the org is using Multi-Currency. Note currently dated exchanged rates (available through Advanced Mulit-Currency) are currently not supported. - **Version 1.11** +________________ Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QdRT), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QdRT) - Fix for [Issue Deploy Trigger not successful, with no error (due to code coverage being low)](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/54) **Version 1.10** +________________ Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000Qbz8), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000Qbz8) - Enhancement for [Issue 52 Auto Create Remote Site Setting](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/52) - Fix for [Issue 25 Error with Manage Child Trigger button for very long object names](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/25) - **Version 1.9 - Community Powered!** +____________________________________ Read more about this release [here](http://andyinthecloud.com/2014/04/09/new-declarative-rollup-tool-release-community-powered) @@ -120,16 +336,19 @@ Package [Production URL](https://login.salesforce.com/packaging/installPackage.a **KNOWN INSTALL ISSUE** There appears to be an install issue identified when installing into orgs without Ideas installed for v1.9, if you encourter this enable Ideas if you can, otherwise use v1.7 until the issue is resolved. **Version 1.8** +________________ Not released **Version 1.7** +________________ Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QYAW), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QYAW) - Fix for [Issue 14](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/14), relating to null pointer exception **Version 1.6 - Spring'14 Release - 9th February 2014** +_______________________________________________________ Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QRXG), [Sandbox URL](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QRXG) @@ -138,20 +357,24 @@ Package [Production URL](https://login.salesforce.com/packaging/installPackage.a - Fix for [Issue 11](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/11) **Version 1.5** +_______________ Package [Production URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QCpr), [Sandbox URL](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tb0000000QCpr) - Fix for [Issue 7](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/7) and [Issue 8](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/8), relating to failure to report test execution errors in production org. **Version 1.4** +_______________ - Fix for [Issue 3](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/4), relating to issue when deleting last child record not updating rollup fields to 0. **Version 1.3** +_______________ - Fix for [Issue 2](https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/2), relating to error 'purgeOnDelete option can only be used on a non-active org' **Version 1.2** +_______________ - Support for Realtime calculations - Validation of valid fields and field types on Declarative Rollup definition fields @@ -162,6 +385,7 @@ Package [Production URL](https://login.salesforce.com/packaging/installPackage.a ![Review Passed](https://raw.githubusercontent.com/afawcett/declarative-lookup-rollup-summaries/master/images/UploadedPackages.png) **Version Beta 6** +__________________ - Support for Realtime calculations - Limited validation on Declarative Rollup definition fields diff --git a/build.properties b/build.properties new file mode 100644 index 00000000..5cac9bd4 --- /dev/null +++ b/build.properties @@ -0,0 +1,3 @@ +sf.serverurl = https://login.salesforce.com + +sf.maxPoll = 100 \ No newline at end of file diff --git a/build.xml b/build.xml new file mode 100644 index 00000000..30fc8791 --- /dev/null +++ b/build.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + diff --git a/images/newscheduledcalc.png b/images/newscheduledcalc.png new file mode 100644 index 00000000..a5926ef0 Binary files /dev/null and b/images/newscheduledcalc.png differ diff --git a/images/newscheduledcalcbutton.png b/images/newscheduledcalcbutton.png new file mode 100644 index 00000000..0e1854eb Binary files /dev/null and b/images/newscheduledcalcbutton.png differ diff --git a/lib/ant-salesforce.jar b/lib/ant-salesforce.jar new file mode 100644 index 00000000..406a482d Binary files /dev/null and b/lib/ant-salesforce.jar differ diff --git a/rolluptool/src/applications/DeclarativeLookupRollupSummaries.app b/rolluptool/src/applications/DeclarativeLookupRollupSummaries.app index 0e6e0b90..d617097e 100644 --- a/rolluptool/src/applications/DeclarativeLookupRollupSummaries.app +++ b/rolluptool/src/applications/DeclarativeLookupRollupSummaries.app @@ -1,7 +1,8 @@ - LookupRollupSummary__c + Welcome - LookupRollupSummary__c + Welcome + ManageLookupRollupSummaries LookupRollupSummaryLog__c diff --git a/rolluptool/src/classes/ApexClassesSelector.cls b/rolluptool/src/classes/ApexClassesSelector.cls index 9014b0b0..5f9bdbaf 100644 --- a/rolluptool/src/classes/ApexClassesSelector.cls +++ b/rolluptool/src/classes/ApexClassesSelector.cls @@ -27,7 +27,7 @@ /** * Performs various queries on the ApexClass object **/ -public with sharing class ApexClassesSelector extends SObjectSelector +public class ApexClassesSelector extends fflib_SObjectSelector { public List getSObjectFieldList() { @@ -59,12 +59,11 @@ public with sharing class ApexClassesSelector extends SObjectSelector **/ public Map selectByName(Set names) { - assertIsAccessible(); - List apexClasses = Database.query(String.format( - 'select {0} from {1} where Name in :names order by {2}', - new List{getFieldListString(), - getSObjectName(), - getOrderBy()})); + List apexClasses = + Database.query( + newQueryFactory(). + setCondition('Name in :names'). + toSOQL()); Map mapByName = new Map(); for(ApexClass apexClass : apexClasses) mapByName.put(apexClass.Name, apexClass); diff --git a/rolluptool/src/classes/ApexClassesSelector.cls-meta.xml b/rolluptool/src/classes/ApexClassesSelector.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/ApexClassesSelector.cls-meta.xml +++ b/rolluptool/src/classes/ApexClassesSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/ApexTriggersSelector.cls b/rolluptool/src/classes/ApexTriggersSelector.cls index 382b341b..46795738 100644 --- a/rolluptool/src/classes/ApexTriggersSelector.cls +++ b/rolluptool/src/classes/ApexTriggersSelector.cls @@ -27,7 +27,7 @@ /** * Performs various queries on the ApexTrigger object **/ -public with sharing class ApexTriggersSelector extends SObjectSelector +public class ApexTriggersSelector extends fflib_SObjectSelector { public List getSObjectFieldList() { @@ -68,12 +68,11 @@ public with sharing class ApexTriggersSelector extends SObjectSelector **/ public Map selectByName(Set names) { - assertIsAccessible(); - List apexTriggers = Database.query(String.format( - 'select {0} from {1} where Name in :names order by {2}', - new List{getFieldListString(), - getSObjectName(), - getOrderBy()})); + List apexTriggers = + Database.query( + newQueryFactory(). + setCondition('Name in :names'). + toSOQL()); Map mapByName = new Map(); for(ApexTrigger apexTrigger : apexTriggers) mapByName.put(apexTrigger.Name, apexTrigger); diff --git a/rolluptool/src/classes/ApexTriggersSelector.cls-meta.xml b/rolluptool/src/classes/ApexTriggersSelector.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/ApexTriggersSelector.cls-meta.xml +++ b/rolluptool/src/classes/ApexTriggersSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/AsyncApexJobsSelector.cls b/rolluptool/src/classes/AsyncApexJobsSelector.cls index 4c8ca771..d641e087 100644 --- a/rolluptool/src/classes/AsyncApexJobsSelector.cls +++ b/rolluptool/src/classes/AsyncApexJobsSelector.cls @@ -24,13 +24,8 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **/ -public with sharing class AsyncApexJobsSelector extends SObjectSelector -{ - public override String getOrderBy() - { - return 'CreatedDate'; - } - +public class AsyncApexJobsSelector extends fflib_SObjectSelector +{ List getSObjectFieldList() { return new List { @@ -49,6 +44,11 @@ public with sharing class AsyncApexJobsSelector extends SObjectSelector { return AsyncApexJob.sObjectType; } + + public override String getOrderBy() + { + return 'CreatedDate'; + } public List selectById(Set idSet) { @@ -63,12 +63,11 @@ public with sharing class AsyncApexJobsSelector extends SObjectSelector Set statuses = new Set { 'Queued', 'Processing', 'Preparing' }; String jobType = 'BatchApex'; String query = - String.format( - 'select {0} from {1} ' + - 'where JobType = :jobType And ' + + newQueryFactory(). + setCondition( + 'JobType = :jobType And ' + 'ApexClass.Name in :classNames And ' + - 'Status in :statuses', - new List{getFieldListString(),getSObjectName()}); + 'Status in :statuses').toSOQL(); List jobs = (List) Database.query(query); return jobs.size()>0; diff --git a/rolluptool/src/classes/AsyncApexJobsSelector.cls-meta.xml b/rolluptool/src/classes/AsyncApexJobsSelector.cls-meta.xml index 1124945f..49358969 100644 --- a/rolluptool/src/classes/AsyncApexJobsSelector.cls-meta.xml +++ b/rolluptool/src/classes/AsyncApexJobsSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 24.0 + 37.0 Active diff --git a/rolluptool/src/classes/CustomMetadataService.cls b/rolluptool/src/classes/CustomMetadataService.cls new file mode 100644 index 00000000..d5ed14bd --- /dev/null +++ b/rolluptool/src/classes/CustomMetadataService.cls @@ -0,0 +1,175 @@ +/** + * Copyright (c) 2013, Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * Wraps the Apex Metadata API to provide create, update and delete operations around Custom Metadata SObject's + * + * NOTE: Upsert is currently not supported by the Metadata API + * + * TODO: Support bulk requests + * TODO: Support All Or Nothing (new for Metadata API v34.0) + **/ +public class CustomMetadataService { + + public static void createMetadata(SObjectType mdtType, List> records) { + + } + + /** + * Insert the given Custom Metadata records into the orgs config + **/ + public static void createMetadata(List records) { + // Call Metadata API and handle response + MetadataService.MetadataPort service = createService(); + List results = + service.createMetadata(new List { toCustomMetadata(records[0]) }); + handleSaveResults(results[0]); + } + + /** + * Update the given Custom Metadata records in the orgs config + **/ + public static void updateMetadata(List records) { + // Call Metadata API and handle response + MetadataService.MetadataPort service = createService(); + List results = + service.updateMetadata(new List { toCustomMetadata(records[0]) }); + handleSaveResults(results[0]); + } + + /** + * Delete the given Custom Metadata records from the orgs config + **/ + public static void deleteMetadata(SObjectType qualifiedMetadataType, List customMetadataFullNames) { + MetadataService.MetadataPort service = createService(); + List qualifiedFullNames = new List(); + for(String customMetadataFullName : customMetadataFullNames) + qualifiedFullNames.add(qualifiedMetadataType.getDescribe().getName() + '.' + customMetadataFullName); + List results = + service.deleteMetadata('CustomMetadata', qualifiedFullNames); + handleDeleteResults(results[0]); + } + + public class CustomMetadataServiceException extends Exception {} + + /** + * Takes the SObject instance of the Custom Metadata Type and translates to a Metadata API Custmo Metadata Type + **/ + private static MetadataService.CustomMetadata toCustomMetadata(SObject customMetadataRecord) { + MetadataService.CustomMetadata cm = new MetadataService.CustomMetadata(); + cm.values = new List(); + SObjectType recordType = customMetadataRecord.getSObjectType(); + cm.fullName = recordType.getDescribe().getName().replace('__mdt', '') + '.' + customMetadataRecord.get('DeveloperName'); + cm.label = (String) customMetadataRecord.get('Label'); + for(SObjectField sObjectField : recordType.getDescribe().fields.getMap().values()) { + DescribeFieldResult dsr = sObjectField.getDescribe(); + if(!dsr.isCustom()) + continue; + Object fieldValue = customMetadataRecord.get(sObjectField); + MetadataService.CustomMetadataValue cmdv = new MetadataService.CustomMetadataValue(); + cmdv.field = dsr.getName(); + if(dsr.getType() == Schema.DisplayType.Double) { + if(fieldValue!=null) { + Decimal fieldValueNumber = (Decimal) fieldValue; + // TODO: Bit of a hack, MDT Number fields seem to be populated with zeros when the VF bound field is emptied by the user?!? + if(fieldValueNumber != 0) { + fieldValueNumber = fieldValueNumber.setScale(dsr.getScale()); + cmdv.value = fieldValueNumber.format(); + } + } + } else { + cmdv.value = fieldValue + ''; // TODO: More work here, type conversion + } + cm.values.add(cmdv); + } + return cm; + } + + /** + * Connect to the Metadata API + **/ + private static MetadataService.MetadataPort createService() + { + MetadataService.MetadataPort service = new MetadataService.MetadataPort(); + service.SessionHeader = new MetadataService.SessionHeader_element(); + service.SessionHeader.sessionId = UserInfo.getSessionId(); + return service; + } + + /** + * Example helper method to interpret a SaveResult, throws an exception if errors are found + **/ + private static void handleSaveResults(MetadataService.SaveResult saveResult) + { + // Nothing to see? + if(saveResult==null || saveResult.success) + return; + // Construct error message and throw an exception + if(saveResult.errors!=null) + { + List messages = new List(); + messages.add( + (saveResult.errors.size()==1 ? 'Error ' : 'Errors ') + + 'occured processing component ' + saveResult.fullName + '.'); + for(MetadataService.Error error : saveResult.errors) + messages.add( + error.message + ' (' + error.statusCode + ').' + + ( error.fields!=null && error.fields.size()>0 ? + ' Fields ' + String.join(error.fields, ',') + '.' : '' ) ); + if(messages.size()>0) + throw new CustomMetadataServiceException(String.join(messages, ' ')); + } + if(!saveResult.success) + throw new CustomMetadataServiceException('Request failed with no specified error.'); + } + + /** + * Example helper method to interpret a SaveResult, throws an exception if errors are found + **/ + private static void handleDeleteResults(MetadataService.DeleteResult deleteResult) + { + // Nothing to see? + if(deleteResult==null || deleteResult.success) + return; + // Construct error message and throw an exception + if(deleteResult.errors!=null) + { + List messages = new List(); + messages.add( + (deleteResult.errors.size()==1 ? 'Error ' : 'Errors ') + + 'occured processing component ' + deleteResult.fullName + '.'); + for(MetadataService.Error error : deleteResult.errors) + messages.add( + error.message + ' (' + error.statusCode + ').' + + ( error.fields!=null && error.fields.size()>0 ? + ' Fields ' + String.join(error.fields, ',') + '.' : '' ) ); + if(messages.size()>0) + throw new CustomMetadataServiceException(String.join(messages, ' ')); + } + if(!deleteResult.success) + throw new CustomMetadataServiceException('Request failed with no specified error.'); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/SObjectSelector.cls-meta.xml b/rolluptool/src/classes/CustomMetadataService.cls-meta.xml similarity index 80% rename from rolluptool/src/classes/SObjectSelector.cls-meta.xml rename to rolluptool/src/classes/CustomMetadataService.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/SObjectSelector.cls-meta.xml +++ b/rolluptool/src/classes/CustomMetadataService.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/CustomMetadataServiceTest.cls b/rolluptool/src/classes/CustomMetadataServiceTest.cls new file mode 100644 index 00000000..908ef94c --- /dev/null +++ b/rolluptool/src/classes/CustomMetadataServiceTest.cls @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2013, Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@IsTest +private class CustomMetadataServiceTest { + +} \ No newline at end of file diff --git a/rolluptool/src/classes/SObjectDomain.cls-meta.xml b/rolluptool/src/classes/CustomMetadataServiceTest.cls-meta.xml similarity index 80% rename from rolluptool/src/classes/SObjectDomain.cls-meta.xml rename to rolluptool/src/classes/CustomMetadataServiceTest.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/SObjectDomain.cls-meta.xml +++ b/rolluptool/src/classes/CustomMetadataServiceTest.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/LREngine.cls b/rolluptool/src/classes/LREngine.cls index 05d0e056..f3d5902a 100644 --- a/rolluptool/src/classes/LREngine.cls +++ b/rolluptool/src/classes/LREngine.cls @@ -36,8 +36,20 @@ public class LREngine { 1 : Object to query 2 : Optional WHERE clause filter to add 3 : Group By field name + 4 : ALL ROWS or empty string */ - static String SOQL_TEMPLATE = 'SELECT {0} FROM {1} WHERE {3} in :masterIds {2} GROUP BY {3}'; + static String SOQL_AGGREGATE_TEMPLATE = 'SELECT {0} FROM {1} WHERE {3} in :masterIds {2} GROUP BY {3} {4}'; + + /* + Tempalte tokens + 0 : Fields to project + 1 : Object to query + 2 : Parent lookup field + 3 : Optional WHERE clause filter to add + 4 : Order by clause + 5 : ALL ROWS or empty string + */ + static String SOQL_QUERY_TEMPLATE = 'SELECT {0} FROM {1} WHERE {2} in :masterIds {3} ORDER BY {4} {5}'; /* Support for multi-currency orgs @@ -60,7 +72,7 @@ public class LREngine { for(sObject ct : Database.query(query)) currencyConversionMap.put((String)ct.get('IsoCode'), (Decimal)ct.get('ConversionRate')); } - return val * currencyConversionMap.get(iso); + return val!=null ? val * currencyConversionMap.get(iso) : 0; } /** @@ -82,7 +94,7 @@ public class LREngine { } return rollUp(ctx, masterRecordIds); } - + /** Key driver method that rolls up lookup fields based on the context. This is meant to be called from non trigger contexts like scheduled/batch apex, where we want to rollup on some master record ids. @@ -93,6 +105,20 @@ public class LREngine { because we want client or calling code to have this freedom to do some post processing and update when required. */ public static Sobject[] rollUp(Context ctx, Set masterIds) { + return rollUp(ctx, masterIds, false); + } + + /** + Key driver method that rolls up lookup fields based on the context. This is meant to be called from non trigger contexts like + scheduled/batch apex, where we want to rollup on some master record ids. + + @param Context the complete context required to rollup + @param masterIds Master record IDs whose child records should be rolled up. + @param validateOnly Checks the SOQL query is valid, throws an exception if not, returns null if valid + @returns Array of in memory master objects. These objects are not updated back to the database + because we want client or calling code to have this freedom to do some post processing and update when required. + */ + public static Sobject[] rollUp(Context ctx, Set masterIds, Boolean validateOnly) { // Clone this since we are about to modify it later masterIds = masterIds.clone(); // K: Id of master record @@ -104,18 +130,37 @@ public class LREngine { // #0 token : SOQL projection String soqlProjection = ctx.lookupField.getName(); + // k: detail field name, v: master field name Integer exprIdx = 0; Boolean needsCurrency = false; + Boolean builtAggregateQuery = false; + Set selectedFields = new Set(); Map rsfByAlais = new Map(); for (RollupSummaryField rsf : ctx.fieldsToRoll) { - // create aggreate projection with alias for easy fetching via AggregateResult class - // i.e. SUM(Amount) Amount - String alias = 'lre'+exprIdx++; // Calculate an alias, using field name blew the 25 character limit in some cases - soqlProjection += ', ' + rsf.operation + '(' + rsf.detail.getName() + ') ' + alias; - rsfByAlais.put(alias, rsf); - if(IsMultiCurrencyOrg() == true && needsCurrency == false && rsf.isMasterTypeCurrency){ - needsCurrency = true; + if(rsf.operation == RollupOperation.Sum || + rsf.operation == RollupOperation.Max || + rsf.operation == RollupOperation.Min || + rsf.operation == RollupOperation.Avg || + rsf.operation == RollupOperation.Count || + rsf.operation == RollupOperation.Count_Distinct) { + // create aggreate projection with alias for easy fetching via AggregateResult class + // i.e. SUM(Amount) Amount + builtAggregateQuery = true; + String alias = 'lre'+exprIdx++; // Calculate an alias, using field name blew the 25 character limit in some cases + soqlProjection += ', ' + rsf.operation + '(' + rsf.detail.getName() + ') ' + alias; + rsfByAlais.put(alias, rsf); + if(IsMultiCurrencyOrg() == true && needsCurrency == false && rsf.isMasterTypeCurrency){ + needsCurrency = true; + } + } else { + // create field projection + // i.e. Amount + String selectField = rsf.detail.getName(); + if(!selectedFields.contains(selectField)) { + soqlProjection += ', ' + selectField; + selectedFields.add(selectField); + } } } @@ -137,34 +182,138 @@ public class LREngine { // #3 Group by field String grpByFld = ctx.lookupField.getName(); - - String soql = String.format(SOQL_TEMPLATE, new String[]{soqlProjection, detailTblName, whereClause, grpByFld}); + + // #4 Order by clause fields + // i.e. Amount ASC NULLS FIRST, Name DESC NULL LAST + String orderByClause = ctx.lookupField.getName() + (String.isBlank(ctx.detailOrderByClause) ? '' : (',' + ctx.detailOrderByClause)); + + // #5 ALL ROWS + String allRows = ctx.AllRows ? 'ALL ROWS' : ''; + + // build approprite soql for this rollup context + String soql = + builtAggregateQuery ? + String.format(SOQL_AGGREGATE_TEMPLATE, + new String[]{ + soqlProjection, + detailTblName, + whereClause, + grpByFld, + allRows}) : + String.format(SOQL_QUERY_TEMPLATE, + new String[]{ + soqlProjection, + detailTblName, + ctx.lookupField.getName(), + whereClause, + orderByClause, + allRows}); System.debug('SOQL is ' + soql); - // aggregated results - List results = Database.query(soql); - - for (AggregateResult res : results){ - Id masterRecId = (Id)res.get(grpByFld); - Sobject masterObj = masterRecordsMap.get(masterRecId); - if (masterObj == null) { - System.debug(Logginglevel.WARN, 'No master record found for ID :' + masterRecId); - continue; - } - - for (String alias : rsfByAlais.keySet()) { - RollupSummaryField rsf = rsfByAlais.get(alias); - Object aggregatedDetailVal = res.get(alias); - System.debug(LoggingLevel.INFO, 'New aggregarte value ' + aggregatedDetailVal + ' for master ' + masterRecId); - // Should also test for necessity - if(IsMultiCurrencyOrg() == true && rsf.isMasterTypeCurrency){ - masterObj.put(rsf.master.getName(), convertCurrency((String)res.get(MASTERCURRENCYALIAS),(Decimal)aggregatedDetailVal)); - } else { - masterObj.put(rsf.master.getName(), aggregatedDetailVal); + // validate only? + if(validateOnly) { + Database.getQueryLocator(soql); + return null; + } + + // consider sharing rules or not? + QueryExecutor qe = null; + if (ctx.SharingMode == SharingMode.User) + qe = new WithSharingQueryExecutor(); + else if (ctx.SharingMode == SharingMode.System_x) + qe = new WithoutSharingQueryExecutor(); + else // Default + qe = new WithSharingQueryExecutor(); + + // query results + Object queryResults = qe.query(soql, masterIds); + if(queryResults instanceof List) { + + // Process Aggregate query results from RollupOperations related to Aggergate operations + List results = (List) queryResults; + for (AggregateResult res : results){ + Id masterRecId = (Id)res.get(grpByFld); + Sobject masterObj = masterRecordsMap.get(masterRecId); + if (masterObj == null) { + System.debug(Logginglevel.WARN, 'No master record found for ID :' + masterRecId); + continue; + } + + for (String alias : rsfByAlais.keySet()) { + RollupSummaryField rsf = rsfByAlais.get(alias); + Object aggregatedDetailVal = res.get(alias); + System.debug(LoggingLevel.INFO, 'New aggregarte value ' + aggregatedDetailVal + ' for master ' + masterRecId); + // Should also test for necessity + if(IsMultiCurrencyOrg() == true && rsf.isMasterTypeCurrency){ + masterObj.put(rsf.master.getName(), convertCurrency((String)res.get(MASTERCURRENCYALIAS),(Decimal)aggregatedDetailVal)); + } else { + masterObj.put(rsf.master.getName(), aggregatedDetailVal); + } + } + // Remove master Id record as its been processed + masterIds.remove(masterRecId); + } + } else if(queryResults instanceof List) { + + // Group detail records by master Id + List detailRecords = (List) queryResults; + Map> detailRecordsByMasterId = new Map>(); + Id lastMasterId = null; + List currentDetailRecords = null; + for(SObject detailRecord : detailRecords) { + Id masterId = (Id) detailRecord.get(ctx.lookupField.getName()); + if(masterId != lastMasterId) { + currentDetailRecords = new List(); + detailRecordsByMasterId.put(masterId, currentDetailRecords); } - } - // Remove master Id record as its been processed - masterIds.remove(masterRecId); + currentDetailRecords.add(detailRecord); + lastMasterId = masterId; + } + + // Process rollup fields + for(Id masterId : detailRecordsByMasterId.keySet()) { + for (RollupSummaryField rsf : ctx.fieldsToRoll) { + List childDetailRecords = detailRecordsByMasterId.get(masterId); + if(rsf.operation == RollupOperation.Concatenate || + rsf.operation == RollupOperation.Concatenate_Distinct) { + Concatenator concatenator = + new Concatenator(rsf.operation == RollupOperation.Concatenate_Distinct, rsf.concatenateDelimiter); + Integer rowIdx = 0; + for(SObject childDetailRecord : childDetailRecords) { + rowIdx++; + String childFieldValue = String.valueOf(childDetailRecord.get(rsf.detail.getName())); + if (childFieldValue != null) { + if (rsf.detail.getType() == Schema.DisplayType.MultiPicklist) { + for (String mspValue : childFieldValue.split(';')) { + concatenator.add(mspValue); + } + } else { + concatenator.add(childFieldValue); + } + } + if(rsf.RowLimit!=null && rsf.RowLimit>0 && rowIdx == rsf.RowLimit) { + break; + } + } + String concatenatedValues = concatenator.toString(); + concatenatedValues = concatenatedValues.abbreviate(rsf.master.getLength()); + masterRecordsMap.get(masterId).put(rsf.master.getName(), concatenatedValues); + } else if(rsf.operation == RollupOperation.First) { + masterRecordsMap.get(masterId).put( + rsf.master.getName(), childDetailRecords[0].get(rsf.detail.getName())); + } else if(rsf.operation == RollupOperation.Last) { + Integer recordSetSize = childDetailRecords.size(); + Integer index = + rsf.RowLimit!=null && rsf.RowLimit>0 ? + (rsf.RowLimit < recordSetSize ? rsf.RowLimit-1 : recordSetSize - 1) : recordSetSize - 1; + masterRecordsMap.get(masterId).put( + rsf.master.getName(), + childDetailRecords[index].get(rsf.detail.getName())); + } + // Remove master Id record as its been processed + masterIds.remove(masterId); + } + } } // Zero rollups for unprocessed master records (those with no longer any child relationships) @@ -175,10 +324,48 @@ public class LREngine { return masterRecordsMap.values(); } - - - - + + private final static Map delimiterTokens = new Map { + Pattern.compile('BR\\(\\)') => '\n' + , Pattern.compile('SP\\(\\)') => ' ' + , Pattern.compile('TB\\(\\)') => '\t' + }; + + /** + * Concatenates strings (removes duplicates) + **/ + private class Concatenator + { + private Boolean distinct; + private List listOfString; + private Set setOfStrings; + private String delimiter; + + public Concatenator(Boolean distinct, String delimiter) { + this.distinct = distinct; + if(delimiter!=null) { + for (Pattern p : delimiterTokens.keySet()) { + delimiter = p.matcher(delimiter).replaceAll((String)delimiterTokens.get(p)); + } + this.delimiter = delimiter; + } + setOfStrings = new Set(); + listOfString = new List(); + } + + public void add(String value) { + Boolean exists = setOfStrings.contains(value); + if(!exists) + setOfStrings.add(value); + if(distinct ? !exists : true) + listOfString.add(value); + } + + public override String toString() { + return String.join(listOfString, delimiter == null ? '' : delimiter); + } + } + /** Exception throwed if Rollup Summary field is in bad state */ @@ -188,7 +375,7 @@ public class LREngine { Which rollup operation you want to perform */ public enum RollupOperation { - Sum, Max, Min, Avg, Count + Sum, Max, Min, Avg, Count, Count_Distinct, Concatenate, Concatenate_Distinct, First, Last } /** @@ -202,6 +389,8 @@ public class LREngine { public Schema.Describefieldresult master; public Schema.Describefieldresult detail; public RollupOperation operation; + public String concatenateDelimiter; + public Integer rowLimit; // derived fields, kept like this to save script lines later, by saving the same // computations over and over again @@ -210,12 +399,35 @@ public class LREngine { public boolean isMasterTypeDateOrTime; public boolean isDetailTypeDateOrTime; public boolean isMasterTypeCurrency; - + public boolean isMasterTypeText; + public boolean isDetailTypeText; + public boolean isMasterTypeId; + public boolean isDetailTypeId; + public RollupSummaryField(Schema.Describefieldresult m, Schema.Describefieldresult d, RollupOperation op) { + this(m, d, op, null); + } + + public RollupSummaryField(Schema.Describefieldresult m, + Schema.Describefieldresult d, + RollupOperation op, + String concatenateDelimiter) { + this(m, d, op, concatenateDelimiter, null); + } + + + public RollupSummaryField(Schema.Describefieldresult m, + Schema.Describefieldresult d, + RollupOperation op, + String concatenateDelimiter, + Integer rowLimit) { + this.master = m; this.detail = d; this.operation = op; + this.concatenateDelimiter = concatenateDelimiter; + this.rowLimit = rowLimit; // caching these derived attrbutes for once // as their is no view state involved here // and this caching will lead to saving in script lines later on @@ -224,6 +436,10 @@ public class LREngine { this.isMasterTypeDateOrTime = isDateOrTime(master.getType()); this.isDetailTypeDateOrTime = isDateOrTime(detail.getType()); this.isMasterTypeCurrency = isCurrency(master.getType()); + this.isMasterTypeText = isText(master.getType()); + this.isDetailTypeText = isText(detail.getType()); + this.isMasterTypeId = isIdOrReference(master.getType()); + this.isDetailTypeId = isIdOrReference(detail.getType()); // validate if field is good to work on later validate(); } @@ -232,7 +448,26 @@ public class LREngine { if (master == null || detail == null || operation == null) throw new BadRollUpSummaryStateException('All of Master/Detail Describefieldresult and RollupOperation info is mandantory'); - if (operation != RollupOperation.Count) { + if (operation == RollupOperation.Concatenate || + operation == RollupOperation.Concatenate_Distinct) { + if ( !isMasterTypeText ) { + throw new BadRollUpSummaryStateException('Only Text/Text Area fields are allowed for Concatenate and Concatenate Distinct'); + } + } + + if (operation == RollupOperation.First || + operation == RollupOperation.Last) { + if ( (this.master.getType() != this.detail.getType()) && + ((!isDetailTypeText && !isDetailTypeId) || + (!isMasterTypeText && !isMasterTypeId))) { + throw new BadRollUpSummaryStateException('Master and detail fields must be the same field type (or text/Id based) for First or Last operations'); + } + } + + if (operation == RollupOperation.Sum || + operation == RollupOperation.Max || + operation == RollupOperation.Min || + operation == RollupOperation.Avg) { if ( (!isMasterTypeDateOrTime && !isMasterTypeNumber) || (!isDetailTypeDateOrTime && !isDetailTypeNumber)) { throw new BadRollUpSummaryStateException('Only Date/DateTime/Time/Numeric fields are allowed for Sum, Max, Min and Avg'); @@ -243,7 +478,19 @@ public class LREngine { throw new BadRollUpSummaryStateException('Sum/Avg doesnt looks like valid for dates ! Still want, then implement the IRollerCoaster yourself and change this class as required.'); } } + + boolean isText (Schema.Displaytype dt) { + return dt == Schema.Displaytype.TextArea || + dt == Schema.Displaytype.String || + dt == Schema.Displaytype.Picklist || + dt == Schema.Displaytype.MultiPicklist; + } + boolean isIdOrReference (Schema.Displaytype dt) { + return dt == Schema.DisplayType.ID || + dt == Schema.DisplayType.REFERENCE; + } + boolean isNumber (Schema.Displaytype dt) { return dt == Schema.Displaytype.Currency || dt == Schema.Displaytype.Integer @@ -260,13 +507,44 @@ public class LREngine { boolean isCurrency(Schema.DisplayType dt) { return dt == Schema.Displaytype.Currency; } + + public boolean isAggregateBasedRollup() { + return isAggregateBasedRollup(operation); + } + + public boolean isQueryBasedRollup() { + return isQueryBasedRollup(operation); + } } + public enum SharingMode { + User, + System_x + } + + public static boolean isAggregateBasedRollup(RollupOperation operation) { + return operation == RollupOperation.Sum || + operation == RollupOperation.Min || + operation == RollupOperation.Max || + operation == RollupOperation.Avg || + operation == RollupOperation.Count || + operation == RollupOperation.Count_Distinct; + } + + public static boolean isQueryBasedRollup(RollupOperation operation) { + return operation == RollupOperation.Concatenate || + operation == RollupOperation.Concatenate_Distinct || + operation == RollupOperation.First || + operation == RollupOperation.Last; + } + /** Context having all the information about the rollup to be done. Please note : This class encapsulates many rollup summary fields with different operations. */ public class Context { + // Sharing mode + public SharingMode sharingMode; // Master Sobject Type public Schema.Sobjecttype master; // Child/Details Sobject Type @@ -275,10 +553,18 @@ public class LREngine { public Schema.Describefieldresult lookupField; // various fields to rollup on public List fieldsToRoll; + // include all rows + public Boolean allRows; + // what type of rollups does this context contain + private Boolean isAggregateBased = null; + private Boolean isQueryBased = null; // Where clause or filters to apply while aggregating detail records public String detailWhereClause; - + + // Order By clause to apply while aggregating detail records + public String detailOrderByClause; + public Context(Schema.Sobjecttype m, Schema.Sobjecttype d, Schema.Describefieldresult lf) { this(m, d, lf, ''); @@ -286,18 +572,82 @@ public class LREngine { public Context(Schema.Sobjecttype m, Schema.Sobjecttype d, Schema.Describefieldresult lf, String detailWhereClause) { + this(m, d, lf, detailWhereClause, (SharingMode)null); + } + + public Context(Schema.Sobjecttype m, Schema.Sobjecttype d, + Schema.Describefieldresult lf, String detailWhereClause, SharingMode sharingMode) { + this(m, d, lf, detailWhereClause, sharingMode, null); + } + + public Context(Schema.Sobjecttype m, Schema.Sobjecttype d, + Schema.Describefieldresult lf, String detailWhereClause, String detailOrderByClause) { + this(m, d, lf, detailWhereClause, null, detailOrderByClause); + } + + public Context(Schema.Sobjecttype m, Schema.Sobjecttype d, + Schema.Describefieldresult lf, String detailWhereClause, SharingMode sharingMode, String detailOrderByClause) { + this(m, d, lf, detailWhereClause, null, detailOrderByClause, false); + } + + public Context(Schema.Sobjecttype m, Schema.Sobjecttype d, + Schema.Describefieldresult lf, String detailWhereClause, SharingMode sharingMode, String detailOrderByClause, Boolean allRows) { this.master = m; this.detail = d; this.lookupField = lf; this.detailWhereClause = detailWhereClause; + this.detailOrderByClause = detailOrderByClause; this.fieldsToRoll = new List(); + this.sharingMode = sharingMode; + this.allRows = allRows; } /** Adds new rollup summary fields to the context */ public void add(RollupSummaryField fld) { + + // The type of query this context is based is driven by the first summary field added + if(isQueryBased == null && isAggregateBased == null) + { + isAggregateBased = fld.isAggregateBasedRollup(); + isQueryBased = fld.isQueryBasedRollup(); + } + + // A context cannot support summary fields with operations that mix the use of underlying query types + if(isAggregateBased && !fld.isAggregateBasedRollup() || + isQueryBased && !fld.isQueryBasedRollup()) + throw new BadRollUpSummaryStateException('Cannot mix Sum, Max, Min, Avg, Count, Count_Distinct operations with Concatenate, Concatenate_Distinct, First, Last operations'); + this.fieldsToRoll.add(fld); } } + + /** + * Wraps platform query executor to permit override of sharing rule consideration or not + **/ + public abstract class QueryExecutor { + public virtual List query(String query, Set masterIds) { + return Database.query(query); + } + } + + /** + * Query executor that considers sharing rules + **/ + public with sharing class WithSharingQueryExecutor extends QueryExecutor { + public override List query(String query, Set masterIds) { + return super.query(query, masterIds); + } + } + + /** + * QUery executor that ignores sharing rules + **/ + public without sharing class WithoutSharingQueryExecutor extends QueryExecutor { + public override List query(String query, Set masterIds) { + return super.query(query, masterIds); + } + } + } \ No newline at end of file diff --git a/rolluptool/src/classes/LREngine.cls-meta.xml b/rolluptool/src/classes/LREngine.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/LREngine.cls-meta.xml +++ b/rolluptool/src/classes/LREngine.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/ManageLookupRollupSummariesController.cls b/rolluptool/src/classes/ManageLookupRollupSummariesController.cls new file mode 100644 index 00000000..1fb5f8b6 --- /dev/null +++ b/rolluptool/src/classes/ManageLookupRollupSummariesController.cls @@ -0,0 +1,158 @@ +/** + * Copyright (c) 2013, Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +public with sharing class ManageLookupRollupSummariesController { + + public LookupRollupSummary2__mdt LookupRollupSummary {get;set;} + + public String selectedLookup {get;set;} + + public Boolean MetadataConnectionError {get;set;} + + public ManageLookupRollupSummariesController() { + LookupRollupSummary = new LookupRollupSummary2__mdt(); + } + + public List getLookups() { + // List current rollup custom metadata configs + List options = new List(); + options.add(new SelectOption('[new]','Create new...')); + for(RollupSummary rollup : new RollupSummariesSelector.CustomMetadataSelector().selectAll()) + options.add(new SelectOption(rollup.Id,rollup.Name)); + return options; + } + + public PageReference init() { + + // Metadata API connection? + MetadataConnectionError = !RollupService.checkMetadataAPIConnection(); + if(MetadataConnectionError) + { + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error, 'Salesforce Metadata API connection failure, click the link below to configure.')); + return null; + } + + // URL parameter? + selectedLookup = (Id) ApexPages.currentPage().getParameters().get('id'); + if(selectedLookup!=null) { + LookupRollupSummary = (LookupRollupSummary2__mdt) + new RollupSummariesSelector.CustomMetadataSelector(). + selectById(new Set { selectedLookup })[0].Record; + } + else { + selectedLookup = ApexPages.currentPage().getParameters().get('developerName'); + if(selectedLookup!=null) { + LookupRollupSummary = (LookupRollupSummary2__mdt) + new RollupSummariesSelector.CustomMetadataSelector(). + selectByDeveloperName(new Set { selectedLookup })[0].Record; + selectedLookup = LookupRollupSummary.Id; + } + } + return null; + } + + public PageReference load() { + // Reload the page + PageReference newPage = Page.managelookuprollupsummaries; + newPage.setRedirect(true); + if(selectedLookup != '[new]') + newPage.getParameters().put('id', selectedLookup); + return newPage; + } + + public PageReference save() { + try { + // Insert / Update the rollup custom metadata + if(LookupRollupSummary.Id==null) + RollupService.create(new List { LookupRollupSummary }); + else + RollupService.update_x(new List { LookupRollupSummary }); + // Reload this page (and thus the rollup list in a new request, metadata changes are not visible until this request ends) + PageReference newPage = Page.managelookuprollupsummaries; + newPage.setRedirect(true); + newPage.getParameters().put('developerName', LookupRollupSummary.DeveloperName); + return newPage; + } catch (RollupService.RollupValidationException e) { + // Extract errors from exception and display on the page + for(RollupService.RollupRecordValidationError recordError : e.RecordErrors) { + if(recordError.Error!=null) { + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error, recordError.Error)); + } + for(String fieldError : recordError.FieldErrors) { + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error, fieldError)); + } + } + } catch (Exception e) { + ApexPages.addMessages(e); + } + return null; + } + + public PageReference deleteX() { + try { + // Delete the rollup custom metadata + RollupService.delete_X(new List { LookupRollupSummary.DeveloperName }); + // Reload this page (and thus the rollup list in a new request, metadata changes are not visible until this request ends) + PageReference newPage = Page.managelookuprollupsummaries; + newPage.setRedirect(true); + return newPage; + } catch (Exception e) { + ApexPages.addMessages(e); + } + return null; + } + + public PageReference hideMessage() { + DeclarativeLookupRollupSummaries__c settings = DeclarativeLookupRollupSummaries__c.getOrgDefaults(); + settings.HideManageLookupRollupSummariesInfo__c = true; + upsert settings; + return null; + } + + public List getCalculationModes(){ + List options = new List(); + for(Schema.Picklistentry picklistEntry : LookupRollupSummary__c.fields.CalculationMode__c.getDescribe().getPickListValues()) { + options.add(new SelectOption(picklistEntry.getValue(), picklistEntry.getLabel())); + } + return options; + } + + public List getAggregateOperations(){ + List options = new List(); + for(Schema.Picklistentry picklistEntry : LookupRollupSummary__c.fields.AggregateOperation__c.getDescribe().getPickListValues()) { + options.add(new SelectOption(picklistEntry.getValue(), picklistEntry.getLabel())); + } + return options; + } + + public List getCalculationSharingModes(){ + List options = new List(); + for(Schema.Picklistentry picklistEntry : LookupRollupSummary__c.fields.CalculationSharingMode__c.getDescribe().getPickListValues()) { + options.add(new SelectOption(picklistEntry.getValue(), picklistEntry.getLabel())); + } + return options; + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/SObjectSelectorTest.cls-meta.xml b/rolluptool/src/classes/ManageLookupRollupSummariesController.cls-meta.xml similarity index 80% rename from rolluptool/src/classes/SObjectSelectorTest.cls-meta.xml rename to rolluptool/src/classes/ManageLookupRollupSummariesController.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/SObjectSelectorTest.cls-meta.xml +++ b/rolluptool/src/classes/ManageLookupRollupSummariesController.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/MetadataService.cls b/rolluptool/src/classes/MetadataService.cls index 44b6fc77..ceedc34e 100644 --- a/rolluptool/src/classes/MetadataService.cls +++ b/rolluptool/src/classes/MetadataService.cls @@ -1,39 +1,43 @@ /** - * Copyright (c), Andrew Fawcett, + * Copyright (c), FinancialForce.com, inc * All rights reserved. * - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * - * - Redistributions of source code must retain the above copyright notice, + * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * - Neither the name of the Andrew Fawcett, nor the names of its contributors - * may be used to endorse or promote products derived from this software without + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without * specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **/ +//Patched by MetadataServicePatcher v34.0 2015-07-06 00:00:00 //Generated by wsdl2apex -/* - * WARNING: Parts of this file have been manually edited post generation by the WSDL2Apex tool, - * please review the readme at https://github.com/financialforcedev/apex-mdapi for more information - */ - public class MetadataService { - public class WorkflowRule { + public class listMetadataResponse_element { + public MetadataService.FileProperties[] result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class WorkflowRule extends Metadata { + public String type = 'WorkflowRule'; + public String fullName; public MetadataService.WorkflowActionReference[] actions; public Boolean active; public String booleanFilter; @@ -42,118 +46,96 @@ public class MetadataService { public String formula; public String triggerType; public MetadataService.WorkflowTimeTrigger[] workflowTimeTriggers; - private String[] actions_type_info = new String[]{'actions','http://soap.sforce.com/2006/04/metadata','WorkflowActionReference','0','-1','false'}; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata','FilterItem','0','-1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] formula_type_info = new String[]{'formula','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] triggerType_type_info = new String[]{'triggerType','http://soap.sforce.com/2006/04/metadata','WorkflowTriggerTypes','1','1','false'}; - private String[] workflowTimeTriggers_type_info = new String[]{'workflowTimeTriggers','http://soap.sforce.com/2006/04/metadata','WorkflowTimeTrigger','0','-1','false'}; + private String[] actions_type_info = new String[]{'actions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] formula_type_info = new String[]{'formula','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] triggerType_type_info = new String[]{'triggerType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] workflowTimeTriggers_type_info = new String[]{'workflowTimeTriggers','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'actions','active','booleanFilter','criteriaItems','description','formula','triggerType','workflowTimeTriggers'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'actions','active','booleanFilter','criteriaItems','description','formula','triggerType','workflowTimeTriggers'}; } public class FieldOverride { public String field; public String formula; public String literalValue; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] formula_type_info = new String[]{'formula','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] literalValue_type_info = new String[]{'literalValue','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] formula_type_info = new String[]{'formula','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] literalValue_type_info = new String[]{'literalValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'field','formula','literalValue'}; } - public class listMetadataResponse_element { - public MetadataService.FileProperties[] result; - private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata','FileProperties','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'result'}; - } - public class AccountOwnerSharingRule { - public String accountAccessLevel; - public String caseAccessLevel; - public String contactAccessLevel; - public String name; - public String opportunityAccessLevel; - private String[] accountAccessLevel_type_info = new String[]{'accountAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoNone','1','1','false'}; - private String[] caseAccessLevel_type_info = new String[]{'caseAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoAll','1','1','false'}; - private String[] contactAccessLevel_type_info = new String[]{'contactAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoAll','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] opportunityAccessLevel_type_info = new String[]{'opportunityAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoAll','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'accountAccessLevel','caseAccessLevel','contactAccessLevel','name','opportunityAccessLevel'}; - } public class QuotasSettings { public Boolean showQuotas; - private String[] showQuotas_type_info = new String[]{'showQuotas','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] showQuotas_type_info = new String[]{'showQuotas','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'showQuotas'}; } public class checkDeployStatus_element { public String asyncProcessId; - private String[] asyncProcessId_type_info = new String[]{'asyncProcessId','http://soap.sforce.com/2006/04/metadata','ID','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'asyncProcessId'}; - } - public class FlowApexPluginCall { - public String apexClass; - public MetadataService.FlowConnector connector; - public MetadataService.FlowConnector faultConnector; - public MetadataService.FlowApexPluginCallInputParameter[] inputParameters; - public MetadataService.FlowApexPluginCallOutputParameter[] outputParameters; - private String[] apexClass_type_info = new String[]{'apexClass','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] inputParameters_type_info = new String[]{'inputParameters','http://soap.sforce.com/2006/04/metadata','FlowApexPluginCallInputParameter','0','-1','false'}; - private String[] outputParameters_type_info = new String[]{'outputParameters','http://soap.sforce.com/2006/04/metadata','FlowApexPluginCallOutputParameter','0','-1','false'}; + public Boolean includeDetails; + private String[] asyncProcessId_type_info = new String[]{'asyncProcessId','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] includeDetails_type_info = new String[]{'includeDetails','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apexClass','connector','faultConnector','inputParameters','outputParameters'}; + private String[] field_order_type_info = new String[]{'asyncProcessId','includeDetails'}; } - public class CodeCoverageWarning { - public String id; - public String message; - public String name; - public String namespace; - private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata','ID','1','1','false'}; - private String[] message_type_info = new String[]{'message','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','true'}; - private String[] namespace_type_info = new String[]{'namespace','http://www.w3.org/2001/XMLSchema','string','1','1','true'}; + public class Skill extends Metadata { + public String type = 'Skill'; + public String fullName; + public MetadataService.SkillAssignments assignments; + public String label; + private String[] assignments_type_info = new String[]{'assignments','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'id','message','name','namespace'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'assignments','label'}; } public class FlowInputValidationRule { public String errorMessage; public String formulaExpression; - private String[] errorMessage_type_info = new String[]{'errorMessage','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] formulaExpression_type_info = new String[]{'formulaExpression','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] errorMessage_type_info = new String[]{'errorMessage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] formulaExpression_type_info = new String[]{'formulaExpression','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'errorMessage','formulaExpression'}; } - public class Skill { - public MetadataService.SkillAssignments assignments; - public String label; - private String[] assignments_type_info = new String[]{'assignments','http://soap.sforce.com/2006/04/metadata','SkillAssignments','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class CodeCoverageWarning { + public String id; + public String message; + public String name; + public String namespace; + private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] message_type_info = new String[]{'message','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','true'}; + private String[] namespace_type_info = new String[]{'namespace','http://soap.sforce.com/2006/04/metadata',null,'1','1','true'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'assignments','label'}; + private String[] field_order_type_info = new String[]{'id','message','name','namespace'}; } - public class CustomObjectCriteriaBasedSharingRule { - public String accessLevel; - public String booleanFilter; - public String name; - private String[] accessLevel_type_info = new String[]{'accessLevel','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class FlowApexPluginCall { + public String apexClass; + public MetadataService.FlowConnector connector; + public MetadataService.FlowConnector faultConnector; + public MetadataService.FlowApexPluginCallInputParameter[] inputParameters; + public MetadataService.FlowApexPluginCallOutputParameter[] outputParameters; + private String[] apexClass_type_info = new String[]{'apexClass','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] inputParameters_type_info = new String[]{'inputParameters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] outputParameters_type_info = new String[]{'outputParameters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'accessLevel','booleanFilter','name'}; + private String[] field_order_type_info = new String[]{'apexClass','connector','faultConnector','inputParameters','outputParameters'}; } public class KnowledgeAnswerSettings { public String assignTo; public String defaultArticleType; public Boolean enableArticleCreation; - private String[] assignTo_type_info = new String[]{'assignTo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] defaultArticleType_type_info = new String[]{'defaultArticleType','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] enableArticleCreation_type_info = new String[]{'enableArticleCreation','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] assignTo_type_info = new String[]{'assignTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultArticleType_type_info = new String[]{'defaultArticleType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableArticleCreation_type_info = new String[]{'enableArticleCreation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'assignTo','defaultArticleType','enableArticleCreation'}; } @@ -165,55 +147,50 @@ public class MetadataService { public String lockoutInterval; public String maxLoginAttempts; public String minPasswordLength; + public Boolean minimumPasswordLifetime; + public Boolean obscureSecretAnswer; public String passwordAssistanceMessage; public String passwordAssistanceURL; public String questionRestriction; - private String[] apiOnlyUserHomePageURL_type_info = new String[]{'apiOnlyUserHomePageURL','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] complexity_type_info = new String[]{'complexity','http://soap.sforce.com/2006/04/metadata','Complexity','0','1','false'}; - private String[] expiration_type_info = new String[]{'expiration','http://soap.sforce.com/2006/04/metadata','Expiration','0','1','false'}; - private String[] historyRestriction_type_info = new String[]{'historyRestriction','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] lockoutInterval_type_info = new String[]{'lockoutInterval','http://soap.sforce.com/2006/04/metadata','LockoutInterval','0','1','false'}; - private String[] maxLoginAttempts_type_info = new String[]{'maxLoginAttempts','http://soap.sforce.com/2006/04/metadata','MaxLoginAttempts','0','1','false'}; - private String[] minPasswordLength_type_info = new String[]{'minPasswordLength','http://soap.sforce.com/2006/04/metadata','MinPasswordLength','0','1','false'}; - private String[] passwordAssistanceMessage_type_info = new String[]{'passwordAssistanceMessage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] passwordAssistanceURL_type_info = new String[]{'passwordAssistanceURL','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] questionRestriction_type_info = new String[]{'questionRestriction','http://soap.sforce.com/2006/04/metadata','QuestionRestriction','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apiOnlyUserHomePageURL','complexity','expiration','historyRestriction','lockoutInterval','maxLoginAttempts','minPasswordLength','passwordAssistanceMessage','passwordAssistanceURL','questionRestriction'}; + private String[] apiOnlyUserHomePageURL_type_info = new String[]{'apiOnlyUserHomePageURL','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] complexity_type_info = new String[]{'complexity','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] expiration_type_info = new String[]{'expiration','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] historyRestriction_type_info = new String[]{'historyRestriction','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lockoutInterval_type_info = new String[]{'lockoutInterval','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] maxLoginAttempts_type_info = new String[]{'maxLoginAttempts','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] minPasswordLength_type_info = new String[]{'minPasswordLength','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] minimumPasswordLifetime_type_info = new String[]{'minimumPasswordLifetime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] obscureSecretAnswer_type_info = new String[]{'obscureSecretAnswer','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] passwordAssistanceMessage_type_info = new String[]{'passwordAssistanceMessage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] passwordAssistanceURL_type_info = new String[]{'passwordAssistanceURL','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] questionRestriction_type_info = new String[]{'questionRestriction','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'apiOnlyUserHomePageURL','complexity','expiration','historyRestriction','lockoutInterval','maxLoginAttempts','minPasswordLength','minimumPasswordLifetime','obscureSecretAnswer','passwordAssistanceMessage','passwordAssistanceURL','questionRestriction'}; } public class QueueSobject { public String sobjectType; - private String[] sobjectType_type_info = new String[]{'sobjectType','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] sobjectType_type_info = new String[]{'sobjectType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'sobjectType'}; } - public class CaseSharingRules { - public MetadataService.CaseCriteriaBasedSharingRule[] criteriaBasedRules; - public MetadataService.CaseOwnerSharingRule[] ownerRules; - private String[] criteriaBasedRules_type_info = new String[]{'criteriaBasedRules','http://soap.sforce.com/2006/04/metadata','CaseCriteriaBasedSharingRule','0','-1','false'}; - private String[] ownerRules_type_info = new String[]{'ownerRules','http://soap.sforce.com/2006/04/metadata','CaseOwnerSharingRule','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'criteriaBasedRules','ownerRules'}; - } public class AgentConfigProfileAssignments { public String[] profile; - private String[] profile_type_info = new String[]{'profile','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + private String[] profile_type_info = new String[]{'profile','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'profile'}; } - public class OpportunityOwnerSharingRule { - public String name; - public String opportunityAccessLevel; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] opportunityAccessLevel_type_info = new String[]{'opportunityAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelReadEdit','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'name','opportunityAccessLevel'}; - } - public class ExternalDataSource { + public class ExternalDataSource extends Metadata { + public String type = 'ExternalDataSource'; + public String fullName; public String apiKey; + public String authProvider; public String certificate; + public String customConfiguration; public String endpoint; public String label; + public String oauthRefreshToken; + public String oauthScope; + public String oauthToken; public String password; public String principalType; public String protocol; @@ -221,27 +198,34 @@ public class MetadataService { public String type_x; public String username; public String version; - private String[] apiKey_type_info = new String[]{'apiKey','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] certificate_type_info = new String[]{'certificate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] endpoint_type_info = new String[]{'endpoint','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] principalType_type_info = new String[]{'principalType','http://soap.sforce.com/2006/04/metadata','ExternalPrincipalType','1','1','false'}; - private String[] protocol_type_info = new String[]{'protocol','http://soap.sforce.com/2006/04/metadata','AuthenticationProtocol','1','1','false'}; - private String[] repository_type_info = new String[]{'repository','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','ExternalDataSourceType','1','1','false'}; - private String[] username_type_info = new String[]{'username','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] version_type_info = new String[]{'version','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apiKey','certificate','endpoint','label','password','principalType','protocol','repository','type_x','username','version'}; + private String[] apiKey_type_info = new String[]{'apiKey','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] authProvider_type_info = new String[]{'authProvider','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] certificate_type_info = new String[]{'certificate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customConfiguration_type_info = new String[]{'customConfiguration','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] endpoint_type_info = new String[]{'endpoint','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] oauthRefreshToken_type_info = new String[]{'oauthRefreshToken','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] oauthScope_type_info = new String[]{'oauthScope','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] oauthToken_type_info = new String[]{'oauthToken','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] password_type_info = new String[]{'password','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] principalType_type_info = new String[]{'principalType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] protocol_type_info = new String[]{'protocol','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] repository_type_info = new String[]{'repository','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] username_type_info = new String[]{'username','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] version_type_info = new String[]{'version','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'apiKey','authProvider','certificate','customConfiguration','endpoint','label','oauthRefreshToken','oauthScope','oauthToken','password','principalType','protocol','repository','type_x','username','version'}; } public class WorkflowEmailRecipient { public String field; public String recipient; public String type_x; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] recipient_type_info = new String[]{'recipient','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','ActionEmailRecipientTypes','1','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recipient_type_info = new String[]{'recipient','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'field','recipient','type_x'}; } @@ -250,14 +234,17 @@ public class MetadataService { public String organizationNamespace; public Boolean partialSaveAllowed; public Boolean testRequired; - private String[] metadataObjects_type_info = new String[]{'metadataObjects','http://soap.sforce.com/2006/04/metadata','DescribeMetadataObject','0','-1','false'}; - private String[] organizationNamespace_type_info = new String[]{'organizationNamespace','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] partialSaveAllowed_type_info = new String[]{'partialSaveAllowed','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] testRequired_type_info = new String[]{'testRequired','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] metadataObjects_type_info = new String[]{'metadataObjects','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] organizationNamespace_type_info = new String[]{'organizationNamespace','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] partialSaveAllowed_type_info = new String[]{'partialSaveAllowed','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] testRequired_type_info = new String[]{'testRequired','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'metadataObjects','organizationNamespace','partialSaveAllowed','testRequired'}; } - public class Scontrol { + public class Scontrol extends MetadataWithContent { + public String type = 'Scontrol'; + public String fullName; + public String content; public String contentSource; public String description; public String encodingKey; @@ -265,15 +252,18 @@ public class MetadataService { public String fileName; public String name; public Boolean supportsCaching; - private String[] contentSource_type_info = new String[]{'contentSource','http://soap.sforce.com/2006/04/metadata','SControlContentSource','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] encodingKey_type_info = new String[]{'encodingKey','http://soap.sforce.com/2006/04/metadata','Encoding','1','1','false'}; - private String[] fileContent_type_info = new String[]{'fileContent','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; - private String[] fileName_type_info = new String[]{'fileName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] supportsCaching_type_info = new String[]{'supportsCaching','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] contentSource_type_info = new String[]{'contentSource','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] encodingKey_type_info = new String[]{'encodingKey','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] fileContent_type_info = new String[]{'fileContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fileName_type_info = new String[]{'fileName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] supportsCaching_type_info = new String[]{'supportsCaching','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'contentSource','description','encodingKey','fileContent','fileName','name','supportsCaching'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'content', 'contentSource','description','encodingKey','fileContent','fileName','name','supportsCaching'}; } public class DashboardComponent { public Boolean autoselectColumnsFromReport; @@ -316,60 +306,82 @@ public class MetadataService { public String sortBy; public String title; public Boolean useReportChart; - private String[] autoselectColumnsFromReport_type_info = new String[]{'autoselectColumnsFromReport','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] chartAxisRange_type_info = new String[]{'chartAxisRange','http://soap.sforce.com/2006/04/metadata','ChartRangeType','0','1','false'}; - private String[] chartAxisRangeMax_type_info = new String[]{'chartAxisRangeMax','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] chartAxisRangeMin_type_info = new String[]{'chartAxisRangeMin','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] chartSummary_type_info = new String[]{'chartSummary','http://soap.sforce.com/2006/04/metadata','ChartSummary','0','-1','false'}; - private String[] componentType_type_info = new String[]{'componentType','http://soap.sforce.com/2006/04/metadata','DashboardComponentType','1','1','false'}; - private String[] dashboardFilterColumns_type_info = new String[]{'dashboardFilterColumns','http://soap.sforce.com/2006/04/metadata','DashboardFilterColumn','0','-1','false'}; - private String[] dashboardTableColumn_type_info = new String[]{'dashboardTableColumn','http://soap.sforce.com/2006/04/metadata','DashboardTableColumn','0','-1','false'}; - private String[] displayUnits_type_info = new String[]{'displayUnits','http://soap.sforce.com/2006/04/metadata','ChartUnits','0','1','false'}; - private String[] drillDownUrl_type_info = new String[]{'drillDownUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] drillEnabled_type_info = new String[]{'drillEnabled','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] drillToDetailEnabled_type_info = new String[]{'drillToDetailEnabled','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableHover_type_info = new String[]{'enableHover','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] expandOthers_type_info = new String[]{'expandOthers','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] footer_type_info = new String[]{'footer','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] gaugeMax_type_info = new String[]{'gaugeMax','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] gaugeMin_type_info = new String[]{'gaugeMin','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] groupingColumn_type_info = new String[]{'groupingColumn','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] header_type_info = new String[]{'header','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] indicatorBreakpoint1_type_info = new String[]{'indicatorBreakpoint1','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] indicatorBreakpoint2_type_info = new String[]{'indicatorBreakpoint2','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] indicatorHighColor_type_info = new String[]{'indicatorHighColor','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] indicatorLowColor_type_info = new String[]{'indicatorLowColor','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] indicatorMiddleColor_type_info = new String[]{'indicatorMiddleColor','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] legendPosition_type_info = new String[]{'legendPosition','http://soap.sforce.com/2006/04/metadata','ChartLegendPosition','0','1','false'}; - private String[] maxValuesDisplayed_type_info = new String[]{'maxValuesDisplayed','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] metricLabel_type_info = new String[]{'metricLabel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] page_x_type_info = new String[]{'page','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] pageHeightInPixels_type_info = new String[]{'pageHeightInPixels','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] report_type_info = new String[]{'report','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] scontrol_type_info = new String[]{'scontrol','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] scontrolHeightInPixels_type_info = new String[]{'scontrolHeightInPixels','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] showPercentage_type_info = new String[]{'showPercentage','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showPicturesOnCharts_type_info = new String[]{'showPicturesOnCharts','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showPicturesOnTables_type_info = new String[]{'showPicturesOnTables','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showTotal_type_info = new String[]{'showTotal','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showValues_type_info = new String[]{'showValues','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] sortBy_type_info = new String[]{'sortBy','http://soap.sforce.com/2006/04/metadata','DashboardComponentFilter','0','1','false'}; - private String[] title_type_info = new String[]{'title','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] useReportChart_type_info = new String[]{'useReportChart','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] autoselectColumnsFromReport_type_info = new String[]{'autoselectColumnsFromReport','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chartAxisRange_type_info = new String[]{'chartAxisRange','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chartAxisRangeMax_type_info = new String[]{'chartAxisRangeMax','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chartAxisRangeMin_type_info = new String[]{'chartAxisRangeMin','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chartSummary_type_info = new String[]{'chartSummary','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] componentType_type_info = new String[]{'componentType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] dashboardFilterColumns_type_info = new String[]{'dashboardFilterColumns','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] dashboardTableColumn_type_info = new String[]{'dashboardTableColumn','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] displayUnits_type_info = new String[]{'displayUnits','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] drillDownUrl_type_info = new String[]{'drillDownUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] drillEnabled_type_info = new String[]{'drillEnabled','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] drillToDetailEnabled_type_info = new String[]{'drillToDetailEnabled','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableHover_type_info = new String[]{'enableHover','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] expandOthers_type_info = new String[]{'expandOthers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] footer_type_info = new String[]{'footer','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] gaugeMax_type_info = new String[]{'gaugeMax','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] gaugeMin_type_info = new String[]{'gaugeMin','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] groupingColumn_type_info = new String[]{'groupingColumn','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] header_type_info = new String[]{'header','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] indicatorBreakpoint1_type_info = new String[]{'indicatorBreakpoint1','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] indicatorBreakpoint2_type_info = new String[]{'indicatorBreakpoint2','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] indicatorHighColor_type_info = new String[]{'indicatorHighColor','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] indicatorLowColor_type_info = new String[]{'indicatorLowColor','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] indicatorMiddleColor_type_info = new String[]{'indicatorMiddleColor','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] legendPosition_type_info = new String[]{'legendPosition','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] maxValuesDisplayed_type_info = new String[]{'maxValuesDisplayed','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] metricLabel_type_info = new String[]{'metricLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] page_x_type_info = new String[]{'page','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] pageHeightInPixels_type_info = new String[]{'pageHeightInPixels','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] report_type_info = new String[]{'report','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scontrol_type_info = new String[]{'scontrol','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scontrolHeightInPixels_type_info = new String[]{'scontrolHeightInPixels','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showPercentage_type_info = new String[]{'showPercentage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showPicturesOnCharts_type_info = new String[]{'showPicturesOnCharts','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showPicturesOnTables_type_info = new String[]{'showPicturesOnTables','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showTotal_type_info = new String[]{'showTotal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showValues_type_info = new String[]{'showValues','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sortBy_type_info = new String[]{'sortBy','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] title_type_info = new String[]{'title','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] useReportChart_type_info = new String[]{'useReportChart','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'autoselectColumnsFromReport','chartAxisRange','chartAxisRangeMax','chartAxisRangeMin','chartSummary','componentType','dashboardFilterColumns','dashboardTableColumn','displayUnits','drillDownUrl','drillEnabled','drillToDetailEnabled','enableHover','expandOthers','footer','gaugeMax','gaugeMin','groupingColumn','header','indicatorBreakpoint1','indicatorBreakpoint2','indicatorHighColor','indicatorLowColor','indicatorMiddleColor','legendPosition','maxValuesDisplayed','metricLabel','page_x','pageHeightInPixels','report','scontrol','scontrolHeightInPixels','showPercentage','showPicturesOnCharts','showPicturesOnTables','showTotal','showValues','sortBy','title','useReportChart'}; } - public class IdeasSettings { + public class WorkflowFlowActionParameter { + public String name; + public String value; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'name','value'}; + } + public class IdeasSettings extends Metadata { + public String type = 'IdeasSettings'; + public String fullName; + public Boolean enableChatterProfile; public Boolean enableIdeaThemes; public Boolean enableIdeas; public Boolean enableIdeasReputation; public Double halfLife; - private String[] enableIdeaThemes_type_info = new String[]{'enableIdeaThemes','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableIdeas_type_info = new String[]{'enableIdeas','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableIdeasReputation_type_info = new String[]{'enableIdeasReputation','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] halfLife_type_info = new String[]{'halfLife','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; + public String ideasProfilePage; + private String[] enableChatterProfile_type_info = new String[]{'enableChatterProfile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableIdeaThemes_type_info = new String[]{'enableIdeaThemes','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableIdeas_type_info = new String[]{'enableIdeas','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableIdeasReputation_type_info = new String[]{'enableIdeasReputation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] halfLife_type_info = new String[]{'halfLife','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] ideasProfilePage_type_info = new String[]{'ideasProfilePage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enableIdeaThemes','enableIdeas','enableIdeasReputation','halfLife'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'enableChatterProfile','enableIdeaThemes','enableIdeas','enableIdeasReputation','halfLife','ideasProfilePage'}; + } + public class deployRecentValidationResponse_element { + public String result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; } public class Country { public Boolean active; @@ -380,56 +392,86 @@ public class MetadataService { public Boolean standard; public MetadataService.State[] states; public Boolean visible; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] integrationValue_type_info = new String[]{'integrationValue','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] isoCode_type_info = new String[]{'isoCode','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] orgDefault_type_info = new String[]{'orgDefault','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] standard_type_info = new String[]{'standard','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] states_type_info = new String[]{'states','http://soap.sforce.com/2006/04/metadata','State','0','-1','false'}; - private String[] visible_type_info = new String[]{'visible','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] integrationValue_type_info = new String[]{'integrationValue','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isoCode_type_info = new String[]{'isoCode','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] orgDefault_type_info = new String[]{'orgDefault','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] standard_type_info = new String[]{'standard','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] states_type_info = new String[]{'states','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] visible_type_info = new String[]{'visible','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'active','integrationValue','isoCode','label','orgDefault','standard','states','visible'}; } + public class PathAssistantStep { + public String[] fieldNames; + public String info; + public String picklistValueName; + private String[] fieldNames_type_info = new String[]{'fieldNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] info_type_info = new String[]{'info','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] picklistValueName_type_info = new String[]{'picklistValueName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'fieldNames','info','picklistValueName'}; + } + public class ConnectedAppOauthConfig { + public String callbackUrl; + public String certificate; + public String consumerKey; + public String consumerSecret; + public String[] scopes; + private String[] callbackUrl_type_info = new String[]{'callbackUrl','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] certificate_type_info = new String[]{'certificate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] consumerKey_type_info = new String[]{'consumerKey','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] consumerSecret_type_info = new String[]{'consumerSecret','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scopes_type_info = new String[]{'scopes','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'callbackUrl','certificate','consumerKey','consumerSecret','scopes'}; + } + public class LiveAgentSettings extends Metadata { + public String type = 'LiveAgentSettings'; + public String fullName; + public Boolean enableLiveAgent; + private String[] enableLiveAgent_type_info = new String[]{'enableLiveAgent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'enableLiveAgent'}; + } public class PermissionSetApexClassAccess { public String apexClass; public Boolean enabled; - private String[] apexClass_type_info = new String[]{'apexClass','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] enabled_type_info = new String[]{'enabled','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] apexClass_type_info = new String[]{'apexClass','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enabled_type_info = new String[]{'enabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'apexClass','enabled'}; } - public class LiveAgentSettings { - public Boolean enableLiveAgent; - private String[] enableLiveAgent_type_info = new String[]{'enableLiveAgent','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + public class LogInfo { + public String category; + public String level; + private String[] category_type_info = new String[]{'category','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] level_type_info = new String[]{'level','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enableLiveAgent'}; + private String[] field_order_type_info = new String[]{'category','level'}; } public class SkillAssignments { public MetadataService.SkillProfileAssignments profiles; public MetadataService.SkillUserAssignments users; - private String[] profiles_type_info = new String[]{'profiles','http://soap.sforce.com/2006/04/metadata','SkillProfileAssignments','0','1','false'}; - private String[] users_type_info = new String[]{'users','http://soap.sforce.com/2006/04/metadata','SkillUserAssignments','0','1','false'}; + private String[] profiles_type_info = new String[]{'profiles','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] users_type_info = new String[]{'users','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'profiles','users'}; } - public class LogInfo { - public String category; - public String level; - private String[] category_type_info = new String[]{'category','http://soap.sforce.com/2006/04/metadata','LogCategory','1','1','false'}; - private String[] level_type_info = new String[]{'level','http://soap.sforce.com/2006/04/metadata','LogCategoryLevel','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'category','level'}; - } public class ReputationLevels { public MetadataService.ChatterAnswersReputationLevel[] chatterAnswersReputationLevels; public MetadataService.IdeaReputationLevel[] ideaReputationLevels; - private String[] chatterAnswersReputationLevels_type_info = new String[]{'chatterAnswersReputationLevels','http://soap.sforce.com/2006/04/metadata','ChatterAnswersReputationLevel','0','-1','false'}; - private String[] ideaReputationLevels_type_info = new String[]{'ideaReputationLevels','http://soap.sforce.com/2006/04/metadata','IdeaReputationLevel','0','-1','false'}; + private String[] chatterAnswersReputationLevels_type_info = new String[]{'chatterAnswersReputationLevels','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] ideaReputationLevels_type_info = new String[]{'ideaReputationLevels','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'chatterAnswersReputationLevels','ideaReputationLevels'}; } - public class ActivitiesSettings { + public class ActivitiesSettings extends Metadata { + public String type = 'ActivitiesSettings'; + public String fullName; public Boolean allowUsersToRelateMultipleContactsToTasksAndEvents; public Boolean enableActivityReminders; public Boolean enableClickCreateEvents; @@ -443,77 +485,113 @@ public class MetadataService { public Boolean enableRecurringEvents; public Boolean enableRecurringTasks; public Boolean enableSidebarCalendarShortcut; + public Boolean enableSimpleTaskCreateUI; + public Boolean enableUNSTaskDelegatedToNotifications; public String meetingRequestsLogo; public Boolean showCustomLogoMeetingRequests; public Boolean showEventDetailsMultiUserCalendar; public Boolean showHomePageHoverLinksForEvents; public Boolean showMyTasksHoverLinks; public Boolean showRequestedMeetingsOnHomePage; - private String[] allowUsersToRelateMultipleContactsToTasksAndEvents_type_info = new String[]{'allowUsersToRelateMultipleContactsToTasksAndEvents','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableActivityReminders_type_info = new String[]{'enableActivityReminders','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableClickCreateEvents_type_info = new String[]{'enableClickCreateEvents','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableDragAndDropScheduling_type_info = new String[]{'enableDragAndDropScheduling','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableEmailTracking_type_info = new String[]{'enableEmailTracking','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableEventScheduler_type_info = new String[]{'enableEventScheduler','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableGroupTasks_type_info = new String[]{'enableGroupTasks','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableListViewScheduling_type_info = new String[]{'enableListViewScheduling','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableLogNote_type_info = new String[]{'enableLogNote','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableMultidayEvents_type_info = new String[]{'enableMultidayEvents','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableRecurringEvents_type_info = new String[]{'enableRecurringEvents','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableRecurringTasks_type_info = new String[]{'enableRecurringTasks','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableSidebarCalendarShortcut_type_info = new String[]{'enableSidebarCalendarShortcut','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] meetingRequestsLogo_type_info = new String[]{'meetingRequestsLogo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] showCustomLogoMeetingRequests_type_info = new String[]{'showCustomLogoMeetingRequests','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showEventDetailsMultiUserCalendar_type_info = new String[]{'showEventDetailsMultiUserCalendar','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showHomePageHoverLinksForEvents_type_info = new String[]{'showHomePageHoverLinksForEvents','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showMyTasksHoverLinks_type_info = new String[]{'showMyTasksHoverLinks','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showRequestedMeetingsOnHomePage_type_info = new String[]{'showRequestedMeetingsOnHomePage','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'allowUsersToRelateMultipleContactsToTasksAndEvents','enableActivityReminders','enableClickCreateEvents','enableDragAndDropScheduling','enableEmailTracking','enableEventScheduler','enableGroupTasks','enableListViewScheduling','enableLogNote','enableMultidayEvents','enableRecurringEvents','enableRecurringTasks','enableSidebarCalendarShortcut','meetingRequestsLogo','showCustomLogoMeetingRequests','showEventDetailsMultiUserCalendar','showHomePageHoverLinksForEvents','showMyTasksHoverLinks','showRequestedMeetingsOnHomePage'}; + private String[] allowUsersToRelateMultipleContactsToTasksAndEvents_type_info = new String[]{'allowUsersToRelateMultipleContactsToTasksAndEvents','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableActivityReminders_type_info = new String[]{'enableActivityReminders','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableClickCreateEvents_type_info = new String[]{'enableClickCreateEvents','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableDragAndDropScheduling_type_info = new String[]{'enableDragAndDropScheduling','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableEmailTracking_type_info = new String[]{'enableEmailTracking','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableEventScheduler_type_info = new String[]{'enableEventScheduler','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableGroupTasks_type_info = new String[]{'enableGroupTasks','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableListViewScheduling_type_info = new String[]{'enableListViewScheduling','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableLogNote_type_info = new String[]{'enableLogNote','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableMultidayEvents_type_info = new String[]{'enableMultidayEvents','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableRecurringEvents_type_info = new String[]{'enableRecurringEvents','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableRecurringTasks_type_info = new String[]{'enableRecurringTasks','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableSidebarCalendarShortcut_type_info = new String[]{'enableSidebarCalendarShortcut','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableSimpleTaskCreateUI_type_info = new String[]{'enableSimpleTaskCreateUI','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableUNSTaskDelegatedToNotifications_type_info = new String[]{'enableUNSTaskDelegatedToNotifications','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] meetingRequestsLogo_type_info = new String[]{'meetingRequestsLogo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showCustomLogoMeetingRequests_type_info = new String[]{'showCustomLogoMeetingRequests','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showEventDetailsMultiUserCalendar_type_info = new String[]{'showEventDetailsMultiUserCalendar','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showHomePageHoverLinksForEvents_type_info = new String[]{'showHomePageHoverLinksForEvents','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showMyTasksHoverLinks_type_info = new String[]{'showMyTasksHoverLinks','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showRequestedMeetingsOnHomePage_type_info = new String[]{'showRequestedMeetingsOnHomePage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'allowUsersToRelateMultipleContactsToTasksAndEvents','enableActivityReminders','enableClickCreateEvents','enableDragAndDropScheduling','enableEmailTracking','enableEventScheduler','enableGroupTasks','enableListViewScheduling','enableLogNote','enableMultidayEvents','enableRecurringEvents','enableRecurringTasks','enableSidebarCalendarShortcut','enableSimpleTaskCreateUI','enableUNSTaskDelegatedToNotifications','meetingRequestsLogo','showCustomLogoMeetingRequests','showEventDetailsMultiUserCalendar','showHomePageHoverLinksForEvents','showMyTasksHoverLinks','showRequestedMeetingsOnHomePage'}; } public class WorkflowTaskTranslation { public String description; public String name; public String subject; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] subject_type_info = new String[]{'subject','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] subject_type_info = new String[]{'subject','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'description','name','subject'}; } public class FlowElement { public String description; public String name; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'description','name'}; } public class FlowInputFieldAssignment { public String field; public MetadataService.FlowElementReferenceOrValue value; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata','FlowElementReferenceOrValue','0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'field','value'}; } public class DashboardComponentSection { public String columnSize; public MetadataService.DashboardComponent[] components; - private String[] columnSize_type_info = new String[]{'columnSize','http://soap.sforce.com/2006/04/metadata','DashboardComponentSize','1','1','false'}; - private String[] components_type_info = new String[]{'components','http://soap.sforce.com/2006/04/metadata','DashboardComponent','0','-1','false'}; + private String[] columnSize_type_info = new String[]{'columnSize','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] components_type_info = new String[]{'components','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'columnSize','components'}; } + public class FlowLoop { + public String assignNextValueToReference; + public String collectionReference; + public String iterationOrder; + public MetadataService.FlowConnector nextValueConnector; + public MetadataService.FlowConnector noMoreValuesConnector; + private String[] assignNextValueToReference_type_info = new String[]{'assignNextValueToReference','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] collectionReference_type_info = new String[]{'collectionReference','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] iterationOrder_type_info = new String[]{'iterationOrder','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] nextValueConnector_type_info = new String[]{'nextValueConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] noMoreValuesConnector_type_info = new String[]{'noMoreValuesConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'assignNextValueToReference','collectionReference','iterationOrder','nextValueConnector','noMoreValuesConnector'}; + } + public class ReputationPointsRule { + public String eventType; + public Integer points; + private String[] eventType_type_info = new String[]{'eventType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] points_type_info = new String[]{'points','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'eventType','points'}; + } + public class FlowActionCallInputParameter { + public String name; + public MetadataService.FlowElementReferenceOrValue value; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'name','value'}; + } public class ReportTypeColumn { public Boolean checkedByDefault; public String displayNameOverride; public String field; public String table; - private String[] checkedByDefault_type_info = new String[]{'checkedByDefault','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] displayNameOverride_type_info = new String[]{'displayNameOverride','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] table_type_info = new String[]{'table','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] checkedByDefault_type_info = new String[]{'checkedByDefault','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] displayNameOverride_type_info = new String[]{'displayNameOverride','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] table_type_info = new String[]{'table','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'checkedByDefault','displayNameOverride','field','table'}; } @@ -526,56 +604,102 @@ public class MetadataService { public Boolean openNewVFPageSubtab; public MetadataService.PagesToOpen pagesToOpen; public Boolean showKnowledgeArticles; - private String[] enableLiveChat_type_info = new String[]{'enableLiveChat','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] openNewAccountSubtab_type_info = new String[]{'openNewAccountSubtab','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] openNewCaseSubtab_type_info = new String[]{'openNewCaseSubtab','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] openNewContactSubtab_type_info = new String[]{'openNewContactSubtab','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] openNewLeadSubtab_type_info = new String[]{'openNewLeadSubtab','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] openNewVFPageSubtab_type_info = new String[]{'openNewVFPageSubtab','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] pagesToOpen_type_info = new String[]{'pagesToOpen','http://soap.sforce.com/2006/04/metadata','PagesToOpen','0','1','false'}; - private String[] showKnowledgeArticles_type_info = new String[]{'showKnowledgeArticles','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] enableLiveChat_type_info = new String[]{'enableLiveChat','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] openNewAccountSubtab_type_info = new String[]{'openNewAccountSubtab','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] openNewCaseSubtab_type_info = new String[]{'openNewCaseSubtab','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] openNewContactSubtab_type_info = new String[]{'openNewContactSubtab','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] openNewLeadSubtab_type_info = new String[]{'openNewLeadSubtab','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] openNewVFPageSubtab_type_info = new String[]{'openNewVFPageSubtab','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] pagesToOpen_type_info = new String[]{'pagesToOpen','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showKnowledgeArticles_type_info = new String[]{'showKnowledgeArticles','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'enableLiveChat','openNewAccountSubtab','openNewCaseSubtab','openNewContactSubtab','openNewLeadSubtab','openNewVFPageSubtab','pagesToOpen','showKnowledgeArticles'}; } + public class WeightedSourceCategory { + public String sourceCategoryApiName; + public Double weight; + private String[] sourceCategoryApiName_type_info = new String[]{'sourceCategoryApiName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] weight_type_info = new String[]{'weight','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'sourceCategoryApiName','weight'}; + } public class KnowledgeSitesSettings { public String[] site; - private String[] site_type_info = new String[]{'site','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + private String[] site_type_info = new String[]{'site','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'site'}; } - public class FlowRecordUpdate { - public MetadataService.FlowConnector connector; - public MetadataService.FlowConnector faultConnector; - public MetadataService.FlowRecordFilter[] filters; - public MetadataService.FlowInputFieldAssignment[] inputAssignments; - public String object_x; - private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] filters_type_info = new String[]{'filters','http://soap.sforce.com/2006/04/metadata','FlowRecordFilter','0','-1','false'}; - private String[] inputAssignments_type_info = new String[]{'inputAssignments','http://soap.sforce.com/2006/04/metadata','FlowInputFieldAssignment','0','-1','false'}; - private String[] object_x_type_info = new String[]{'object','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class CustomMetadata extends Metadata { + public String type = 'CustomMetadata'; + public String fullName; + public String description; + public String label; + public MetadataService.CustomMetadataValue[] values; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] values_type_info = new String[]{'values','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'description','label','values'}; + } + public class VisualizationPlugin extends Metadata { + public String type = 'VisualizationPlugin'; + public String fullName; + public String description; + public String developerName; + public String icon; + public String masterLabel; + public MetadataService.VisualizationResource[] visualizationResources; + public MetadataService.VisualizationType[] visualizationTypes; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] developerName_type_info = new String[]{'developerName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] icon_type_info = new String[]{'icon','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] visualizationResources_type_info = new String[]{'visualizationResources','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] visualizationTypes_type_info = new String[]{'visualizationTypes','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'description','developerName','icon','masterLabel','visualizationResources','visualizationTypes'}; + } + public class ApprovalPageField { + public String[] field; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'connector','faultConnector','filters','inputAssignments','object_x'}; + private String[] field_order_type_info = new String[]{'field'}; } public class FlowRule { public String conditionLogic; public MetadataService.FlowCondition[] conditions; public MetadataService.FlowConnector connector; public String label; - private String[] conditionLogic_type_info = new String[]{'conditionLogic','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] conditions_type_info = new String[]{'conditions','http://soap.sforce.com/2006/04/metadata','FlowCondition','0','-1','false'}; - private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] conditionLogic_type_info = new String[]{'conditionLogic','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] conditions_type_info = new String[]{'conditions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'conditionLogic','conditions','connector','label'}; } - public class ApprovalPageField { - public String[] field; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + public class FlowRecordUpdate { + public MetadataService.FlowConnector connector; + public MetadataService.FlowConnector faultConnector; + public MetadataService.FlowRecordFilter[] filters; + public MetadataService.FlowInputFieldAssignment[] inputAssignments; + public String inputReference; + public String object_x; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] filters_type_info = new String[]{'filters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] inputAssignments_type_info = new String[]{'inputAssignments','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] inputReference_type_info = new String[]{'inputReference','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] object_x_type_info = new String[]{'object','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'field'}; + private String[] field_order_type_info = new String[]{'connector','faultConnector','filters','inputAssignments','inputReference','object_x'}; } - public class CustomSite { + public class CustomSite extends Metadata { + public String type = 'CustomSite'; + public String fullName; public Boolean active; public Boolean allowHomePage; public Boolean allowStandardAnswersPages; @@ -591,10 +715,12 @@ public class MetadataService { public String chatterAnswersHelpPage; public String chatterAnswersLoginPage; public String chatterAnswersRegistrationPage; + public String clickjackProtectionLevel; public MetadataService.SiteWebAddress[] customWebAddresses; public String description; public String favoriteIcon; public String fileNotFoundPage; + public String forgotPasswordPage; public String genericErrorPage; public String guestProfile; public String inMaintenancePage; @@ -603,9 +729,11 @@ public class MetadataService { public String masterLabel; public String myProfilePage; public String portal; + public Boolean requireHttps; public Boolean requireInsecurePortalAccess; public String robotsTxtPage; public String rootComponent; + public String selfRegPage; public String serverIsDown; public String siteAdmin; public MetadataService.SiteRedirectMapping[] siteRedirectMappings; @@ -613,74 +741,74 @@ public class MetadataService { public String siteType; public String subdomain; public String urlPathPrefix; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] allowHomePage_type_info = new String[]{'allowHomePage','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] allowStandardAnswersPages_type_info = new String[]{'allowStandardAnswersPages','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] allowStandardIdeasPages_type_info = new String[]{'allowStandardIdeasPages','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] allowStandardLookups_type_info = new String[]{'allowStandardLookups','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] allowStandardSearch_type_info = new String[]{'allowStandardSearch','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] analyticsTrackingCode_type_info = new String[]{'analyticsTrackingCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] authorizationRequiredPage_type_info = new String[]{'authorizationRequiredPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] bandwidthExceededPage_type_info = new String[]{'bandwidthExceededPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] changePasswordPage_type_info = new String[]{'changePasswordPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] chatterAnswersForgotPasswordConfirmPage_type_info = new String[]{'chatterAnswersForgotPasswordConfirmPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] chatterAnswersForgotPasswordPage_type_info = new String[]{'chatterAnswersForgotPasswordPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] chatterAnswersHelpPage_type_info = new String[]{'chatterAnswersHelpPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] chatterAnswersLoginPage_type_info = new String[]{'chatterAnswersLoginPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] chatterAnswersRegistrationPage_type_info = new String[]{'chatterAnswersRegistrationPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] customWebAddresses_type_info = new String[]{'customWebAddresses','http://soap.sforce.com/2006/04/metadata','SiteWebAddress','0','-1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] favoriteIcon_type_info = new String[]{'favoriteIcon','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] fileNotFoundPage_type_info = new String[]{'fileNotFoundPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] genericErrorPage_type_info = new String[]{'genericErrorPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] guestProfile_type_info = new String[]{'guestProfile','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] inMaintenancePage_type_info = new String[]{'inMaintenancePage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] inactiveIndexPage_type_info = new String[]{'inactiveIndexPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] indexPage_type_info = new String[]{'indexPage','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] masterLabel_type_info = new String[]{'masterLabel','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] myProfilePage_type_info = new String[]{'myProfilePage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] portal_type_info = new String[]{'portal','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] requireInsecurePortalAccess_type_info = new String[]{'requireInsecurePortalAccess','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] robotsTxtPage_type_info = new String[]{'robotsTxtPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] rootComponent_type_info = new String[]{'rootComponent','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] serverIsDown_type_info = new String[]{'serverIsDown','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] siteAdmin_type_info = new String[]{'siteAdmin','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] siteRedirectMappings_type_info = new String[]{'siteRedirectMappings','http://soap.sforce.com/2006/04/metadata','SiteRedirectMapping','0','-1','false'}; - private String[] siteTemplate_type_info = new String[]{'siteTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] siteType_type_info = new String[]{'siteType','http://soap.sforce.com/2006/04/metadata','SiteType','1','1','false'}; - private String[] subdomain_type_info = new String[]{'subdomain','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] urlPathPrefix_type_info = new String[]{'urlPathPrefix','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','allowHomePage','allowStandardAnswersPages','allowStandardIdeasPages','allowStandardLookups','allowStandardSearch','analyticsTrackingCode','authorizationRequiredPage','bandwidthExceededPage','changePasswordPage','chatterAnswersForgotPasswordConfirmPage','chatterAnswersForgotPasswordPage','chatterAnswersHelpPage','chatterAnswersLoginPage','chatterAnswersRegistrationPage','customWebAddresses','description','favoriteIcon','fileNotFoundPage','genericErrorPage','guestProfile','inMaintenancePage','inactiveIndexPage','indexPage','masterLabel','myProfilePage','portal','requireInsecurePortalAccess','robotsTxtPage','rootComponent','serverIsDown','siteAdmin','siteRedirectMappings','siteTemplate','siteType','subdomain','urlPathPrefix'}; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] allowHomePage_type_info = new String[]{'allowHomePage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] allowStandardAnswersPages_type_info = new String[]{'allowStandardAnswersPages','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] allowStandardIdeasPages_type_info = new String[]{'allowStandardIdeasPages','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] allowStandardLookups_type_info = new String[]{'allowStandardLookups','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] allowStandardSearch_type_info = new String[]{'allowStandardSearch','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] analyticsTrackingCode_type_info = new String[]{'analyticsTrackingCode','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] authorizationRequiredPage_type_info = new String[]{'authorizationRequiredPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] bandwidthExceededPage_type_info = new String[]{'bandwidthExceededPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] changePasswordPage_type_info = new String[]{'changePasswordPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chatterAnswersForgotPasswordConfirmPage_type_info = new String[]{'chatterAnswersForgotPasswordConfirmPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chatterAnswersForgotPasswordPage_type_info = new String[]{'chatterAnswersForgotPasswordPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chatterAnswersHelpPage_type_info = new String[]{'chatterAnswersHelpPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chatterAnswersLoginPage_type_info = new String[]{'chatterAnswersLoginPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chatterAnswersRegistrationPage_type_info = new String[]{'chatterAnswersRegistrationPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] clickjackProtectionLevel_type_info = new String[]{'clickjackProtectionLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] customWebAddresses_type_info = new String[]{'customWebAddresses','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] favoriteIcon_type_info = new String[]{'favoriteIcon','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fileNotFoundPage_type_info = new String[]{'fileNotFoundPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] forgotPasswordPage_type_info = new String[]{'forgotPasswordPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] genericErrorPage_type_info = new String[]{'genericErrorPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] guestProfile_type_info = new String[]{'guestProfile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] inMaintenancePage_type_info = new String[]{'inMaintenancePage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] inactiveIndexPage_type_info = new String[]{'inactiveIndexPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] indexPage_type_info = new String[]{'indexPage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] myProfilePage_type_info = new String[]{'myProfilePage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] portal_type_info = new String[]{'portal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] requireHttps_type_info = new String[]{'requireHttps','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] requireInsecurePortalAccess_type_info = new String[]{'requireInsecurePortalAccess','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] robotsTxtPage_type_info = new String[]{'robotsTxtPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] rootComponent_type_info = new String[]{'rootComponent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] selfRegPage_type_info = new String[]{'selfRegPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] serverIsDown_type_info = new String[]{'serverIsDown','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] siteAdmin_type_info = new String[]{'siteAdmin','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] siteRedirectMappings_type_info = new String[]{'siteRedirectMappings','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] siteTemplate_type_info = new String[]{'siteTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] siteType_type_info = new String[]{'siteType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] subdomain_type_info = new String[]{'subdomain','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] urlPathPrefix_type_info = new String[]{'urlPathPrefix','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','allowHomePage','allowStandardAnswersPages','allowStandardIdeasPages','allowStandardLookups','allowStandardSearch','analyticsTrackingCode','authorizationRequiredPage','bandwidthExceededPage','changePasswordPage','chatterAnswersForgotPasswordConfirmPage','chatterAnswersForgotPasswordPage','chatterAnswersHelpPage','chatterAnswersLoginPage','chatterAnswersRegistrationPage','clickjackProtectionLevel','customWebAddresses','description','favoriteIcon','fileNotFoundPage','forgotPasswordPage','genericErrorPage','guestProfile','inMaintenancePage','inactiveIndexPage','indexPage','masterLabel','myProfilePage','portal','requireHttps','requireInsecurePortalAccess','robotsTxtPage','rootComponent','selfRegPage','serverIsDown','siteAdmin','siteRedirectMappings','siteTemplate','siteType','subdomain','urlPathPrefix'}; } public class ReportBlockInfo { public MetadataService.ReportAggregateReference[] aggregateReferences; public String blockId; public String joinTable; - private String[] aggregateReferences_type_info = new String[]{'aggregateReferences','http://soap.sforce.com/2006/04/metadata','ReportAggregateReference','0','-1','false'}; - private String[] blockId_type_info = new String[]{'blockId','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] joinTable_type_info = new String[]{'joinTable','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] aggregateReferences_type_info = new String[]{'aggregateReferences','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] blockId_type_info = new String[]{'blockId','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] joinTable_type_info = new String[]{'joinTable','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'aggregateReferences','blockId','joinTable'}; } public class describeMetadataResponse_element { public MetadataService.DescribeMetadataResult result; - private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata','DescribeMetadataResult','1','1','false'}; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'result'}; } - public class CaseOwnerSharingRule { - public String caseAccessLevel; - public String name; - private String[] caseAccessLevel_type_info = new String[]{'caseAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelReadEdit','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'caseAccessLevel','name'}; - } public class DeployMessage { public Boolean changed; public Integer columnNumber; + public String componentType; public Boolean created; + public DateTime createdDate; public Boolean deleted; public String fileName; public String fullName; @@ -689,37 +817,34 @@ public class MetadataService { public String problem; public String problemType; public Boolean success; - private String[] changed_type_info = new String[]{'changed','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] columnNumber_type_info = new String[]{'columnNumber','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] created_type_info = new String[]{'created','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] deleted_type_info = new String[]{'deleted','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] fileName_type_info = new String[]{'fileName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] id_type_info = new String[]{'id','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] lineNumber_type_info = new String[]{'lineNumber','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] problem_type_info = new String[]{'problem','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] problemType_type_info = new String[]{'problemType','http://soap.sforce.com/2006/04/metadata','DeployProblemType','0','1','false'}; - private String[] success_type_info = new String[]{'success','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'changed','columnNumber','created','deleted','fileName','fullName','id','lineNumber','problem','problemType','success'}; + private String[] changed_type_info = new String[]{'changed','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] columnNumber_type_info = new String[]{'columnNumber','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] componentType_type_info = new String[]{'componentType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] created_type_info = new String[]{'created','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] createdDate_type_info = new String[]{'createdDate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] deleted_type_info = new String[]{'deleted','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] fileName_type_info = new String[]{'fileName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] fullName_type_info = new String[]{'fullName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lineNumber_type_info = new String[]{'lineNumber','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] problem_type_info = new String[]{'problem','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] problemType_type_info = new String[]{'problemType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] success_type_info = new String[]{'success','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'changed','columnNumber','componentType','created','createdDate','deleted','fileName','fullName','id','lineNumber','problem','problemType','success'}; } public class FlowSubflowInputAssignment { public String name; public MetadataService.FlowElementReferenceOrValue value; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata','FlowElementReferenceOrValue','0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'name','value'}; } - public class Group_x { - public Boolean doesIncludeBosses; - public String name; - private String[] doesIncludeBosses_type_info = new String[]{'doesIncludeBosses','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'doesIncludeBosses','name'}; - } - public class ReportType { + public class ReportType extends Metadata { + public String type = 'ReportType'; + public String fullName; + public Boolean autogenerated; public String baseObject; public String category; public Boolean deployed; @@ -727,17 +852,34 @@ public class MetadataService { public MetadataService.ObjectRelationship join_x; public String label; public MetadataService.ReportLayoutSection[] sections; - private String[] baseObject_type_info = new String[]{'baseObject','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] category_type_info = new String[]{'category','http://soap.sforce.com/2006/04/metadata','ReportTypeCategory','1','1','false'}; - private String[] deployed_type_info = new String[]{'deployed','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] join_x_type_info = new String[]{'join','http://soap.sforce.com/2006/04/metadata','ObjectRelationship','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] sections_type_info = new String[]{'sections','http://soap.sforce.com/2006/04/metadata','ReportLayoutSection','0','-1','false'}; + private String[] autogenerated_type_info = new String[]{'autogenerated','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] baseObject_type_info = new String[]{'baseObject','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] category_type_info = new String[]{'category','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] deployed_type_info = new String[]{'deployed','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] join_x_type_info = new String[]{'join','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sections_type_info = new String[]{'sections','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'baseObject','category','deployed','description','join_x','label','sections'}; - } - public class CustomPageWebLink { + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'autogenerated','baseObject','category','deployed','description','join_x','label','sections'}; + } + public class Action { + public Boolean block; + public Boolean endSession; + public MetadataService.Notification[] notifications; + public Boolean twoFactorAuthentication; + private String[] block_type_info = new String[]{'block','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] endSession_type_info = new String[]{'endSession','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] notifications_type_info = new String[]{'notifications','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] twoFactorAuthentication_type_info = new String[]{'twoFactorAuthentication','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'block','endSession','notifications','twoFactorAuthentication'}; + } + public class CustomPageWebLink extends Metadata { + public String type = 'CustomPageWebLink'; + public String fullName; public String availability; public String description; public String displayType; @@ -759,29 +901,31 @@ public class MetadataService { public Boolean showsStatus; public String url; public Integer width; - private String[] availability_type_info = new String[]{'availability','http://soap.sforce.com/2006/04/metadata','WebLinkAvailability','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] displayType_type_info = new String[]{'displayType','http://soap.sforce.com/2006/04/metadata','WebLinkDisplayType','1','1','false'}; - private String[] encodingKey_type_info = new String[]{'encodingKey','http://soap.sforce.com/2006/04/metadata','Encoding','0','1','false'}; - private String[] hasMenubar_type_info = new String[]{'hasMenubar','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] hasScrollbars_type_info = new String[]{'hasScrollbars','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] hasToolbar_type_info = new String[]{'hasToolbar','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] height_type_info = new String[]{'height','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] isResizable_type_info = new String[]{'isResizable','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] linkType_type_info = new String[]{'linkType','http://soap.sforce.com/2006/04/metadata','WebLinkType','1','1','false'}; - private String[] masterLabel_type_info = new String[]{'masterLabel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] openType_type_info = new String[]{'openType','http://soap.sforce.com/2006/04/metadata','WebLinkWindowType','1','1','false'}; - private String[] page_x_type_info = new String[]{'page','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] position_type_info = new String[]{'position','http://soap.sforce.com/2006/04/metadata','WebLinkPosition','0','1','false'}; - private String[] protected_x_type_info = new String[]{'protected','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] requireRowSelection_type_info = new String[]{'requireRowSelection','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] scontrol_type_info = new String[]{'scontrol','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] showsLocation_type_info = new String[]{'showsLocation','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showsStatus_type_info = new String[]{'showsStatus','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] url_type_info = new String[]{'url','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] width_type_info = new String[]{'width','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'availability','description','displayType','encodingKey','hasMenubar','hasScrollbars','hasToolbar','height','isResizable','linkType','masterLabel','openType','page_x','position','protected_x','requireRowSelection','scontrol','showsLocation','showsStatus','url','width'}; + private String[] availability_type_info = new String[]{'availability','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] displayType_type_info = new String[]{'displayType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] encodingKey_type_info = new String[]{'encodingKey','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] hasMenubar_type_info = new String[]{'hasMenubar','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] hasScrollbars_type_info = new String[]{'hasScrollbars','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] hasToolbar_type_info = new String[]{'hasToolbar','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isResizable_type_info = new String[]{'isResizable','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] linkType_type_info = new String[]{'linkType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] openType_type_info = new String[]{'openType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] page_x_type_info = new String[]{'page','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] position_type_info = new String[]{'position','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] requireRowSelection_type_info = new String[]{'requireRowSelection','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scontrol_type_info = new String[]{'scontrol','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showsLocation_type_info = new String[]{'showsLocation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showsStatus_type_info = new String[]{'showsStatus','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] url_type_info = new String[]{'url','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'availability','description','displayType','encodingKey','hasMenubar','hasScrollbars','hasToolbar','height','isResizable','linkType','masterLabel','openType','page_x','position','protected_x','requireRowSelection','scontrol','showsLocation','showsStatus','url','width'}; } public class CodeCoverageResult { public MetadataService.CodeLocation[] dmlInfo; @@ -795,145 +939,235 @@ public class MetadataService { public MetadataService.CodeLocation[] soqlInfo; public MetadataService.CodeLocation[] soslInfo; public String type_x; - private String[] dmlInfo_type_info = new String[]{'dmlInfo','http://soap.sforce.com/2006/04/metadata','CodeLocation','0','-1','false'}; - private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata','ID','1','1','false'}; - private String[] locationsNotCovered_type_info = new String[]{'locationsNotCovered','http://soap.sforce.com/2006/04/metadata','CodeLocation','0','-1','false'}; - private String[] methodInfo_type_info = new String[]{'methodInfo','http://soap.sforce.com/2006/04/metadata','CodeLocation','0','-1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] namespace_type_info = new String[]{'namespace','http://www.w3.org/2001/XMLSchema','string','1','1','true'}; - private String[] numLocations_type_info = new String[]{'numLocations','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] numLocationsNotCovered_type_info = new String[]{'numLocationsNotCovered','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] soqlInfo_type_info = new String[]{'soqlInfo','http://soap.sforce.com/2006/04/metadata','CodeLocation','0','-1','false'}; - private String[] soslInfo_type_info = new String[]{'soslInfo','http://soap.sforce.com/2006/04/metadata','CodeLocation','0','-1','false'}; - private String[] type_x_type_info = new String[]{'type','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] dmlInfo_type_info = new String[]{'dmlInfo','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] locationsNotCovered_type_info = new String[]{'locationsNotCovered','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] methodInfo_type_info = new String[]{'methodInfo','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] namespace_type_info = new String[]{'namespace','http://soap.sforce.com/2006/04/metadata',null,'1','1','true'}; + private String[] numLocations_type_info = new String[]{'numLocations','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] numLocationsNotCovered_type_info = new String[]{'numLocationsNotCovered','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] soqlInfo_type_info = new String[]{'soqlInfo','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] soslInfo_type_info = new String[]{'soslInfo','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'dmlInfo','id','locationsNotCovered','methodInfo','name','namespace','numLocations','numLocationsNotCovered','soqlInfo','soslInfo','type_x'}; } + public class renameMetadata_element { + public String type_x; + public String oldFullName; + public String newFullName; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] oldFullName_type_info = new String[]{'oldFullName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] newFullName_type_info = new String[]{'newFullName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'type_x','oldFullName','newFullName'}; + } + public class SharingCriteriaRule extends SharingBaseRule { + public String type = 'SharingCriteriaRule'; + public String fullName; + public String accessLevel; + public MetadataService.AccountSharingRuleSettings accountSettings; + public String description; + public String label; + public MetadataService.SharedTo sharedTo; + private String[] accessLevel_type_info = new String[]{'accessLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] accountSettings_type_info = new String[]{'accountSettings','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + public String booleanFilter; + public MetadataService.FilterItem[] criteriaItems; + private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName','accessLevel','accountSettings','description','label','sharedTo', 'booleanFilter','criteriaItems'}; + } public class NetworkAccess { public MetadataService.IpRange[] ipRanges; - private String[] ipRanges_type_info = new String[]{'ipRanges','http://soap.sforce.com/2006/04/metadata','IpRange','0','-1','false'}; + private String[] ipRanges_type_info = new String[]{'ipRanges','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'ipRanges'}; } public class RecordTypePicklistValue { public String picklist; public MetadataService.PicklistValue[] values; - private String[] picklist_type_info = new String[]{'picklist','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] values_type_info = new String[]{'values','http://soap.sforce.com/2006/04/metadata','PicklistValue','0','-1','false'}; + private String[] picklist_type_info = new String[]{'picklist','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] values_type_info = new String[]{'values','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'picklist','values'}; } public class describeMetadata_element { public Double asOfVersion; - private String[] asOfVersion_type_info = new String[]{'asOfVersion','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; + private String[] asOfVersion_type_info = new String[]{'asOfVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'asOfVersion'}; } public class DashboardFilterColumn { public String column; - private String[] column_type_info = new String[]{'column','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] column_type_info = new String[]{'column','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'column'}; } + public class Territory2RuleAssociation { + public Boolean inherited; + public String ruleName; + private String[] inherited_type_info = new String[]{'inherited','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] ruleName_type_info = new String[]{'ruleName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'inherited','ruleName'}; + } public class ReportParam { public String name; public String value; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'name','value'}; } - public class RoleOrTerritory { + public class RoleOrTerritory extends Metadata { + public String type = 'RoleOrTerritory'; + public String fullName; public String caseAccessLevel; public String contactAccessLevel; public String description; public Boolean mayForecastManagerShare; public String name; public String opportunityAccessLevel; - private String[] caseAccessLevel_type_info = new String[]{'caseAccessLevel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] contactAccessLevel_type_info = new String[]{'contactAccessLevel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] mayForecastManagerShare_type_info = new String[]{'mayForecastManagerShare','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] opportunityAccessLevel_type_info = new String[]{'opportunityAccessLevel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] caseAccessLevel_type_info = new String[]{'caseAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] contactAccessLevel_type_info = new String[]{'contactAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] mayForecastManagerShare_type_info = new String[]{'mayForecastManagerShare','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] opportunityAccessLevel_type_info = new String[]{'opportunityAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'caseAccessLevel','contactAccessLevel','description','mayForecastManagerShare','name','opportunityAccessLevel'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'caseAccessLevel','contactAccessLevel','description','mayForecastManagerShare','name','opportunityAccessLevel'}; } - public class WorkflowActionReference { + public class ActionLinkGroupTemplate extends Metadata { + public String type = 'ActionLinkGroupTemplate'; + public String fullName; + public MetadataService.ActionLinkTemplate[] actionLinkTemplates; + public String category; + public String executionsAllowed; + public Integer hoursUntilExpiration; + public Boolean isPublished; public String name; - public String type_x; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','WorkflowActionType','1','1','false'}; + private String[] actionLinkTemplates_type_info = new String[]{'actionLinkTemplates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] category_type_info = new String[]{'category','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] executionsAllowed_type_info = new String[]{'executionsAllowed','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] hoursUntilExpiration_type_info = new String[]{'hoursUntilExpiration','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isPublished_type_info = new String[]{'isPublished','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'name','type_x'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'actionLinkTemplates','category','executionsAllowed','hoursUntilExpiration','isPublished','name'}; + } + public class ForecastingTypeSettings { + public Boolean active; + public MetadataService.AdjustmentsSettings adjustmentsSettings; + public String[] displayedCategoryApiNames; + public MetadataService.ForecastRangeSettings forecastRangeSettings; + public String[] forecastedCategoryApiNames; + public String[] managerAdjustableCategoryApiNames; + public String name; + public MetadataService.OpportunityListFieldsSelectedSettings opportunityListFieldsSelectedSettings; + public String[] ownerAdjustableCategoryApiNames; + public MetadataService.QuotasSettings quotasSettings; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] adjustmentsSettings_type_info = new String[]{'adjustmentsSettings','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] displayedCategoryApiNames_type_info = new String[]{'displayedCategoryApiNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] forecastRangeSettings_type_info = new String[]{'forecastRangeSettings','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] forecastedCategoryApiNames_type_info = new String[]{'forecastedCategoryApiNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] managerAdjustableCategoryApiNames_type_info = new String[]{'managerAdjustableCategoryApiNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] opportunityListFieldsSelectedSettings_type_info = new String[]{'opportunityListFieldsSelectedSettings','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] ownerAdjustableCategoryApiNames_type_info = new String[]{'ownerAdjustableCategoryApiNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] quotasSettings_type_info = new String[]{'quotasSettings','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'active','adjustmentsSettings','displayedCategoryApiNames','forecastRangeSettings','forecastedCategoryApiNames','managerAdjustableCategoryApiNames','name','opportunityListFieldsSelectedSettings','ownerAdjustableCategoryApiNames','quotasSettings'}; } public class FlowApexPluginCallInputParameter { public String name; public MetadataService.FlowElementReferenceOrValue value; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata','FlowElementReferenceOrValue','0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'name','value'}; } - public class Role { - public String parentRole; - private String[] parentRole_type_info = new String[]{'parentRole','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + public class WorkflowActionReference { + public String name; + public String type_x; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'parentRole'}; + private String[] field_order_type_info = new String[]{'name','type_x'}; } public class RetrieveResult { + public Boolean done; + public String errorMessage; + public String errorStatusCode; public MetadataService.FileProperties[] fileProperties; public String id; public MetadataService.RetrieveMessage[] messages; + public String status; + public Boolean success; public String zipFile; - private String[] fileProperties_type_info = new String[]{'fileProperties','http://soap.sforce.com/2006/04/metadata','FileProperties','0','-1','false'}; - private String[] id_type_info = new String[]{'id','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] messages_type_info = new String[]{'messages','http://soap.sforce.com/2006/04/metadata','RetrieveMessage','0','-1','false'}; - private String[] zipFile_type_info = new String[]{'zipFile','http://www.w3.org/2001/XMLSchema','base64Binary','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'fileProperties','id','messages','zipFile'}; - } - public class delete_element { - public MetadataService.Metadata[] metadata; - private String[] metadata_type_info = new String[]{'metadata','http://soap.sforce.com/2006/04/metadata','Metadata','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'metadata'}; + private String[] done_type_info = new String[]{'done','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] errorMessage_type_info = new String[]{'errorMessage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] errorStatusCode_type_info = new String[]{'errorStatusCode','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fileProperties_type_info = new String[]{'fileProperties','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] messages_type_info = new String[]{'messages','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] status_type_info = new String[]{'status','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] success_type_info = new String[]{'success','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] zipFile_type_info = new String[]{'zipFile','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'done','errorMessage','errorStatusCode','fileProperties','id','messages','status','success','zipFile'}; } - public class CustomObjectSharingRules { - public MetadataService.CustomObjectCriteriaBasedSharingRule[] criteriaBasedRules; - public MetadataService.CustomObjectOwnerSharingRule[] ownerRules; - private String[] criteriaBasedRules_type_info = new String[]{'criteriaBasedRules','http://soap.sforce.com/2006/04/metadata','CustomObjectCriteriaBasedSharingRule','0','-1','false'}; - private String[] ownerRules_type_info = new String[]{'ownerRules','http://soap.sforce.com/2006/04/metadata','CustomObjectOwnerSharingRule','0','-1','false'}; + public class Role { + public String parentRole; + private String[] parentRole_type_info = new String[]{'parentRole','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'criteriaBasedRules','ownerRules'}; + private String[] field_order_type_info = new String[]{'parentRole'}; } public class QuickActionList { public MetadataService.QuickActionListItem[] quickActionListItems; - private String[] quickActionListItems_type_info = new String[]{'quickActionListItems','http://soap.sforce.com/2006/04/metadata','QuickActionListItem','0','-1','false'}; + private String[] quickActionListItems_type_info = new String[]{'quickActionListItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'quickActionListItems'}; } - public class create_element { - public MetadataService.Metadata[] metadata; - private String[] metadata_type_info = new String[]{'metadata','http://soap.sforce.com/2006/04/metadata','Metadata','0','-1','false'}; + public class RelatedList { + public Boolean hideOnDetail; + public String name; + private String[] hideOnDetail_type_info = new String[]{'hideOnDetail','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'metadata'}; + private String[] field_order_type_info = new String[]{'hideOnDetail','name'}; + } + public class FlowActionCallOutputParameter { + public String assignToReference; + public String name; + private String[] assignToReference_type_info = new String[]{'assignToReference','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'assignToReference','name'}; } public class DashboardFilterOption { public String operator; public String[] values; - private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata','DashboardFilterOperation','1','1','false'}; - private String[] values_type_info = new String[]{'values','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] values_type_info = new String[]{'values','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'operator','values'}; } - public class checkStatus_element { - public String[] asyncProcessId; - private String[] asyncProcessId_type_info = new String[]{'asyncProcessId','http://soap.sforce.com/2006/04/metadata','ID','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'asyncProcessId'}; - } - public class WorkflowOutboundMessage { + public class WorkflowOutboundMessage extends WorkflowAction { + public String type = 'WorkflowOutboundMessage'; + public String fullName; public Double apiVersion; public String description; public String endpointUrl; @@ -943,97 +1177,113 @@ public class MetadataService { public String name; public Boolean protected_x; public Boolean useDeadLetterQueue; - private String[] apiVersion_type_info = new String[]{'apiVersion','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] endpointUrl_type_info = new String[]{'endpointUrl','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] fields_type_info = new String[]{'fields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] includeSessionId_type_info = new String[]{'includeSessionId','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] integrationUser_type_info = new String[]{'integrationUser','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] protected_x_type_info = new String[]{'protected','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] useDeadLetterQueue_type_info = new String[]{'useDeadLetterQueue','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apiVersion','description','endpointUrl','fields','includeSessionId','integrationUser','name','protected_x','useDeadLetterQueue'}; + private String[] apiVersion_type_info = new String[]{'apiVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] endpointUrl_type_info = new String[]{'endpointUrl','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] includeSessionId_type_info = new String[]{'includeSessionId','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] integrationUser_type_info = new String[]{'integrationUser','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] useDeadLetterQueue_type_info = new String[]{'useDeadLetterQueue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'apiVersion','description','endpointUrl','fields','includeSessionId','integrationUser','name','protected_x','useDeadLetterQueue'}; } public class RunTestSuccess { public String id; public String methodName; public String name; public String namespace; + public Boolean seeAllData; public Double time_x; - private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata','ID','1','1','false'}; - private String[] methodName_type_info = new String[]{'methodName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] namespace_type_info = new String[]{'namespace','http://www.w3.org/2001/XMLSchema','string','1','1','true'}; - private String[] time_x_type_info = new String[]{'time','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; + private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] methodName_type_info = new String[]{'methodName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] namespace_type_info = new String[]{'namespace','http://soap.sforce.com/2006/04/metadata',null,'1','1','true'}; + private String[] seeAllData_type_info = new String[]{'seeAllData','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] time_x_type_info = new String[]{'time','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'id','methodName','name','namespace','time_x'}; + private String[] field_order_type_info = new String[]{'id','methodName','name','namespace','seeAllData','time_x'}; } public class LiveChatButtonDeployments { public String[] deployment; - private String[] deployment_type_info = new String[]{'deployment','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + private String[] deployment_type_info = new String[]{'deployment','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'deployment'}; } + public class PermissionSetApplicationVisibility { + public String application; + public Boolean visible; + private String[] application_type_info = new String[]{'application','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] visible_type_info = new String[]{'visible','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'application','visible'}; + } public class InstalledPackage extends Metadata { public String type = 'InstalledPackage'; - public String fullName; + public String fullName; public String password; public String versionNumber; - private String[] type_att_info = new String[]{'xsi:type'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] versionNumber_type_info = new String[]{'versionNumber','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] password_type_info = new String[]{'password','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] versionNumber_type_info = new String[]{'versionNumber','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; private String[] field_order_type_info = new String[]{'fullName', 'password','versionNumber'}; } - public class Queue { + public class Queue extends Metadata { + public String type = 'Queue'; + public String fullName; public Boolean doesSendEmailToMembers; public String email; public String name; public MetadataService.QueueSobject[] queueSobject; - private String[] doesSendEmailToMembers_type_info = new String[]{'doesSendEmailToMembers','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] email_type_info = new String[]{'email','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] queueSobject_type_info = new String[]{'queueSobject','http://soap.sforce.com/2006/04/metadata','QueueSobject','0','-1','false'}; + private String[] doesSendEmailToMembers_type_info = new String[]{'doesSendEmailToMembers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] email_type_info = new String[]{'email','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] queueSobject_type_info = new String[]{'queueSobject','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'doesSendEmailToMembers','email','name','queueSobject'}; - } - public class LeadSharingRules { - public MetadataService.LeadCriteriaBasedSharingRule[] criteriaBasedRules; - public MetadataService.LeadOwnerSharingRule[] ownerRules; - private String[] criteriaBasedRules_type_info = new String[]{'criteriaBasedRules','http://soap.sforce.com/2006/04/metadata','LeadCriteriaBasedSharingRule','0','-1','false'}; - private String[] ownerRules_type_info = new String[]{'ownerRules','http://soap.sforce.com/2006/04/metadata','LeadOwnerSharingRule','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'criteriaBasedRules','ownerRules'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'doesSendEmailToMembers','email','name','queueSobject'}; } public class ListViewFilter { public String field; public String operation; public String value; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] operation_type_info = new String[]{'operation','http://soap.sforce.com/2006/04/metadata','FilterOperation','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] operation_type_info = new String[]{'operation','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'field','operation','value'}; } - public class CampaignOwnerSharingRule { - public String campaignAccessLevel; - public String name; - private String[] campaignAccessLevel_type_info = new String[]{'campaignAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoNone','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'campaignAccessLevel','name'}; - } - public class checkStatusResponse_element { - public MetadataService.AsyncResult[] result; - private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata','AsyncResult','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'result'}; + public class FeedLayout { + public Boolean autocollapsePublisher; + public Boolean compactFeed; + public String feedFilterPosition; + public MetadataService.FeedLayoutFilter[] feedFilters; + public Boolean fullWidthFeed; + public Boolean hideSidebar; + public Boolean highlightExternalFeedItems; + public MetadataService.FeedLayoutComponent[] leftComponents; + public MetadataService.FeedLayoutComponent[] rightComponents; + private String[] autocollapsePublisher_type_info = new String[]{'autocollapsePublisher','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] compactFeed_type_info = new String[]{'compactFeed','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] feedFilterPosition_type_info = new String[]{'feedFilterPosition','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] feedFilters_type_info = new String[]{'feedFilters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] fullWidthFeed_type_info = new String[]{'fullWidthFeed','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] hideSidebar_type_info = new String[]{'hideSidebar','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] highlightExternalFeedItems_type_info = new String[]{'highlightExternalFeedItems','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] leftComponents_type_info = new String[]{'leftComponents','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] rightComponents_type_info = new String[]{'rightComponents','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'autocollapsePublisher','compactFeed','feedFilterPosition','feedFilters','fullWidthFeed','hideSidebar','highlightExternalFeedItems','leftComponents','rightComponents'}; } public class CustomField extends Metadata { - public String type = 'CustomField'; - public String fullName; + public String type = 'CustomField'; + public String fullName; public Boolean caseSensitive; public String customDataType; public String defaultValue; @@ -1041,6 +1291,7 @@ public class MetadataService { public Boolean deprecated; public String description; public String displayFormat; + public Boolean encrypted; public Boolean escapeMarkup; public String externalDeveloperName; public Boolean externalId; @@ -1052,11 +1303,13 @@ public class MetadataService { public Boolean isSortingDisabled; public String label; public Integer length; + public MetadataService.LookupFilter lookupFilter; public String maskChar; public String maskType; public MetadataService.Picklist picklist; public Boolean populateExistingRows; public Integer precision; + public String referenceTargetField; public String referenceTo; public String relationshipLabel; public String relationshipName; @@ -1073,63 +1326,68 @@ public class MetadataService { public String summaryOperation; public Boolean trackFeedHistory; public Boolean trackHistory; + public Boolean trackTrending; public String type_x; public Boolean unique; public Integer visibleLines; public Boolean writeRequiresMasterRead; - private String[] type_att_info = new String[]{'xsi:type'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] caseSensitive_type_info = new String[]{'caseSensitive','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] customDataType_type_info = new String[]{'customDataType','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] defaultValue_type_info = new String[]{'defaultValue','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] deleteConstraint_type_info = new String[]{'deleteConstraint','http://soap.sforce.com/2006/04/metadata','DeleteConstraint','0','1','false'}; - private String[] deprecated_type_info = new String[]{'deprecated','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] displayFormat_type_info = new String[]{'displayFormat','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] escapeMarkup_type_info = new String[]{'escapeMarkup','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] externalDeveloperName_type_info = new String[]{'externalDeveloperName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] externalId_type_info = new String[]{'externalId','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] formula_type_info = new String[]{'formula','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] formulaTreatBlanksAs_type_info = new String[]{'formulaTreatBlanksAs','http://soap.sforce.com/2006/04/metadata','TreatBlanksAs','0','1','false'}; - private String[] inlineHelpText_type_info = new String[]{'inlineHelpText','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] isFilteringDisabled_type_info = new String[]{'isFilteringDisabled','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] isNameField_type_info = new String[]{'isNameField','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] isSortingDisabled_type_info = new String[]{'isSortingDisabled','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] length_type_info = new String[]{'length','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] maskChar_type_info = new String[]{'maskChar','http://soap.sforce.com/2006/04/metadata','EncryptedFieldMaskChar','0','1','false'}; - private String[] maskType_type_info = new String[]{'maskType','http://soap.sforce.com/2006/04/metadata','EncryptedFieldMaskType','0','1','false'}; - private String[] picklist_type_info = new String[]{'picklist','http://soap.sforce.com/2006/04/metadata','Picklist','0','1','false'}; - private String[] populateExistingRows_type_info = new String[]{'populateExistingRows','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] precision_type_info = new String[]{'precision','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] referenceTo_type_info = new String[]{'referenceTo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] relationshipLabel_type_info = new String[]{'relationshipLabel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] relationshipName_type_info = new String[]{'relationshipName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] relationshipOrder_type_info = new String[]{'relationshipOrder','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] reparentableMasterDetail_type_info = new String[]{'reparentableMasterDetail','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] required_type_info = new String[]{'required','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] restrictedAdminField_type_info = new String[]{'restrictedAdminField','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] scale_type_info = new String[]{'scale','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] startingNumber_type_info = new String[]{'startingNumber','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] stripMarkup_type_info = new String[]{'stripMarkup','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] summarizedField_type_info = new String[]{'summarizedField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] summaryFilterItems_type_info = new String[]{'summaryFilterItems','http://soap.sforce.com/2006/04/metadata','FilterItem','0','-1','false'}; - private String[] summaryForeignKey_type_info = new String[]{'summaryForeignKey','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] summaryOperation_type_info = new String[]{'summaryOperation','http://soap.sforce.com/2006/04/metadata','SummaryOperations','0','1','false'}; - private String[] trackFeedHistory_type_info = new String[]{'trackFeedHistory','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] trackHistory_type_info = new String[]{'trackHistory','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','FieldType','1','1','false'}; - private String[] unique_type_info = new String[]{'unique','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] visibleLines_type_info = new String[]{'visibleLines','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] writeRequiresMasterRead_type_info = new String[]{'writeRequiresMasterRead','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'fullName','caseSensitive','customDataType','defaultValue','deleteConstraint','deprecated','description','displayFormat','escapeMarkup','externalDeveloperName','externalId','formula','formulaTreatBlanksAs','inlineHelpText','isFilteringDisabled','isNameField','isSortingDisabled','label','length','maskChar','maskType','picklist','populateExistingRows','precision','referenceTo','relationshipLabel','relationshipName','relationshipOrder','reparentableMasterDetail','required','restrictedAdminField','scale','startingNumber','stripMarkup','summarizedField','summaryFilterItems','summaryForeignKey','summaryOperation','trackFeedHistory','trackHistory','type_x','unique','visibleLines','writeRequiresMasterRead'}; + private String[] caseSensitive_type_info = new String[]{'caseSensitive','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customDataType_type_info = new String[]{'customDataType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultValue_type_info = new String[]{'defaultValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] deleteConstraint_type_info = new String[]{'deleteConstraint','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] deprecated_type_info = new String[]{'deprecated','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] displayFormat_type_info = new String[]{'displayFormat','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] encrypted_type_info = new String[]{'encrypted','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] escapeMarkup_type_info = new String[]{'escapeMarkup','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] externalDeveloperName_type_info = new String[]{'externalDeveloperName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] externalId_type_info = new String[]{'externalId','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] formula_type_info = new String[]{'formula','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] formulaTreatBlanksAs_type_info = new String[]{'formulaTreatBlanksAs','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] inlineHelpText_type_info = new String[]{'inlineHelpText','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isFilteringDisabled_type_info = new String[]{'isFilteringDisabled','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isNameField_type_info = new String[]{'isNameField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isSortingDisabled_type_info = new String[]{'isSortingDisabled','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] length_type_info = new String[]{'length','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lookupFilter_type_info = new String[]{'lookupFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] maskChar_type_info = new String[]{'maskChar','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] maskType_type_info = new String[]{'maskType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] picklist_type_info = new String[]{'picklist','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] populateExistingRows_type_info = new String[]{'populateExistingRows','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] precision_type_info = new String[]{'precision','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] referenceTargetField_type_info = new String[]{'referenceTargetField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] referenceTo_type_info = new String[]{'referenceTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] relationshipLabel_type_info = new String[]{'relationshipLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] relationshipName_type_info = new String[]{'relationshipName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] relationshipOrder_type_info = new String[]{'relationshipOrder','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] reparentableMasterDetail_type_info = new String[]{'reparentableMasterDetail','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] required_type_info = new String[]{'required','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] restrictedAdminField_type_info = new String[]{'restrictedAdminField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scale_type_info = new String[]{'scale','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] startingNumber_type_info = new String[]{'startingNumber','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] stripMarkup_type_info = new String[]{'stripMarkup','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] summarizedField_type_info = new String[]{'summarizedField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] summaryFilterItems_type_info = new String[]{'summaryFilterItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] summaryForeignKey_type_info = new String[]{'summaryForeignKey','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] summaryOperation_type_info = new String[]{'summaryOperation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] trackFeedHistory_type_info = new String[]{'trackFeedHistory','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] trackHistory_type_info = new String[]{'trackHistory','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] trackTrending_type_info = new String[]{'trackTrending','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] unique_type_info = new String[]{'unique','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] visibleLines_type_info = new String[]{'visibleLines','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] writeRequiresMasterRead_type_info = new String[]{'writeRequiresMasterRead','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'caseSensitive','customDataType','defaultValue','deleteConstraint','deprecated','description','displayFormat','encrypted','escapeMarkup','externalDeveloperName','externalId','formula','formulaTreatBlanksAs','inlineHelpText','isFilteringDisabled','isNameField','isSortingDisabled','label','length','lookupFilter','maskChar','maskType','picklist','populateExistingRows','precision','referenceTargetField','referenceTo','relationshipLabel','relationshipName','relationshipOrder','reparentableMasterDetail','required','restrictedAdminField','scale','startingNumber','stripMarkup','summarizedField','summaryFilterItems','summaryForeignKey','summaryOperation','trackFeedHistory','trackHistory','trackTrending','type_x','unique','visibleLines','writeRequiresMasterRead'}; } public class PushNotification { public String[] fieldNames; public String objectName; - private String[] fieldNames_type_info = new String[]{'fieldNames','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] objectName_type_info = new String[]{'objectName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] fieldNames_type_info = new String[]{'fieldNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] objectName_type_info = new String[]{'objectName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'fieldNames','objectName'}; } @@ -1141,26 +1399,38 @@ public class MetadataService { public Boolean enableThreadIDInSubject; public Boolean notifyOwnerOnNewCaseEmail; public String overEmailLimitAction; + public Boolean preQuoteSignature; public MetadataService.EmailToCaseRoutingAddress[] routingAddresses; public String unauthorizedSenderAction; - private String[] enableEmailToCase_type_info = new String[]{'enableEmailToCase','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableHtmlEmail_type_info = new String[]{'enableHtmlEmail','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableOnDemandEmailToCase_type_info = new String[]{'enableOnDemandEmailToCase','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableThreadIDInBody_type_info = new String[]{'enableThreadIDInBody','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableThreadIDInSubject_type_info = new String[]{'enableThreadIDInSubject','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] notifyOwnerOnNewCaseEmail_type_info = new String[]{'notifyOwnerOnNewCaseEmail','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] overEmailLimitAction_type_info = new String[]{'overEmailLimitAction','http://soap.sforce.com/2006/04/metadata','EmailToCaseOnFailureActionType','0','1','false'}; - private String[] routingAddresses_type_info = new String[]{'routingAddresses','http://soap.sforce.com/2006/04/metadata','EmailToCaseRoutingAddress','0','-1','false'}; - private String[] unauthorizedSenderAction_type_info = new String[]{'unauthorizedSenderAction','http://soap.sforce.com/2006/04/metadata','EmailToCaseOnFailureActionType','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enableEmailToCase','enableHtmlEmail','enableOnDemandEmailToCase','enableThreadIDInBody','enableThreadIDInSubject','notifyOwnerOnNewCaseEmail','overEmailLimitAction','routingAddresses','unauthorizedSenderAction'}; + private String[] enableEmailToCase_type_info = new String[]{'enableEmailToCase','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableHtmlEmail_type_info = new String[]{'enableHtmlEmail','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableOnDemandEmailToCase_type_info = new String[]{'enableOnDemandEmailToCase','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableThreadIDInBody_type_info = new String[]{'enableThreadIDInBody','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableThreadIDInSubject_type_info = new String[]{'enableThreadIDInSubject','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] notifyOwnerOnNewCaseEmail_type_info = new String[]{'notifyOwnerOnNewCaseEmail','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] overEmailLimitAction_type_info = new String[]{'overEmailLimitAction','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] preQuoteSignature_type_info = new String[]{'preQuoteSignature','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] routingAddresses_type_info = new String[]{'routingAddresses','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] unauthorizedSenderAction_type_info = new String[]{'unauthorizedSenderAction','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'enableEmailToCase','enableHtmlEmail','enableOnDemandEmailToCase','enableThreadIDInBody','enableThreadIDInSubject','notifyOwnerOnNewCaseEmail','overEmailLimitAction','preQuoteSignature','routingAddresses','unauthorizedSenderAction'}; } public class deployResponse_element { public MetadataService.AsyncResult result; - private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata','AsyncResult','1','1','false'}; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'result'}; } + public class DataCategory { + public MetadataService.DataCategory[] dataCategory; + public String label; + public String name; + private String[] dataCategory_type_info = new String[]{'dataCategory','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'dataCategory','label','name'}; + } public class EscalationAction { public String assignedTo; public String assignedToTemplate; @@ -1170,36 +1440,37 @@ public class MetadataService { public String[] notifyEmail; public String notifyTo; public String notifyToTemplate; - private String[] assignedTo_type_info = new String[]{'assignedTo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] assignedToTemplate_type_info = new String[]{'assignedToTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] assignedToType_type_info = new String[]{'assignedToType','http://soap.sforce.com/2006/04/metadata','AssignToLookupValueType','0','1','false'}; - private String[] minutesToEscalation_type_info = new String[]{'minutesToEscalation','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] notifyCaseOwner_type_info = new String[]{'notifyCaseOwner','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] notifyEmail_type_info = new String[]{'notifyEmail','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] notifyTo_type_info = new String[]{'notifyTo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] notifyToTemplate_type_info = new String[]{'notifyToTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] assignedTo_type_info = new String[]{'assignedTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] assignedToTemplate_type_info = new String[]{'assignedToTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] assignedToType_type_info = new String[]{'assignedToType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] minutesToEscalation_type_info = new String[]{'minutesToEscalation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] notifyCaseOwner_type_info = new String[]{'notifyCaseOwner','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] notifyEmail_type_info = new String[]{'notifyEmail','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] notifyTo_type_info = new String[]{'notifyTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] notifyToTemplate_type_info = new String[]{'notifyToTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'assignedTo','assignedToTemplate','assignedToType','minutesToEscalation','notifyCaseOwner','notifyEmail','notifyTo','notifyToTemplate'}; } - public class DataCategory { - public MetadataService.DataCategory[] dataCategory; - public String label; - public String name; - private String[] dataCategory_type_info = new String[]{'dataCategory','http://soap.sforce.com/2006/04/metadata','DataCategory','0','-1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'dataCategory','label','name'}; - } public class FlowOutputFieldAssignment { public String assignToReference; public String field; - private String[] assignToReference_type_info = new String[]{'assignToReference','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] assignToReference_type_info = new String[]{'assignToReference','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'assignToReference','field'}; } - public class EmailTemplate { + public class AppMenuItem { + public String name; + public String type_x; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'name','type_x'}; + } + public class EmailTemplate extends MetadataWithContent { + public String type = 'EmailTemplate'; + public String fullName; + public String content; public Double apiVersion; public String[] attachedDocuments; public MetadataService.Attachment[] attachments; @@ -1213,399 +1484,308 @@ public class MetadataService { public String subject; public String textOnly; public String type_x; - private String[] apiVersion_type_info = new String[]{'apiVersion','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] attachedDocuments_type_info = new String[]{'attachedDocuments','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] attachments_type_info = new String[]{'attachments','http://soap.sforce.com/2006/04/metadata','Attachment','0','-1','false'}; - private String[] available_type_info = new String[]{'available','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] encodingKey_type_info = new String[]{'encodingKey','http://soap.sforce.com/2006/04/metadata','Encoding','1','1','false'}; - private String[] letterhead_type_info = new String[]{'letterhead','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata','PackageVersion','0','-1','false'}; - private String[] style_type_info = new String[]{'style','http://soap.sforce.com/2006/04/metadata','EmailTemplateStyle','1','1','false'}; - private String[] subject_type_info = new String[]{'subject','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] textOnly_type_info = new String[]{'textOnly','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','EmailTemplateType','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apiVersion','attachedDocuments','attachments','available','description','encodingKey','letterhead','name','packageVersions','style','subject','textOnly','type_x'}; - } - public class MetadataPort { - public String endpoint_x; - { - URL baseUrl = URL.getSalesforceBaseUrl(); - endpoint_x = baseUrl.toExternalForm() + '/services/Soap/m/28.0'; - } - public Map inputHttpHeaders_x; - public Map outputHttpHeaders_x; - public String clientCertName_x; - public String clientCert_x; - public String clientCertPasswd_x; - public Integer timeout_x; - public MetadataService.SessionHeader_element SessionHeader; - public MetadataService.DebuggingInfo_element DebuggingInfo; - public MetadataService.CallOptions_element CallOptions; - public MetadataService.DebuggingHeader_element DebuggingHeader; - private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/2006/04/metadata'; - private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/2006/04/metadata'; - private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/2006/04/metadata'; - private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/2006/04/metadata'; - private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata', 'MetadataService'}; - public MetadataService.AsyncResult retrieve(MetadataService.RetrieveRequest retrieveRequest) { - MetadataService.retrieve_element request_x = new MetadataService.retrieve_element(); - MetadataService.retrieveResponse_element response_x; - request_x.retrieveRequest = retrieveRequest; - Map response_map_x = new Map(); - response_map_x.put('response_x', response_x); - WebServiceCallout.invoke( - this, - request_x, - response_map_x, - new String[]{endpoint_x, - '', - 'http://soap.sforce.com/2006/04/metadata', - 'retrieve', - 'http://soap.sforce.com/2006/04/metadata', - 'retrieveResponse', - 'MetadataService.retrieveResponse_element'} - ); - response_x = response_map_x.get('response_x'); - return response_x.result; - } - public MetadataService.DeployResult checkDeployStatus(String asyncProcessId) { - MetadataService.checkDeployStatus_element request_x = new MetadataService.checkDeployStatus_element(); - MetadataService.checkDeployStatusResponse_element response_x; - request_x.asyncProcessId = asyncProcessId; - Map response_map_x = new Map(); - response_map_x.put('response_x', response_x); - WebServiceCallout.invoke( - this, - request_x, - response_map_x, - new String[]{endpoint_x, - '', - 'http://soap.sforce.com/2006/04/metadata', - 'checkDeployStatus', - 'http://soap.sforce.com/2006/04/metadata', - 'checkDeployStatusResponse', - 'MetadataService.checkDeployStatusResponse_element'} - ); - response_x = response_map_x.get('response_x'); - return response_x.result; - } - public MetadataService.AsyncResult[] updateMetadata(MetadataService.UpdateMetadata[] UpdateMetadata) { - MetadataService.update_element request_x = new MetadataService.update_element(); - MetadataService.updateResponse_element response_x; - request_x.UpdateMetadata = UpdateMetadata; - Map response_map_x = new Map(); - response_map_x.put('response_x', response_x); - WebServiceCallout.invoke( - this, - request_x, - response_map_x, - new String[]{endpoint_x, - '', - 'http://soap.sforce.com/2006/04/metadata', - 'update', - 'http://soap.sforce.com/2006/04/metadata', - 'updateResponse', - 'MetadataService.updateResponse_element'} - ); - response_x = response_map_x.get('response_x'); - return response_x.result; - } - public MetadataService.FileProperties[] listMetadata(MetadataService.ListMetadataQuery[] queries,Double asOfVersion) { - MetadataService.listMetadata_element request_x = new MetadataService.listMetadata_element(); - MetadataService.listMetadataResponse_element response_x; - request_x.queries = queries; - request_x.asOfVersion = asOfVersion; - Map response_map_x = new Map(); - response_map_x.put('response_x', response_x); - WebServiceCallout.invoke( - this, - request_x, - response_map_x, - new String[]{endpoint_x, - '', - 'http://soap.sforce.com/2006/04/metadata', - 'listMetadata', - 'http://soap.sforce.com/2006/04/metadata', - 'listMetadataResponse', - 'MetadataService.listMetadataResponse_element'} - ); - response_x = response_map_x.get('response_x'); - return response_x.result; - } - public MetadataService.AsyncResult[] checkStatus(String[] asyncProcessId) { - MetadataService.checkStatus_element request_x = new MetadataService.checkStatus_element(); - MetadataService.checkStatusResponse_element response_x; - request_x.asyncProcessId = asyncProcessId; - Map response_map_x = new Map(); - response_map_x.put('response_x', response_x); - WebServiceCallout.invoke( - this, - request_x, - response_map_x, - new String[]{endpoint_x, - '', - 'http://soap.sforce.com/2006/04/metadata', - 'checkStatus', - 'http://soap.sforce.com/2006/04/metadata', - 'checkStatusResponse', - 'MetadataService.checkStatusResponse_element'} - ); - response_x = response_map_x.get('response_x'); - return response_x.result; - } - public MetadataService.AsyncResult[] create(MetadataService.Metadata[] metadata) { - MetadataService.create_element request_x = new MetadataService.create_element(); - MetadataService.createResponse_element response_x; - request_x.metadata = metadata; - Map response_map_x = new Map(); - response_map_x.put('response_x', response_x); - WebServiceCallout.invoke( - this, - request_x, - response_map_x, - new String[]{endpoint_x, - '', - 'http://soap.sforce.com/2006/04/metadata', - 'create', - 'http://soap.sforce.com/2006/04/metadata', - 'createResponse', - 'MetadataService.createResponse_element'} - ); - response_x = response_map_x.get('response_x'); - return response_x.result; - } - public MetadataService.RetrieveResult checkRetrieveStatus(String asyncProcessId) { - MetadataService.checkRetrieveStatus_element request_x = new MetadataService.checkRetrieveStatus_element(); - MetadataService.checkRetrieveStatusResponse_element response_x; - request_x.asyncProcessId = asyncProcessId; - Map response_map_x = new Map(); - response_map_x.put('response_x', response_x); - WebServiceCallout.invoke( - this, - request_x, - response_map_x, - new String[]{endpoint_x, - '', - 'http://soap.sforce.com/2006/04/metadata', - 'checkRetrieveStatus', - 'http://soap.sforce.com/2006/04/metadata', - 'checkRetrieveStatusResponse', - 'MetadataService.checkRetrieveStatusResponse_element'} - ); - response_x = response_map_x.get('response_x'); - return response_x.result; - } - public MetadataService.AsyncResult[] deleteMetadata(MetadataService.Metadata[] metadata) { - MetadataService.delete_element request_x = new MetadataService.delete_element(); - MetadataService.deleteResponse_element response_x; - request_x.metadata = metadata; - Map response_map_x = new Map(); - response_map_x.put('response_x', response_x); - WebServiceCallout.invoke( - this, - request_x, - response_map_x, - new String[]{endpoint_x, - '', - 'http://soap.sforce.com/2006/04/metadata', - 'delete', - 'http://soap.sforce.com/2006/04/metadata', - 'deleteResponse', - 'MetadataService.deleteResponse_element'} - ); - response_x = response_map_x.get('response_x'); - return response_x.result; - } - public MetadataService.DescribeMetadataResult describeMetadata(Double asOfVersion) { - MetadataService.describeMetadata_element request_x = new MetadataService.describeMetadata_element(); - MetadataService.describeMetadataResponse_element response_x; - request_x.asOfVersion = asOfVersion; - Map response_map_x = new Map(); - response_map_x.put('response_x', response_x); - WebServiceCallout.invoke( - this, - request_x, - response_map_x, - new String[]{endpoint_x, - '', - 'http://soap.sforce.com/2006/04/metadata', - 'describeMetadata', - 'http://soap.sforce.com/2006/04/metadata', - 'describeMetadataResponse', - 'MetadataService.describeMetadataResponse_element'} - ); - response_x = response_map_x.get('response_x'); - return response_x.result; - } - public MetadataService.AsyncResult deploy(String ZipFile,MetadataService.DeployOptions DeployOptions) { - MetadataService.deploy_element request_x = new MetadataService.deploy_element(); - MetadataService.deployResponse_element response_x; - request_x.ZipFile = ZipFile; - request_x.DeployOptions = DeployOptions; - Map response_map_x = new Map(); - response_map_x.put('response_x', response_x); - WebServiceCallout.invoke( - this, - request_x, - response_map_x, - new String[]{endpoint_x, - '', - 'http://soap.sforce.com/2006/04/metadata', - 'deploy', - 'http://soap.sforce.com/2006/04/metadata', - 'deployResponse', - 'MetadataService.deployResponse_element'} - ); - response_x = response_map_x.get('response_x'); - return response_x.result; - } + private String[] apiVersion_type_info = new String[]{'apiVersion','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] attachedDocuments_type_info = new String[]{'attachedDocuments','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] attachments_type_info = new String[]{'attachments','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] available_type_info = new String[]{'available','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] encodingKey_type_info = new String[]{'encodingKey','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] letterhead_type_info = new String[]{'letterhead','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] style_type_info = new String[]{'style','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] subject_type_info = new String[]{'subject','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] textOnly_type_info = new String[]{'textOnly','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'content', 'apiVersion','attachedDocuments','attachments','available','description','encodingKey','letterhead','name','packageVersions','style','subject','textOnly','type_x'}; } public class ObjectUsage { public String[] object_x; - private String[] object_x_type_info = new String[]{'object','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + private String[] object_x_type_info = new String[]{'object','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'object_x'}; } - public class AssignmentRule { + public class AssignmentRule extends Metadata { + public String type = 'AssignmentRule'; + public String fullName; public Boolean active; public MetadataService.RuleEntry[] ruleEntry; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] ruleEntry_type_info = new String[]{'ruleEntry','http://soap.sforce.com/2006/04/metadata','RuleEntry','0','-1','false'}; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] ruleEntry_type_info = new String[]{'ruleEntry','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','ruleEntry'}; + } + public class deleteMetadataResponse_element { + public MetadataService.DeleteResult[] result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','ruleEntry'}; + private String[] field_order_type_info = new String[]{'result'}; } public class CustomTabTranslation { public String label; public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'label','name'}; } - public class LiveChatAgentConfig { + public class LiveChatAgentConfig extends Metadata { + public String type = 'LiveChatAgentConfig'; + public String fullName; public MetadataService.AgentConfigAssignments assignments; public String autoGreeting; public Integer capacity; + public Integer criticalWaitTime; + public String customAgentName; + public Boolean enableAgentFileTransfer; + public Boolean enableAgentSneakPeek; public Boolean enableAutoAwayOnDecline; + public Boolean enableAutoAwayOnPushTimeout; + public Boolean enableChatConferencing; + public Boolean enableChatMonitoring; + public Boolean enableChatTransfer; public Boolean enableLogoutSound; public Boolean enableNotifications; public Boolean enableRequestSound; public Boolean enableSneakPeek; + public Boolean enableVisitorBlocking; + public Boolean enableWhisperMessage; public String label; - private String[] assignments_type_info = new String[]{'assignments','http://soap.sforce.com/2006/04/metadata','AgentConfigAssignments','0','1','false'}; - private String[] autoGreeting_type_info = new String[]{'autoGreeting','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] capacity_type_info = new String[]{'capacity','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] enableAutoAwayOnDecline_type_info = new String[]{'enableAutoAwayOnDecline','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableLogoutSound_type_info = new String[]{'enableLogoutSound','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableNotifications_type_info = new String[]{'enableNotifications','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableRequestSound_type_info = new String[]{'enableRequestSound','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableSneakPeek_type_info = new String[]{'enableSneakPeek','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'assignments','autoGreeting','capacity','enableAutoAwayOnDecline','enableLogoutSound','enableNotifications','enableRequestSound','enableSneakPeek','label'}; + public String supervisorDefaultAgentStatusFilter; + public String supervisorDefaultButtonFilter; + public String supervisorDefaultSkillFilter; + public MetadataService.SupervisorAgentConfigSkills supervisorSkills; + public MetadataService.AgentConfigButtons transferableButtons; + public MetadataService.AgentConfigSkills transferableSkills; + private String[] assignments_type_info = new String[]{'assignments','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] autoGreeting_type_info = new String[]{'autoGreeting','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] capacity_type_info = new String[]{'capacity','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] criticalWaitTime_type_info = new String[]{'criticalWaitTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customAgentName_type_info = new String[]{'customAgentName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableAgentFileTransfer_type_info = new String[]{'enableAgentFileTransfer','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableAgentSneakPeek_type_info = new String[]{'enableAgentSneakPeek','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableAutoAwayOnDecline_type_info = new String[]{'enableAutoAwayOnDecline','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableAutoAwayOnPushTimeout_type_info = new String[]{'enableAutoAwayOnPushTimeout','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableChatConferencing_type_info = new String[]{'enableChatConferencing','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableChatMonitoring_type_info = new String[]{'enableChatMonitoring','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableChatTransfer_type_info = new String[]{'enableChatTransfer','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableLogoutSound_type_info = new String[]{'enableLogoutSound','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableNotifications_type_info = new String[]{'enableNotifications','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableRequestSound_type_info = new String[]{'enableRequestSound','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableSneakPeek_type_info = new String[]{'enableSneakPeek','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableVisitorBlocking_type_info = new String[]{'enableVisitorBlocking','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableWhisperMessage_type_info = new String[]{'enableWhisperMessage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] supervisorDefaultAgentStatusFilter_type_info = new String[]{'supervisorDefaultAgentStatusFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] supervisorDefaultButtonFilter_type_info = new String[]{'supervisorDefaultButtonFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] supervisorDefaultSkillFilter_type_info = new String[]{'supervisorDefaultSkillFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] supervisorSkills_type_info = new String[]{'supervisorSkills','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] transferableButtons_type_info = new String[]{'transferableButtons','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] transferableSkills_type_info = new String[]{'transferableSkills','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'assignments','autoGreeting','capacity','criticalWaitTime','customAgentName','enableAgentFileTransfer','enableAgentSneakPeek','enableAutoAwayOnDecline','enableAutoAwayOnPushTimeout','enableChatConferencing','enableChatMonitoring','enableChatTransfer','enableLogoutSound','enableNotifications','enableRequestSound','enableSneakPeek','enableVisitorBlocking','enableWhisperMessage','label','supervisorDefaultAgentStatusFilter','supervisorDefaultButtonFilter','supervisorDefaultSkillFilter','supervisorSkills','transferableButtons','transferableSkills'}; } public class AdjustmentsSettings { public Boolean enableAdjustments; - private String[] enableAdjustments_type_info = new String[]{'enableAdjustments','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + public Boolean enableOwnerAdjustments; + private String[] enableAdjustments_type_info = new String[]{'enableAdjustments','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enableOwnerAdjustments_type_info = new String[]{'enableOwnerAdjustments','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enableAdjustments'}; + private String[] field_order_type_info = new String[]{'enableAdjustments','enableOwnerAdjustments'}; } - public class BusinessProcess { + public class BusinessProcess extends Metadata { + public String type = 'BusinessProcess'; + public String fullName; public String description; public Boolean isActive; public MetadataService.PicklistValue[] values; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] isActive_type_info = new String[]{'isActive','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] values_type_info = new String[]{'values','http://soap.sforce.com/2006/04/metadata','PicklistValue','0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isActive_type_info = new String[]{'isActive','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] values_type_info = new String[]{'values','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'description','isActive','values'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'description','isActive','values'}; } - public class PermissionSet { + public class PermissionSet extends Metadata { + public String type = 'PermissionSet'; + public String fullName; + public MetadataService.PermissionSetApplicationVisibility[] applicationVisibilities; public MetadataService.PermissionSetApexClassAccess[] classAccesses; + public MetadataService.PermissionSetCustomPermissions[] customPermissions; public String description; public MetadataService.PermissionSetExternalDataSourceAccess[] externalDataSourceAccesses; public MetadataService.PermissionSetFieldPermissions[] fieldPermissions; public String label; public MetadataService.PermissionSetObjectPermissions[] objectPermissions; public MetadataService.PermissionSetApexPageAccess[] pageAccesses; + public MetadataService.PermissionSetRecordTypeVisibility[] recordTypeVisibilities; public MetadataService.PermissionSetTabSetting[] tabSettings; public String userLicense; public MetadataService.PermissionSetUserPermission[] userPermissions; - private String[] classAccesses_type_info = new String[]{'classAccesses','http://soap.sforce.com/2006/04/metadata','PermissionSetApexClassAccess','0','-1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] externalDataSourceAccesses_type_info = new String[]{'externalDataSourceAccesses','http://soap.sforce.com/2006/04/metadata','PermissionSetExternalDataSourceAccess','0','-1','false'}; - private String[] fieldPermissions_type_info = new String[]{'fieldPermissions','http://soap.sforce.com/2006/04/metadata','PermissionSetFieldPermissions','0','-1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] objectPermissions_type_info = new String[]{'objectPermissions','http://soap.sforce.com/2006/04/metadata','PermissionSetObjectPermissions','0','-1','false'}; - private String[] pageAccesses_type_info = new String[]{'pageAccesses','http://soap.sforce.com/2006/04/metadata','PermissionSetApexPageAccess','0','-1','false'}; - private String[] tabSettings_type_info = new String[]{'tabSettings','http://soap.sforce.com/2006/04/metadata','PermissionSetTabSetting','0','-1','false'}; - private String[] userLicense_type_info = new String[]{'userLicense','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] userPermissions_type_info = new String[]{'userPermissions','http://soap.sforce.com/2006/04/metadata','PermissionSetUserPermission','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'classAccesses','description','externalDataSourceAccesses','fieldPermissions','label','objectPermissions','pageAccesses','tabSettings','userLicense','userPermissions'}; - } - public class ForecastingSettings { - public MetadataService.AdjustmentsSettings adjustmentsSettings; - public MetadataService.DataSourceSettings dataSourceSettings; - public String displayCurrency; - public Boolean enableForecasts; - public MetadataService.ForecastRangeSettings forecastRangeSettings; - public MetadataService.OpportunityListFieldsSelectedSettings opportunityListFieldsSelectedSettings; - public MetadataService.QuotasSettings quotasSettings; - private String[] adjustmentsSettings_type_info = new String[]{'adjustmentsSettings','http://soap.sforce.com/2006/04/metadata','AdjustmentsSettings','0','1','false'}; - private String[] dataSourceSettings_type_info = new String[]{'dataSourceSettings','http://soap.sforce.com/2006/04/metadata','DataSourceSettings','0','1','false'}; - private String[] displayCurrency_type_info = new String[]{'displayCurrency','http://soap.sforce.com/2006/04/metadata','DisplayCurrency','0','1','false'}; - private String[] enableForecasts_type_info = new String[]{'enableForecasts','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] forecastRangeSettings_type_info = new String[]{'forecastRangeSettings','http://soap.sforce.com/2006/04/metadata','ForecastRangeSettings','0','1','false'}; - private String[] opportunityListFieldsSelectedSettings_type_info = new String[]{'opportunityListFieldsSelectedSettings','http://soap.sforce.com/2006/04/metadata','OpportunityListFieldsSelectedSettings','0','1','false'}; - private String[] quotasSettings_type_info = new String[]{'quotasSettings','http://soap.sforce.com/2006/04/metadata','QuotasSettings','0','1','false'}; + private String[] applicationVisibilities_type_info = new String[]{'applicationVisibilities','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] classAccesses_type_info = new String[]{'classAccesses','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] customPermissions_type_info = new String[]{'customPermissions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] externalDataSourceAccesses_type_info = new String[]{'externalDataSourceAccesses','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] fieldPermissions_type_info = new String[]{'fieldPermissions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] objectPermissions_type_info = new String[]{'objectPermissions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] pageAccesses_type_info = new String[]{'pageAccesses','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] recordTypeVisibilities_type_info = new String[]{'recordTypeVisibilities','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] tabSettings_type_info = new String[]{'tabSettings','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] userLicense_type_info = new String[]{'userLicense','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] userPermissions_type_info = new String[]{'userPermissions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'adjustmentsSettings','dataSourceSettings','displayCurrency','enableForecasts','forecastRangeSettings','opportunityListFieldsSelectedSettings','quotasSettings'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'applicationVisibilities','classAccesses','customPermissions','description','externalDataSourceAccesses','fieldPermissions','label','objectPermissions','pageAccesses','recordTypeVisibilities','tabSettings','userLicense','userPermissions'}; + } + public class ConnectedAppAttribute { + public String formula; + public String key; + private String[] formula_type_info = new String[]{'formula','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] key_type_info = new String[]{'key','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'formula','key'}; + } + public class ManagedTopics extends Metadata { + public String type = 'ManagedTopics'; + public String fullName; + public MetadataService.ManagedTopic[] managedTopic; + private String[] managedTopic_type_info = new String[]{'managedTopic','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'managedTopic'}; + } + public class ForecastingSettings extends Metadata { + public String type = 'ForecastingSettings'; + public String fullName; + public String displayCurrency; + public Boolean enableForecasts; + public MetadataService.ForecastingCategoryMapping[] forecastingCategoryMappings; + public MetadataService.ForecastingTypeSettings[] forecastingTypeSettings; + private String[] displayCurrency_type_info = new String[]{'displayCurrency','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableForecasts_type_info = new String[]{'enableForecasts','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] forecastingCategoryMappings_type_info = new String[]{'forecastingCategoryMappings','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] forecastingTypeSettings_type_info = new String[]{'forecastingTypeSettings','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'displayCurrency','enableForecasts','forecastingCategoryMappings','forecastingTypeSettings'}; + } + public class ReportChartComponentLayoutItem { + public Boolean cacheData; + public String contextFilterableField; + public String error; + public Boolean hideOnError; + public Boolean includeContext; + public String reportName; + public Boolean showTitle; + public String size; + private String[] cacheData_type_info = new String[]{'cacheData','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] contextFilterableField_type_info = new String[]{'contextFilterableField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] error_type_info = new String[]{'error','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] hideOnError_type_info = new String[]{'hideOnError','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] includeContext_type_info = new String[]{'includeContext','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] reportName_type_info = new String[]{'reportName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] showTitle_type_info = new String[]{'showTitle','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] size_type_info = new String[]{'size','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'cacheData','contextFilterableField','error','hideOnError','includeContext','reportName','showTitle','size'}; + } + public class AppMenu extends Metadata { + public String type = 'AppMenu'; + public String fullName; + public MetadataService.AppMenuItem[] appMenuItems; + private String[] appMenuItems_type_info = new String[]{'appMenuItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'appMenuItems'}; } public class FlowSubflowOutputAssignment { public String assignToReference; public String name; - private String[] assignToReference_type_info = new String[]{'assignToReference','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] assignToReference_type_info = new String[]{'assignToReference','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'assignToReference','name'}; } - public class ContactSharingRules { - public MetadataService.ContactCriteriaBasedSharingRule[] criteriaBasedRules; - public MetadataService.ContactOwnerSharingRule[] ownerRules; - private String[] criteriaBasedRules_type_info = new String[]{'criteriaBasedRules','http://soap.sforce.com/2006/04/metadata','ContactCriteriaBasedSharingRule','0','-1','false'}; - private String[] ownerRules_type_info = new String[]{'ownerRules','http://soap.sforce.com/2006/04/metadata','ContactOwnerSharingRule','0','-1','false'}; + public class ConnectedAppIpRange { + public String description; + public String end_x; + public String start; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] end_x_type_info = new String[]{'end','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] start_type_info = new String[]{'start','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'description','end_x','start'}; + } + public class Package_x extends Metadata { + public String type = 'Package_x'; + public String fullName; + public String apiAccessLevel; + public String description; + public String namespacePrefix; + public MetadataService.ProfileObjectPermissions[] objectPermissions; + public String postInstallClass; + public String setupWeblink; + public MetadataService.PackageTypeMembers[] types; + public String uninstallClass; + public String version; + private String[] apiAccessLevel_type_info = new String[]{'apiAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] namespacePrefix_type_info = new String[]{'namespacePrefix','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] objectPermissions_type_info = new String[]{'objectPermissions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] postInstallClass_type_info = new String[]{'postInstallClass','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] setupWeblink_type_info = new String[]{'setupWeblink','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] types_type_info = new String[]{'types','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] uninstallClass_type_info = new String[]{'uninstallClass','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] version_type_info = new String[]{'version','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'criteriaBasedRules','ownerRules'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'apiAccessLevel','description','namespacePrefix','objectPermissions','postInstallClass','setupWeblink','types','uninstallClass','version'}; } - public class AccountTerritorySharingRules { - public MetadataService.AccountTerritorySharingRule[] rules; - private String[] rules_type_info = new String[]{'rules','http://soap.sforce.com/2006/04/metadata','AccountTerritorySharingRule','0','-1','false'}; + public class FlowActionCall { + public String actionName; + public String actionType; + public MetadataService.FlowConnector connector; + public MetadataService.FlowConnector faultConnector; + public MetadataService.FlowActionCallInputParameter[] inputParameters; + public MetadataService.FlowActionCallOutputParameter[] outputParameters; + private String[] actionName_type_info = new String[]{'actionName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] actionType_type_info = new String[]{'actionType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] inputParameters_type_info = new String[]{'inputParameters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] outputParameters_type_info = new String[]{'outputParameters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'rules'}; + private String[] field_order_type_info = new String[]{'actionName','actionType','connector','faultConnector','inputParameters','outputParameters'}; } public virtual class MetadataWithContent extends Metadata { public String content; - private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; + private String[] content_type_info = new String[]{'content','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'content'}; } - public class FlowConnector { - public String targetReference; - private String[] targetReference_type_info = new String[]{'targetReference','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'targetReference'}; - } - public class ListMetadataQuery { - public String folder; - public String type_x; - private String[] folder_type_info = new String[]{'folder','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ForecastingCategoryMapping { + public String forecastingItemCategoryApiName; + public MetadataService.WeightedSourceCategory[] weightedSourceCategories; + private String[] forecastingItemCategoryApiName_type_info = new String[]{'forecastingItemCategoryApiName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] weightedSourceCategories_type_info = new String[]{'weightedSourceCategories','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'folder','type_x'}; + private String[] field_order_type_info = new String[]{'forecastingItemCategoryApiName','weightedSourceCategories'}; } public class RetrieveRequest { public Double apiVersion; @@ -1613,15 +1793,31 @@ public class MetadataService { public Boolean singlePackage; public String[] specificFiles; public MetadataService.Package_x unpackaged; - private String[] apiVersion_type_info = new String[]{'apiVersion','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; - private String[] packageNames_type_info = new String[]{'packageNames','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] singlePackage_type_info = new String[]{'singlePackage','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] specificFiles_type_info = new String[]{'specificFiles','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] unpackaged_type_info = new String[]{'unpackaged','http://soap.sforce.com/2006/04/metadata','Package','0','1','false'}; + private String[] apiVersion_type_info = new String[]{'apiVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] packageNames_type_info = new String[]{'packageNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] singlePackage_type_info = new String[]{'singlePackage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] specificFiles_type_info = new String[]{'specificFiles','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] unpackaged_type_info = new String[]{'unpackaged','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'apiVersion','packageNames','singlePackage','specificFiles','unpackaged'}; } - public class CustomApplicationComponent { + public class ListMetadataQuery { + public String folder; + public String type_x; + private String[] folder_type_info = new String[]{'folder','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'folder','type_x'}; + } + public class FlowConnector { + public String targetReference; + private String[] targetReference_type_info = new String[]{'targetReference','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'targetReference'}; + } + public class CustomApplicationComponent extends Metadata { + public String type = 'CustomApplicationComponent'; + public String fullName; public String buttonIconUrl; public String buttonStyle; public String buttonText; @@ -1632,98 +1828,132 @@ public class MetadataService { public Boolean isWidthFixed; public String visualforcePage; public Integer width; - private String[] buttonIconUrl_type_info = new String[]{'buttonIconUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] buttonStyle_type_info = new String[]{'buttonStyle','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] buttonText_type_info = new String[]{'buttonText','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] buttonWidth_type_info = new String[]{'buttonWidth','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] height_type_info = new String[]{'height','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] isHeightFixed_type_info = new String[]{'isHeightFixed','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] isHidden_type_info = new String[]{'isHidden','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] isWidthFixed_type_info = new String[]{'isWidthFixed','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] visualforcePage_type_info = new String[]{'visualforcePage','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] width_type_info = new String[]{'width','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'buttonIconUrl','buttonStyle','buttonText','buttonWidth','height','isHeightFixed','isHidden','isWidthFixed','visualforcePage','width'}; + private String[] buttonIconUrl_type_info = new String[]{'buttonIconUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] buttonStyle_type_info = new String[]{'buttonStyle','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] buttonText_type_info = new String[]{'buttonText','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] buttonWidth_type_info = new String[]{'buttonWidth','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isHeightFixed_type_info = new String[]{'isHeightFixed','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isHidden_type_info = new String[]{'isHidden','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isWidthFixed_type_info = new String[]{'isWidthFixed','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] visualforcePage_type_info = new String[]{'visualforcePage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'buttonIconUrl','buttonStyle','buttonText','buttonWidth','height','isHeightFixed','isHidden','isWidthFixed','visualforcePage','width'}; } public class FlowRecordLookup { + public Boolean assignNullValuesIfNoRecordsFound; public MetadataService.FlowConnector connector; public MetadataService.FlowConnector faultConnector; public MetadataService.FlowRecordFilter[] filters; public String object_x; public MetadataService.FlowOutputFieldAssignment[] outputAssignments; + public String outputReference; + public String[] queriedFields; public String sortField; public String sortOrder; - private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] filters_type_info = new String[]{'filters','http://soap.sforce.com/2006/04/metadata','FlowRecordFilter','0','-1','false'}; - private String[] object_x_type_info = new String[]{'object','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] outputAssignments_type_info = new String[]{'outputAssignments','http://soap.sforce.com/2006/04/metadata','FlowOutputFieldAssignment','0','-1','false'}; - private String[] sortField_type_info = new String[]{'sortField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata','SortOrder','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'connector','faultConnector','filters','object_x','outputAssignments','sortField','sortOrder'}; - } - public class FieldSet { + private String[] assignNullValuesIfNoRecordsFound_type_info = new String[]{'assignNullValuesIfNoRecordsFound','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] filters_type_info = new String[]{'filters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] object_x_type_info = new String[]{'object','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] outputAssignments_type_info = new String[]{'outputAssignments','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] outputReference_type_info = new String[]{'outputReference','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] queriedFields_type_info = new String[]{'queriedFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] sortField_type_info = new String[]{'sortField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'assignNullValuesIfNoRecordsFound','connector','faultConnector','filters','object_x','outputAssignments','outputReference','queriedFields','sortField','sortOrder'}; + } + public class FieldSet extends Metadata { + public String type = 'FieldSet'; + public String fullName; public MetadataService.FieldSetItem[] availableFields; public String description; public MetadataService.FieldSetItem[] displayedFields; public String label; - private String[] availableFields_type_info = new String[]{'availableFields','http://soap.sforce.com/2006/04/metadata','FieldSetItem','0','-1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] displayedFields_type_info = new String[]{'displayedFields','http://soap.sforce.com/2006/04/metadata','FieldSetItem','0','-1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] availableFields_type_info = new String[]{'availableFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] displayedFields_type_info = new String[]{'displayedFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'availableFields','description','displayedFields','label'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'availableFields','description','displayedFields','label'}; } - public class AccountCriteriaBasedSharingRule { - public String accountAccessLevel; - public String booleanFilter; - public String caseAccessLevel; - public String contactAccessLevel; - public String name; - public String opportunityAccessLevel; - private String[] accountAccessLevel_type_info = new String[]{'accountAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoNone','1','1','false'}; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] caseAccessLevel_type_info = new String[]{'caseAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoAll','1','1','false'}; - private String[] contactAccessLevel_type_info = new String[]{'contactAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoAll','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] opportunityAccessLevel_type_info = new String[]{'opportunityAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoAll','1','1','false'}; + public class Error { + public String[] fields; + public String message; + public String statusCode; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] message_type_info = new String[]{'message','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] statusCode_type_info = new String[]{'statusCode','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'accountAccessLevel','booleanFilter','caseAccessLevel','contactAccessLevel','name','opportunityAccessLevel'}; + private String[] field_order_type_info = new String[]{'fields','message','statusCode'}; } public class DebuggingHeader_element { public MetadataService.LogInfo[] categories; public String debugLevel; - private String[] categories_type_info = new String[]{'categories','http://soap.sforce.com/2006/04/metadata','LogInfo','0','-1','false'}; - private String[] debugLevel_type_info = new String[]{'debugLevel','http://soap.sforce.com/2006/04/metadata','LogType','1','1','false'}; + private String[] categories_type_info = new String[]{'categories','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] debugLevel_type_info = new String[]{'debugLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'categories','debugLevel'}; } + public class ComponentInstanceProperty { + public String name; + public String value; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'name','value'}; + } public class FlowRecordDelete { public MetadataService.FlowConnector connector; public MetadataService.FlowConnector faultConnector; public MetadataService.FlowRecordFilter[] filters; + public String inputReference; public String object_x; - private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] filters_type_info = new String[]{'filters','http://soap.sforce.com/2006/04/metadata','FlowRecordFilter','0','-1','false'}; - private String[] object_x_type_info = new String[]{'object','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] filters_type_info = new String[]{'filters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] inputReference_type_info = new String[]{'inputReference','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] object_x_type_info = new String[]{'object','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'connector','faultConnector','filters','object_x'}; + private String[] field_order_type_info = new String[]{'connector','faultConnector','filters','inputReference','object_x'}; } public class FlowDecision { public MetadataService.FlowConnector defaultConnector; public String defaultConnectorLabel; public MetadataService.FlowRule[] rules; - private String[] defaultConnector_type_info = new String[]{'defaultConnector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] defaultConnectorLabel_type_info = new String[]{'defaultConnectorLabel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] rules_type_info = new String[]{'rules','http://soap.sforce.com/2006/04/metadata','FlowRule','0','-1','false'}; + private String[] defaultConnector_type_info = new String[]{'defaultConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultConnectorLabel_type_info = new String[]{'defaultConnectorLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] rules_type_info = new String[]{'rules','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'defaultConnector','defaultConnectorLabel','rules'}; } + public class MatchingRule extends Metadata { + public String type = 'MatchingRule'; + public String fullName; + public String booleanFilter; + public String description; + public String label; + public MetadataService.MatchingRuleItem[] matchingRuleItems; + public String ruleStatus; + private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] matchingRuleItems_type_info = new String[]{'matchingRuleItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] ruleStatus_type_info = new String[]{'ruleStatus','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'booleanFilter','description','label','matchingRuleItems','ruleStatus'}; + } public class QuickActionListItem { public String quickActionName; - private String[] quickActionName_type_info = new String[]{'quickActionName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] quickActionName_type_info = new String[]{'quickActionName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'quickActionName'}; } @@ -1741,87 +1971,151 @@ public class MetadataService { public String tertiaryComplementColor; public String zeronaryColor; public String zeronaryComplementColor; - private String[] loginFooterText_type_info = new String[]{'loginFooterText','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] loginLogo_type_info = new String[]{'loginLogo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] pageFooter_type_info = new String[]{'pageFooter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] pageHeader_type_info = new String[]{'pageHeader','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] primaryColor_type_info = new String[]{'primaryColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] primaryComplementColor_type_info = new String[]{'primaryComplementColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] quaternaryColor_type_info = new String[]{'quaternaryColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] quaternaryComplementColor_type_info = new String[]{'quaternaryComplementColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] secondaryColor_type_info = new String[]{'secondaryColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] tertiaryColor_type_info = new String[]{'tertiaryColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] tertiaryComplementColor_type_info = new String[]{'tertiaryComplementColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] zeronaryColor_type_info = new String[]{'zeronaryColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] zeronaryComplementColor_type_info = new String[]{'zeronaryComplementColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] loginFooterText_type_info = new String[]{'loginFooterText','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] loginLogo_type_info = new String[]{'loginLogo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] pageFooter_type_info = new String[]{'pageFooter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] pageHeader_type_info = new String[]{'pageHeader','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] primaryColor_type_info = new String[]{'primaryColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] primaryComplementColor_type_info = new String[]{'primaryComplementColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] quaternaryColor_type_info = new String[]{'quaternaryColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] quaternaryComplementColor_type_info = new String[]{'quaternaryComplementColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] secondaryColor_type_info = new String[]{'secondaryColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] tertiaryColor_type_info = new String[]{'tertiaryColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] tertiaryComplementColor_type_info = new String[]{'tertiaryComplementColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] zeronaryColor_type_info = new String[]{'zeronaryColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] zeronaryComplementColor_type_info = new String[]{'zeronaryComplementColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'loginFooterText','loginLogo','pageFooter','pageHeader','primaryColor','primaryComplementColor','quaternaryColor','quaternaryComplementColor','secondaryColor','tertiaryColor','tertiaryComplementColor','zeronaryColor','zeronaryComplementColor'}; } - public class CustomLabel { + public class CustomLabel extends Metadata { + public String type = 'CustomLabel'; + public String fullName; public String categories; public String language; public Boolean protected_x; public String shortDescription; public String value; - private String[] categories_type_info = new String[]{'categories','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] language_type_info = new String[]{'language','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] protected_x_type_info = new String[]{'protected','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] shortDescription_type_info = new String[]{'shortDescription','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] categories_type_info = new String[]{'categories','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] shortDescription_type_info = new String[]{'shortDescription','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'categories','language','protected_x','shortDescription','value'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'categories','language','protected_x','shortDescription','value'}; } public class Attachment { public String content; public String name; - private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] content_type_info = new String[]{'content','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'content','name'}; } + public class BusinessHoursEntry extends Metadata { + public String type = 'BusinessHoursEntry'; + public String fullName; + public Boolean active; + public Boolean default_x; + public DateTime fridayEndTime; + public DateTime fridayStartTime; + public DateTime mondayEndTime; + public DateTime mondayStartTime; + public String name; + public DateTime saturdayEndTime; + public DateTime saturdayStartTime; + public DateTime sundayEndTime; + public DateTime sundayStartTime; + public DateTime thursdayEndTime; + public DateTime thursdayStartTime; + public String timeZoneId; + public DateTime tuesdayEndTime; + public DateTime tuesdayStartTime; + public DateTime wednesdayEndTime; + public DateTime wednesdayStartTime; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] default_x_type_info = new String[]{'default','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] fridayEndTime_type_info = new String[]{'fridayEndTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fridayStartTime_type_info = new String[]{'fridayStartTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] mondayEndTime_type_info = new String[]{'mondayEndTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] mondayStartTime_type_info = new String[]{'mondayStartTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] saturdayEndTime_type_info = new String[]{'saturdayEndTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] saturdayStartTime_type_info = new String[]{'saturdayStartTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sundayEndTime_type_info = new String[]{'sundayEndTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sundayStartTime_type_info = new String[]{'sundayStartTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] thursdayEndTime_type_info = new String[]{'thursdayEndTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] thursdayStartTime_type_info = new String[]{'thursdayStartTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] timeZoneId_type_info = new String[]{'timeZoneId','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] tuesdayEndTime_type_info = new String[]{'tuesdayEndTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] tuesdayStartTime_type_info = new String[]{'tuesdayStartTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] wednesdayEndTime_type_info = new String[]{'wednesdayEndTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] wednesdayStartTime_type_info = new String[]{'wednesdayStartTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','default_x','fridayEndTime','fridayStartTime','mondayEndTime','mondayStartTime','name','saturdayEndTime','saturdayStartTime','sundayEndTime','sundayStartTime','thursdayEndTime','thursdayStartTime','timeZoneId','tuesdayEndTime','tuesdayStartTime','wednesdayEndTime','wednesdayStartTime'}; + } public class FiscalYearSettings { public String fiscalYearNameBasedOn; public String startMonth; - private String[] fiscalYearNameBasedOn_type_info = new String[]{'fiscalYearNameBasedOn','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] startMonth_type_info = new String[]{'startMonth','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] fiscalYearNameBasedOn_type_info = new String[]{'fiscalYearNameBasedOn','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] startMonth_type_info = new String[]{'startMonth','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'fiscalYearNameBasedOn','startMonth'}; } - public class SharingRules { + public class SharingRules extends Metadata { + public String type = 'SharingRules'; + public String fullName; + public MetadataService.SharingCriteriaRule[] sharingCriteriaRules; + public MetadataService.SharingOwnerRule[] sharingOwnerRules; + public MetadataService.SharingTerritoryRule[] sharingTerritoryRules; + private String[] sharingCriteriaRules_type_info = new String[]{'sharingCriteriaRules','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] sharingOwnerRules_type_info = new String[]{'sharingOwnerRules','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] sharingTerritoryRules_type_info = new String[]{'sharingTerritoryRules','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'sharingCriteriaRules','sharingOwnerRules','sharingTerritoryRules'}; } - public class ChatterAnswersSettings { + public class ChatterAnswersSettings extends Metadata { + public String type = 'ChatterAnswersSettings'; + public String fullName; public Boolean emailFollowersOnBestAnswer; public Boolean emailFollowersOnReply; public Boolean emailOwnerOnPrivateReply; public Boolean emailOwnerOnReply; + public Boolean enableAnswerViaEmail; public Boolean enableChatterAnswers; public Boolean enableFacebookSSO; - public Boolean enableOptimizeQuestionFlow; + public Boolean enableInlinePublisher; public Boolean enableReputation; public Boolean enableRichTextEditor; public String facebookAuthProvider; public Boolean showInPortals; - private String[] emailFollowersOnBestAnswer_type_info = new String[]{'emailFollowersOnBestAnswer','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] emailFollowersOnReply_type_info = new String[]{'emailFollowersOnReply','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] emailOwnerOnPrivateReply_type_info = new String[]{'emailOwnerOnPrivateReply','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] emailOwnerOnReply_type_info = new String[]{'emailOwnerOnReply','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableChatterAnswers_type_info = new String[]{'enableChatterAnswers','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] enableFacebookSSO_type_info = new String[]{'enableFacebookSSO','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableOptimizeQuestionFlow_type_info = new String[]{'enableOptimizeQuestionFlow','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableReputation_type_info = new String[]{'enableReputation','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableRichTextEditor_type_info = new String[]{'enableRichTextEditor','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] facebookAuthProvider_type_info = new String[]{'facebookAuthProvider','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] showInPortals_type_info = new String[]{'showInPortals','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'emailFollowersOnBestAnswer','emailFollowersOnReply','emailOwnerOnPrivateReply','emailOwnerOnReply','enableChatterAnswers','enableFacebookSSO','enableOptimizeQuestionFlow','enableReputation','enableRichTextEditor','facebookAuthProvider','showInPortals'}; + private String[] emailFollowersOnBestAnswer_type_info = new String[]{'emailFollowersOnBestAnswer','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailFollowersOnReply_type_info = new String[]{'emailFollowersOnReply','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailOwnerOnPrivateReply_type_info = new String[]{'emailOwnerOnPrivateReply','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailOwnerOnReply_type_info = new String[]{'emailOwnerOnReply','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableAnswerViaEmail_type_info = new String[]{'enableAnswerViaEmail','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableChatterAnswers_type_info = new String[]{'enableChatterAnswers','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enableFacebookSSO_type_info = new String[]{'enableFacebookSSO','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableInlinePublisher_type_info = new String[]{'enableInlinePublisher','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableReputation_type_info = new String[]{'enableReputation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableRichTextEditor_type_info = new String[]{'enableRichTextEditor','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] facebookAuthProvider_type_info = new String[]{'facebookAuthProvider','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showInPortals_type_info = new String[]{'showInPortals','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'emailFollowersOnBestAnswer','emailFollowersOnReply','emailOwnerOnPrivateReply','emailOwnerOnReply','enableAnswerViaEmail','enableChatterAnswers','enableFacebookSSO','enableInlinePublisher','enableReputation','enableRichTextEditor','facebookAuthProvider','showInPortals'}; } public class CustomConsoleComponents { public MetadataService.PrimaryTabComponents primaryTabComponents; public MetadataService.SubtabComponents subtabComponents; - private String[] primaryTabComponents_type_info = new String[]{'primaryTabComponents','http://soap.sforce.com/2006/04/metadata','PrimaryTabComponents','0','1','false'}; - private String[] subtabComponents_type_info = new String[]{'subtabComponents','http://soap.sforce.com/2006/04/metadata','SubtabComponents','0','1','false'}; + private String[] primaryTabComponents_type_info = new String[]{'primaryTabComponents','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] subtabComponents_type_info = new String[]{'subtabComponents','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'primaryTabComponents','subtabComponents'}; } @@ -1829,19 +2123,59 @@ public class MetadataService { public String aggregate; public String axisBinding; public String column; - private String[] aggregate_type_info = new String[]{'aggregate','http://soap.sforce.com/2006/04/metadata','ReportSummaryType','0','1','false'}; - private String[] axisBinding_type_info = new String[]{'axisBinding','http://soap.sforce.com/2006/04/metadata','ChartAxis','0','1','false'}; - private String[] column_type_info = new String[]{'column','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] aggregate_type_info = new String[]{'aggregate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] axisBinding_type_info = new String[]{'axisBinding','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] column_type_info = new String[]{'column','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'aggregate','axisBinding','column'}; } + public class AnalyticsCloudComponentLayoutItem { + public String assetType; + public String devName; + public String error; + public String filter; + public Integer height; + public Boolean hideOnError; + public Boolean showTitle; + public String width; + private String[] assetType_type_info = new String[]{'assetType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] devName_type_info = new String[]{'devName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] error_type_info = new String[]{'error','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] filter_type_info = new String[]{'filter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] hideOnError_type_info = new String[]{'hideOnError','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showTitle_type_info = new String[]{'showTitle','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'assetType','devName','error','filter','height','hideOnError','showTitle','width'}; + } + public class describeValueType_element { + public String type_x; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'type_x'}; + } + public class FlowDefinition extends Metadata { + public String type = 'FlowDefinition'; + public String fullName; + public Integer activeVersionNumber; + public String description; + public String masterLabel; + private String[] activeVersionNumber_type_info = new String[]{'activeVersionNumber','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'activeVersionNumber','description','masterLabel'}; + } public class QuickActionLayoutItem { public Boolean emptySpace; public String field; public String uiBehavior; - private String[] emptySpace_type_info = new String[]{'emptySpace','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] uiBehavior_type_info = new String[]{'uiBehavior','http://soap.sforce.com/2006/04/metadata','UiBehavior','0','1','false'}; + private String[] emptySpace_type_info = new String[]{'emptySpace','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] uiBehavior_type_info = new String[]{'uiBehavior','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'emptySpace','field','uiBehavior'}; } @@ -1849,17 +2183,17 @@ public class MetadataService { public String controllingField; public MetadataService.PicklistValue[] picklistValues; public Boolean sorted; - private String[] controllingField_type_info = new String[]{'controllingField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] picklistValues_type_info = new String[]{'picklistValues','http://soap.sforce.com/2006/04/metadata','PicklistValue','0','-1','false'}; - private String[] sorted_type_info = new String[]{'sorted','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] controllingField_type_info = new String[]{'controllingField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] picklistValues_type_info = new String[]{'picklistValues','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] sorted_type_info = new String[]{'sorted','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'controllingField','picklistValues','sorted'}; } public class ReportLayoutSection { public MetadataService.ReportTypeColumn[] columns; public String masterLabel; - private String[] columns_type_info = new String[]{'columns','http://soap.sforce.com/2006/04/metadata','ReportTypeColumn','0','-1','false'}; - private String[] masterLabel_type_info = new String[]{'masterLabel','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] columns_type_info = new String[]{'columns','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'columns','masterLabel'}; } @@ -1869,11 +2203,11 @@ public class MetadataService { public Integer posX; public Integer posY; public Integer posZ; - private String[] customLink_type_info = new String[]{'customLink','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] posX_type_info = new String[]{'posX','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] posY_type_info = new String[]{'posY','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] posZ_type_info = new String[]{'posZ','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; + private String[] customLink_type_info = new String[]{'customLink','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] posX_type_info = new String[]{'posX','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] posY_type_info = new String[]{'posY','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] posZ_type_info = new String[]{'posZ','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'customLink','field','posX','posY','posZ'}; } @@ -1884,24 +2218,24 @@ public class MetadataService { public String label; public MetadataService.LayoutColumn[] layoutColumns; public String style; - private String[] customLabel_type_info = new String[]{'customLabel','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] detailHeading_type_info = new String[]{'detailHeading','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] editHeading_type_info = new String[]{'editHeading','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] layoutColumns_type_info = new String[]{'layoutColumns','http://soap.sforce.com/2006/04/metadata','LayoutColumn','0','-1','false'}; - private String[] style_type_info = new String[]{'style','http://soap.sforce.com/2006/04/metadata','LayoutSectionStyle','1','1','false'}; + private String[] customLabel_type_info = new String[]{'customLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] detailHeading_type_info = new String[]{'detailHeading','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] editHeading_type_info = new String[]{'editHeading','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] layoutColumns_type_info = new String[]{'layoutColumns','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] style_type_info = new String[]{'style','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'customLabel','detailHeading','editHeading','label','layoutColumns','style'}; } public class CountriesAndStates { public MetadataService.Country[] countries; - private String[] countries_type_info = new String[]{'countries','http://soap.sforce.com/2006/04/metadata','Country','0','-1','false'}; + private String[] countries_type_info = new String[]{'countries','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'countries'}; } public class OpportunityListFieldsSelectedSettings { public String[] field; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'field'}; } @@ -1910,16 +2244,32 @@ public class MetadataService { public Date endDate; public String interval; public Date startDate; - private String[] dateColumn_type_info = new String[]{'dateColumn','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] endDate_type_info = new String[]{'endDate','http://www.w3.org/2001/XMLSchema','date','0','1','false'}; - private String[] interval_type_info = new String[]{'interval','http://soap.sforce.com/2006/04/metadata','UserDateInterval','1','1','false'}; - private String[] startDate_type_info = new String[]{'startDate','http://www.w3.org/2001/XMLSchema','date','0','1','false'}; + private String[] dateColumn_type_info = new String[]{'dateColumn','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] endDate_type_info = new String[]{'endDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] interval_type_info = new String[]{'interval','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] startDate_type_info = new String[]{'startDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'dateColumn','endDate','interval','startDate'}; } + public class XOrgHub extends Metadata { + public String type = 'XOrgHub'; + public String fullName; + public String label; + public Boolean lockSharedObjects; + public String[] permissionSets; + public MetadataService.XOrgHubSharedObject[] sharedObjects; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] lockSharedObjects_type_info = new String[]{'lockSharedObjects','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] permissionSets_type_info = new String[]{'permissionSets','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] sharedObjects_type_info = new String[]{'sharedObjects','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'label','lockSharedObjects','permissionSets','sharedObjects'}; + } public class ApprovalStepRejectBehavior { public String type_x; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','StepRejectBehaviorType','1','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'type_x'}; } @@ -1935,219 +2285,383 @@ public class MetadataService { public String routingName; public Boolean saveEmailHeaders; public String taskStatus; - private String[] addressType_type_info = new String[]{'addressType','http://soap.sforce.com/2006/04/metadata','EmailToCaseRoutingAddressType','0','1','false'}; - private String[] authorizedSenders_type_info = new String[]{'authorizedSenders','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] caseOrigin_type_info = new String[]{'caseOrigin','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] caseOwner_type_info = new String[]{'caseOwner','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] caseOwnerType_type_info = new String[]{'caseOwnerType','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] casePriority_type_info = new String[]{'casePriority','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] createTask_type_info = new String[]{'createTask','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] emailAddress_type_info = new String[]{'emailAddress','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] routingName_type_info = new String[]{'routingName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] saveEmailHeaders_type_info = new String[]{'saveEmailHeaders','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] taskStatus_type_info = new String[]{'taskStatus','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] addressType_type_info = new String[]{'addressType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] authorizedSenders_type_info = new String[]{'authorizedSenders','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] caseOrigin_type_info = new String[]{'caseOrigin','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] caseOwner_type_info = new String[]{'caseOwner','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] caseOwnerType_type_info = new String[]{'caseOwnerType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] casePriority_type_info = new String[]{'casePriority','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] createTask_type_info = new String[]{'createTask','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailAddress_type_info = new String[]{'emailAddress','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] routingName_type_info = new String[]{'routingName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] saveEmailHeaders_type_info = new String[]{'saveEmailHeaders','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] taskStatus_type_info = new String[]{'taskStatus','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'addressType','authorizedSenders','caseOrigin','caseOwner','caseOwnerType','casePriority','createTask','emailAddress','routingName','saveEmailHeaders','taskStatus'}; } + public class FlowWaitEventInputParameter { + public String name; + public MetadataService.FlowElementReferenceOrValue value; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'name','value'}; + } public class FolderShare { public String accessLevel; public String sharedTo; public String sharedToType; - private String[] accessLevel_type_info = new String[]{'accessLevel','http://soap.sforce.com/2006/04/metadata','FolderShareAccessLevel','1','1','false'}; - private String[] sharedTo_type_info = new String[]{'sharedTo','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] sharedToType_type_info = new String[]{'sharedToType','http://soap.sforce.com/2006/04/metadata','FolderSharedToType','1','1','false'}; + private String[] accessLevel_type_info = new String[]{'accessLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sharedToType_type_info = new String[]{'sharedToType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'accessLevel','sharedTo','sharedToType'}; } + public class ManagedTopic { + public String managedTopicType; + public String name; + public Integer position; + public String topicDescription; + private String[] managedTopicType_type_info = new String[]{'managedTopicType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] position_type_info = new String[]{'position','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] topicDescription_type_info = new String[]{'topicDescription','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'managedTopicType','name','position','topicDescription'}; + } public class ApprovalEntryCriteria { public String booleanFilter; public MetadataService.FilterItem[] criteriaItems; public String formula; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata','FilterItem','0','-1','false'}; - private String[] formula_type_info = new String[]{'formula','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] formula_type_info = new String[]{'formula','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'booleanFilter','criteriaItems','formula'}; } + public class Territory2RuleItem { + public String field; + public String operation; + public String value; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] operation_type_info = new String[]{'operation','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'field','operation','value'}; + } + public class Notification { + public Boolean inApp; + public Boolean sendEmail; + public String user_x; + private String[] inApp_type_info = new String[]{'inApp','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sendEmail_type_info = new String[]{'sendEmail','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] user_x_type_info = new String[]{'user','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'inApp','sendEmail','user_x'}; + } public class WorkspaceMapping { public String fieldName; public String tab; - private String[] fieldName_type_info = new String[]{'fieldName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] tab_type_info = new String[]{'tab','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] fieldName_type_info = new String[]{'fieldName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] tab_type_info = new String[]{'tab','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'fieldName','tab'}; } + public class LicensedCustomPermissions { + public String customPermission; + public String licenseDefinition; + private String[] customPermission_type_info = new String[]{'customPermission','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] licenseDefinition_type_info = new String[]{'licenseDefinition','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'customPermission','licenseDefinition'}; + } public class ApexPage extends MetadataWithContent { - public String type = 'ApexPage'; - public String fullName; - public String content; + public String type = 'ApexPage'; + public String fullName; + public String content; public Double apiVersion; public Boolean availableInTouch; public Boolean confirmationTokenRequired; public String description; public String label; public MetadataService.PackageVersion[] packageVersions; - private String[] type_att_info = new String[]{'xsi:type'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; - private String[] apiVersion_type_info = new String[]{'apiVersion','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; - private String[] availableInTouch_type_info = new String[]{'availableInTouch','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] confirmationTokenRequired_type_info = new String[]{'confirmationTokenRequired','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata','PackageVersion','0','-1','false'}; + private String[] apiVersion_type_info = new String[]{'apiVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] availableInTouch_type_info = new String[]{'availableInTouch','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] confirmationTokenRequired_type_info = new String[]{'confirmationTokenRequired','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; private String[] field_order_type_info = new String[]{'fullName', 'content', 'apiVersion','availableInTouch','confirmationTokenRequired','description','label','packageVersions'}; } - public class ProductSettings { + public class ProductSettings extends Metadata { + public String type = 'ProductSettings'; + public String fullName; public Boolean enableCascadeActivateToRelatedPrices; public Boolean enableQuantitySchedule; public Boolean enableRevenueSchedule; - private String[] enableCascadeActivateToRelatedPrices_type_info = new String[]{'enableCascadeActivateToRelatedPrices','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableQuantitySchedule_type_info = new String[]{'enableQuantitySchedule','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableRevenueSchedule_type_info = new String[]{'enableRevenueSchedule','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] enableCascadeActivateToRelatedPrices_type_info = new String[]{'enableCascadeActivateToRelatedPrices','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableQuantitySchedule_type_info = new String[]{'enableQuantitySchedule','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableRevenueSchedule_type_info = new String[]{'enableRevenueSchedule','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enableCascadeActivateToRelatedPrices','enableQuantitySchedule','enableRevenueSchedule'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'enableCascadeActivateToRelatedPrices','enableQuantitySchedule','enableRevenueSchedule'}; } - public class OpportunitySettings { + public class OpportunitySettings extends Metadata { + public String type = 'OpportunitySettings'; + public String fullName; public Boolean autoActivateNewReminders; public Boolean enableFindSimilarOpportunities; public Boolean enableOpportunityTeam; public Boolean enableUpdateReminders; public MetadataService.FindSimilarOppFilter findSimilarOppFilter; public Boolean promptToAddProducts; - private String[] autoActivateNewReminders_type_info = new String[]{'autoActivateNewReminders','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableFindSimilarOpportunities_type_info = new String[]{'enableFindSimilarOpportunities','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableOpportunityTeam_type_info = new String[]{'enableOpportunityTeam','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableUpdateReminders_type_info = new String[]{'enableUpdateReminders','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] findSimilarOppFilter_type_info = new String[]{'findSimilarOppFilter','http://soap.sforce.com/2006/04/metadata','FindSimilarOppFilter','0','1','false'}; - private String[] promptToAddProducts_type_info = new String[]{'promptToAddProducts','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] autoActivateNewReminders_type_info = new String[]{'autoActivateNewReminders','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableFindSimilarOpportunities_type_info = new String[]{'enableFindSimilarOpportunities','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableOpportunityTeam_type_info = new String[]{'enableOpportunityTeam','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableUpdateReminders_type_info = new String[]{'enableUpdateReminders','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] findSimilarOppFilter_type_info = new String[]{'findSimilarOppFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] promptToAddProducts_type_info = new String[]{'promptToAddProducts','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'autoActivateNewReminders','enableFindSimilarOpportunities','enableOpportunityTeam','enableUpdateReminders','findSimilarOppFilter','promptToAddProducts'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'autoActivateNewReminders','enableFindSimilarOpportunities','enableOpportunityTeam','enableUpdateReminders','findSimilarOppFilter','promptToAddProducts'}; } - public class LiveChatDeployment { + public class LiveChatDeployment extends Metadata { + public String type = 'LiveChatDeployment'; + public String fullName; public String brandingImage; + public Boolean displayQueuePosition; public MetadataService.LiveChatDeploymentDomainWhitelist domainWhiteList; + public Boolean enablePrechatApi; public Boolean enableTranscriptSave; public String label; public String mobileBrandingImage; public String site; public String windowTitle; - private String[] brandingImage_type_info = new String[]{'brandingImage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] domainWhiteList_type_info = new String[]{'domainWhiteList','http://soap.sforce.com/2006/04/metadata','LiveChatDeploymentDomainWhitelist','0','1','false'}; - private String[] enableTranscriptSave_type_info = new String[]{'enableTranscriptSave','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] mobileBrandingImage_type_info = new String[]{'mobileBrandingImage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] site_type_info = new String[]{'site','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] windowTitle_type_info = new String[]{'windowTitle','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] brandingImage_type_info = new String[]{'brandingImage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] displayQueuePosition_type_info = new String[]{'displayQueuePosition','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] domainWhiteList_type_info = new String[]{'domainWhiteList','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enablePrechatApi_type_info = new String[]{'enablePrechatApi','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableTranscriptSave_type_info = new String[]{'enableTranscriptSave','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] mobileBrandingImage_type_info = new String[]{'mobileBrandingImage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] site_type_info = new String[]{'site','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] windowTitle_type_info = new String[]{'windowTitle','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'brandingImage','domainWhiteList','enableTranscriptSave','label','mobileBrandingImage','site','windowTitle'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'brandingImage','displayQueuePosition','domainWhiteList','enablePrechatApi','enableTranscriptSave','label','mobileBrandingImage','site','windowTitle'}; + } + public class RelatedContent { + public MetadataService.RelatedContentItem[] relatedContentItems; + private String[] relatedContentItems_type_info = new String[]{'relatedContentItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'relatedContentItems'}; + } + public class MatchingRuleItem { + public String blankValueBehavior; + public String fieldName; + public String matchingMethod; + private String[] blankValueBehavior_type_info = new String[]{'blankValueBehavior','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fieldName_type_info = new String[]{'fieldName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] matchingMethod_type_info = new String[]{'matchingMethod','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'blankValueBehavior','fieldName','matchingMethod'}; + } + public class SupervisorAgentConfigSkills { + public String[] skill; + private String[] skill_type_info = new String[]{'skill','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'skill'}; } public class QuickActionLayoutColumn { public MetadataService.QuickActionLayoutItem[] quickActionLayoutItems; - private String[] quickActionLayoutItems_type_info = new String[]{'quickActionLayoutItems','http://soap.sforce.com/2006/04/metadata','QuickActionLayoutItem','0','-1','false'}; + private String[] quickActionLayoutItems_type_info = new String[]{'quickActionLayoutItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'quickActionLayoutItems'}; } - public class AccountTerritorySharingRule { - public String accountAccessLevel; - public String caseAccessLevel; - public String contactAccessLevel; - public String name; - public String opportunityAccessLevel; - private String[] accountAccessLevel_type_info = new String[]{'accountAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoNone','1','1','false'}; - private String[] caseAccessLevel_type_info = new String[]{'caseAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoAll','1','1','false'}; - private String[] contactAccessLevel_type_info = new String[]{'contactAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoAll','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] opportunityAccessLevel_type_info = new String[]{'opportunityAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoAll','1','1','false'}; + public class CustomPermission extends Metadata { + public String type = 'CustomPermission'; + public String fullName; + public String connectedApp; + public String description; + public String label; + public MetadataService.CustomPermissionDependencyRequired[] requiredPermission; + private String[] connectedApp_type_info = new String[]{'connectedApp','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] requiredPermission_type_info = new String[]{'requiredPermission','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'accountAccessLevel','caseAccessLevel','contactAccessLevel','name','opportunityAccessLevel'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'connectedApp','description','label','requiredPermission'}; } - public class ConsoleComponent { - public Integer height; - public String location; - public String visualforcePage; - public Integer width; - private String[] height_type_info = new String[]{'height','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] location_type_info = new String[]{'location','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] visualforcePage_type_info = new String[]{'visualforcePage','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] width_type_info = new String[]{'width','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; + public class DataPipeline { + public Double apiVersion; + public String label; + public String scriptType; + private String[] apiVersion_type_info = new String[]{'apiVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] scriptType_type_info = new String[]{'scriptType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'height','location','visualforcePage','width'}; + private String[] field_order_type_info = new String[]{'apiVersion','label','scriptType'}; } - public class CompanySettings { + public class CompanySettings extends Metadata { + public String type = 'CompanySettings'; + public String fullName; public MetadataService.FiscalYearSettings fiscalYear; - private String[] fiscalYear_type_info = new String[]{'fiscalYear','http://soap.sforce.com/2006/04/metadata','FiscalYearSettings','0','1','false'}; + private String[] fiscalYear_type_info = new String[]{'fiscalYear','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'fiscalYear'}; - } - public class OpportunitySharingRules { - public MetadataService.OpportunityCriteriaBasedSharingRule[] criteriaBasedRules; - public MetadataService.OpportunityOwnerSharingRule[] ownerRules; - private String[] criteriaBasedRules_type_info = new String[]{'criteriaBasedRules','http://soap.sforce.com/2006/04/metadata','OpportunityCriteriaBasedSharingRule','0','-1','false'}; - private String[] ownerRules_type_info = new String[]{'ownerRules','http://soap.sforce.com/2006/04/metadata','OpportunityOwnerSharingRule','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'criteriaBasedRules','ownerRules'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'fiscalYear'}; } - public class HomePageLayout { + public class HomePageLayout extends Metadata { + public String type = 'HomePageLayout'; + public String fullName; public String[] narrowComponents; public String[] wideComponents; - private String[] narrowComponents_type_info = new String[]{'narrowComponents','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] wideComponents_type_info = new String[]{'wideComponents','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + private String[] narrowComponents_type_info = new String[]{'narrowComponents','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] wideComponents_type_info = new String[]{'wideComponents','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'narrowComponents','wideComponents'}; + } + public class UiPlugin { + public String description; + public String extensionPointIdentifier; + public Boolean isEnabled; + public String language; + public String masterLabel; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] extensionPointIdentifier_type_info = new String[]{'extensionPointIdentifier','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isEnabled_type_info = new String[]{'isEnabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'narrowComponents','wideComponents'}; + private String[] field_order_type_info = new String[]{'description','extensionPointIdentifier','isEnabled','language','masterLabel'}; } public class SiteWebAddress { public String certificate; public String domainName; public Boolean primary; - private String[] certificate_type_info = new String[]{'certificate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] domainName_type_info = new String[]{'domainName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] primary_type_info = new String[]{'primary','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] certificate_type_info = new String[]{'certificate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] domainName_type_info = new String[]{'domainName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] primary_type_info = new String[]{'primary','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'certificate','domainName','primary'}; } public class RetrieveMessage { public String fileName; public String problem; - private String[] fileName_type_info = new String[]{'fileName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] problem_type_info = new String[]{'problem','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] fileName_type_info = new String[]{'fileName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] problem_type_info = new String[]{'problem','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'fileName','problem'}; } - public class EmailFolder { + public class AssignmentRules extends Metadata { + public String type = 'AssignmentRules'; + public String fullName; + public MetadataService.AssignmentRule[] assignmentRule; + private String[] assignmentRule_type_info = new String[]{'assignmentRule','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'assignmentRule'}; } - public class AssignmentRules { - public MetadataService.AssignmentRule[] assignmentRule; - private String[] assignmentRule_type_info = new String[]{'assignmentRule','http://soap.sforce.com/2006/04/metadata','AssignmentRule','0','-1','false'}; + public class EmailFolder extends Folder { + public String type = 'EmailFolder'; + public String fullName; + public String accessType; + public MetadataService.FolderShare[] folderShares; + public String name; + public String publicFolderAccess; + public MetadataService.SharedTo sharedTo; + private String[] accessType_type_info = new String[]{'accessType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] folderShares_type_info = new String[]{'folderShares','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] publicFolderAccess_type_info = new String[]{'publicFolderAccess','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName','accessType','folderShares','name','publicFolderAccess','sharedTo'}; + } + public class Territory2Rule { + public Boolean active; + public String booleanFilter; + public String name; + public String objectType; + public MetadataService.Territory2RuleItem[] ruleItems; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] objectType_type_info = new String[]{'objectType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] ruleItems_type_info = new String[]{'ruleItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'active','booleanFilter','name','objectType','ruleItems'}; + } + public class ComponentInstance { + public MetadataService.ComponentInstanceProperty[] componentInstanceProperties; + public String componentName; + private String[] componentInstanceProperties_type_info = new String[]{'componentInstanceProperties','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] componentName_type_info = new String[]{'componentName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'assignmentRule'}; + private String[] field_order_type_info = new String[]{'componentInstanceProperties','componentName'}; } public class WebToCaseSettings { public String caseOrigin; public String defaultResponseTemplate; public Boolean enableWebToCase; - private String[] caseOrigin_type_info = new String[]{'caseOrigin','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] defaultResponseTemplate_type_info = new String[]{'defaultResponseTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] enableWebToCase_type_info = new String[]{'enableWebToCase','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] caseOrigin_type_info = new String[]{'caseOrigin','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultResponseTemplate_type_info = new String[]{'defaultResponseTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableWebToCase_type_info = new String[]{'enableWebToCase','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'caseOrigin','defaultResponseTemplate','enableWebToCase'}; } public class SessionHeader_element { public String sessionId; - private String[] sessionId_type_info = new String[]{'sessionId','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] sessionId_type_info = new String[]{'sessionId','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'sessionId'}; } - public class EscalationRule { + public class EscalationRule extends Metadata { + public String type = 'EscalationRule'; + public String fullName; public Boolean active; public MetadataService.RuleEntry[] ruleEntry; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] ruleEntry_type_info = new String[]{'ruleEntry','http://soap.sforce.com/2006/04/metadata','RuleEntry','0','-1','false'}; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] ruleEntry_type_info = new String[]{'ruleEntry','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','ruleEntry'}; + } + public class SidebarComponent { + public String componentType; + public Integer height; + public String label; + public String lookup; + public String page_x; + public MetadataService.RelatedList[] relatedLists; + public String unit; + public Integer width; + private String[] componentType_type_info = new String[]{'componentType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lookup_type_info = new String[]{'lookup','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] page_x_type_info = new String[]{'page','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] relatedLists_type_info = new String[]{'relatedLists','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] unit_type_info = new String[]{'unit','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','ruleEntry'}; + private String[] field_order_type_info = new String[]{'componentType','height','label','lookup','page_x','relatedLists','unit','width'}; } public class SummaryLayout { public String masterLabel; @@ -2156,12 +2670,12 @@ public class MetadataService { public Integer sizeZ; public MetadataService.SummaryLayoutItem[] summaryLayoutItems; public String summaryLayoutStyle; - private String[] masterLabel_type_info = new String[]{'masterLabel','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] sizeX_type_info = new String[]{'sizeX','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] sizeY_type_info = new String[]{'sizeY','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] sizeZ_type_info = new String[]{'sizeZ','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] summaryLayoutItems_type_info = new String[]{'summaryLayoutItems','http://soap.sforce.com/2006/04/metadata','SummaryLayoutItem','0','-1','false'}; - private String[] summaryLayoutStyle_type_info = new String[]{'summaryLayoutStyle','http://soap.sforce.com/2006/04/metadata','SummaryLayoutStyle','1','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sizeX_type_info = new String[]{'sizeX','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sizeY_type_info = new String[]{'sizeY','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sizeZ_type_info = new String[]{'sizeZ','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] summaryLayoutItems_type_info = new String[]{'summaryLayoutItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] summaryLayoutStyle_type_info = new String[]{'summaryLayoutStyle','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'masterLabel','sizeX','sizeY','sizeZ','summaryLayoutItems','summaryLayoutStyle'}; } @@ -2169,9 +2683,9 @@ public class MetadataService { public String leftValueReference; public String operator; public MetadataService.FlowElementReferenceOrValue rightValue; - private String[] leftValueReference_type_info = new String[]{'leftValueReference','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata','FlowComparisonOperator','1','1','false'}; - private String[] rightValue_type_info = new String[]{'rightValue','http://soap.sforce.com/2006/04/metadata','FlowElementReferenceOrValue','0','1','false'}; + private String[] leftValueReference_type_info = new String[]{'leftValueReference','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] rightValue_type_info = new String[]{'rightValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'leftValueReference','operator','rightValue'}; } @@ -2183,75 +2697,125 @@ public class MetadataService { public Boolean performRetrieve; public Boolean purgeOnDelete; public Boolean rollbackOnError; - public Boolean runAllTests; public String[] runTests; public Boolean singlePackage; - private String[] allowMissingFiles_type_info = new String[]{'allowMissingFiles','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] autoUpdatePackage_type_info = new String[]{'autoUpdatePackage','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] checkOnly_type_info = new String[]{'checkOnly','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] ignoreWarnings_type_info = new String[]{'ignoreWarnings','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] performRetrieve_type_info = new String[]{'performRetrieve','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] purgeOnDelete_type_info = new String[]{'purgeOnDelete','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] rollbackOnError_type_info = new String[]{'rollbackOnError','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] runAllTests_type_info = new String[]{'runAllTests','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] runTests_type_info = new String[]{'runTests','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] singlePackage_type_info = new String[]{'singlePackage','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'allowMissingFiles','autoUpdatePackage','checkOnly','ignoreWarnings','performRetrieve','purgeOnDelete','rollbackOnError','runAllTests','runTests','singlePackage'}; + public String testLevel; + private String[] allowMissingFiles_type_info = new String[]{'allowMissingFiles','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] autoUpdatePackage_type_info = new String[]{'autoUpdatePackage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] checkOnly_type_info = new String[]{'checkOnly','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] ignoreWarnings_type_info = new String[]{'ignoreWarnings','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] performRetrieve_type_info = new String[]{'performRetrieve','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] purgeOnDelete_type_info = new String[]{'purgeOnDelete','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] rollbackOnError_type_info = new String[]{'rollbackOnError','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] runTests_type_info = new String[]{'runTests','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] singlePackage_type_info = new String[]{'singlePackage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] testLevel_type_info = new String[]{'testLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'allowMissingFiles','autoUpdatePackage','checkOnly','ignoreWarnings','performRetrieve','purgeOnDelete','rollbackOnError','runTests','singlePackage','testLevel'}; + } + public class MarketingResourceType extends Metadata { + public String type = 'MarketingResourceType'; + public String fullName; + public String description; + public String masterLabel; + public String object_x; + public String provider; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] object_x_type_info = new String[]{'object','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] provider_type_info = new String[]{'provider','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'description','masterLabel','object_x','provider'}; } public class ProfileApplicationVisibility { public String application; public Boolean default_x; public Boolean visible; - private String[] application_type_info = new String[]{'application','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] default_x_type_info = new String[]{'default','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] visible_type_info = new String[]{'visible','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] application_type_info = new String[]{'application','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] default_x_type_info = new String[]{'default','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] visible_type_info = new String[]{'visible','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'application','default_x','visible'}; } - public class UpdateMetadata { - public String currentName; - public MetadataService.Metadata metadata; - private String[] currentName_type_info = new String[]{'currentName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] metadata_type_info = new String[]{'metadata','http://soap.sforce.com/2006/04/metadata','Metadata','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'currentName','metadata'}; + public class Holiday { + public Date activityDate; + public String[] businessHours; + public String description; + public DateTime endTime; + public Boolean isRecurring; + public String name; + public Integer recurrenceDayOfMonth; + public String[] recurrenceDayOfWeek; + public Integer recurrenceDayOfWeekMask; + public Date recurrenceEndDate; + public String recurrenceInstance; + public Integer recurrenceInterval; + public String recurrenceMonthOfYear; + public Date recurrenceStartDate; + public String recurrenceType; + public DateTime startTime; + private String[] activityDate_type_info = new String[]{'activityDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] businessHours_type_info = new String[]{'businessHours','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] endTime_type_info = new String[]{'endTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isRecurring_type_info = new String[]{'isRecurring','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recurrenceDayOfMonth_type_info = new String[]{'recurrenceDayOfMonth','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recurrenceDayOfWeek_type_info = new String[]{'recurrenceDayOfWeek','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] recurrenceDayOfWeekMask_type_info = new String[]{'recurrenceDayOfWeekMask','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recurrenceEndDate_type_info = new String[]{'recurrenceEndDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recurrenceInstance_type_info = new String[]{'recurrenceInstance','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recurrenceInterval_type_info = new String[]{'recurrenceInterval','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recurrenceMonthOfYear_type_info = new String[]{'recurrenceMonthOfYear','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recurrenceStartDate_type_info = new String[]{'recurrenceStartDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recurrenceType_type_info = new String[]{'recurrenceType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] startTime_type_info = new String[]{'startTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'activityDate','businessHours','description','endTime','isRecurring','name','recurrenceDayOfMonth','recurrenceDayOfWeek','recurrenceDayOfWeekMask','recurrenceEndDate','recurrenceInstance','recurrenceInterval','recurrenceMonthOfYear','recurrenceStartDate','recurrenceType','startTime'}; } public class FlowElementReferenceOrValue { public Boolean booleanValue; + public DateTime dateTimeValue; public Date dateValue; public String elementReference; public Double numberValue; public String stringValue; - private String[] booleanValue_type_info = new String[]{'booleanValue','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] dateValue_type_info = new String[]{'dateValue','http://www.w3.org/2001/XMLSchema','date','0','1','false'}; - private String[] elementReference_type_info = new String[]{'elementReference','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] numberValue_type_info = new String[]{'numberValue','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] stringValue_type_info = new String[]{'stringValue','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] booleanValue_type_info = new String[]{'booleanValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','true'}; + private String[] dateTimeValue_type_info = new String[]{'dateTimeValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] dateValue_type_info = new String[]{'dateValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] elementReference_type_info = new String[]{'elementReference','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] numberValue_type_info = new String[]{'numberValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','true'}; + private String[] stringValue_type_info = new String[]{'stringValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'booleanValue','dateValue','elementReference','numberValue','stringValue'}; + private String[] field_order_type_info = new String[]{'booleanValue','dateTimeValue','dateValue','elementReference','numberValue','stringValue'}; } - public class EntitlementTemplate { + public class EntitlementTemplate extends Metadata { + public String type = 'EntitlementTemplate'; + public String fullName; public String businessHours; public Integer casesPerEntitlement; public String entitlementProcess; public Boolean isPerIncident; public Integer term; public String type_x; - private String[] businessHours_type_info = new String[]{'businessHours','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] casesPerEntitlement_type_info = new String[]{'casesPerEntitlement','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] entitlementProcess_type_info = new String[]{'entitlementProcess','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] isPerIncident_type_info = new String[]{'isPerIncident','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] term_type_info = new String[]{'term','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] businessHours_type_info = new String[]{'businessHours','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] casesPerEntitlement_type_info = new String[]{'casesPerEntitlement','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] entitlementProcess_type_info = new String[]{'entitlementProcess','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isPerIncident_type_info = new String[]{'isPerIncident','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] term_type_info = new String[]{'term','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'businessHours','casesPerEntitlement','entitlementProcess','isPerIncident','term','type_x'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'businessHours','casesPerEntitlement','entitlementProcess','isPerIncident','term','type_x'}; } public class ProfileTabVisibility { public String tab; public String visibility; - private String[] tab_type_info = new String[]{'tab','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] visibility_type_info = new String[]{'visibility','http://soap.sforce.com/2006/04/metadata','TabVisibility','1','1','false'}; + private String[] tab_type_info = new String[]{'tab','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] visibility_type_info = new String[]{'visibility','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'tab','visibility'}; } @@ -2261,85 +2825,133 @@ public class MetadataService { public String content; public Boolean skipRecordTypeSelect; public String type_x; - private String[] actionName_type_info = new String[]{'actionName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] comment_type_info = new String[]{'comment','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] skipRecordTypeSelect_type_info = new String[]{'skipRecordTypeSelect','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','ActionOverrideType','0','1','false'}; + private String[] actionName_type_info = new String[]{'actionName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] comment_type_info = new String[]{'comment','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] content_type_info = new String[]{'content','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] skipRecordTypeSelect_type_info = new String[]{'skipRecordTypeSelect','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'actionName','comment','content','skipRecordTypeSelect','type_x'}; } - public class WorkflowAction { + public class SaveResult { + public MetadataService.Error[] errors; + public String fullName; + public Boolean success; + private String[] errors_type_info = new String[]{'errors','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] fullName_type_info = new String[]{'fullName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] success_type_info = new String[]{'success','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'errors','fullName','success'}; + } + public class readMetadataResponse_element { + public MetadataService.ReadResult result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public virtual class WorkflowAction extends Metadata{ private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{}; } public class WorkspaceMappings { public MetadataService.WorkspaceMapping[] mapping; - private String[] mapping_type_info = new String[]{'mapping','http://soap.sforce.com/2006/04/metadata','WorkspaceMapping','0','-1','false'}; + private String[] mapping_type_info = new String[]{'mapping','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'mapping'}; } - public class ContractSettings { + public class ContractSettings extends Metadata { + public String type = 'ContractSettings'; + public String fullName; public Boolean autoCalculateEndDate; public String autoExpirationDelay; public String autoExpirationRecipient; public Boolean autoExpireContracts; public Boolean enableContractHistoryTracking; public Boolean notifyOwnersOnContractExpiration; - private String[] autoCalculateEndDate_type_info = new String[]{'autoCalculateEndDate','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] autoExpirationDelay_type_info = new String[]{'autoExpirationDelay','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] autoExpirationRecipient_type_info = new String[]{'autoExpirationRecipient','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] autoExpireContracts_type_info = new String[]{'autoExpireContracts','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableContractHistoryTracking_type_info = new String[]{'enableContractHistoryTracking','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] notifyOwnersOnContractExpiration_type_info = new String[]{'notifyOwnersOnContractExpiration','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] autoCalculateEndDate_type_info = new String[]{'autoCalculateEndDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] autoExpirationDelay_type_info = new String[]{'autoExpirationDelay','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] autoExpirationRecipient_type_info = new String[]{'autoExpirationRecipient','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] autoExpireContracts_type_info = new String[]{'autoExpireContracts','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableContractHistoryTracking_type_info = new String[]{'enableContractHistoryTracking','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] notifyOwnersOnContractExpiration_type_info = new String[]{'notifyOwnersOnContractExpiration','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'autoCalculateEndDate','autoExpirationDelay','autoExpirationRecipient','autoExpireContracts','enableContractHistoryTracking','notifyOwnersOnContractExpiration'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'autoCalculateEndDate','autoExpirationDelay','autoExpirationRecipient','autoExpireContracts','enableContractHistoryTracking','notifyOwnersOnContractExpiration'}; } - public class GlobalQuickActionTranslation { - public String label; + public class TransactionSecurityPolicy { + public MetadataService.Action action; + public Boolean active; + public String apexClass; + public String eventType; + public String resourceName; + private String[] action_type_info = new String[]{'action','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apexClass_type_info = new String[]{'apexClass','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] eventType_type_info = new String[]{'eventType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] resourceName_type_info = new String[]{'resourceName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'action','active','apexClass','eventType','resourceName'}; + } + public class GlobalQuickActionTranslation { + public String label; public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'label','name'}; } + public class ReputationLevelDefinitions { + public MetadataService.ReputationLevel[] level; + private String[] level_type_info = new String[]{'level','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'level'}; + } public class LayoutTranslation { public String layout; public String layoutType; public MetadataService.LayoutSectionTranslation[] sections; - private String[] layout_type_info = new String[]{'layout','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] layoutType_type_info = new String[]{'layoutType','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sections_type_info = new String[]{'sections','http://soap.sforce.com/2006/04/metadata','LayoutSectionTranslation','0','-1','false'}; + private String[] layout_type_info = new String[]{'layout','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] layoutType_type_info = new String[]{'layoutType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sections_type_info = new String[]{'sections','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'layout','layoutType','sections'}; } - public class ApexTrigger { + public class ApexTrigger extends MetadataWithContent { + public String type = 'ApexTrigger'; + public String fullName; + public String content; public Double apiVersion; public MetadataService.PackageVersion[] packageVersions; public String status; - private String[] apiVersion_type_info = new String[]{'apiVersion','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; - private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata','PackageVersion','0','-1','false'}; - private String[] status_type_info = new String[]{'status','http://soap.sforce.com/2006/04/metadata','ApexCodeUnitStatus','1','1','false'}; + private String[] apiVersion_type_info = new String[]{'apiVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] status_type_info = new String[]{'status','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apiVersion','packageVersions','status'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'content', 'apiVersion','packageVersions','status'}; } public class CustomApplicationTranslation { public String label; public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'label','name'}; } public class ApprovalStepApprover { public MetadataService.Approver[] approver; public String whenMultipleApprovers; - private String[] approver_type_info = new String[]{'approver','http://soap.sforce.com/2006/04/metadata','Approver','0','-1','false'}; - private String[] whenMultipleApprovers_type_info = new String[]{'whenMultipleApprovers','http://soap.sforce.com/2006/04/metadata','RoutingType','0','1','false'}; + private String[] approver_type_info = new String[]{'approver','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] whenMultipleApprovers_type_info = new String[]{'whenMultipleApprovers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'approver','whenMultipleApprovers'}; } - public class CallCenter { + public class CallCenter extends Metadata { + public String type = 'CallCenter'; + public String fullName; public String adapterUrl; public String customSettings; public String displayName; @@ -2347,31 +2959,29 @@ public class MetadataService { public String internalNameLabel; public MetadataService.CallCenterSection[] sections; public String version; - private String[] adapterUrl_type_info = new String[]{'adapterUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] customSettings_type_info = new String[]{'customSettings','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] displayName_type_info = new String[]{'displayName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] displayNameLabel_type_info = new String[]{'displayNameLabel','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] internalNameLabel_type_info = new String[]{'internalNameLabel','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] sections_type_info = new String[]{'sections','http://soap.sforce.com/2006/04/metadata','CallCenterSection','0','-1','false'}; - private String[] version_type_info = new String[]{'version','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] adapterUrl_type_info = new String[]{'adapterUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customSettings_type_info = new String[]{'customSettings','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] displayName_type_info = new String[]{'displayName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] displayNameLabel_type_info = new String[]{'displayNameLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] internalNameLabel_type_info = new String[]{'internalNameLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sections_type_info = new String[]{'sections','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] version_type_info = new String[]{'version','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'adapterUrl','customSettings','displayName','displayNameLabel','internalNameLabel','sections','version'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'adapterUrl','customSettings','displayName','displayNameLabel','internalNameLabel','sections','version'}; } - public class RemoteSiteSetting { - public String description; - public Boolean disableProtocolSecurity; - public Boolean isActive; - public String url; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] disableProtocolSecurity_type_info = new String[]{'disableProtocolSecurity','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] isActive_type_info = new String[]{'isActive','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] url_type_info = new String[]{'url','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class FlexiPageRegion { + public MetadataService.ComponentInstance[] componentInstances; + public String name; + private String[] componentInstances_type_info = new String[]{'componentInstances','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'description','disableProtocolSecurity','isActive','url'}; + private String[] field_order_type_info = new String[]{'componentInstances','name'}; } public class PicklistValue extends Metadata { - public String type = 'PicklistValue'; - public String fullName; + public String type = 'PicklistValue'; + public String fullName; public Boolean allowEmail; public Boolean closed; public String color; @@ -2386,77 +2996,121 @@ public class MetadataService { public String reverseRole; public Boolean reviewed; public Boolean won; - private String[] type_att_info = new String[]{'xsi:type'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] allowEmail_type_info = new String[]{'allowEmail','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] closed_type_info = new String[]{'closed','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] color_type_info = new String[]{'color','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] controllingFieldValues_type_info = new String[]{'controllingFieldValues','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] converted_type_info = new String[]{'converted','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] cssExposed_type_info = new String[]{'cssExposed','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] default_x_type_info = new String[]{'default','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] forecastCategory_type_info = new String[]{'forecastCategory','http://soap.sforce.com/2006/04/metadata','ForecastCategories','0','1','false'}; - private String[] highPriority_type_info = new String[]{'highPriority','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] probability_type_info = new String[]{'probability','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] reverseRole_type_info = new String[]{'reverseRole','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] reviewed_type_info = new String[]{'reviewed','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] won_type_info = new String[]{'won','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] allowEmail_type_info = new String[]{'allowEmail','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] closed_type_info = new String[]{'closed','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] color_type_info = new String[]{'color','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] controllingFieldValues_type_info = new String[]{'controllingFieldValues','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] converted_type_info = new String[]{'converted','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] cssExposed_type_info = new String[]{'cssExposed','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] default_x_type_info = new String[]{'default','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] forecastCategory_type_info = new String[]{'forecastCategory','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] highPriority_type_info = new String[]{'highPriority','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] probability_type_info = new String[]{'probability','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] reverseRole_type_info = new String[]{'reverseRole','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] reviewed_type_info = new String[]{'reviewed','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] won_type_info = new String[]{'won','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; private String[] field_order_type_info = new String[]{'fullName', 'allowEmail','closed','color','controllingFieldValues','converted','cssExposed','default_x','description','forecastCategory','highPriority','probability','reverseRole','reviewed','won'}; } + public class RemoteSiteSetting extends Metadata { + public String type = 'RemoteSiteSetting'; + public String fullName; + public String description; + public Boolean disableProtocolSecurity; + public Boolean isActive; + public String url; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] disableProtocolSecurity_type_info = new String[]{'disableProtocolSecurity','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isActive_type_info = new String[]{'isActive','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] url_type_info = new String[]{'url','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'description','disableProtocolSecurity','isActive','url'}; + } public class retrieveResponse_element { public MetadataService.AsyncResult result; - private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata','AsyncResult','1','1','false'}; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'result'}; } public class deploy_element { public String ZipFile; public MetadataService.DeployOptions DeployOptions; - private String[] ZipFile_type_info = new String[]{'ZipFile','http://www.w3.org/2001/XMLSchema','base64Binary','1','1','false'}; - private String[] DeployOptions_type_info = new String[]{'DeployOptions','http://soap.sforce.com/2006/04/metadata','DeployOptions','1','1','false'}; + private String[] ZipFile_type_info = new String[]{'ZipFile','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] DeployOptions_type_info = new String[]{'DeployOptions','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'ZipFile','DeployOptions'}; } - public class QuoteSettings { - public Boolean enableQuote; - private String[] enableQuote_type_info = new String[]{'enableQuote','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + public class XOrgHubSharedObject { + public String[] fields; + public String name; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'fields','name'}; + } + public class Territory2Type extends Metadata { + public String type = 'Territory2Type'; + public String fullName; + public String description; + public String name; + public Integer priority; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] priority_type_info = new String[]{'priority','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enableQuote'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'description','name','priority'}; } public class SharingRecalculation { public String className; - private String[] className_type_info = new String[]{'className','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] className_type_info = new String[]{'className','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'className'}; } + public class QuoteSettings extends Metadata { + public String type = 'QuoteSettings'; + public String fullName; + public Boolean enableQuote; + private String[] enableQuote_type_info = new String[]{'enableQuote','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'enableQuote'}; + } + public class WebLinkTranslation { + public String label; + public String name; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'label','name'}; + } public class ProfileLoginIpRange { + public String description; public String endAddress; public String startAddress; - private String[] endAddress_type_info = new String[]{'endAddress','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] startAddress_type_info = new String[]{'startAddress','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] endAddress_type_info = new String[]{'endAddress','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] startAddress_type_info = new String[]{'startAddress','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'endAddress','startAddress'}; + private String[] field_order_type_info = new String[]{'description','endAddress','startAddress'}; } public class ObjectRelationship { public MetadataService.ObjectRelationship join_x; public Boolean outerJoin; public String relationship; - private String[] join_x_type_info = new String[]{'join','http://soap.sforce.com/2006/04/metadata','ObjectRelationship','0','1','false'}; - private String[] outerJoin_type_info = new String[]{'outerJoin','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] relationship_type_info = new String[]{'relationship','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] join_x_type_info = new String[]{'join','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] outerJoin_type_info = new String[]{'outerJoin','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] relationship_type_info = new String[]{'relationship','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'join_x','outerJoin','relationship'}; } - public class WebLinkTranslation { - public String label; - public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'label','name'}; - } public class RuleEntry { public String assignedTo; public String assignedToType; @@ -2468,80 +3122,68 @@ public class MetadataService { public MetadataService.EscalationAction[] escalationAction; public String escalationStartTime; public String formula; + public Boolean notifyCcRecipients; public Boolean overrideExistingTeams; public String replyToEmail; public String senderEmail; public String senderName; public String[] team; public String template; - private String[] assignedTo_type_info = new String[]{'assignedTo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] assignedToType_type_info = new String[]{'assignedToType','http://soap.sforce.com/2006/04/metadata','AssignToLookupValueType','0','1','false'}; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] businessHours_type_info = new String[]{'businessHours','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] businessHoursSource_type_info = new String[]{'businessHoursSource','http://soap.sforce.com/2006/04/metadata','BusinessHoursSourceType','0','1','false'}; - private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata','FilterItem','0','-1','false'}; - private String[] disableEscalationWhenModified_type_info = new String[]{'disableEscalationWhenModified','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] escalationAction_type_info = new String[]{'escalationAction','http://soap.sforce.com/2006/04/metadata','EscalationAction','0','-1','false'}; - private String[] escalationStartTime_type_info = new String[]{'escalationStartTime','http://soap.sforce.com/2006/04/metadata','EscalationStartTimeType','0','1','false'}; - private String[] formula_type_info = new String[]{'formula','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] overrideExistingTeams_type_info = new String[]{'overrideExistingTeams','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] replyToEmail_type_info = new String[]{'replyToEmail','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] senderEmail_type_info = new String[]{'senderEmail','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] senderName_type_info = new String[]{'senderName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] team_type_info = new String[]{'team','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] template_type_info = new String[]{'template','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'assignedTo','assignedToType','booleanFilter','businessHours','businessHoursSource','criteriaItems','disableEscalationWhenModified','escalationAction','escalationStartTime','formula','overrideExistingTeams','replyToEmail','senderEmail','senderName','team','template'}; + private String[] assignedTo_type_info = new String[]{'assignedTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] assignedToType_type_info = new String[]{'assignedToType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] businessHours_type_info = new String[]{'businessHours','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] businessHoursSource_type_info = new String[]{'businessHoursSource','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] disableEscalationWhenModified_type_info = new String[]{'disableEscalationWhenModified','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] escalationAction_type_info = new String[]{'escalationAction','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] escalationStartTime_type_info = new String[]{'escalationStartTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] formula_type_info = new String[]{'formula','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] notifyCcRecipients_type_info = new String[]{'notifyCcRecipients','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] overrideExistingTeams_type_info = new String[]{'overrideExistingTeams','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] replyToEmail_type_info = new String[]{'replyToEmail','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] senderEmail_type_info = new String[]{'senderEmail','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] senderName_type_info = new String[]{'senderName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] team_type_info = new String[]{'team','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] template_type_info = new String[]{'template','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'assignedTo','assignedToType','booleanFilter','businessHours','businessHoursSource','criteriaItems','disableEscalationWhenModified','escalationAction','escalationStartTime','formula','notifyCcRecipients','overrideExistingTeams','replyToEmail','senderEmail','senderName','team','template'}; + } + public class deleteMetadata_element { + public String type_x; + public String[] fullNames; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] fullNames_type_info = new String[]{'fullNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'type_x','fullNames'}; } public class ListPlacement { public Integer height; public String location; public String units; public Integer width; - private String[] height_type_info = new String[]{'height','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] location_type_info = new String[]{'location','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] units_type_info = new String[]{'units','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] width_type_info = new String[]{'width','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] location_type_info = new String[]{'location','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] units_type_info = new String[]{'units','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'height','location','units','width'}; } - public class OwnerSharingRule { - public MetadataService.SharedTo sharedFrom; - private String[] sharedFrom_type_info = new String[]{'sharedFrom','http://soap.sforce.com/2006/04/metadata','SharedTo','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'sharedFrom'}; - } public class SiteRedirectMapping { public String action; public Boolean isActive; public String source; public String target; - private String[] action_type_info = new String[]{'action','http://soap.sforce.com/2006/04/metadata','SiteRedirect','1','1','false'}; - private String[] isActive_type_info = new String[]{'isActive','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] source_type_info = new String[]{'source','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] target_type_info = new String[]{'target','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] action_type_info = new String[]{'action','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isActive_type_info = new String[]{'isActive','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] source_type_info = new String[]{'source','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] target_type_info = new String[]{'target','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'action','isActive','source','target'}; } - public class OpportunityCriteriaBasedSharingRule { - public String booleanFilter; - public String name; - public String opportunityAccessLevel; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] opportunityAccessLevel_type_info = new String[]{'opportunityAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelReadEdit','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'booleanFilter','name','opportunityAccessLevel'}; - } - public class LetterheadLine { - public String color; - public Integer height; - private String[] color_type_info = new String[]{'color','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] height_type_info = new String[]{'height','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'color','height'}; - } - public class WorkflowFieldUpdate { + public class WorkflowFieldUpdate extends WorkflowAction { + public String type = 'WorkflowFieldUpdate'; + public String fullName; public String description; public String field; public String formula; @@ -2554,46 +3196,78 @@ public class MetadataService { public Boolean protected_x; public Boolean reevaluateOnChange; public String targetObject; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] formula_type_info = new String[]{'formula','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] literalValue_type_info = new String[]{'literalValue','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] lookupValue_type_info = new String[]{'lookupValue','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] lookupValueType_type_info = new String[]{'lookupValueType','http://soap.sforce.com/2006/04/metadata','LookupValueType','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] notifyAssignee_type_info = new String[]{'notifyAssignee','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] operation_type_info = new String[]{'operation','http://soap.sforce.com/2006/04/metadata','FieldUpdateOperation','1','1','false'}; - private String[] protected_x_type_info = new String[]{'protected','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] reevaluateOnChange_type_info = new String[]{'reevaluateOnChange','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] targetObject_type_info = new String[]{'targetObject','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'description','field','formula','literalValue','lookupValue','lookupValueType','name','notifyAssignee','operation','protected_x','reevaluateOnChange','targetObject'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] formula_type_info = new String[]{'formula','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] literalValue_type_info = new String[]{'literalValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lookupValue_type_info = new String[]{'lookupValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lookupValueType_type_info = new String[]{'lookupValueType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] notifyAssignee_type_info = new String[]{'notifyAssignee','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] operation_type_info = new String[]{'operation','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] reevaluateOnChange_type_info = new String[]{'reevaluateOnChange','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] targetObject_type_info = new String[]{'targetObject','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'description','field','formula','literalValue','lookupValue','lookupValueType','name','notifyAssignee','operation','protected_x','reevaluateOnChange','targetObject'}; + } + public class LetterheadLine { + public String color; + public Integer height; + private String[] color_type_info = new String[]{'color','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'color','height'}; } public class FlowChoiceUserInput { public Boolean isRequired; public String promptText; public MetadataService.FlowInputValidationRule validationRule; - private String[] isRequired_type_info = new String[]{'isRequired','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] promptText_type_info = new String[]{'promptText','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] validationRule_type_info = new String[]{'validationRule','http://soap.sforce.com/2006/04/metadata','FlowInputValidationRule','0','1','false'}; + private String[] isRequired_type_info = new String[]{'isRequired','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] promptText_type_info = new String[]{'promptText','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] validationRule_type_info = new String[]{'validationRule','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'isRequired','promptText','validationRule'}; } - public class CriteriaBasedSharingRule { - public MetadataService.FilterItem[] criteriaItems; - private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata','FilterItem','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'criteriaItems'}; + public class ConnectedAppMobileDetailConfig { + public String applicationBinaryFile; + public String applicationBinaryFileName; + public String applicationBundleIdentifier; + public Integer applicationFileLength; + public String applicationIconFile; + public String applicationIconFileName; + public String applicationInstallUrl; + public String devicePlatform; + public String deviceType; + public String minimumOsVersion; + public Boolean privateApp; + public String version; + private String[] applicationBinaryFile_type_info = new String[]{'applicationBinaryFile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] applicationBinaryFileName_type_info = new String[]{'applicationBinaryFileName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] applicationBundleIdentifier_type_info = new String[]{'applicationBundleIdentifier','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] applicationFileLength_type_info = new String[]{'applicationFileLength','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] applicationIconFile_type_info = new String[]{'applicationIconFile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] applicationIconFileName_type_info = new String[]{'applicationIconFileName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] applicationInstallUrl_type_info = new String[]{'applicationInstallUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] devicePlatform_type_info = new String[]{'devicePlatform','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] deviceType_type_info = new String[]{'deviceType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] minimumOsVersion_type_info = new String[]{'minimumOsVersion','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] privateApp_type_info = new String[]{'privateApp','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] version_type_info = new String[]{'version','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'applicationBinaryFile','applicationBinaryFileName','applicationBundleIdentifier','applicationFileLength','applicationIconFile','applicationIconFileName','applicationInstallUrl','devicePlatform','deviceType','minimumOsVersion','privateApp','version'}; } public class ProfileRecordTypeVisibility { public Boolean default_x; public Boolean personAccountDefault; public String recordType; public Boolean visible; - private String[] default_x_type_info = new String[]{'default','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] personAccountDefault_type_info = new String[]{'personAccountDefault','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] recordType_type_info = new String[]{'recordType','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] visible_type_info = new String[]{'visible','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] default_x_type_info = new String[]{'default','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] personAccountDefault_type_info = new String[]{'personAccountDefault','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recordType_type_info = new String[]{'recordType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] visible_type_info = new String[]{'visible','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'default_x','personAccountDefault','recordType','visible'}; } @@ -2601,47 +3275,61 @@ public class MetadataService { public Integer majorNumber; public Integer minorNumber; public String namespace; - private String[] majorNumber_type_info = new String[]{'majorNumber','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] minorNumber_type_info = new String[]{'minorNumber','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] namespace_type_info = new String[]{'namespace','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] majorNumber_type_info = new String[]{'majorNumber','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] minorNumber_type_info = new String[]{'minorNumber','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] namespace_type_info = new String[]{'namespace','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'majorNumber','minorNumber','namespace'}; } + public class PermissionSetCustomPermissions { + public Boolean enabled; + public String name; + private String[] enabled_type_info = new String[]{'enabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'enabled','name'}; + } public class CustomLabelTranslation { public String label; public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'label','name'}; } - public class LeadOwnerSharingRule { - public String leadAccessLevel; - public String name; - private String[] leadAccessLevel_type_info = new String[]{'leadAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelReadEdit','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class CorsWhitelistOrigin extends Metadata { + public String type = 'CorsWhitelistOrigin'; + public String fullName; + public String urlPattern; + private String[] urlPattern_type_info = new String[]{'urlPattern','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'leadAccessLevel','name'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'urlPattern'}; } public class StaticResource extends MetadataWithContent { - public String type = 'StaticResource'; - public String fullName; - public String content; + public String type = 'StaticResource'; + public String fullName; + public String content; public String cacheControl; public String contentType; public String description; + private String[] cacheControl_type_info = new String[]{'cacheControl','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] contentType_type_info = new String[]{'contentType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] type_att_info = new String[]{'xsi:type'}; private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; - private String[] cacheControl_type_info = new String[]{'cacheControl','http://soap.sforce.com/2006/04/metadata','StaticResourceCacheControl','1','1','false'}; - private String[] contentType_type_info = new String[]{'contentType','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; private String[] field_order_type_info = new String[]{'fullName', 'content', 'cacheControl','contentType','description'}; } - public class LiveChatButton { + public class LiveChatButton extends Metadata { + public String type = 'LiveChatButton'; + public String fullName; public String animation; + public String autoGreeting; public String chatPage; + public String customAgentName; public MetadataService.LiveChatButtonDeployments deployments; public Boolean enableQueue; public String inviteEndPosition; @@ -2649,10 +3337,14 @@ public class MetadataService { public String inviteStartPosition; public Boolean isActive; public String label; + public Integer numberOfReroutingAttempts; public String offlineImage; public String onlineImage; + public Boolean optionsCustomRoutingIsEnabled; public Boolean optionsHasInviteAfterAccept; public Boolean optionsHasInviteAfterReject; + public Boolean optionsHasRerouteDeclinedRequest; + public Boolean optionsIsAutoAccept; public Boolean optionsIsInviteAutoRemove; public Integer overallQueueLength; public Integer perAgentQueueLength; @@ -2667,47 +3359,87 @@ public class MetadataService { public Integer timeToRemoveInvite; public String type_x; public String windowLanguage; - private String[] animation_type_info = new String[]{'animation','http://soap.sforce.com/2006/04/metadata','LiveChatButtonPresentation','0','1','false'}; - private String[] chatPage_type_info = new String[]{'chatPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] deployments_type_info = new String[]{'deployments','http://soap.sforce.com/2006/04/metadata','LiveChatButtonDeployments','0','1','false'}; - private String[] enableQueue_type_info = new String[]{'enableQueue','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] inviteEndPosition_type_info = new String[]{'inviteEndPosition','http://soap.sforce.com/2006/04/metadata','LiveChatButtonInviteEndPosition','0','1','false'}; - private String[] inviteImage_type_info = new String[]{'inviteImage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] inviteStartPosition_type_info = new String[]{'inviteStartPosition','http://soap.sforce.com/2006/04/metadata','LiveChatButtonInviteStartPosition','0','1','false'}; - private String[] isActive_type_info = new String[]{'isActive','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] offlineImage_type_info = new String[]{'offlineImage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] onlineImage_type_info = new String[]{'onlineImage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] optionsHasInviteAfterAccept_type_info = new String[]{'optionsHasInviteAfterAccept','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] optionsHasInviteAfterReject_type_info = new String[]{'optionsHasInviteAfterReject','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] optionsIsInviteAutoRemove_type_info = new String[]{'optionsIsInviteAutoRemove','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] overallQueueLength_type_info = new String[]{'overallQueueLength','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] perAgentQueueLength_type_info = new String[]{'perAgentQueueLength','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] postChatPage_type_info = new String[]{'postChatPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] postChatUrl_type_info = new String[]{'postChatUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] preChatFormPage_type_info = new String[]{'preChatFormPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] preChatFormUrl_type_info = new String[]{'preChatFormUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] pushTimeOut_type_info = new String[]{'pushTimeOut','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] routingType_type_info = new String[]{'routingType','http://soap.sforce.com/2006/04/metadata','LiveChatButtonRoutingType','1','1','false'}; - private String[] site_type_info = new String[]{'site','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] skills_type_info = new String[]{'skills','http://soap.sforce.com/2006/04/metadata','LiveChatButtonSkills','0','1','false'}; - private String[] timeToRemoveInvite_type_info = new String[]{'timeToRemoveInvite','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','LiveChatButtonType','1','1','false'}; - private String[] windowLanguage_type_info = new String[]{'windowLanguage','http://soap.sforce.com/2006/04/metadata','Language','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'animation','chatPage','deployments','enableQueue','inviteEndPosition','inviteImage','inviteStartPosition','isActive','label','offlineImage','onlineImage','optionsHasInviteAfterAccept','optionsHasInviteAfterReject','optionsIsInviteAutoRemove','overallQueueLength','perAgentQueueLength','postChatPage','postChatUrl','preChatFormPage','preChatFormUrl','pushTimeOut','routingType','site','skills','timeToRemoveInvite','type_x','windowLanguage'}; - } - public class Network { + private String[] animation_type_info = new String[]{'animation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] autoGreeting_type_info = new String[]{'autoGreeting','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chatPage_type_info = new String[]{'chatPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customAgentName_type_info = new String[]{'customAgentName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] deployments_type_info = new String[]{'deployments','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableQueue_type_info = new String[]{'enableQueue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] inviteEndPosition_type_info = new String[]{'inviteEndPosition','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] inviteImage_type_info = new String[]{'inviteImage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] inviteStartPosition_type_info = new String[]{'inviteStartPosition','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isActive_type_info = new String[]{'isActive','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] numberOfReroutingAttempts_type_info = new String[]{'numberOfReroutingAttempts','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] offlineImage_type_info = new String[]{'offlineImage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] onlineImage_type_info = new String[]{'onlineImage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] optionsCustomRoutingIsEnabled_type_info = new String[]{'optionsCustomRoutingIsEnabled','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] optionsHasInviteAfterAccept_type_info = new String[]{'optionsHasInviteAfterAccept','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] optionsHasInviteAfterReject_type_info = new String[]{'optionsHasInviteAfterReject','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] optionsHasRerouteDeclinedRequest_type_info = new String[]{'optionsHasRerouteDeclinedRequest','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] optionsIsAutoAccept_type_info = new String[]{'optionsIsAutoAccept','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] optionsIsInviteAutoRemove_type_info = new String[]{'optionsIsInviteAutoRemove','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] overallQueueLength_type_info = new String[]{'overallQueueLength','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] perAgentQueueLength_type_info = new String[]{'perAgentQueueLength','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] postChatPage_type_info = new String[]{'postChatPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] postChatUrl_type_info = new String[]{'postChatUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] preChatFormPage_type_info = new String[]{'preChatFormPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] preChatFormUrl_type_info = new String[]{'preChatFormUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] pushTimeOut_type_info = new String[]{'pushTimeOut','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] routingType_type_info = new String[]{'routingType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] site_type_info = new String[]{'site','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] skills_type_info = new String[]{'skills','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] timeToRemoveInvite_type_info = new String[]{'timeToRemoveInvite','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] windowLanguage_type_info = new String[]{'windowLanguage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'animation','autoGreeting','chatPage','customAgentName','deployments','enableQueue','inviteEndPosition','inviteImage','inviteStartPosition','isActive','label','numberOfReroutingAttempts','offlineImage','onlineImage','optionsCustomRoutingIsEnabled','optionsHasInviteAfterAccept','optionsHasInviteAfterReject','optionsHasRerouteDeclinedRequest','optionsIsAutoAccept','optionsIsInviteAutoRemove','overallQueueLength','perAgentQueueLength','postChatPage','postChatUrl','preChatFormPage','preChatFormUrl','pushTimeOut','routingType','site','skills','timeToRemoveInvite','type_x','windowLanguage'}; + } + public class RunTestsResult { + public MetadataService.CodeCoverageResult[] codeCoverage; + public MetadataService.CodeCoverageWarning[] codeCoverageWarnings; + public MetadataService.RunTestFailure[] failures; + public Integer numFailures; + public Integer numTestsRun; + public MetadataService.RunTestSuccess[] successes; + public Double totalTime; + private String[] codeCoverage_type_info = new String[]{'codeCoverage','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] codeCoverageWarnings_type_info = new String[]{'codeCoverageWarnings','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] failures_type_info = new String[]{'failures','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] numFailures_type_info = new String[]{'numFailures','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] numTestsRun_type_info = new String[]{'numTestsRun','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] successes_type_info = new String[]{'successes','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] totalTime_type_info = new String[]{'totalTime','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'codeCoverage','codeCoverageWarnings','failures','numFailures','numTestsRun','successes','totalTime'}; + } + public class Network extends Metadata { + public String type = 'Network'; + public String fullName; + public Boolean allowMembersToFlag; public MetadataService.Branding branding; public String caseCommentEmailTemplate; public String changePasswordTemplate; public String description; public String emailSenderAddress; public String emailSenderName; + public Boolean enableGuestChatter; public Boolean enableInvitation; + public Boolean enableKnowledgeable; + public Boolean enableNicknameDisplay; + public Boolean enablePrivateMessages; + public Boolean enableReputation; + public String feedChannel; public String forgotPasswordTemplate; + public String logoutUrl; public MetadataService.NetworkMemberGroup networkMemberGroups; public String newSenderAddress; + public String picassoSite; + public MetadataService.ReputationLevelDefinitions reputationLevels; + public MetadataService.ReputationPointsRules reputationPointsRules; + public String selfRegProfile; public Boolean selfRegistration; public Boolean sendWelcomeEmail; public String site; @@ -2715,80 +3447,110 @@ public class MetadataService { public MetadataService.NetworkTabSet tabs; public String urlPathPrefix; public String welcomeTemplate; - private String[] branding_type_info = new String[]{'branding','http://soap.sforce.com/2006/04/metadata','Branding','0','1','false'}; - private String[] caseCommentEmailTemplate_type_info = new String[]{'caseCommentEmailTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] changePasswordTemplate_type_info = new String[]{'changePasswordTemplate','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] emailSenderAddress_type_info = new String[]{'emailSenderAddress','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] emailSenderName_type_info = new String[]{'emailSenderName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] enableInvitation_type_info = new String[]{'enableInvitation','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] forgotPasswordTemplate_type_info = new String[]{'forgotPasswordTemplate','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] networkMemberGroups_type_info = new String[]{'networkMemberGroups','http://soap.sforce.com/2006/04/metadata','NetworkMemberGroup','0','1','false'}; - private String[] newSenderAddress_type_info = new String[]{'newSenderAddress','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] selfRegistration_type_info = new String[]{'selfRegistration','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] sendWelcomeEmail_type_info = new String[]{'sendWelcomeEmail','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] site_type_info = new String[]{'site','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] status_type_info = new String[]{'status','http://soap.sforce.com/2006/04/metadata','NetworkStatus','1','1','false'}; - private String[] tabs_type_info = new String[]{'tabs','http://soap.sforce.com/2006/04/metadata','NetworkTabSet','1','1','false'}; - private String[] urlPathPrefix_type_info = new String[]{'urlPathPrefix','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] welcomeTemplate_type_info = new String[]{'welcomeTemplate','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'branding','caseCommentEmailTemplate','changePasswordTemplate','description','emailSenderAddress','emailSenderName','enableInvitation','forgotPasswordTemplate','networkMemberGroups','newSenderAddress','selfRegistration','sendWelcomeEmail','site','status','tabs','urlPathPrefix','welcomeTemplate'}; - } - public class RunTestsResult { - public MetadataService.CodeCoverageResult[] codeCoverage; - public MetadataService.CodeCoverageWarning[] codeCoverageWarnings; - public MetadataService.RunTestFailure[] failures; - public Integer numFailures; - public Integer numTestsRun; - public MetadataService.RunTestSuccess[] successes; - public Double totalTime; - private String[] codeCoverage_type_info = new String[]{'codeCoverage','http://soap.sforce.com/2006/04/metadata','CodeCoverageResult','0','-1','false'}; - private String[] codeCoverageWarnings_type_info = new String[]{'codeCoverageWarnings','http://soap.sforce.com/2006/04/metadata','CodeCoverageWarning','0','-1','false'}; - private String[] failures_type_info = new String[]{'failures','http://soap.sforce.com/2006/04/metadata','RunTestFailure','0','-1','false'}; - private String[] numFailures_type_info = new String[]{'numFailures','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] numTestsRun_type_info = new String[]{'numTestsRun','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] successes_type_info = new String[]{'successes','http://soap.sforce.com/2006/04/metadata','RunTestSuccess','0','-1','false'}; - private String[] totalTime_type_info = new String[]{'totalTime','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; + private String[] allowMembersToFlag_type_info = new String[]{'allowMembersToFlag','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] branding_type_info = new String[]{'branding','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] caseCommentEmailTemplate_type_info = new String[]{'caseCommentEmailTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] changePasswordTemplate_type_info = new String[]{'changePasswordTemplate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailSenderAddress_type_info = new String[]{'emailSenderAddress','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] emailSenderName_type_info = new String[]{'emailSenderName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enableGuestChatter_type_info = new String[]{'enableGuestChatter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableInvitation_type_info = new String[]{'enableInvitation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableKnowledgeable_type_info = new String[]{'enableKnowledgeable','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableNicknameDisplay_type_info = new String[]{'enableNicknameDisplay','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enablePrivateMessages_type_info = new String[]{'enablePrivateMessages','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableReputation_type_info = new String[]{'enableReputation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] feedChannel_type_info = new String[]{'feedChannel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] forgotPasswordTemplate_type_info = new String[]{'forgotPasswordTemplate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] logoutUrl_type_info = new String[]{'logoutUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] networkMemberGroups_type_info = new String[]{'networkMemberGroups','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] newSenderAddress_type_info = new String[]{'newSenderAddress','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] picassoSite_type_info = new String[]{'picassoSite','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] reputationLevels_type_info = new String[]{'reputationLevels','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] reputationPointsRules_type_info = new String[]{'reputationPointsRules','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] selfRegProfile_type_info = new String[]{'selfRegProfile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] selfRegistration_type_info = new String[]{'selfRegistration','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sendWelcomeEmail_type_info = new String[]{'sendWelcomeEmail','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] site_type_info = new String[]{'site','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] status_type_info = new String[]{'status','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] tabs_type_info = new String[]{'tabs','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] urlPathPrefix_type_info = new String[]{'urlPathPrefix','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] welcomeTemplate_type_info = new String[]{'welcomeTemplate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'codeCoverage','codeCoverageWarnings','failures','numFailures','numTestsRun','successes','totalTime'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'allowMembersToFlag','branding','caseCommentEmailTemplate','changePasswordTemplate','description','emailSenderAddress','emailSenderName','enableGuestChatter','enableInvitation','enableKnowledgeable','enableNicknameDisplay','enablePrivateMessages','enableReputation','feedChannel','forgotPasswordTemplate','logoutUrl','networkMemberGroups','newSenderAddress','picassoSite','reputationLevels','reputationPointsRules','selfRegProfile','selfRegistration','sendWelcomeEmail','site','status','tabs','urlPathPrefix','welcomeTemplate'}; } public class PermissionSetUserPermission { public Boolean enabled; public String name; - private String[] enabled_type_info = new String[]{'enabled','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] enabled_type_info = new String[]{'enabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'enabled','name'}; } public class FlowVariable { public String dataType; + public Boolean isCollection; public Boolean isInput; public Boolean isOutput; + public String objectType; public Integer scale; public MetadataService.FlowElementReferenceOrValue value; - private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata','FlowDataType','1','1','false'}; - private String[] isInput_type_info = new String[]{'isInput','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] isOutput_type_info = new String[]{'isOutput','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] scale_type_info = new String[]{'scale','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata','FlowElementReferenceOrValue','0','1','false'}; + private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isCollection_type_info = new String[]{'isCollection','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isInput_type_info = new String[]{'isInput','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isOutput_type_info = new String[]{'isOutput','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] objectType_type_info = new String[]{'objectType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scale_type_info = new String[]{'scale','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'dataType','isCollection','isInput','isOutput','objectType','scale','value'}; + } + public class AccountSettings extends Metadata { + public String type = 'AccountSettings'; + public String fullName; + public Boolean enableAccountOwnerReport; + public Boolean enableAccountTeams; + public Boolean enableSharedContacts; + public Boolean showViewHierarchyLink; + private String[] enableAccountOwnerReport_type_info = new String[]{'enableAccountOwnerReport','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableAccountTeams_type_info = new String[]{'enableAccountTeams','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableSharedContacts_type_info = new String[]{'enableSharedContacts','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showViewHierarchyLink_type_info = new String[]{'showViewHierarchyLink','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'enableAccountOwnerReport','enableAccountTeams','enableSharedContacts','showViewHierarchyLink'}; + } + public class PathAssistantSettings { + public Boolean pathAssistantForOpportunityEnabled; + private String[] pathAssistantForOpportunityEnabled_type_info = new String[]{'pathAssistantForOpportunityEnabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'dataType','isInput','isOutput','scale','value'}; + private String[] field_order_type_info = new String[]{'pathAssistantForOpportunityEnabled'}; } public class ChatterAnswersReputationLevel { public String name; public Integer value; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'name','value'}; } public class LiveChatDeploymentDomainWhitelist { public String[] domain; - private String[] domain_type_info = new String[]{'domain','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + private String[] domain_type_info = new String[]{'domain','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'domain'}; } + public class DashboardFilter { + public MetadataService.DashboardFilterOption[] dashboardFilterOptions; + public String name; + private String[] dashboardFilterOptions_type_info = new String[]{'dashboardFilterOptions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'dashboardFilterOptions','name'}; + } public class ProfileLoginHours { public String fridayEnd; public String fridayStart; @@ -2804,68 +3566,94 @@ public class MetadataService { public String tuesdayStart; public String wednesdayEnd; public String wednesdayStart; - private String[] fridayEnd_type_info = new String[]{'fridayEnd','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] fridayStart_type_info = new String[]{'fridayStart','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] mondayEnd_type_info = new String[]{'mondayEnd','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] mondayStart_type_info = new String[]{'mondayStart','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] saturdayEnd_type_info = new String[]{'saturdayEnd','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] saturdayStart_type_info = new String[]{'saturdayStart','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sundayEnd_type_info = new String[]{'sundayEnd','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sundayStart_type_info = new String[]{'sundayStart','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] thursdayEnd_type_info = new String[]{'thursdayEnd','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] thursdayStart_type_info = new String[]{'thursdayStart','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] tuesdayEnd_type_info = new String[]{'tuesdayEnd','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] tuesdayStart_type_info = new String[]{'tuesdayStart','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] wednesdayEnd_type_info = new String[]{'wednesdayEnd','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] wednesdayStart_type_info = new String[]{'wednesdayStart','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] fridayEnd_type_info = new String[]{'fridayEnd','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fridayStart_type_info = new String[]{'fridayStart','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] mondayEnd_type_info = new String[]{'mondayEnd','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] mondayStart_type_info = new String[]{'mondayStart','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] saturdayEnd_type_info = new String[]{'saturdayEnd','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] saturdayStart_type_info = new String[]{'saturdayStart','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sundayEnd_type_info = new String[]{'sundayEnd','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sundayStart_type_info = new String[]{'sundayStart','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] thursdayEnd_type_info = new String[]{'thursdayEnd','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] thursdayStart_type_info = new String[]{'thursdayStart','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] tuesdayEnd_type_info = new String[]{'tuesdayEnd','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] tuesdayStart_type_info = new String[]{'tuesdayStart','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] wednesdayEnd_type_info = new String[]{'wednesdayEnd','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] wednesdayStart_type_info = new String[]{'wednesdayStart','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'fridayEnd','fridayStart','mondayEnd','mondayStart','saturdayEnd','saturdayStart','sundayEnd','sundayStart','thursdayEnd','thursdayStart','tuesdayEnd','tuesdayStart','wednesdayEnd','wednesdayStart'}; } - public class DashboardFilter { - public MetadataService.DashboardFilterOption[] dashboardFilterOptions; - public String name; - private String[] dashboardFilterOptions_type_info = new String[]{'dashboardFilterOptions','http://soap.sforce.com/2006/04/metadata','DashboardFilterOption','0','-1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'dashboardFilterOptions','name'}; - } public class CodeLocation { public Integer column; public Integer line; public Integer numExecutions; public Double time_x; - private String[] column_type_info = new String[]{'column','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] line_type_info = new String[]{'line','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] numExecutions_type_info = new String[]{'numExecutions','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] time_x_type_info = new String[]{'time','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; + private String[] column_type_info = new String[]{'column','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] line_type_info = new String[]{'line','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] numExecutions_type_info = new String[]{'numExecutions','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] time_x_type_info = new String[]{'time','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'column','line','numExecutions','time_x'}; } + public class PermissionSetRecordTypeVisibility { + public String recordType; + public Boolean visible; + private String[] recordType_type_info = new String[]{'recordType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] visible_type_info = new String[]{'visible','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'recordType','visible'}; + } public class FieldSetItem { public String field; public Boolean isFieldManaged; public Boolean isRequired; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] isFieldManaged_type_info = new String[]{'isFieldManaged','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] isRequired_type_info = new String[]{'isRequired','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isFieldManaged_type_info = new String[]{'isFieldManaged','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isRequired_type_info = new String[]{'isRequired','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'field','isFieldManaged','isRequired'}; } public class KnowledgeLanguageSettings { public MetadataService.KnowledgeLanguage[] language; - private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata','KnowledgeLanguage','0','-1','false'}; + private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'language'}; } + public class OrderSettings extends Metadata { + public String type = 'OrderSettings'; + public String fullName; + public Boolean enableNegativeQuantity; + public Boolean enableOrders; + public Boolean enableReductionOrders; + private String[] enableNegativeQuantity_type_info = new String[]{'enableNegativeQuantity','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableOrders_type_info = new String[]{'enableOrders','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableReductionOrders_type_info = new String[]{'enableReductionOrders','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'enableNegativeQuantity','enableOrders','enableReductionOrders'}; + } + public class ProfileUserPermission { + public Boolean enabled; + public String name; + private String[] enabled_type_info = new String[]{'enabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'enabled','name'}; + } public class ReportFilterItem { public String column; + public Boolean columnToColumn; public String operator; + public String snapshot; public String value; - private String[] column_type_info = new String[]{'column','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata','FilterOperation','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] column_type_info = new String[]{'column','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] columnToColumn_type_info = new String[]{'columnToColumn','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] snapshot_type_info = new String[]{'snapshot','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'column','operator','value'}; + private String[] field_order_type_info = new String[]{'column','columnToColumn','operator','snapshot','value'}; } public class FlowDynamicChoiceSet { public String dataType; @@ -2877,22 +3665,43 @@ public class MetadataService { public String sortField; public String sortOrder; public String valueField; - private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata','FlowDataType','1','1','false'}; - private String[] displayField_type_info = new String[]{'displayField','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] filters_type_info = new String[]{'filters','http://soap.sforce.com/2006/04/metadata','FlowRecordFilter','0','-1','false'}; - private String[] limit_x_type_info = new String[]{'limit','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] object_x_type_info = new String[]{'object','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] outputAssignments_type_info = new String[]{'outputAssignments','http://soap.sforce.com/2006/04/metadata','FlowOutputFieldAssignment','0','-1','false'}; - private String[] sortField_type_info = new String[]{'sortField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata','SortOrder','0','1','false'}; - private String[] valueField_type_info = new String[]{'valueField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] displayField_type_info = new String[]{'displayField','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] filters_type_info = new String[]{'filters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] limit_x_type_info = new String[]{'limit','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] object_x_type_info = new String[]{'object','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] outputAssignments_type_info = new String[]{'outputAssignments','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] sortField_type_info = new String[]{'sortField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] valueField_type_info = new String[]{'valueField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'dataType','displayField','filters','limit_x','object_x','outputAssignments','sortField','sortOrder','valueField'}; } - public class KnowledgeSettings { + public virtual class SharingBaseRule extends Metadata { + public String type = 'SharingBaseRule'; + public String fullName; + public String accessLevel; + public MetadataService.AccountSharingRuleSettings accountSettings; + public String description; + public String label; + public MetadataService.SharedTo sharedTo; + private String[] accessLevel_type_info = new String[]{'accessLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] accountSettings_type_info = new String[]{'accountSettings','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'accessLevel','accountSettings','description','label','sharedTo'}; + } + public class KnowledgeSettings extends Metadata { + public String type = 'KnowledgeSettings'; + public String fullName; public MetadataService.KnowledgeAnswerSettings answers; public MetadataService.KnowledgeCaseSettings cases; public String defaultLanguage; + public Boolean enableChatterQuestionKBDeflection; public Boolean enableCreateEditOnArticlesTab; public Boolean enableExternalMediaContent; public Boolean enableKnowledge; @@ -2901,36 +3710,83 @@ public class MetadataService { public Boolean showArticleSummariesInternalApp; public Boolean showArticleSummariesPartnerPortal; public Boolean showValidationStatusField; - private String[] answers_type_info = new String[]{'answers','http://soap.sforce.com/2006/04/metadata','KnowledgeAnswerSettings','0','1','false'}; - private String[] cases_type_info = new String[]{'cases','http://soap.sforce.com/2006/04/metadata','KnowledgeCaseSettings','0','1','false'}; - private String[] defaultLanguage_type_info = new String[]{'defaultLanguage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] enableCreateEditOnArticlesTab_type_info = new String[]{'enableCreateEditOnArticlesTab','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableExternalMediaContent_type_info = new String[]{'enableExternalMediaContent','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableKnowledge_type_info = new String[]{'enableKnowledge','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] languages_type_info = new String[]{'languages','http://soap.sforce.com/2006/04/metadata','KnowledgeLanguageSettings','0','1','false'}; - private String[] showArticleSummariesCustomerPortal_type_info = new String[]{'showArticleSummariesCustomerPortal','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showArticleSummariesInternalApp_type_info = new String[]{'showArticleSummariesInternalApp','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showArticleSummariesPartnerPortal_type_info = new String[]{'showArticleSummariesPartnerPortal','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showValidationStatusField_type_info = new String[]{'showValidationStatusField','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'answers','cases','defaultLanguage','enableCreateEditOnArticlesTab','enableExternalMediaContent','enableKnowledge','languages','showArticleSummariesCustomerPortal','showArticleSummariesInternalApp','showArticleSummariesPartnerPortal','showValidationStatusField'}; + private String[] answers_type_info = new String[]{'answers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] cases_type_info = new String[]{'cases','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultLanguage_type_info = new String[]{'defaultLanguage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableChatterQuestionKBDeflection_type_info = new String[]{'enableChatterQuestionKBDeflection','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableCreateEditOnArticlesTab_type_info = new String[]{'enableCreateEditOnArticlesTab','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableExternalMediaContent_type_info = new String[]{'enableExternalMediaContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableKnowledge_type_info = new String[]{'enableKnowledge','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] languages_type_info = new String[]{'languages','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showArticleSummariesCustomerPortal_type_info = new String[]{'showArticleSummariesCustomerPortal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showArticleSummariesInternalApp_type_info = new String[]{'showArticleSummariesInternalApp','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showArticleSummariesPartnerPortal_type_info = new String[]{'showArticleSummariesPartnerPortal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showValidationStatusField_type_info = new String[]{'showValidationStatusField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'answers','cases','defaultLanguage','enableChatterQuestionKBDeflection','enableCreateEditOnArticlesTab','enableExternalMediaContent','enableKnowledge','languages','showArticleSummariesCustomerPortal','showArticleSummariesInternalApp','showArticleSummariesPartnerPortal','showValidationStatusField'}; + } + public class StandardFieldTranslation { + public String label; + public String name; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'label','name'}; + } + public class MatchingRules extends Metadata { + public String type = 'MatchingRules'; + public String fullName; + public MetadataService.MatchingRule[] matchingRules; + private String[] matchingRules_type_info = new String[]{'matchingRules','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'matchingRules'}; + } + public class upsertMetadata_element { + public MetadataService.Metadata[] metadata; + private String[] metadata_type_info = new String[]{'metadata','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'metadata'}; } public class ApexClass extends MetadataWithContent { - public String type = 'ApexClass'; - public String fullName; - public String content; + public String type = 'ApexClass'; + public String fullName; + public String content; public Double apiVersion; public MetadataService.PackageVersion[] packageVersions; public String status; - private String[] type_att_info = new String[]{'xsi:type'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apiVersion_type_info = new String[]{'apiVersion','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; - private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; - private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata','PackageVersion','0','-1','false'}; - private String[] status_type_info = new String[]{'status','http://soap.sforce.com/2006/04/metadata','ApexCodeUnitStatus','1','1','false'}; + private String[] apiVersion_type_info = new String[]{'apiVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] status_type_info = new String[]{'status','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; private String[] field_order_type_info = new String[]{'fullName', 'content', 'apiVersion','packageVersions','status'}; } + public class PathAssistant extends Metadata { + public String type = 'PathAssistant'; + public String fullName; + public Boolean active; + public String entityName; + public String fieldName; + public String masterLabel; + public MetadataService.PathAssistantStep[] pathAssistantSteps; + public String recordTypeName; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] entityName_type_info = new String[]{'entityName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] fieldName_type_info = new String[]{'fieldName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] pathAssistantSteps_type_info = new String[]{'pathAssistantSteps','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] recordTypeName_type_info = new String[]{'recordTypeName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','entityName','fieldName','masterLabel','pathAssistantSteps','recordTypeName'}; + } public class SessionSettings { public Boolean disableTimeoutWarning; public Boolean enableCSRFOnGet; @@ -2938,96 +3794,164 @@ public class MetadataService { public Boolean enableCacheAndAutocomplete; public Boolean enableClickjackNonsetupSFDC; public Boolean enableClickjackNonsetupUser; + public Boolean enableClickjackNonsetupUserHeaderless; public Boolean enableClickjackSetup; + public Boolean enablePostForSessions; public Boolean enableSMSIdentity; + public Boolean enforceIpRangesEveryRequest; + public Boolean forceLogoutOnSessionTimeout; public Boolean forceRelogin; + public Boolean lockSessionsToDomain; public Boolean lockSessionsToIp; + public String logoutURL; public String sessionTimeout; - private String[] disableTimeoutWarning_type_info = new String[]{'disableTimeoutWarning','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableCSRFOnGet_type_info = new String[]{'enableCSRFOnGet','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableCSRFOnPost_type_info = new String[]{'enableCSRFOnPost','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableCacheAndAutocomplete_type_info = new String[]{'enableCacheAndAutocomplete','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableClickjackNonsetupSFDC_type_info = new String[]{'enableClickjackNonsetupSFDC','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableClickjackNonsetupUser_type_info = new String[]{'enableClickjackNonsetupUser','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableClickjackSetup_type_info = new String[]{'enableClickjackSetup','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableSMSIdentity_type_info = new String[]{'enableSMSIdentity','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] forceRelogin_type_info = new String[]{'forceRelogin','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] lockSessionsToIp_type_info = new String[]{'lockSessionsToIp','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] sessionTimeout_type_info = new String[]{'sessionTimeout','http://soap.sforce.com/2006/04/metadata','SessionTimeout','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'disableTimeoutWarning','enableCSRFOnGet','enableCSRFOnPost','enableCacheAndAutocomplete','enableClickjackNonsetupSFDC','enableClickjackNonsetupUser','enableClickjackSetup','enableSMSIdentity','forceRelogin','lockSessionsToIp','sessionTimeout'}; - } - public class Document { + private String[] disableTimeoutWarning_type_info = new String[]{'disableTimeoutWarning','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableCSRFOnGet_type_info = new String[]{'enableCSRFOnGet','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableCSRFOnPost_type_info = new String[]{'enableCSRFOnPost','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableCacheAndAutocomplete_type_info = new String[]{'enableCacheAndAutocomplete','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableClickjackNonsetupSFDC_type_info = new String[]{'enableClickjackNonsetupSFDC','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableClickjackNonsetupUser_type_info = new String[]{'enableClickjackNonsetupUser','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableClickjackNonsetupUserHeaderless_type_info = new String[]{'enableClickjackNonsetupUserHeaderless','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableClickjackSetup_type_info = new String[]{'enableClickjackSetup','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enablePostForSessions_type_info = new String[]{'enablePostForSessions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableSMSIdentity_type_info = new String[]{'enableSMSIdentity','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enforceIpRangesEveryRequest_type_info = new String[]{'enforceIpRangesEveryRequest','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] forceLogoutOnSessionTimeout_type_info = new String[]{'forceLogoutOnSessionTimeout','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] forceRelogin_type_info = new String[]{'forceRelogin','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lockSessionsToDomain_type_info = new String[]{'lockSessionsToDomain','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lockSessionsToIp_type_info = new String[]{'lockSessionsToIp','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] logoutURL_type_info = new String[]{'logoutURL','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sessionTimeout_type_info = new String[]{'sessionTimeout','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'disableTimeoutWarning','enableCSRFOnGet','enableCSRFOnPost','enableCacheAndAutocomplete','enableClickjackNonsetupSFDC','enableClickjackNonsetupUser','enableClickjackNonsetupUserHeaderless','enableClickjackSetup','enablePostForSessions','enableSMSIdentity','enforceIpRangesEveryRequest','forceLogoutOnSessionTimeout','forceRelogin','lockSessionsToDomain','lockSessionsToIp','logoutURL','sessionTimeout'}; + } + public class Document extends MetadataWithContent { + public String type = 'Document'; + public String fullName; + public String content; public String description; public Boolean internalUseOnly; public String keywords; public String name; public Boolean public_x; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] internalUseOnly_type_info = new String[]{'internalUseOnly','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] keywords_type_info = new String[]{'keywords','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] public_x_type_info = new String[]{'public','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] internalUseOnly_type_info = new String[]{'internalUseOnly','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] keywords_type_info = new String[]{'keywords','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] public_x_type_info = new String[]{'public','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'content', 'description','internalUseOnly','keywords','name','public_x'}; + } + public class AutoResponseRules extends Metadata { + public String type = 'AutoResponseRules'; + public String fullName; + public MetadataService.AutoResponseRule[] autoResponseRule; + private String[] autoResponseRule_type_info = new String[]{'autoResponseRule','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'description','internalUseOnly','keywords','name','public_x'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'autoResponseRule'}; } - public class Folder { + public virtual class Folder extends Metadata{ public String accessType; public MetadataService.FolderShare[] folderShares; public String name; public String publicFolderAccess; public MetadataService.SharedTo sharedTo; - private String[] accessType_type_info = new String[]{'accessType','http://soap.sforce.com/2006/04/metadata','FolderAccessTypes','0','1','false'}; - private String[] folderShares_type_info = new String[]{'folderShares','http://soap.sforce.com/2006/04/metadata','FolderShare','0','-1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] publicFolderAccess_type_info = new String[]{'publicFolderAccess','http://soap.sforce.com/2006/04/metadata','PublicFolderAccess','0','1','false'}; - private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata','SharedTo','0','1','false'}; + private String[] accessType_type_info = new String[]{'accessType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] folderShares_type_info = new String[]{'folderShares','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] publicFolderAccess_type_info = new String[]{'publicFolderAccess','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'accessType','folderShares','name','publicFolderAccess','sharedTo'}; } - public class AutoResponseRules { - public MetadataService.AutoResponseRule[] autoResponseRule; - private String[] autoResponseRule_type_info = new String[]{'autoResponseRule','http://soap.sforce.com/2006/04/metadata','AutoResponseRule','0','-1','false'}; + public class Territory2Model extends Metadata { + public String type = 'Territory2Model'; + public String fullName; + public MetadataService.FieldValue[] customFields; + public String description; + public String name; + private String[] customFields_type_info = new String[]{'customFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'autoResponseRule'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'customFields','description','name'}; } public class DeployResult { + public String canceledBy; + public String canceledByName; + public Boolean checkOnly; + public DateTime completedDate; + public String createdBy; + public String createdByName; + public DateTime createdDate; + public MetadataService.DeployDetails details; + public Boolean done; + public String errorMessage; + public String errorStatusCode; public String id; - public MetadataService.DeployMessage[] messages; - public MetadataService.RetrieveResult retrieveResult; - public MetadataService.RunTestsResult runTestResult; + public Boolean ignoreWarnings; + public DateTime lastModifiedDate; + public Integer numberComponentErrors; + public Integer numberComponentsDeployed; + public Integer numberComponentsTotal; + public Integer numberTestErrors; + public Integer numberTestsCompleted; + public Integer numberTestsTotal; + public Boolean rollbackOnError; + public Boolean runTestsEnabled; + public DateTime startDate; + public String stateDetail; + public String status; public Boolean success; - private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata','ID','1','1','false'}; - private String[] messages_type_info = new String[]{'messages','http://soap.sforce.com/2006/04/metadata','DeployMessage','0','-1','false'}; - private String[] retrieveResult_type_info = new String[]{'retrieveResult','http://soap.sforce.com/2006/04/metadata','RetrieveResult','0','1','false'}; - private String[] runTestResult_type_info = new String[]{'runTestResult','http://soap.sforce.com/2006/04/metadata','RunTestsResult','0','1','false'}; - private String[] success_type_info = new String[]{'success','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'id','messages','retrieveResult','runTestResult','success'}; - } - public class CampaignCriteriaBasedSharingRule { - public String booleanFilter; - public String campaignAccessLevel; - public String name; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] campaignAccessLevel_type_info = new String[]{'campaignAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelNoNone','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'booleanFilter','campaignAccessLevel','name'}; + private String[] canceledBy_type_info = new String[]{'canceledBy','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] canceledByName_type_info = new String[]{'canceledByName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] checkOnly_type_info = new String[]{'checkOnly','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] completedDate_type_info = new String[]{'completedDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] createdBy_type_info = new String[]{'createdBy','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] createdByName_type_info = new String[]{'createdByName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] createdDate_type_info = new String[]{'createdDate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] details_type_info = new String[]{'details','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] done_type_info = new String[]{'done','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] errorMessage_type_info = new String[]{'errorMessage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] errorStatusCode_type_info = new String[]{'errorStatusCode','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] ignoreWarnings_type_info = new String[]{'ignoreWarnings','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] lastModifiedDate_type_info = new String[]{'lastModifiedDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] numberComponentErrors_type_info = new String[]{'numberComponentErrors','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] numberComponentsDeployed_type_info = new String[]{'numberComponentsDeployed','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] numberComponentsTotal_type_info = new String[]{'numberComponentsTotal','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] numberTestErrors_type_info = new String[]{'numberTestErrors','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] numberTestsCompleted_type_info = new String[]{'numberTestsCompleted','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] numberTestsTotal_type_info = new String[]{'numberTestsTotal','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] rollbackOnError_type_info = new String[]{'rollbackOnError','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] runTestsEnabled_type_info = new String[]{'runTestsEnabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] startDate_type_info = new String[]{'startDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] stateDetail_type_info = new String[]{'stateDetail','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] status_type_info = new String[]{'status','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] success_type_info = new String[]{'success','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'canceledBy','canceledByName','checkOnly','completedDate','createdBy','createdByName','createdDate','details','done','errorMessage','errorStatusCode','id','ignoreWarnings','lastModifiedDate','numberComponentErrors','numberComponentsDeployed','numberComponentsTotal','numberTestErrors','numberTestsCompleted','numberTestsTotal','rollbackOnError','runTestsEnabled','startDate','stateDetail','status','success'}; } public class ProfileApexPageAccess { public String apexPage; public Boolean enabled; - private String[] apexPage_type_info = new String[]{'apexPage','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] enabled_type_info = new String[]{'enabled','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] apexPage_type_info = new String[]{'apexPage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enabled_type_info = new String[]{'enabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'apexPage','enabled'}; } public class Approver { public String name; public String type_x; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','NextOwnerType','1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'name','type_x'}; } @@ -3037,38 +3961,62 @@ public class MetadataService { public String horizontalAlignment; public String logo; public String verticalAlignment; - private String[] backgroundColor_type_info = new String[]{'backgroundColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] height_type_info = new String[]{'height','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] horizontalAlignment_type_info = new String[]{'horizontalAlignment','http://soap.sforce.com/2006/04/metadata','LetterheadHorizontalAlignment','0','1','false'}; - private String[] logo_type_info = new String[]{'logo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] verticalAlignment_type_info = new String[]{'verticalAlignment','http://soap.sforce.com/2006/04/metadata','LetterheadVerticalAlignment','0','1','false'}; + private String[] backgroundColor_type_info = new String[]{'backgroundColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] horizontalAlignment_type_info = new String[]{'horizontalAlignment','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] logo_type_info = new String[]{'logo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] verticalAlignment_type_info = new String[]{'verticalAlignment','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'backgroundColor','height','horizontalAlignment','logo','verticalAlignment'}; } - public class HomePageComponent { + public class HomePageComponent extends Metadata { + public String type = 'HomePageComponent'; + public String fullName; public String body; + public Integer height; public String[] links; + public String page_x; public String pageComponentType; + public Boolean showLabel; + public Boolean showScrollbars; public String width; - private String[] body_type_info = new String[]{'body','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] links_type_info = new String[]{'links','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] pageComponentType_type_info = new String[]{'pageComponentType','http://soap.sforce.com/2006/04/metadata','PageComponentType','1','1','false'}; - private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata','PageComponentWidth','0','1','false'}; + private String[] body_type_info = new String[]{'body','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] links_type_info = new String[]{'links','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] page_x_type_info = new String[]{'page','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] pageComponentType_type_info = new String[]{'pageComponentType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] showLabel_type_info = new String[]{'showLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showScrollbars_type_info = new String[]{'showScrollbars','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'body','links','pageComponentType','width'}; - } - public class RecordTypeTranslation { - public String label; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'body','height','links','page_x','pageComponentType','showLabel','showScrollbars','width'}; + } + public class ProfileCustomPermissions { + public Boolean enabled; public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] enabled_type_info = new String[]{'enabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'label','name'}; + private String[] field_order_type_info = new String[]{'enabled','name'}; } - public class SamlSsoConfig { + public class LookupFilterTranslation { + public String errorMessage; + public String informationalMessage; + private String[] errorMessage_type_info = new String[]{'errorMessage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] informationalMessage_type_info = new String[]{'informationalMessage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'errorMessage','informationalMessage'}; + } + public class SamlSsoConfig extends Metadata { + public String type = 'SamlSsoConfig'; + public String fullName; public String attributeName; public String attributeNameIdFormat; + public String decryptionCertificate; public String errorUrl; + public String executionUserId; public String identityLocation; public String identityMapping; public String issuer; @@ -3077,89 +4025,181 @@ public class MetadataService { public String name; public String oauthTokenEndpoint; public Boolean redirectBinding; + public String requestSignatureMethod; public String salesforceLoginUrl; public String samlEntityId; + public String samlJitHandlerId; public String samlVersion; public Boolean userProvisioning; public String validationCert; - private String[] attributeName_type_info = new String[]{'attributeName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] attributeNameIdFormat_type_info = new String[]{'attributeNameIdFormat','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] errorUrl_type_info = new String[]{'errorUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] identityLocation_type_info = new String[]{'identityLocation','http://soap.sforce.com/2006/04/metadata','SamlIdentityLocationType','1','1','false'}; - private String[] identityMapping_type_info = new String[]{'identityMapping','http://soap.sforce.com/2006/04/metadata','SamlIdentityType','1','1','false'}; - private String[] issuer_type_info = new String[]{'issuer','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] loginUrl_type_info = new String[]{'loginUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] logoutUrl_type_info = new String[]{'logoutUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] oauthTokenEndpoint_type_info = new String[]{'oauthTokenEndpoint','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] redirectBinding_type_info = new String[]{'redirectBinding','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] salesforceLoginUrl_type_info = new String[]{'salesforceLoginUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] samlEntityId_type_info = new String[]{'samlEntityId','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] samlVersion_type_info = new String[]{'samlVersion','http://soap.sforce.com/2006/04/metadata','SamlType','1','1','false'}; - private String[] userProvisioning_type_info = new String[]{'userProvisioning','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] validationCert_type_info = new String[]{'validationCert','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'attributeName','attributeNameIdFormat','errorUrl','identityLocation','identityMapping','issuer','loginUrl','logoutUrl','name','oauthTokenEndpoint','redirectBinding','salesforceLoginUrl','samlEntityId','samlVersion','userProvisioning','validationCert'}; - } - public class MobileSettings { + private String[] attributeName_type_info = new String[]{'attributeName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] attributeNameIdFormat_type_info = new String[]{'attributeNameIdFormat','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] decryptionCertificate_type_info = new String[]{'decryptionCertificate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] errorUrl_type_info = new String[]{'errorUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] executionUserId_type_info = new String[]{'executionUserId','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] identityLocation_type_info = new String[]{'identityLocation','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] identityMapping_type_info = new String[]{'identityMapping','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] issuer_type_info = new String[]{'issuer','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] loginUrl_type_info = new String[]{'loginUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] logoutUrl_type_info = new String[]{'logoutUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] oauthTokenEndpoint_type_info = new String[]{'oauthTokenEndpoint','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] redirectBinding_type_info = new String[]{'redirectBinding','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] requestSignatureMethod_type_info = new String[]{'requestSignatureMethod','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] salesforceLoginUrl_type_info = new String[]{'salesforceLoginUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] samlEntityId_type_info = new String[]{'samlEntityId','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] samlJitHandlerId_type_info = new String[]{'samlJitHandlerId','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] samlVersion_type_info = new String[]{'samlVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] userProvisioning_type_info = new String[]{'userProvisioning','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] validationCert_type_info = new String[]{'validationCert','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'attributeName','attributeNameIdFormat','decryptionCertificate','errorUrl','executionUserId','identityLocation','identityMapping','issuer','loginUrl','logoutUrl','name','oauthTokenEndpoint','redirectBinding','requestSignatureMethod','salesforceLoginUrl','samlEntityId','samlJitHandlerId','samlVersion','userProvisioning','validationCert'}; + } + public class RecordTypeTranslation { + public String label; + public String name; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'label','name'}; + } + public class deployRecentValidation_element { + public String validationId; + private String[] validationId_type_info = new String[]{'validationId','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'validationId'}; + } + public class WorkflowFlowAction { + public String description; + public String flow; + public MetadataService.WorkflowFlowActionParameter[] flowInputs; + public String label; + public String language; + public Boolean protected_x; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] flow_type_info = new String[]{'flow','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] flowInputs_type_info = new String[]{'flowInputs','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'description','flow','flowInputs','label','language','protected_x'}; + } + public class ActionLinkTemplate { + public String actionUrl; + public String headers; + public Boolean isConfirmationRequired; + public Boolean isGroupDefault; + public String label; + public String labelKey; + public String linkType; + public String method; + public Integer position; + public String requestBody; + public String userAlias; + public String userVisibility; + private String[] actionUrl_type_info = new String[]{'actionUrl','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] headers_type_info = new String[]{'headers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isConfirmationRequired_type_info = new String[]{'isConfirmationRequired','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isGroupDefault_type_info = new String[]{'isGroupDefault','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] labelKey_type_info = new String[]{'labelKey','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] linkType_type_info = new String[]{'linkType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] method_type_info = new String[]{'method','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] position_type_info = new String[]{'position','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] requestBody_type_info = new String[]{'requestBody','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] userAlias_type_info = new String[]{'userAlias','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] userVisibility_type_info = new String[]{'userVisibility','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'actionUrl','headers','isConfirmationRequired','isGroupDefault','label','labelKey','linkType','method','position','requestBody','userAlias','userVisibility'}; + } + public class MobileSettings extends Metadata { + public String type = 'MobileSettings'; + public String fullName; public MetadataService.ChatterMobileSettings chatterMobile; public MetadataService.DashboardMobileSettings dashboardMobile; public MetadataService.SFDCMobileSettings salesforceMobile; public MetadataService.TouchMobileSettings touchMobile; - private String[] chatterMobile_type_info = new String[]{'chatterMobile','http://soap.sforce.com/2006/04/metadata','ChatterMobileSettings','0','1','false'}; - private String[] dashboardMobile_type_info = new String[]{'dashboardMobile','http://soap.sforce.com/2006/04/metadata','DashboardMobileSettings','0','1','false'}; - private String[] salesforceMobile_type_info = new String[]{'salesforceMobile','http://soap.sforce.com/2006/04/metadata','SFDCMobileSettings','0','1','false'}; - private String[] touchMobile_type_info = new String[]{'touchMobile','http://soap.sforce.com/2006/04/metadata','TouchMobileSettings','0','1','false'}; + private String[] chatterMobile_type_info = new String[]{'chatterMobile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] dashboardMobile_type_info = new String[]{'dashboardMobile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] salesforceMobile_type_info = new String[]{'salesforceMobile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] touchMobile_type_info = new String[]{'touchMobile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'chatterMobile','dashboardMobile','salesforceMobile','touchMobile'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'chatterMobile','dashboardMobile','salesforceMobile','touchMobile'}; + } + public class PersonListSettings { + public Boolean enablePersonList; + private String[] enablePersonList_type_info = new String[]{'enablePersonList','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'enablePersonList'}; + } + public class SharingTerritoryRule extends SharingBaseRule { + public String type = 'SharingTerritoryRule'; + public String fullName; + public String accessLevel; + public MetadataService.AccountSharingRuleSettings accountSettings; + public String description; + public String label; + public MetadataService.SharedTo sharedTo; + private String[] accessLevel_type_info = new String[]{'accessLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] accountSettings_type_info = new String[]{'accountSettings','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName','accessLevel','accountSettings','description','label','sharedTo'}; } public class FlowFormula { + public String dataType; public String expression; public Integer scale; - private String[] expression_type_info = new String[]{'expression','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] scale_type_info = new String[]{'scale','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; + private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] expression_type_info = new String[]{'expression','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] scale_type_info = new String[]{'scale','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'expression','scale'}; + private String[] field_order_type_info = new String[]{'dataType','expression','scale'}; } - public class EscalationRules { + public class EscalationRules extends Metadata { + public String type = 'EscalationRules'; + public String fullName; public MetadataService.EscalationRule[] escalationRule; - private String[] escalationRule_type_info = new String[]{'escalationRule','http://soap.sforce.com/2006/04/metadata','EscalationRule','0','-1','false'}; + private String[] escalationRule_type_info = new String[]{'escalationRule','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'escalationRule'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'escalationRule'}; } public class ApprovalSubmitter { public String submitter; public String type_x; - private String[] submitter_type_info = new String[]{'submitter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','ProcessSubmitterType','1','1','false'}; + private String[] submitter_type_info = new String[]{'submitter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'submitter','type_x'}; } + public class AgentConfigButtons { + public String[] button; + private String[] button_type_info = new String[]{'button','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'button'}; + } public class PicklistValueTranslation { public String masterLabel; public String translation; - private String[] masterLabel_type_info = new String[]{'masterLabel','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] translation_type_info = new String[]{'translation','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] translation_type_info = new String[]{'translation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'masterLabel','translation'}; } - public class DataSourceSettings { - public Boolean enableQuantity; - public Boolean enableRevenue; - private String[] enableQuantity_type_info = new String[]{'enableQuantity','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] enableRevenue_type_info = new String[]{'enableRevenue','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enableQuantity','enableRevenue'}; - } - public class ContactOwnerSharingRule { - public String contactAccessLevel; - public String name; - private String[] contactAccessLevel_type_info = new String[]{'contactAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelReadEdit','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'contactAccessLevel','name'}; - } - public class CustomDataType { + public class CustomDataType extends Metadata { + public String type = 'CustomDataType'; + public String fullName; public MetadataService.CustomDataTypeComponent[] customDataTypeComponents; public String description; public String displayFormula; @@ -3167,24 +4207,35 @@ public class MetadataService { public String label; public Boolean rightAligned; public Boolean supportComponentsInReports; - private String[] customDataTypeComponents_type_info = new String[]{'customDataTypeComponents','http://soap.sforce.com/2006/04/metadata','CustomDataTypeComponent','0','-1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] displayFormula_type_info = new String[]{'displayFormula','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] editComponentsOnSeparateLines_type_info = new String[]{'editComponentsOnSeparateLines','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] rightAligned_type_info = new String[]{'rightAligned','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] supportComponentsInReports_type_info = new String[]{'supportComponentsInReports','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] customDataTypeComponents_type_info = new String[]{'customDataTypeComponents','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] displayFormula_type_info = new String[]{'displayFormula','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] editComponentsOnSeparateLines_type_info = new String[]{'editComponentsOnSeparateLines','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] rightAligned_type_info = new String[]{'rightAligned','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] supportComponentsInReports_type_info = new String[]{'supportComponentsInReports','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'customDataTypeComponents','description','displayFormula','editComponentsOnSeparateLines','label','rightAligned','supportComponentsInReports'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'customDataTypeComponents','description','displayFormula','editComponentsOnSeparateLines','label','rightAligned','supportComponentsInReports'}; } public class PrimaryTabComponents { - public MetadataService.ConsoleComponent[] component; - private String[] component_type_info = new String[]{'component','http://soap.sforce.com/2006/04/metadata','ConsoleComponent','0','-1','false'}; + public MetadataService.Container[] containers; + private String[] containers_type_info = new String[]{'containers','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'component'}; + private String[] field_order_type_info = new String[]{'containers'}; + } + public class AgentConfigSkills { + public String[] skill; + private String[] skill_type_info = new String[]{'skill','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'skill'}; } - public class EntitlementProcess { + public class EntitlementProcess extends Metadata { + public String type = 'EntitlementProcess'; + public String fullName; public Boolean active; + public String businessHours; public String description; public String entryStartDateField; public String exitCriteriaBooleanFilter; @@ -3196,64 +4247,64 @@ public class MetadataService { public String versionMaster; public String versionNotes; public Integer versionNumber; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] entryStartDateField_type_info = new String[]{'entryStartDateField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] exitCriteriaBooleanFilter_type_info = new String[]{'exitCriteriaBooleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] exitCriteriaFilterItems_type_info = new String[]{'exitCriteriaFilterItems','http://soap.sforce.com/2006/04/metadata','FilterItem','0','-1','false'}; - private String[] exitCriteriaFormula_type_info = new String[]{'exitCriteriaFormula','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] isVersionDefault_type_info = new String[]{'isVersionDefault','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] milestones_type_info = new String[]{'milestones','http://soap.sforce.com/2006/04/metadata','EntitlementProcessMilestoneItem','0','-1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] versionMaster_type_info = new String[]{'versionMaster','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] versionNotes_type_info = new String[]{'versionNotes','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] versionNumber_type_info = new String[]{'versionNumber','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','description','entryStartDateField','exitCriteriaBooleanFilter','exitCriteriaFilterItems','exitCriteriaFormula','isVersionDefault','milestones','name','versionMaster','versionNotes','versionNumber'}; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] businessHours_type_info = new String[]{'businessHours','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] entryStartDateField_type_info = new String[]{'entryStartDateField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] exitCriteriaBooleanFilter_type_info = new String[]{'exitCriteriaBooleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] exitCriteriaFilterItems_type_info = new String[]{'exitCriteriaFilterItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] exitCriteriaFormula_type_info = new String[]{'exitCriteriaFormula','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isVersionDefault_type_info = new String[]{'isVersionDefault','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] milestones_type_info = new String[]{'milestones','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] versionMaster_type_info = new String[]{'versionMaster','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] versionNotes_type_info = new String[]{'versionNotes','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] versionNumber_type_info = new String[]{'versionNumber','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','businessHours','description','entryStartDateField','exitCriteriaBooleanFilter','exitCriteriaFilterItems','exitCriteriaFormula','isVersionDefault','milestones','name','versionMaster','versionNotes','versionNumber'}; } public class RecordType extends Metadata { - public String type = 'RecordType'; - public String fullName; + public String type = 'RecordType'; + public String fullName; public Boolean active; public String businessProcess; + public String compactLayoutAssignment; public String description; public String label; public MetadataService.RecordTypePicklistValue[] picklistValues; - private String[] type_att_info = new String[]{'xsi:type'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] businessProcess_type_info = new String[]{'businessProcess','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] picklistValues_type_info = new String[]{'picklistValues','http://soap.sforce.com/2006/04/metadata','RecordTypePicklistValue','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'fullName', 'active','businessProcess','description','label','picklistValues'}; - } - public class ContactCriteriaBasedSharingRule { - public String booleanFilter; - public String contactAccessLevel; - public String name; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] contactAccessLevel_type_info = new String[]{'contactAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelReadEdit','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] businessProcess_type_info = new String[]{'businessProcess','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] compactLayoutAssignment_type_info = new String[]{'compactLayoutAssignment','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] picklistValues_type_info = new String[]{'picklistValues','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'booleanFilter','contactAccessLevel','name'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','businessProcess','compactLayoutAssignment','description','label','picklistValues'}; } public class FilterItem { public String field; public String operation; public String value; public String valueField; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] operation_type_info = new String[]{'operation','http://soap.sforce.com/2006/04/metadata','FilterOperation','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] valueField_type_info = new String[]{'valueField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] operation_type_info = new String[]{'operation','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] valueField_type_info = new String[]{'valueField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'field','operation','value','valueField'}; } - public class Profile { + public class Profile extends Metadata { + public String type = 'Profile'; + public String fullName; public MetadataService.ProfileApplicationVisibility[] applicationVisibilities; public MetadataService.ProfileApexClassAccess[] classAccesses; + public Boolean custom; + public MetadataService.ProfileCustomPermissions[] customPermissions; + public String description; public MetadataService.ProfileExternalDataSourceAccess[] externalDataSourceAccesses; public MetadataService.ProfileFieldLevelSecurity[] fieldPermissions; public MetadataService.ProfileLayoutAssignment[] layoutAssignments; @@ -3264,41 +4315,91 @@ public class MetadataService { public MetadataService.ProfileRecordTypeVisibility[] recordTypeVisibilities; public MetadataService.ProfileTabVisibility[] tabVisibilities; public String userLicense; - private String[] applicationVisibilities_type_info = new String[]{'applicationVisibilities','http://soap.sforce.com/2006/04/metadata','ProfileApplicationVisibility','0','-1','false'}; - private String[] classAccesses_type_info = new String[]{'classAccesses','http://soap.sforce.com/2006/04/metadata','ProfileApexClassAccess','0','-1','false'}; - private String[] externalDataSourceAccesses_type_info = new String[]{'externalDataSourceAccesses','http://soap.sforce.com/2006/04/metadata','ProfileExternalDataSourceAccess','0','-1','false'}; - private String[] fieldPermissions_type_info = new String[]{'fieldPermissions','http://soap.sforce.com/2006/04/metadata','ProfileFieldLevelSecurity','0','-1','false'}; - private String[] layoutAssignments_type_info = new String[]{'layoutAssignments','http://soap.sforce.com/2006/04/metadata','ProfileLayoutAssignment','0','-1','false'}; - private String[] loginHours_type_info = new String[]{'loginHours','http://soap.sforce.com/2006/04/metadata','ProfileLoginHours','0','1','false'}; - private String[] loginIpRanges_type_info = new String[]{'loginIpRanges','http://soap.sforce.com/2006/04/metadata','ProfileLoginIpRange','0','-1','false'}; - private String[] objectPermissions_type_info = new String[]{'objectPermissions','http://soap.sforce.com/2006/04/metadata','ProfileObjectPermissions','0','-1','false'}; - private String[] pageAccesses_type_info = new String[]{'pageAccesses','http://soap.sforce.com/2006/04/metadata','ProfileApexPageAccess','0','-1','false'}; - private String[] recordTypeVisibilities_type_info = new String[]{'recordTypeVisibilities','http://soap.sforce.com/2006/04/metadata','ProfileRecordTypeVisibility','0','-1','false'}; - private String[] tabVisibilities_type_info = new String[]{'tabVisibilities','http://soap.sforce.com/2006/04/metadata','ProfileTabVisibility','0','-1','false'}; - private String[] userLicense_type_info = new String[]{'userLicense','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'applicationVisibilities','classAccesses','externalDataSourceAccesses','fieldPermissions','layoutAssignments','loginHours','loginIpRanges','objectPermissions','pageAccesses','recordTypeVisibilities','tabVisibilities','userLicense'}; + public MetadataService.ProfileUserPermission[] userPermissions; + private String[] applicationVisibilities_type_info = new String[]{'applicationVisibilities','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] classAccesses_type_info = new String[]{'classAccesses','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] custom_type_info = new String[]{'custom','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customPermissions_type_info = new String[]{'customPermissions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] externalDataSourceAccesses_type_info = new String[]{'externalDataSourceAccesses','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] fieldPermissions_type_info = new String[]{'fieldPermissions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] layoutAssignments_type_info = new String[]{'layoutAssignments','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] loginHours_type_info = new String[]{'loginHours','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] loginIpRanges_type_info = new String[]{'loginIpRanges','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] objectPermissions_type_info = new String[]{'objectPermissions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] pageAccesses_type_info = new String[]{'pageAccesses','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] recordTypeVisibilities_type_info = new String[]{'recordTypeVisibilities','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] tabVisibilities_type_info = new String[]{'tabVisibilities','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] userLicense_type_info = new String[]{'userLicense','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] userPermissions_type_info = new String[]{'userPermissions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'applicationVisibilities','classAccesses','custom','customPermissions','description','externalDataSourceAccesses','fieldPermissions','layoutAssignments','loginHours','loginIpRanges','objectPermissions','pageAccesses','recordTypeVisibilities','tabVisibilities','userLicense','userPermissions'}; + } + public class ConnectedApp extends Metadata { + public String type = 'ConnectedApp'; + public String fullName; + public MetadataService.ConnectedAppAttribute[] attributes; + public MetadataService.ConnectedAppCanvasConfig canvasConfig; + public String contactEmail; + public String contactPhone; + public String description; + public String iconUrl; + public String infoUrl; + public MetadataService.ConnectedAppIpRange[] ipRanges; + public String label; + public String logoUrl; + public MetadataService.ConnectedAppMobileDetailConfig mobileAppConfig; + public String mobileStartUrl; + public MetadataService.ConnectedAppOauthConfig oauthConfig; + public MetadataService.ConnectedAppSamlConfig samlConfig; + public String startUrl; + private String[] attributes_type_info = new String[]{'attributes','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] canvasConfig_type_info = new String[]{'canvasConfig','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] contactEmail_type_info = new String[]{'contactEmail','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] contactPhone_type_info = new String[]{'contactPhone','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] iconUrl_type_info = new String[]{'iconUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] infoUrl_type_info = new String[]{'infoUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] ipRanges_type_info = new String[]{'ipRanges','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] logoUrl_type_info = new String[]{'logoUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] mobileAppConfig_type_info = new String[]{'mobileAppConfig','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] mobileStartUrl_type_info = new String[]{'mobileStartUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] oauthConfig_type_info = new String[]{'oauthConfig','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] samlConfig_type_info = new String[]{'samlConfig','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] startUrl_type_info = new String[]{'startUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'attributes','canvasConfig','contactEmail','contactPhone','description','iconUrl','infoUrl','ipRanges','label','logoUrl','mobileAppConfig','mobileStartUrl','oauthConfig','samlConfig','startUrl'}; } public class ReportFilter { public String booleanFilter; public MetadataService.ReportFilterItem[] criteriaItems; public String language; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata','ReportFilterItem','0','-1','false'}; - private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata','Language','0','1','false'}; + private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'booleanFilter','criteriaItems','language'}; } - public class Layout { + public class Layout extends Metadata { + public String type = 'Layout'; + public String fullName; public String[] customButtons; public MetadataService.CustomConsoleComponents customConsoleComponents; public Boolean emailDefault; public String[] excludeButtons; + public MetadataService.FeedLayout feedLayout; public String[] headers; public MetadataService.LayoutSection[] layoutSections; public MetadataService.MiniLayout miniLayout; public String[] multilineLayoutFields; + public MetadataService.PlatformActionList platformActionList; public MetadataService.QuickActionList quickActionList; + public MetadataService.RelatedContent relatedContent; public MetadataService.RelatedListItem[] relatedLists; public String[] relatedObjects; public Boolean runAssignmentRulesDefault; @@ -3310,40 +4411,45 @@ public class MetadataService { public Boolean showSolutionSection; public Boolean showSubmitAndAttachButton; public MetadataService.SummaryLayout summaryLayout; - private String[] customButtons_type_info = new String[]{'customButtons','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] customConsoleComponents_type_info = new String[]{'customConsoleComponents','http://soap.sforce.com/2006/04/metadata','CustomConsoleComponents','0','1','false'}; - private String[] emailDefault_type_info = new String[]{'emailDefault','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] excludeButtons_type_info = new String[]{'excludeButtons','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] headers_type_info = new String[]{'headers','http://soap.sforce.com/2006/04/metadata','LayoutHeader','0','-1','false'}; - private String[] layoutSections_type_info = new String[]{'layoutSections','http://soap.sforce.com/2006/04/metadata','LayoutSection','0','-1','false'}; - private String[] miniLayout_type_info = new String[]{'miniLayout','http://soap.sforce.com/2006/04/metadata','MiniLayout','0','1','false'}; - private String[] multilineLayoutFields_type_info = new String[]{'multilineLayoutFields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] quickActionList_type_info = new String[]{'quickActionList','http://soap.sforce.com/2006/04/metadata','QuickActionList','0','1','false'}; - private String[] relatedLists_type_info = new String[]{'relatedLists','http://soap.sforce.com/2006/04/metadata','RelatedListItem','0','-1','false'}; - private String[] relatedObjects_type_info = new String[]{'relatedObjects','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] runAssignmentRulesDefault_type_info = new String[]{'runAssignmentRulesDefault','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showEmailCheckbox_type_info = new String[]{'showEmailCheckbox','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showHighlightsPanel_type_info = new String[]{'showHighlightsPanel','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showInteractionLogPanel_type_info = new String[]{'showInteractionLogPanel','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showKnowledgeComponent_type_info = new String[]{'showKnowledgeComponent','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showRunAssignmentRulesCheckbox_type_info = new String[]{'showRunAssignmentRulesCheckbox','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showSolutionSection_type_info = new String[]{'showSolutionSection','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showSubmitAndAttachButton_type_info = new String[]{'showSubmitAndAttachButton','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] summaryLayout_type_info = new String[]{'summaryLayout','http://soap.sforce.com/2006/04/metadata','SummaryLayout','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'customButtons','customConsoleComponents','emailDefault','excludeButtons','headers','layoutSections','miniLayout','multilineLayoutFields','quickActionList','relatedLists','relatedObjects','runAssignmentRulesDefault','showEmailCheckbox','showHighlightsPanel','showInteractionLogPanel','showKnowledgeComponent','showRunAssignmentRulesCheckbox','showSolutionSection','showSubmitAndAttachButton','summaryLayout'}; + private String[] customButtons_type_info = new String[]{'customButtons','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] customConsoleComponents_type_info = new String[]{'customConsoleComponents','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailDefault_type_info = new String[]{'emailDefault','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] excludeButtons_type_info = new String[]{'excludeButtons','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] feedLayout_type_info = new String[]{'feedLayout','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] headers_type_info = new String[]{'headers','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] layoutSections_type_info = new String[]{'layoutSections','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] miniLayout_type_info = new String[]{'miniLayout','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] multilineLayoutFields_type_info = new String[]{'multilineLayoutFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] platformActionList_type_info = new String[]{'platformActionList','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] quickActionList_type_info = new String[]{'quickActionList','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] relatedContent_type_info = new String[]{'relatedContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] relatedLists_type_info = new String[]{'relatedLists','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] relatedObjects_type_info = new String[]{'relatedObjects','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] runAssignmentRulesDefault_type_info = new String[]{'runAssignmentRulesDefault','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showEmailCheckbox_type_info = new String[]{'showEmailCheckbox','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showHighlightsPanel_type_info = new String[]{'showHighlightsPanel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showInteractionLogPanel_type_info = new String[]{'showInteractionLogPanel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showKnowledgeComponent_type_info = new String[]{'showKnowledgeComponent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showRunAssignmentRulesCheckbox_type_info = new String[]{'showRunAssignmentRulesCheckbox','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showSolutionSection_type_info = new String[]{'showSolutionSection','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showSubmitAndAttachButton_type_info = new String[]{'showSubmitAndAttachButton','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] summaryLayout_type_info = new String[]{'summaryLayout','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'customButtons','customConsoleComponents','emailDefault','excludeButtons','feedLayout','headers','layoutSections','miniLayout','multilineLayoutFields','platformActionList','quickActionList','relatedContent','relatedLists','relatedObjects','runAssignmentRulesDefault','showEmailCheckbox','showHighlightsPanel','showInteractionLogPanel','showKnowledgeComponent','showRunAssignmentRulesCheckbox','showSolutionSection','showSubmitAndAttachButton','summaryLayout'}; } public class KeyboardShortcuts { public MetadataService.CustomShortcut[] customShortcut; public MetadataService.DefaultShortcut[] defaultShortcut; - private String[] customShortcut_type_info = new String[]{'customShortcut','http://soap.sforce.com/2006/04/metadata','CustomShortcut','0','-1','false'}; - private String[] defaultShortcut_type_info = new String[]{'defaultShortcut','http://soap.sforce.com/2006/04/metadata','DefaultShortcut','0','-1','false'}; + private String[] customShortcut_type_info = new String[]{'customShortcut','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] defaultShortcut_type_info = new String[]{'defaultShortcut','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'customShortcut','defaultShortcut'}; } public class WebLink extends Metadata { public String type = 'WebLink'; - public String fullName; + public String fullName; public String availability; public String description; public String displayType; @@ -3365,30 +4471,30 @@ public class MetadataService { public Boolean showsStatus; public String url; public Integer width; - private String[] type_att_info = new String[]{'xsi:type'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] availability_type_info = new String[]{'availability','http://soap.sforce.com/2006/04/metadata','WebLinkAvailability','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] displayType_type_info = new String[]{'displayType','http://soap.sforce.com/2006/04/metadata','WebLinkDisplayType','1','1','false'}; - private String[] encodingKey_type_info = new String[]{'encodingKey','http://soap.sforce.com/2006/04/metadata','Encoding','0','1','false'}; - private String[] hasMenubar_type_info = new String[]{'hasMenubar','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] hasScrollbars_type_info = new String[]{'hasScrollbars','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] hasToolbar_type_info = new String[]{'hasToolbar','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] height_type_info = new String[]{'height','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] isResizable_type_info = new String[]{'isResizable','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] linkType_type_info = new String[]{'linkType','http://soap.sforce.com/2006/04/metadata','WebLinkType','1','1','false'}; - private String[] masterLabel_type_info = new String[]{'masterLabel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] openType_type_info = new String[]{'openType','http://soap.sforce.com/2006/04/metadata','WebLinkWindowType','1','1','false'}; - private String[] page_x_type_info = new String[]{'page','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] position_type_info = new String[]{'position','http://soap.sforce.com/2006/04/metadata','WebLinkPosition','0','1','false'}; - private String[] protected_x_type_info = new String[]{'protected','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] requireRowSelection_type_info = new String[]{'requireRowSelection','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] scontrol_type_info = new String[]{'scontrol','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] showsLocation_type_info = new String[]{'showsLocation','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showsStatus_type_info = new String[]{'showsStatus','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] url_type_info = new String[]{'url','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] width_type_info = new String[]{'width','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; + private String[] availability_type_info = new String[]{'availability','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] displayType_type_info = new String[]{'displayType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] encodingKey_type_info = new String[]{'encodingKey','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] hasMenubar_type_info = new String[]{'hasMenubar','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] hasScrollbars_type_info = new String[]{'hasScrollbars','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] hasToolbar_type_info = new String[]{'hasToolbar','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isResizable_type_info = new String[]{'isResizable','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] linkType_type_info = new String[]{'linkType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] openType_type_info = new String[]{'openType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] page_x_type_info = new String[]{'page','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] position_type_info = new String[]{'position','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] requireRowSelection_type_info = new String[]{'requireRowSelection','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scontrol_type_info = new String[]{'scontrol','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showsLocation_type_info = new String[]{'showsLocation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showsStatus_type_info = new String[]{'showsStatus','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] url_type_info = new String[]{'url','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; private String[] field_order_type_info = new String[]{'fullName', 'availability','description','displayType','encodingKey','hasMenubar','hasScrollbars','hasToolbar','height','isResizable','linkType','masterLabel','openType','page_x','position','protected_x','requireRowSelection','scontrol','showsLocation','showsStatus','url','width'}; } public class ApprovalStep { @@ -3402,16 +4508,16 @@ public class MetadataService { public String name; public MetadataService.ApprovalStepRejectBehavior rejectBehavior; public MetadataService.ApprovalAction rejectionActions; - private String[] allowDelegate_type_info = new String[]{'allowDelegate','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] approvalActions_type_info = new String[]{'approvalActions','http://soap.sforce.com/2006/04/metadata','ApprovalAction','0','1','false'}; - private String[] assignedApprover_type_info = new String[]{'assignedApprover','http://soap.sforce.com/2006/04/metadata','ApprovalStepApprover','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] entryCriteria_type_info = new String[]{'entryCriteria','http://soap.sforce.com/2006/04/metadata','ApprovalEntryCriteria','0','1','false'}; - private String[] ifCriteriaNotMet_type_info = new String[]{'ifCriteriaNotMet','http://soap.sforce.com/2006/04/metadata','StepCriteriaNotMetType','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] rejectBehavior_type_info = new String[]{'rejectBehavior','http://soap.sforce.com/2006/04/metadata','ApprovalStepRejectBehavior','0','1','false'}; - private String[] rejectionActions_type_info = new String[]{'rejectionActions','http://soap.sforce.com/2006/04/metadata','ApprovalAction','0','1','false'}; + private String[] allowDelegate_type_info = new String[]{'allowDelegate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] approvalActions_type_info = new String[]{'approvalActions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] assignedApprover_type_info = new String[]{'assignedApprover','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] entryCriteria_type_info = new String[]{'entryCriteria','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] ifCriteriaNotMet_type_info = new String[]{'ifCriteriaNotMet','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] rejectBehavior_type_info = new String[]{'rejectBehavior','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] rejectionActions_type_info = new String[]{'rejectionActions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'allowDelegate','approvalActions','assignedApprover','description','entryCriteria','ifCriteriaNotMet','label','name','rejectBehavior','rejectionActions'}; } @@ -3421,63 +4527,129 @@ public class MetadataService { public Boolean plural; public String possessive; public String value; - private String[] article_type_info = new String[]{'article','http://soap.sforce.com/2006/04/metadata','Article','0','1','false'}; - private String[] caseType_type_info = new String[]{'caseType','http://soap.sforce.com/2006/04/metadata','CaseType','0','1','false'}; - private String[] plural_type_info = new String[]{'plural','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] possessive_type_info = new String[]{'possessive','http://soap.sforce.com/2006/04/metadata','Possessive','0','1','false'}; - private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] article_type_info = new String[]{'article','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] caseType_type_info = new String[]{'caseType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] plural_type_info = new String[]{'plural','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] possessive_type_info = new String[]{'possessive','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'article','caseType','plural','possessive','value'}; } + public class ChannelLayoutItem { + public String field; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'field'}; + } + public class upsertMetadataResponse_element { + public MetadataService.UpsertResult[] result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } public class CustomDataTypeTranslation { public MetadataService.CustomDataTypeComponentTranslation[] components; public String customDataTypeName; public String description; public String label; - private String[] components_type_info = new String[]{'components','http://soap.sforce.com/2006/04/metadata','CustomDataTypeComponentTranslation','0','-1','false'}; - private String[] customDataTypeName_type_info = new String[]{'customDataTypeName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] components_type_info = new String[]{'components','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] customDataTypeName_type_info = new String[]{'customDataTypeName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'components','customDataTypeName','description','label'}; } + public class SiteDotCom extends MetadataWithContent { + public String type = 'SiteDotCom'; + public String fullName; + public String content; + public String label; + public String siteType; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] siteType_type_info = new String[]{'siteType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'content', 'label','siteType'}; + } + public class PlatformActionList extends Metadata { + public String type = 'PlatformActionList'; + public String fullName; + public String actionListContext; + public MetadataService.PlatformActionListItem[] platformActionListItems; + public String relatedSourceEntity; + private String[] actionListContext_type_info = new String[]{'actionListContext','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] platformActionListItems_type_info = new String[]{'platformActionListItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] relatedSourceEntity_type_info = new String[]{'relatedSourceEntity','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'actionListContext','platformActionListItems','relatedSourceEntity'}; + } + public class PlatformActionListItem { + public String actionName; + public String actionType; + public Integer sortOrder; + public String subtype; + private String[] actionName_type_info = new String[]{'actionName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] actionType_type_info = new String[]{'actionType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] subtype_type_info = new String[]{'subtype','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'actionName','actionType','sortOrder','subtype'}; + } public class CallOptions_element { public String client; - private String[] client_type_info = new String[]{'client','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] client_type_info = new String[]{'client','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'client'}; } public class AgentConfigAssignments { public MetadataService.AgentConfigProfileAssignments profiles; public MetadataService.AgentConfigUserAssignments users; - private String[] profiles_type_info = new String[]{'profiles','http://soap.sforce.com/2006/04/metadata','AgentConfigProfileAssignments','0','1','false'}; - private String[] users_type_info = new String[]{'users','http://soap.sforce.com/2006/04/metadata','AgentConfigUserAssignments','0','1','false'}; + private String[] profiles_type_info = new String[]{'profiles','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] users_type_info = new String[]{'users','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'profiles','users'}; } - public class CustomObjectOwnerSharingRule { - public String accessLevel; - public String name; - private String[] accessLevel_type_info = new String[]{'accessLevel','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class createMetadataResponse_element { + public MetadataService.SaveResult[] result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'accessLevel','name'}; + private String[] field_order_type_info = new String[]{'result'}; } public class CustomFieldTranslation { + public MetadataService.ObjectNameCaseValue[] caseValues; + public String gender; public String help; public String label; + public MetadataService.LookupFilterTranslation lookupFilter; public String name; public MetadataService.PicklistValueTranslation[] picklistValues; public String relationshipLabel; - private String[] help_type_info = new String[]{'help','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] picklistValues_type_info = new String[]{'picklistValues','http://soap.sforce.com/2006/04/metadata','PicklistValueTranslation','0','-1','false'}; - private String[] relationshipLabel_type_info = new String[]{'relationshipLabel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + public String startsWith; + private String[] caseValues_type_info = new String[]{'caseValues','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] gender_type_info = new String[]{'gender','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] help_type_info = new String[]{'help','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lookupFilter_type_info = new String[]{'lookupFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] picklistValues_type_info = new String[]{'picklistValues','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] relationshipLabel_type_info = new String[]{'relationshipLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] startsWith_type_info = new String[]{'startsWith','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'caseValues','gender','help','label','lookupFilter','name','picklistValues','relationshipLabel','startsWith'}; + } + public class updateMetadata_element { + public MetadataService.Metadata[] metadata; + private String[] metadata_type_info = new String[]{'metadata','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'help','label','name','picklistValues','relationshipLabel'}; + private String[] field_order_type_info = new String[]{'metadata'}; } - public class AnalyticSnapshot { + public class AnalyticSnapshot extends Metadata { + public String type = 'AnalyticSnapshot'; + public String fullName; public String description; public String groupColumn; public MetadataService.AnalyticSnapshotMapping[] mappings; @@ -3485,33 +4657,76 @@ public class MetadataService { public String runningUser; public String sourceReport; public String targetObject; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] groupColumn_type_info = new String[]{'groupColumn','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] mappings_type_info = new String[]{'mappings','http://soap.sforce.com/2006/04/metadata','AnalyticSnapshotMapping','0','-1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] runningUser_type_info = new String[]{'runningUser','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sourceReport_type_info = new String[]{'sourceReport','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] targetObject_type_info = new String[]{'targetObject','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] groupColumn_type_info = new String[]{'groupColumn','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] mappings_type_info = new String[]{'mappings','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] runningUser_type_info = new String[]{'runningUser','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sourceReport_type_info = new String[]{'sourceReport','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] targetObject_type_info = new String[]{'targetObject','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'description','groupColumn','mappings','name','runningUser','sourceReport','targetObject'}; + } + public class LookupFilter { + public Boolean active; + public String booleanFilter; + public String description; + public String errorMessage; + public MetadataService.FilterItem[] filterItems; + public String infoMessage; + public Boolean isOptional; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] errorMessage_type_info = new String[]{'errorMessage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] filterItems_type_info = new String[]{'filterItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] infoMessage_type_info = new String[]{'infoMessage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isOptional_type_info = new String[]{'isOptional','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'active','booleanFilter','description','errorMessage','filterItems','infoMessage','isOptional'}; + } + public class AllOrNoneHeader_element { + public Boolean allOrNone; + private String[] allOrNone_type_info = new String[]{'allOrNone','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'description','groupColumn','mappings','name','runningUser','sourceReport','targetObject'}; + private String[] field_order_type_info = new String[]{'allOrNone'}; + } + public class PersonalJourneySettings extends Metadata { + public String type = 'PersonalJourneySettings'; + public String fullName; + public Boolean enableExactTargetForSalesforceApps; + private String[] enableExactTargetForSalesforceApps_type_info = new String[]{'enableExactTargetForSalesforceApps','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'enableExactTargetForSalesforceApps'}; } public class ScontrolTranslation { public String label; public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'label','name'}; } public class ReportColumn { public String[] aggregateTypes; public String field; - private String[] aggregateTypes_type_info = new String[]{'aggregateTypes','http://soap.sforce.com/2006/04/metadata','ReportSummaryType','0','-1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public Boolean reverseColors; + public Boolean showChanges; + private String[] aggregateTypes_type_info = new String[]{'aggregateTypes','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] reverseColors_type_info = new String[]{'reverseColors','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showChanges_type_info = new String[]{'showChanges','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'aggregateTypes','field'}; + private String[] field_order_type_info = new String[]{'aggregateTypes','field','reverseColors','showChanges'}; } - public class QuickAction { + public class QuickAction extends Metadata { + public String type = 'QuickAction'; + public String fullName; + public String canvas; public String description; public MetadataService.FieldOverride[] fieldOverrides; public Integer height; @@ -3520,139 +4735,284 @@ public class MetadataService { public String label; public String page_x; public MetadataService.QuickActionLayout quickActionLayout; + public String standardLabel; public String targetObject; public String targetParentField; public String targetRecordType; public String type_x; public Integer width; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] fieldOverrides_type_info = new String[]{'fieldOverrides','http://soap.sforce.com/2006/04/metadata','FieldOverride','0','-1','false'}; - private String[] height_type_info = new String[]{'height','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] icon_type_info = new String[]{'icon','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] isProtected_type_info = new String[]{'isProtected','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] page_x_type_info = new String[]{'page','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] quickActionLayout_type_info = new String[]{'quickActionLayout','http://soap.sforce.com/2006/04/metadata','QuickActionLayout','0','1','false'}; - private String[] targetObject_type_info = new String[]{'targetObject','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] targetParentField_type_info = new String[]{'targetParentField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] targetRecordType_type_info = new String[]{'targetRecordType','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','QuickActionType','1','1','false'}; - private String[] width_type_info = new String[]{'width','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'description','fieldOverrides','height','icon','isProtected','label','page_x','quickActionLayout','targetObject','targetParentField','targetRecordType','type_x','width'}; + private String[] canvas_type_info = new String[]{'canvas','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fieldOverrides_type_info = new String[]{'fieldOverrides','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] icon_type_info = new String[]{'icon','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isProtected_type_info = new String[]{'isProtected','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] page_x_type_info = new String[]{'page','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] quickActionLayout_type_info = new String[]{'quickActionLayout','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] standardLabel_type_info = new String[]{'standardLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] targetObject_type_info = new String[]{'targetObject','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] targetParentField_type_info = new String[]{'targetParentField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] targetRecordType_type_info = new String[]{'targetRecordType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'canvas','description','fieldOverrides','height','icon','isProtected','label','page_x','quickActionLayout','standardLabel','targetObject','targetParentField','targetRecordType','type_x','width'}; } public class DefaultShortcut { public String action; public Boolean active; public String keyCommand; - private String[] action_type_info = new String[]{'action','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] keyCommand_type_info = new String[]{'keyCommand','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] action_type_info = new String[]{'action','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] keyCommand_type_info = new String[]{'keyCommand','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'action','active','keyCommand'}; } - public class ApexComponent { + public class ApexComponent extends MetadataWithContent { + public String type = 'ApexComponent'; + public String fullName; + public String content; public Double apiVersion; public String description; public String label; public MetadataService.PackageVersion[] packageVersions; - private String[] apiVersion_type_info = new String[]{'apiVersion','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata','PackageVersion','0','-1','false'}; + private String[] apiVersion_type_info = new String[]{'apiVersion','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apiVersion','description','label','packageVersions'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'content', 'apiVersion','description','label','packageVersions'}; } - public class BaseSharingRule { - public MetadataService.SharedTo sharedTo; - private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata','SharedTo','1','1','false'}; + public class updateMetadataResponse_element { + public MetadataService.SaveResult[] result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'sharedTo'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class WorkflowKnowledgePublish { + public class WorkflowKnowledgePublish extends WorkflowAction { + public String type = 'WorkflowKnowledgePublish'; + public String fullName; public String action; public String description; public String label; public String language; public Boolean protected_x; - private String[] action_type_info = new String[]{'action','http://soap.sforce.com/2006/04/metadata','KnowledgeWorkflowAction','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] language_type_info = new String[]{'language','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] protected_x_type_info = new String[]{'protected','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + private String[] action_type_info = new String[]{'action','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'action','description','label','language','protected_x'}; + } + public class FlexiPage extends Metadata { + public String type = 'FlexiPage'; + public String fullName; + public String description; + public MetadataService.FlexiPageRegion[] flexiPageRegions; + public String masterLabel; + public String pageTemplate; + public MetadataService.PlatformActionList platformActionlist; + public MetadataService.QuickActionList quickActionList; + public String sobjectType; + public String type_x; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] flexiPageRegions_type_info = new String[]{'flexiPageRegions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] pageTemplate_type_info = new String[]{'pageTemplate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] platformActionlist_type_info = new String[]{'platformActionlist','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] quickActionList_type_info = new String[]{'quickActionList','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sobjectType_type_info = new String[]{'sobjectType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'description','flexiPageRegions','masterLabel','pageTemplate','platformActionlist','quickActionList','sobjectType','type_x'}; + } + public class ConnectedAppSamlConfig { + public String acsUrl; + public String certificate; + public String encryptionCertificate; + public String encryptionType; + public String entityUrl; + public String issuer; + public String samlNameIdFormat; + public String samlSubjectCustomAttr; + public String samlSubjectType; + private String[] acsUrl_type_info = new String[]{'acsUrl','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] certificate_type_info = new String[]{'certificate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] encryptionCertificate_type_info = new String[]{'encryptionCertificate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] encryptionType_type_info = new String[]{'encryptionType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] entityUrl_type_info = new String[]{'entityUrl','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] issuer_type_info = new String[]{'issuer','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] samlNameIdFormat_type_info = new String[]{'samlNameIdFormat','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] samlSubjectCustomAttr_type_info = new String[]{'samlSubjectCustomAttr','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] samlSubjectType_type_info = new String[]{'samlSubjectType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'acsUrl','certificate','encryptionCertificate','encryptionType','entityUrl','issuer','samlNameIdFormat','samlSubjectCustomAttr','samlSubjectType'}; + } + public class FlowWait { + public MetadataService.FlowConnector defaultConnector; + public String defaultConnectorLabel; + public MetadataService.FlowConnector faultConnector; + public MetadataService.FlowWaitEvent[] waitEvents; + private String[] defaultConnector_type_info = new String[]{'defaultConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultConnectorLabel_type_info = new String[]{'defaultConnectorLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] waitEvents_type_info = new String[]{'waitEvents','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'action','description','label','language','protected_x'}; + private String[] field_order_type_info = new String[]{'defaultConnector','defaultConnectorLabel','faultConnector','waitEvents'}; + } + public class createMetadata_element { + public MetadataService.Metadata[] metadata; + private String[] metadata_type_info = new String[]{'metadata','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'metadata'}; } - public class Workflow { + public class Workflow extends Metadata { + public String type = 'Workflow'; + public String fullName; public MetadataService.WorkflowAlert[] alerts; public MetadataService.WorkflowFieldUpdate[] fieldUpdates; + public MetadataService.WorkflowFlowAction[] flowActions; public MetadataService.WorkflowKnowledgePublish[] knowledgePublishes; public MetadataService.WorkflowOutboundMessage[] outboundMessages; public MetadataService.WorkflowRule[] rules; public MetadataService.WorkflowSend[] send; public MetadataService.WorkflowTask[] tasks; - private String[] alerts_type_info = new String[]{'alerts','http://soap.sforce.com/2006/04/metadata','WorkflowAlert','0','-1','false'}; - private String[] fieldUpdates_type_info = new String[]{'fieldUpdates','http://soap.sforce.com/2006/04/metadata','WorkflowFieldUpdate','0','-1','false'}; - private String[] knowledgePublishes_type_info = new String[]{'knowledgePublishes','http://soap.sforce.com/2006/04/metadata','WorkflowKnowledgePublish','0','-1','false'}; - private String[] outboundMessages_type_info = new String[]{'outboundMessages','http://soap.sforce.com/2006/04/metadata','WorkflowOutboundMessage','0','-1','false'}; - private String[] rules_type_info = new String[]{'rules','http://soap.sforce.com/2006/04/metadata','WorkflowRule','0','-1','false'}; - private String[] send_type_info = new String[]{'send','http://soap.sforce.com/2006/04/metadata','WorkflowSend','0','-1','false'}; - private String[] tasks_type_info = new String[]{'tasks','http://soap.sforce.com/2006/04/metadata','WorkflowTask','0','-1','false'}; + private String[] alerts_type_info = new String[]{'alerts','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] fieldUpdates_type_info = new String[]{'fieldUpdates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] flowActions_type_info = new String[]{'flowActions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] knowledgePublishes_type_info = new String[]{'knowledgePublishes','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] outboundMessages_type_info = new String[]{'outboundMessages','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] rules_type_info = new String[]{'rules','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] send_type_info = new String[]{'send','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] tasks_type_info = new String[]{'tasks','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'alerts','fieldUpdates','knowledgePublishes','outboundMessages','rules','send','tasks'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'alerts','fieldUpdates','flowActions','knowledgePublishes','outboundMessages','rules','send','tasks'}; } public class AddressSettings extends Metadata { - public String type = 'AddressSettings'; - public String fullName; + public String type = 'AddressSettings'; + public String fullName; public MetadataService.CountriesAndStates countriesAndStates; - private String[] type_att_info = new String[]{'xsi:type'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] countriesAndStates_type_info = new String[]{'countriesAndStates','http://soap.sforce.com/2006/04/metadata','CountriesAndStates','1','1','false'}; + private String[] countriesAndStates_type_info = new String[]{'countriesAndStates','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; private String[] field_order_type_info = new String[]{'fullName', 'countriesAndStates'}; } + public class LicenseDefinition extends Metadata { + public String type = 'LicenseDefinition'; + public String fullName; + public String aggregationGroup; + public String description; + public Boolean isPublished; + public String label; + public MetadataService.LicensedCustomPermissions[] licensedCustomPermissions; + public String licensingAuthority; + public String licensingAuthorityProvider; + public Integer minPlatformVersion; + public String origin; + public Integer revision; + public Integer trialLicenseDuration; + public Integer trialLicenseQuantity; + private String[] aggregationGroup_type_info = new String[]{'aggregationGroup','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isPublished_type_info = new String[]{'isPublished','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] licensedCustomPermissions_type_info = new String[]{'licensedCustomPermissions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] licensingAuthority_type_info = new String[]{'licensingAuthority','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] licensingAuthorityProvider_type_info = new String[]{'licensingAuthorityProvider','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] minPlatformVersion_type_info = new String[]{'minPlatformVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] origin_type_info = new String[]{'origin','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] revision_type_info = new String[]{'revision','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] trialLicenseDuration_type_info = new String[]{'trialLicenseDuration','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] trialLicenseQuantity_type_info = new String[]{'trialLicenseQuantity','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'aggregationGroup','description','isPublished','label','licensedCustomPermissions','licensingAuthority','licensingAuthorityProvider','minPlatformVersion','origin','revision','trialLicenseDuration','trialLicenseQuantity'}; + } public class FlowChoice { public String choiceText; public String dataType; public MetadataService.FlowChoiceUserInput userInput; public MetadataService.FlowElementReferenceOrValue value; - private String[] choiceText_type_info = new String[]{'choiceText','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata','FlowDataType','1','1','false'}; - private String[] userInput_type_info = new String[]{'userInput','http://soap.sforce.com/2006/04/metadata','FlowChoiceUserInput','0','1','false'}; - private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata','FlowElementReferenceOrValue','0','1','false'}; + private String[] choiceText_type_info = new String[]{'choiceText','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] userInput_type_info = new String[]{'userInput','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'choiceText','dataType','userInput','value'}; } public class ProfileExternalDataSourceAccess { public Boolean enabled; public String externalDataSource; - private String[] enabled_type_info = new String[]{'enabled','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] externalDataSource_type_info = new String[]{'externalDataSource','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] enabled_type_info = new String[]{'enabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] externalDataSource_type_info = new String[]{'externalDataSource','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'enabled','externalDataSource'}; } + public class FeedLayoutComponent { + public String componentType; + public Integer height; + public String page_x; + private String[] componentType_type_info = new String[]{'componentType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] page_x_type_info = new String[]{'page','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'componentType','height','page_x'}; + } + public class Territory2Settings extends Metadata { + public String type = 'Territory2Settings'; + public String fullName; + public String defaultAccountAccessLevel; + public String defaultCaseAccessLevel; + public String defaultContactAccessLevel; + public String defaultOpportunityAccessLevel; + public MetadataService.Territory2SettingsOpportunityFilter opportunityFilterSettings; + private String[] defaultAccountAccessLevel_type_info = new String[]{'defaultAccountAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultCaseAccessLevel_type_info = new String[]{'defaultCaseAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultContactAccessLevel_type_info = new String[]{'defaultContactAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultOpportunityAccessLevel_type_info = new String[]{'defaultOpportunityAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] opportunityFilterSettings_type_info = new String[]{'opportunityFilterSettings','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'defaultAccountAccessLevel','defaultCaseAccessLevel','defaultContactAccessLevel','defaultOpportunityAccessLevel','opportunityFilterSettings'}; + } public class CallCenterItem { public String label; public String name; public String value; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'label','name','value'}; } - public class FlowStep { - public MetadataService.FlowConnector[] connectors; - private String[] connectors_type_info = new String[]{'connectors','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'connectors'}; - } public class ApprovalAction { public MetadataService.WorkflowActionReference[] action; - private String[] action_type_info = new String[]{'action','http://soap.sforce.com/2006/04/metadata','WorkflowActionReference','0','-1','false'}; + private String[] action_type_info = new String[]{'action','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'action'}; } + public class FlowStep { + public MetadataService.FlowConnector[] connectors; + private String[] connectors_type_info = new String[]{'connectors','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'connectors'}; + } public class ProfileObjectPermissions { public Boolean allowCreate; public Boolean allowDelete; @@ -3661,57 +5021,57 @@ public class MetadataService { public Boolean modifyAllRecords; public String object_x; public Boolean viewAllRecords; - private String[] allowCreate_type_info = new String[]{'allowCreate','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] allowDelete_type_info = new String[]{'allowDelete','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] allowEdit_type_info = new String[]{'allowEdit','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] allowRead_type_info = new String[]{'allowRead','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] modifyAllRecords_type_info = new String[]{'modifyAllRecords','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] object_x_type_info = new String[]{'object','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] viewAllRecords_type_info = new String[]{'viewAllRecords','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + private String[] allowCreate_type_info = new String[]{'allowCreate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] allowDelete_type_info = new String[]{'allowDelete','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] allowEdit_type_info = new String[]{'allowEdit','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] allowRead_type_info = new String[]{'allowRead','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] modifyAllRecords_type_info = new String[]{'modifyAllRecords','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] object_x_type_info = new String[]{'object','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] viewAllRecords_type_info = new String[]{'viewAllRecords','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'allowCreate','allowDelete','allowEdit','allowRead','modifyAllRecords','object_x','viewAllRecords'}; } - public class SecuritySettings { + public class SecuritySettings extends Metadata { + public String type = 'SecuritySettings'; + public String fullName; public MetadataService.NetworkAccess networkAccess; public MetadataService.PasswordPolicies passwordPolicies; public MetadataService.SessionSettings sessionSettings; - private String[] networkAccess_type_info = new String[]{'networkAccess','http://soap.sforce.com/2006/04/metadata','NetworkAccess','0','1','false'}; - private String[] passwordPolicies_type_info = new String[]{'passwordPolicies','http://soap.sforce.com/2006/04/metadata','PasswordPolicies','0','1','false'}; - private String[] sessionSettings_type_info = new String[]{'sessionSettings','http://soap.sforce.com/2006/04/metadata','SessionSettings','0','1','false'}; + private String[] networkAccess_type_info = new String[]{'networkAccess','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] passwordPolicies_type_info = new String[]{'passwordPolicies','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sessionSettings_type_info = new String[]{'sessionSettings','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'networkAccess','passwordPolicies','sessionSettings'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'networkAccess','passwordPolicies','sessionSettings'}; } public class WorkflowTimeTrigger { public MetadataService.WorkflowActionReference[] actions; public String offsetFromField; public String timeLength; public String workflowTimeTriggerUnit; - private String[] actions_type_info = new String[]{'actions','http://soap.sforce.com/2006/04/metadata','WorkflowActionReference','0','-1','false'}; - private String[] offsetFromField_type_info = new String[]{'offsetFromField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] timeLength_type_info = new String[]{'timeLength','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] workflowTimeTriggerUnit_type_info = new String[]{'workflowTimeTriggerUnit','http://soap.sforce.com/2006/04/metadata','WorkflowTimeUnits','1','1','false'}; + private String[] actions_type_info = new String[]{'actions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] offsetFromField_type_info = new String[]{'offsetFromField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] timeLength_type_info = new String[]{'timeLength','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] workflowTimeTriggerUnit_type_info = new String[]{'workflowTimeTriggerUnit','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'actions','offsetFromField','timeLength','workflowTimeTriggerUnit'}; } - public class updateResponse_element { - public MetadataService.AsyncResult[] result; - private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata','AsyncResult','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'result'}; - } public class retrieve_element { public MetadataService.RetrieveRequest retrieveRequest; - private String[] retrieveRequest_type_info = new String[]{'retrieveRequest','http://soap.sforce.com/2006/04/metadata','RetrieveRequest','1','1','false'}; + private String[] retrieveRequest_type_info = new String[]{'retrieveRequest','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'retrieveRequest'}; } - public class PermissionSetExternalDataSourceAccess { - public Boolean enabled; - public String externalDataSource; - private String[] enabled_type_info = new String[]{'enabled','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] externalDataSource_type_info = new String[]{'externalDataSource','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class AccountSharingRuleSettings { + public String caseAccessLevel; + public String contactAccessLevel; + public String opportunityAccessLevel; + private String[] caseAccessLevel_type_info = new String[]{'caseAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] contactAccessLevel_type_info = new String[]{'contactAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] opportunityAccessLevel_type_info = new String[]{'opportunityAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enabled','externalDataSource'}; + private String[] field_order_type_info = new String[]{'caseAccessLevel','contactAccessLevel','opportunityAccessLevel'}; } public class KnowledgeLanguage { public Boolean active; @@ -3720,15 +5080,23 @@ public class MetadataService { public String defaultReviewer; public String defaultReviewerType; public String name; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] defaultAssignee_type_info = new String[]{'defaultAssignee','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] defaultAssigneeType_type_info = new String[]{'defaultAssigneeType','http://soap.sforce.com/2006/04/metadata','KnowledgeLanguageLookupValueType','0','1','false'}; - private String[] defaultReviewer_type_info = new String[]{'defaultReviewer','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] defaultReviewerType_type_info = new String[]{'defaultReviewerType','http://soap.sforce.com/2006/04/metadata','KnowledgeLanguageLookupValueType','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultAssignee_type_info = new String[]{'defaultAssignee','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultAssigneeType_type_info = new String[]{'defaultAssigneeType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultReviewer_type_info = new String[]{'defaultReviewer','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultReviewerType_type_info = new String[]{'defaultReviewerType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'active','defaultAssignee','defaultAssigneeType','defaultReviewer','defaultReviewerType','name'}; } + public class PermissionSetExternalDataSourceAccess { + public Boolean enabled; + public String externalDataSource; + private String[] enabled_type_info = new String[]{'enabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] externalDataSource_type_info = new String[]{'externalDataSource','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'enabled','externalDataSource'}; + } public class DescribeMetadataObject { public String[] childXmlNames; public String directoryName; @@ -3736,94 +5104,172 @@ public class MetadataService { public Boolean metaFile; public String suffix; public String xmlName; - private String[] childXmlNames_type_info = new String[]{'childXmlNames','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] directoryName_type_info = new String[]{'directoryName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] inFolder_type_info = new String[]{'inFolder','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] metaFile_type_info = new String[]{'metaFile','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] suffix_type_info = new String[]{'suffix','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] xmlName_type_info = new String[]{'xmlName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] childXmlNames_type_info = new String[]{'childXmlNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] directoryName_type_info = new String[]{'directoryName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] inFolder_type_info = new String[]{'inFolder','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] metaFile_type_info = new String[]{'metaFile','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] suffix_type_info = new String[]{'suffix','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] xmlName_type_info = new String[]{'xmlName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'childXmlNames','directoryName','inFolder','metaFile','suffix','xmlName'}; } - public class createResponse_element { - public MetadataService.AsyncResult[] result; - private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata','AsyncResult','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'result'}; - } public class LiveChatButtonSkills { public String[] skill; - private String[] skill_type_info = new String[]{'skill','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + private String[] skill_type_info = new String[]{'skill','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'skill'}; } public class LayoutColumn { public MetadataService.LayoutItem[] layoutItems; public String reserved; - private String[] layoutItems_type_info = new String[]{'layoutItems','http://soap.sforce.com/2006/04/metadata','LayoutItem','0','-1','false'}; - private String[] reserved_type_info = new String[]{'reserved','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] layoutItems_type_info = new String[]{'layoutItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] reserved_type_info = new String[]{'reserved','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'layoutItems','reserved'}; } + public class NamedCredential extends Metadata { + public String type = 'NamedCredential'; + public String fullName; + public String authProvider; + public String certificate; + public String endpoint; + public String label; + public String oauthRefreshToken; + public String oauthScope; + public String oauthToken; + public String password; + public String principalType; + public String protocol; + public String username; + private String[] authProvider_type_info = new String[]{'authProvider','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] certificate_type_info = new String[]{'certificate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] endpoint_type_info = new String[]{'endpoint','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] oauthRefreshToken_type_info = new String[]{'oauthRefreshToken','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] oauthScope_type_info = new String[]{'oauthScope','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] oauthToken_type_info = new String[]{'oauthToken','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] password_type_info = new String[]{'password','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] principalType_type_info = new String[]{'principalType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] protocol_type_info = new String[]{'protocol','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] username_type_info = new String[]{'username','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'authProvider','certificate','endpoint','label','oauthRefreshToken','oauthScope','oauthToken','password','principalType','protocol','username'}; + } public class PermissionSetTabSetting { public String tab; public String visibility; - private String[] tab_type_info = new String[]{'tab','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] visibility_type_info = new String[]{'visibility','http://soap.sforce.com/2006/04/metadata','PermissionSetTabVisibility','1','1','false'}; + private String[] tab_type_info = new String[]{'tab','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] visibility_type_info = new String[]{'visibility','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'tab','visibility'}; } public class SkillUserAssignments { public String[] user_x; - private String[] user_x_type_info = new String[]{'user','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + private String[] user_x_type_info = new String[]{'user','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'user_x'}; } - public class AuthProvider { - public String consumerKey; - public String consumerSecret; - public String errorUrl; - public String executionUser; - public String friendlyName; + public class PostTemplate extends Metadata { + public String type = 'PostTemplate'; + public String fullName; + public Boolean default_x; + public String description; + public String[] fields; + public String label; + private String[] default_x_type_info = new String[]{'default','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'default_x','description','fields','label'}; + } + public class RelatedContentItem { + public MetadataService.LayoutItem layoutItem; + private String[] layoutItem_type_info = new String[]{'layoutItem','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'layoutItem'}; + } + public class FieldValue { + public String name; + public String value; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'1','1','true'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'name','value'}; + } + public class AuthProvider extends Metadata { + public String type = 'AuthProvider'; + public String fullName; + public String authorizeUrl; + public String consumerKey; + public String consumerSecret; + public String defaultScopes; + public String errorUrl; + public String executionUser; + public String friendlyName; + public String iconUrl; + public String idTokenIssuer; + public Boolean includeOrgIdInIdentifier; + public String logoutUrl; public String portal; public String providerType; public String registrationHandler; - private String[] consumerKey_type_info = new String[]{'consumerKey','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] consumerSecret_type_info = new String[]{'consumerSecret','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] errorUrl_type_info = new String[]{'errorUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] executionUser_type_info = new String[]{'executionUser','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] friendlyName_type_info = new String[]{'friendlyName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] portal_type_info = new String[]{'portal','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] providerType_type_info = new String[]{'providerType','http://soap.sforce.com/2006/04/metadata','AuthProviderType','1','1','false'}; - private String[] registrationHandler_type_info = new String[]{'registrationHandler','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'consumerKey','consumerSecret','errorUrl','executionUser','friendlyName','portal','providerType','registrationHandler'}; - } - public class NamedFilter { - public Boolean active; - public String booleanFilter; - public String description; - public String errorMessage; - public String field; - public MetadataService.FilterItem[] filterItems; - public String infoMessage; - public Boolean isOptional; - public String name; - public String sourceObject; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] errorMessage_type_info = new String[]{'errorMessage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] filterItems_type_info = new String[]{'filterItems','http://soap.sforce.com/2006/04/metadata','FilterItem','0','-1','false'}; - private String[] infoMessage_type_info = new String[]{'infoMessage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] isOptional_type_info = new String[]{'isOptional','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] sourceObject_type_info = new String[]{'sourceObject','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','booleanFilter','description','errorMessage','field','filterItems','infoMessage','isOptional','name','sourceObject'}; - } - public class WorkflowTask { + public Boolean sendAccessTokenInHeader; + public Boolean sendClientCredentialsInHeader; + public String tokenUrl; + public String userInfoUrl; + private String[] authorizeUrl_type_info = new String[]{'authorizeUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] consumerKey_type_info = new String[]{'consumerKey','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] consumerSecret_type_info = new String[]{'consumerSecret','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultScopes_type_info = new String[]{'defaultScopes','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] errorUrl_type_info = new String[]{'errorUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] executionUser_type_info = new String[]{'executionUser','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] friendlyName_type_info = new String[]{'friendlyName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] iconUrl_type_info = new String[]{'iconUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] idTokenIssuer_type_info = new String[]{'idTokenIssuer','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] includeOrgIdInIdentifier_type_info = new String[]{'includeOrgIdInIdentifier','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] logoutUrl_type_info = new String[]{'logoutUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] portal_type_info = new String[]{'portal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] providerType_type_info = new String[]{'providerType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] registrationHandler_type_info = new String[]{'registrationHandler','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sendAccessTokenInHeader_type_info = new String[]{'sendAccessTokenInHeader','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sendClientCredentialsInHeader_type_info = new String[]{'sendClientCredentialsInHeader','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] tokenUrl_type_info = new String[]{'tokenUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] userInfoUrl_type_info = new String[]{'userInfoUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'authorizeUrl','consumerKey','consumerSecret','defaultScopes','errorUrl','executionUser','friendlyName','iconUrl','idTokenIssuer','includeOrgIdInIdentifier','logoutUrl','portal','providerType','registrationHandler','sendAccessTokenInHeader','sendClientCredentialsInHeader','tokenUrl','userInfoUrl'}; + } + public class DescribeValueTypeResult { + public MetadataService.ValueTypeField[] valueTypeFields; + private String[] valueTypeFields_type_info = new String[]{'valueTypeFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'valueTypeFields'}; + } + public class describeValueTypeResponse_element { + public MetadataService.DescribeValueTypeResult result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReputationLevel { + public MetadataService.ReputationBranding branding; + public String label; + public Double lowerThreshold; + private String[] branding_type_info = new String[]{'branding','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lowerThreshold_type_info = new String[]{'lowerThreshold','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'branding','label','lowerThreshold'}; + } + public class WorkflowTask extends WorkflowAction { + public String type = 'WorkflowTask'; + public String fullName; public String assignedTo; public String assignedToType; public String description; @@ -3834,1759 +5280,4641 @@ public class MetadataService { public Boolean protected_x; public String status; public String subject; - private String[] assignedTo_type_info = new String[]{'assignedTo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] assignedToType_type_info = new String[]{'assignedToType','http://soap.sforce.com/2006/04/metadata','ActionTaskAssignedToTypes','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] dueDateOffset_type_info = new String[]{'dueDateOffset','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] notifyAssignee_type_info = new String[]{'notifyAssignee','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] offsetFromField_type_info = new String[]{'offsetFromField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] priority_type_info = new String[]{'priority','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] protected_x_type_info = new String[]{'protected','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] status_type_info = new String[]{'status','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] subject_type_info = new String[]{'subject','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'assignedTo','assignedToType','description','dueDateOffset','notifyAssignee','offsetFromField','priority','protected_x','status','subject'}; + private String[] assignedTo_type_info = new String[]{'assignedTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] assignedToType_type_info = new String[]{'assignedToType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] dueDateOffset_type_info = new String[]{'dueDateOffset','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] notifyAssignee_type_info = new String[]{'notifyAssignee','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] offsetFromField_type_info = new String[]{'offsetFromField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] priority_type_info = new String[]{'priority','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] status_type_info = new String[]{'status','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] subject_type_info = new String[]{'subject','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'assignedTo','assignedToType','description','dueDateOffset','notifyAssignee','offsetFromField','priority','protected_x','status','subject'}; } public class NextAutomatedApprover { public Boolean useApproverFieldOfRecordOwner; public String userHierarchyField; - private String[] useApproverFieldOfRecordOwner_type_info = new String[]{'useApproverFieldOfRecordOwner','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] userHierarchyField_type_info = new String[]{'userHierarchyField','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] useApproverFieldOfRecordOwner_type_info = new String[]{'useApproverFieldOfRecordOwner','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] userHierarchyField_type_info = new String[]{'userHierarchyField','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'useApproverFieldOfRecordOwner','userHierarchyField'}; } + public class ChannelLayout { + public String[] enabledChannels; + public String label; + public MetadataService.ChannelLayoutItem[] layoutItems; + private String[] enabledChannels_type_info = new String[]{'enabledChannels','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] layoutItems_type_info = new String[]{'layoutItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'enabledChannels','label','layoutItems'}; + } + public class readMetadata_element { + public String type_x; + public String[] fullNames; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] fullNames_type_info = new String[]{'fullNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'type_x','fullNames'}; + } public class ReportAggregateReference { public String aggregate; - private String[] aggregate_type_info = new String[]{'aggregate','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + private String[] aggregate_type_info = new String[]{'aggregate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'aggregate'}; } - public class ApprovalProcess { - public Boolean active; - public Boolean allowRecall; - public MetadataService.ApprovalSubmitter[] allowedSubmitters; - public MetadataService.ApprovalPageField approvalPageFields; - public MetadataService.ApprovalStep[] approvalStep; - public String description; - public String emailTemplate; - public Boolean enableMobileDeviceAccess; - public MetadataService.ApprovalEntryCriteria entryCriteria; - public MetadataService.ApprovalAction finalApprovalActions; - public Boolean finalApprovalRecordLock; - public MetadataService.ApprovalAction finalRejectionActions; - public Boolean finalRejectionRecordLock; - public MetadataService.ApprovalAction initialSubmissionActions; - public String label; - public MetadataService.NextAutomatedApprover nextAutomatedApprover; - public String postTemplate; - public MetadataService.ApprovalAction recallActions; - public String recordEditability; - public Boolean showApprovalHistory; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] allowRecall_type_info = new String[]{'allowRecall','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] allowedSubmitters_type_info = new String[]{'allowedSubmitters','http://soap.sforce.com/2006/04/metadata','ApprovalSubmitter','0','-1','false'}; - private String[] approvalPageFields_type_info = new String[]{'approvalPageFields','http://soap.sforce.com/2006/04/metadata','ApprovalPageField','0','1','false'}; - private String[] approvalStep_type_info = new String[]{'approvalStep','http://soap.sforce.com/2006/04/metadata','ApprovalStep','0','-1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] emailTemplate_type_info = new String[]{'emailTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] enableMobileDeviceAccess_type_info = new String[]{'enableMobileDeviceAccess','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] entryCriteria_type_info = new String[]{'entryCriteria','http://soap.sforce.com/2006/04/metadata','ApprovalEntryCriteria','0','1','false'}; - private String[] finalApprovalActions_type_info = new String[]{'finalApprovalActions','http://soap.sforce.com/2006/04/metadata','ApprovalAction','0','1','false'}; - private String[] finalApprovalRecordLock_type_info = new String[]{'finalApprovalRecordLock','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] finalRejectionActions_type_info = new String[]{'finalRejectionActions','http://soap.sforce.com/2006/04/metadata','ApprovalAction','0','1','false'}; - private String[] finalRejectionRecordLock_type_info = new String[]{'finalRejectionRecordLock','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] initialSubmissionActions_type_info = new String[]{'initialSubmissionActions','http://soap.sforce.com/2006/04/metadata','ApprovalAction','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] nextAutomatedApprover_type_info = new String[]{'nextAutomatedApprover','http://soap.sforce.com/2006/04/metadata','NextAutomatedApprover','0','1','false'}; - private String[] postTemplate_type_info = new String[]{'postTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] recallActions_type_info = new String[]{'recallActions','http://soap.sforce.com/2006/04/metadata','ApprovalAction','0','1','false'}; - private String[] recordEditability_type_info = new String[]{'recordEditability','http://soap.sforce.com/2006/04/metadata','RecordEditabilityType','1','1','false'}; - private String[] showApprovalHistory_type_info = new String[]{'showApprovalHistory','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','allowRecall','allowedSubmitters','approvalPageFields','approvalStep','description','emailTemplate','enableMobileDeviceAccess','entryCriteria','finalApprovalActions','finalApprovalRecordLock','finalRejectionActions','finalRejectionRecordLock','initialSubmissionActions','label','nextAutomatedApprover','postTemplate','recallActions','recordEditability','showApprovalHistory'}; - } - public class MilestoneType { - public String description; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'description'}; + public interface IReadResult { + MetadataService.Metadata[] getRecords(); } - public class FileProperties { - public String createdById; - public String createdByName; - public DateTime createdDate; - public String fileName; - public String fullName; - public String id; - public String lastModifiedById; - public String lastModifiedByName; - public DateTime lastModifiedDate; - public String manageableState; - public String namespacePrefix; - public String type_x; - private String[] createdById_type_info = new String[]{'createdById','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] createdByName_type_info = new String[]{'createdByName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] createdDate_type_info = new String[]{'createdDate','http://www.w3.org/2001/XMLSchema','dateTime','1','1','false'}; - private String[] fileName_type_info = new String[]{'fileName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] id_type_info = new String[]{'id','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] lastModifiedById_type_info = new String[]{'lastModifiedById','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] lastModifiedByName_type_info = new String[]{'lastModifiedByName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] lastModifiedDate_type_info = new String[]{'lastModifiedDate','http://www.w3.org/2001/XMLSchema','dateTime','1','1','false'}; - private String[] manageableState_type_info = new String[]{'manageableState','http://soap.sforce.com/2006/04/metadata','ManageableState','0','1','false'}; - private String[] namespacePrefix_type_info = new String[]{'namespacePrefix','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public interface IReadResponseElement { + IReadResult getResult(); + } + public class ReadCustomSiteResult implements IReadResult { + public MetadataService.CustomSite[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'createdById','createdByName','createdDate','fileName','fullName','id','lastModifiedById','lastModifiedByName','lastModifiedDate','manageableState','namespacePrefix','type_x'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class QuickActionLayout { - public String layoutSectionStyle; - public MetadataService.QuickActionLayoutColumn[] quickActionLayoutColumns; - private String[] layoutSectionStyle_type_info = new String[]{'layoutSectionStyle','http://soap.sforce.com/2006/04/metadata','LayoutSectionStyle','1','1','false'}; - private String[] quickActionLayoutColumns_type_info = new String[]{'quickActionLayoutColumns','http://soap.sforce.com/2006/04/metadata','QuickActionLayoutColumn','0','-1','false'}; + public class readCustomSiteResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomSiteResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'layoutSectionStyle','quickActionLayoutColumns'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class Flow { - public MetadataService.FlowApexPluginCall[] apexPluginCalls; - public MetadataService.FlowAssignment[] assignments; - public MetadataService.FlowChoice[] choices; - public MetadataService.FlowConstant[] constants; - public MetadataService.FlowDecision[] decisions; - public String description; - public MetadataService.FlowDynamicChoiceSet[] dynamicChoiceSets; - public MetadataService.FlowFormula[] formulas; - public String label; - public MetadataService.FlowRecordCreate[] recordCreates; - public MetadataService.FlowRecordDelete[] recordDeletes; - public MetadataService.FlowRecordLookup[] recordLookups; - public MetadataService.FlowRecordUpdate[] recordUpdates; - public MetadataService.FlowScreen[] screens; - public String startElementReference; - public MetadataService.FlowStep[] steps; - public MetadataService.FlowSubflow[] subflows; - public MetadataService.FlowTextTemplate[] textTemplates; - public MetadataService.FlowVariable[] variables; - private String[] apexPluginCalls_type_info = new String[]{'apexPluginCalls','http://soap.sforce.com/2006/04/metadata','FlowApexPluginCall','0','-1','false'}; - private String[] assignments_type_info = new String[]{'assignments','http://soap.sforce.com/2006/04/metadata','FlowAssignment','0','-1','false'}; - private String[] choices_type_info = new String[]{'choices','http://soap.sforce.com/2006/04/metadata','FlowChoice','0','-1','false'}; - private String[] constants_type_info = new String[]{'constants','http://soap.sforce.com/2006/04/metadata','FlowConstant','0','-1','false'}; - private String[] decisions_type_info = new String[]{'decisions','http://soap.sforce.com/2006/04/metadata','FlowDecision','0','-1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] dynamicChoiceSets_type_info = new String[]{'dynamicChoiceSets','http://soap.sforce.com/2006/04/metadata','FlowDynamicChoiceSet','0','-1','false'}; - private String[] formulas_type_info = new String[]{'formulas','http://soap.sforce.com/2006/04/metadata','FlowFormula','0','-1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] recordCreates_type_info = new String[]{'recordCreates','http://soap.sforce.com/2006/04/metadata','FlowRecordCreate','0','-1','false'}; - private String[] recordDeletes_type_info = new String[]{'recordDeletes','http://soap.sforce.com/2006/04/metadata','FlowRecordDelete','0','-1','false'}; - private String[] recordLookups_type_info = new String[]{'recordLookups','http://soap.sforce.com/2006/04/metadata','FlowRecordLookup','0','-1','false'}; - private String[] recordUpdates_type_info = new String[]{'recordUpdates','http://soap.sforce.com/2006/04/metadata','FlowRecordUpdate','0','-1','false'}; - private String[] screens_type_info = new String[]{'screens','http://soap.sforce.com/2006/04/metadata','FlowScreen','0','-1','false'}; - private String[] startElementReference_type_info = new String[]{'startElementReference','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] steps_type_info = new String[]{'steps','http://soap.sforce.com/2006/04/metadata','FlowStep','0','-1','false'}; - private String[] subflows_type_info = new String[]{'subflows','http://soap.sforce.com/2006/04/metadata','FlowSubflow','0','-1','false'}; - private String[] textTemplates_type_info = new String[]{'textTemplates','http://soap.sforce.com/2006/04/metadata','FlowTextTemplate','0','-1','false'}; - private String[] variables_type_info = new String[]{'variables','http://soap.sforce.com/2006/04/metadata','FlowVariable','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apexPluginCalls','assignments','choices','constants','decisions','description','dynamicChoiceSets','formulas','label','recordCreates','recordDeletes','recordLookups','recordUpdates','screens','startElementReference','steps','subflows','textTemplates','variables'}; - } - public class AutoResponseRule { - public Boolean active; - public MetadataService.RuleEntry[] ruleEntry; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] ruleEntry_type_info = new String[]{'ruleEntry','http://soap.sforce.com/2006/04/metadata','RuleEntry','0','-1','false'}; + public class ReadListViewResult implements IReadResult { + public MetadataService.ListView[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','ruleEntry'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class ReportCrossFilter { - public MetadataService.ReportFilterItem[] criteriaItems; - public String operation; - public String primaryTableColumn; - public String relatedTable; - public String relatedTableJoinColumn; - private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata','ReportFilterItem','0','-1','false'}; - private String[] operation_type_info = new String[]{'operation','http://soap.sforce.com/2006/04/metadata','ObjectFilterOperator','1','1','false'}; - private String[] primaryTableColumn_type_info = new String[]{'primaryTableColumn','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] relatedTable_type_info = new String[]{'relatedTable','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] relatedTableJoinColumn_type_info = new String[]{'relatedTableJoinColumn','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class readListViewResponse_element implements IReadResponseElement { + public MetadataService.ReadListViewResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'criteriaItems','operation','primaryTableColumn','relatedTable','relatedTableJoinColumn'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class PermissionSetObjectPermissions { - public Boolean allowCreate; - public Boolean allowDelete; - public Boolean allowEdit; - public Boolean allowRead; - public Boolean modifyAllRecords; - public String object_x; - public Boolean viewAllRecords; - private String[] allowCreate_type_info = new String[]{'allowCreate','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] allowDelete_type_info = new String[]{'allowDelete','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] allowEdit_type_info = new String[]{'allowEdit','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] allowRead_type_info = new String[]{'allowRead','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] modifyAllRecords_type_info = new String[]{'modifyAllRecords','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] object_x_type_info = new String[]{'object','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] viewAllRecords_type_info = new String[]{'viewAllRecords','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + public class ReadInstalledPackageResult implements IReadResult { + public MetadataService.InstalledPackage[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'allowCreate','allowDelete','allowEdit','allowRead','modifyAllRecords','object_x','viewAllRecords'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class Report { - public MetadataService.ReportAggregate[] aggregates; - public MetadataService.Report[] block; - public MetadataService.ReportBlockInfo blockInfo; - public MetadataService.ReportBucketField[] buckets; - public MetadataService.ReportChart chart; - public MetadataService.ReportColorRange[] colorRanges; - public MetadataService.ReportColumn[] columns; - public MetadataService.ReportCrossFilter[] crossFilters; - public String currency_x; - public String description; - public String division; - public MetadataService.ReportFilter filter; - public String format; - public MetadataService.ReportGrouping[] groupingsAcross; - public MetadataService.ReportGrouping[] groupingsDown; - public String name; - public MetadataService.ReportParam[] params; - public String reportType; - public String roleHierarchyFilter; - public Integer rowLimit; - public String scope; - public Boolean showDetails; - public String sortColumn; - public String sortOrder; - public String territoryHierarchyFilter; - public MetadataService.ReportTimeFrameFilter timeFrameFilter; - public String userFilter; - private String[] aggregates_type_info = new String[]{'aggregates','http://soap.sforce.com/2006/04/metadata','ReportAggregate','0','-1','false'}; - private String[] block_type_info = new String[]{'block','http://soap.sforce.com/2006/04/metadata','Report','0','-1','false'}; - private String[] blockInfo_type_info = new String[]{'blockInfo','http://soap.sforce.com/2006/04/metadata','ReportBlockInfo','0','1','false'}; - private String[] buckets_type_info = new String[]{'buckets','http://soap.sforce.com/2006/04/metadata','ReportBucketField','0','-1','false'}; - private String[] chart_type_info = new String[]{'chart','http://soap.sforce.com/2006/04/metadata','ReportChart','0','1','false'}; - private String[] colorRanges_type_info = new String[]{'colorRanges','http://soap.sforce.com/2006/04/metadata','ReportColorRange','0','-1','false'}; - private String[] columns_type_info = new String[]{'columns','http://soap.sforce.com/2006/04/metadata','ReportColumn','0','-1','false'}; - private String[] crossFilters_type_info = new String[]{'crossFilters','http://soap.sforce.com/2006/04/metadata','ReportCrossFilter','0','-1','false'}; - private String[] currency_x_type_info = new String[]{'currency','http://soap.sforce.com/2006/04/metadata','CurrencyIsoCode','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] division_type_info = new String[]{'division','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] filter_type_info = new String[]{'filter','http://soap.sforce.com/2006/04/metadata','ReportFilter','0','1','false'}; - private String[] format_type_info = new String[]{'format','http://soap.sforce.com/2006/04/metadata','ReportFormat','1','1','false'}; - private String[] groupingsAcross_type_info = new String[]{'groupingsAcross','http://soap.sforce.com/2006/04/metadata','ReportGrouping','0','-1','false'}; - private String[] groupingsDown_type_info = new String[]{'groupingsDown','http://soap.sforce.com/2006/04/metadata','ReportGrouping','0','-1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] params_type_info = new String[]{'params','http://soap.sforce.com/2006/04/metadata','ReportParam','0','-1','false'}; - private String[] reportType_type_info = new String[]{'reportType','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] roleHierarchyFilter_type_info = new String[]{'roleHierarchyFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] rowLimit_type_info = new String[]{'rowLimit','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] scope_type_info = new String[]{'scope','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] showDetails_type_info = new String[]{'showDetails','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] sortColumn_type_info = new String[]{'sortColumn','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata','SortOrder','0','1','false'}; - private String[] territoryHierarchyFilter_type_info = new String[]{'territoryHierarchyFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] timeFrameFilter_type_info = new String[]{'timeFrameFilter','http://soap.sforce.com/2006/04/metadata','ReportTimeFrameFilter','0','1','false'}; - private String[] userFilter_type_info = new String[]{'userFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'aggregates','block','blockInfo','buckets','chart','colorRanges','columns','crossFilters','currency_x','description','division','filter','format','groupingsAcross','groupingsDown','name','params','reportType','roleHierarchyFilter','rowLimit','scope','showDetails','sortColumn','sortOrder','territoryHierarchyFilter','timeFrameFilter','userFilter'}; - } - public class ListView { - public String booleanFilter; - public String[] columns; - public String division; - public String filterScope; - public MetadataService.ListViewFilter[] filters; - public String label; - public String language; - public String queue; - public MetadataService.SharedTo sharedTo; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] columns_type_info = new String[]{'columns','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] division_type_info = new String[]{'division','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] filterScope_type_info = new String[]{'filterScope','http://soap.sforce.com/2006/04/metadata','FilterScope','1','1','false'}; - private String[] filters_type_info = new String[]{'filters','http://soap.sforce.com/2006/04/metadata','ListViewFilter','0','-1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata','Language','0','1','false'}; - private String[] queue_type_info = new String[]{'queue','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata','SharedTo','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'booleanFilter','columns','division','filterScope','filters','label','language','queue','sharedTo'}; + public class readInstalledPackageResponse_element implements IReadResponseElement { + public MetadataService.ReadInstalledPackageResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class FlowRecordCreate { - public String assignRecordIdToReference; - public MetadataService.FlowConnector connector; - public MetadataService.FlowConnector faultConnector; - public MetadataService.FlowInputFieldAssignment[] inputAssignments; - public String object_x; - private String[] assignRecordIdToReference_type_info = new String[]{'assignRecordIdToReference','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] inputAssignments_type_info = new String[]{'inputAssignments','http://soap.sforce.com/2006/04/metadata','FlowInputFieldAssignment','0','-1','false'}; - private String[] object_x_type_info = new String[]{'object','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadCustomFieldResult implements IReadResult { + public MetadataService.CustomField[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'assignRecordIdToReference','connector','faultConnector','inputAssignments','object_x'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class DashboardTableColumn { - public String aggregateType; - public String column; - public Boolean showTotal; - public String sortBy; - private String[] aggregateType_type_info = new String[]{'aggregateType','http://soap.sforce.com/2006/04/metadata','ReportSummaryType','0','1','false'}; - private String[] column_type_info = new String[]{'column','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] showTotal_type_info = new String[]{'showTotal','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] sortBy_type_info = new String[]{'sortBy','http://soap.sforce.com/2006/04/metadata','DashboardComponentFilter','0','1','false'}; + public class readCustomFieldResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomFieldResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'aggregateType','column','showTotal','sortBy'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class CaseSettings extends Metadata { - public String type = 'CaseSettings'; - public String fullName; - public String caseAssignNotificationTemplate; - public String caseCloseNotificationTemplate; - public String caseCommentNotificationTemplate; - public String caseCreateNotificationTemplate; - public Boolean closeCaseThroughStatusChange; - public String defaultCaseOwner; - public String defaultCaseOwnerType; - public String defaultCaseUser; - public MetadataService.EmailToCaseSettings emailToCase; - public Boolean enableCaseFeed; - public Boolean enableDraftEmails; - public Boolean enableEarlyEscalationRuleTriggers; - public Boolean enableNewEmailDefaultTemplate; - public Boolean enableSuggestedArticlesApplication; - public Boolean enableSuggestedArticlesCustomerPortal; - public Boolean enableSuggestedArticlesPartnerPortal; - public Boolean enableSuggestedSolutions; - public Boolean keepRecordTypeOnAssignmentRule; - public String newEmailDefaultTemplateClass; - public Boolean notifyContactOnCaseComment; - public Boolean notifyDefaultCaseOwner; - public Boolean notifyOwnerOnCaseComment; - public Boolean notifyOwnerOnCaseOwnerChange; - public Boolean showFewerCloseActions; - public Boolean useSystemEmailAddress; - public MetadataService.WebToCaseSettings webToCase; - private String[] type_att_info = new String[]{'xsi:type'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] caseAssignNotificationTemplate_type_info = new String[]{'caseAssignNotificationTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] caseCloseNotificationTemplate_type_info = new String[]{'caseCloseNotificationTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] caseCommentNotificationTemplate_type_info = new String[]{'caseCommentNotificationTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] caseCreateNotificationTemplate_type_info = new String[]{'caseCreateNotificationTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] closeCaseThroughStatusChange_type_info = new String[]{'closeCaseThroughStatusChange','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] defaultCaseOwner_type_info = new String[]{'defaultCaseOwner','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] defaultCaseOwnerType_type_info = new String[]{'defaultCaseOwnerType','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] defaultCaseUser_type_info = new String[]{'defaultCaseUser','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] emailToCase_type_info = new String[]{'emailToCase','http://soap.sforce.com/2006/04/metadata','EmailToCaseSettings','0','1','false'}; - private String[] enableCaseFeed_type_info = new String[]{'enableCaseFeed','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableDraftEmails_type_info = new String[]{'enableDraftEmails','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableEarlyEscalationRuleTriggers_type_info = new String[]{'enableEarlyEscalationRuleTriggers','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableNewEmailDefaultTemplate_type_info = new String[]{'enableNewEmailDefaultTemplate','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableSuggestedArticlesApplication_type_info = new String[]{'enableSuggestedArticlesApplication','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableSuggestedArticlesCustomerPortal_type_info = new String[]{'enableSuggestedArticlesCustomerPortal','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableSuggestedArticlesPartnerPortal_type_info = new String[]{'enableSuggestedArticlesPartnerPortal','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableSuggestedSolutions_type_info = new String[]{'enableSuggestedSolutions','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] keepRecordTypeOnAssignmentRule_type_info = new String[]{'keepRecordTypeOnAssignmentRule','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] newEmailDefaultTemplateClass_type_info = new String[]{'newEmailDefaultTemplateClass','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] notifyContactOnCaseComment_type_info = new String[]{'notifyContactOnCaseComment','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] notifyDefaultCaseOwner_type_info = new String[]{'notifyDefaultCaseOwner','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] notifyOwnerOnCaseComment_type_info = new String[]{'notifyOwnerOnCaseComment','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] notifyOwnerOnCaseOwnerChange_type_info = new String[]{'notifyOwnerOnCaseOwnerChange','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showFewerCloseActions_type_info = new String[]{'showFewerCloseActions','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] useSystemEmailAddress_type_info = new String[]{'useSystemEmailAddress','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] webToCase_type_info = new String[]{'webToCase','http://soap.sforce.com/2006/04/metadata','WebToCaseSettings','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'fullName', 'caseAssignNotificationTemplate','caseCloseNotificationTemplate','caseCommentNotificationTemplate','caseCreateNotificationTemplate','closeCaseThroughStatusChange','defaultCaseOwner','defaultCaseOwnerType','defaultCaseUser','emailToCase','enableCaseFeed','enableDraftEmails','enableEarlyEscalationRuleTriggers','enableNewEmailDefaultTemplate','enableSuggestedArticlesApplication','enableSuggestedArticlesCustomerPortal','enableSuggestedArticlesPartnerPortal','enableSuggestedSolutions','keepRecordTypeOnAssignmentRule','newEmailDefaultTemplateClass','notifyContactOnCaseComment','notifyDefaultCaseOwner','notifyOwnerOnCaseComment','notifyOwnerOnCaseOwnerChange','showFewerCloseActions','useSystemEmailAddress','webToCase'}; + public class ReadFieldSetResult implements IReadResult { + public MetadataService.FieldSet[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class AsyncResult { - public Boolean checkOnly; - public Boolean done; - public String id; - public String message; - public Integer numberComponentErrors; - public Integer numberComponentsDeployed; - public Integer numberComponentsTotal; - public Integer numberTestErrors; - public Integer numberTestsCompleted; - public Integer numberTestsTotal; - public String state; - public String stateDetail; - public DateTime stateDetailLastModifiedDate; - public String statusCode; - private String[] checkOnly_type_info = new String[]{'checkOnly','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] done_type_info = new String[]{'done','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata','ID','1','1','false'}; - private String[] message_type_info = new String[]{'message','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] numberComponentErrors_type_info = new String[]{'numberComponentErrors','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] numberComponentsDeployed_type_info = new String[]{'numberComponentsDeployed','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] numberComponentsTotal_type_info = new String[]{'numberComponentsTotal','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] numberTestErrors_type_info = new String[]{'numberTestErrors','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] numberTestsCompleted_type_info = new String[]{'numberTestsCompleted','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] numberTestsTotal_type_info = new String[]{'numberTestsTotal','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] state_type_info = new String[]{'state','http://soap.sforce.com/2006/04/metadata','AsyncRequestState','1','1','false'}; - private String[] stateDetail_type_info = new String[]{'stateDetail','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] stateDetailLastModifiedDate_type_info = new String[]{'stateDetailLastModifiedDate','http://www.w3.org/2001/XMLSchema','dateTime','0','1','false'}; - private String[] statusCode_type_info = new String[]{'statusCode','http://soap.sforce.com/2006/04/metadata','StatusCode','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'checkOnly','done','id','message','numberComponentErrors','numberComponentsDeployed','numberComponentsTotal','numberTestErrors','numberTestsCompleted','numberTestsTotal','state','stateDetail','stateDetailLastModifiedDate','statusCode'}; + public class readFieldSetResponse_element implements IReadResponseElement { + public MetadataService.ReadFieldSetResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class ArticleTypeChannelDisplay { - public MetadataService.ArticleTypeTemplate[] articleTypeTemplates; - private String[] articleTypeTemplates_type_info = new String[]{'articleTypeTemplates','http://soap.sforce.com/2006/04/metadata','ArticleTypeTemplate','0','-1','false'}; + public class ReadPicklistValueResult implements IReadResult { + public MetadataService.PicklistValue[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'articleTypeTemplates'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class ProfileLayoutAssignment { - public String layout; - public String recordType; - private String[] layout_type_info = new String[]{'layout','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] recordType_type_info = new String[]{'recordType','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + public class readPicklistValueResponse_element implements IReadResponseElement { + public MetadataService.ReadPicklistValueResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'layout','recordType'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class checkRetrieveStatus_element { - public String asyncProcessId; - private String[] asyncProcessId_type_info = new String[]{'asyncProcessId','http://soap.sforce.com/2006/04/metadata','ID','1','1','false'}; + public class ReadRecordTypeResult implements IReadResult { + public MetadataService.RecordType[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'asyncProcessId'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class ReportFolder { + public class readRecordTypeResponse_element implements IReadResponseElement { + public MetadataService.ReadRecordTypeResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{}; + private String[] field_order_type_info = new String[]{'result'}; } - public class FlowTextTemplate { - public String text; - private String[] text_type_info = new String[]{'text','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadWebLinkResult implements IReadResult { + public MetadataService.WebLink[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'text'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class RelatedListItem { - public String[] customButtons; - public String[] excludeButtons; - public String[] fields; - public String relatedList; - public String sortField; - public String sortOrder; - private String[] customButtons_type_info = new String[]{'customButtons','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] excludeButtons_type_info = new String[]{'excludeButtons','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] fields_type_info = new String[]{'fields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] relatedList_type_info = new String[]{'relatedList','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] sortField_type_info = new String[]{'sortField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata','SortOrder','0','1','false'}; + public class readWebLinkResponse_element implements IReadResponseElement { + public MetadataService.ReadWebLinkResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'customButtons','excludeButtons','fields','relatedList','sortField','sortOrder'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class FlowNode { - public String label; - public Integer locationX; - public Integer locationY; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] locationX_type_info = new String[]{'locationX','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] locationY_type_info = new String[]{'locationY','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; + public class ReadAddressSettingsResult implements IReadResult { + public MetadataService.AddressSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'label','locationX','locationY'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class ProfileApexClassAccess { - public String apexClass; - public Boolean enabled; - private String[] apexClass_type_info = new String[]{'apexClass','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] enabled_type_info = new String[]{'enabled','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + public class readAddressSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadAddressSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apexClass','enabled'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class CustomDataTypeComponentTranslation { - public String developerSuffix; - public String label; - private String[] developerSuffix_type_info = new String[]{'developerSuffix','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + public class ReadCaseSettingsResult implements IReadResult { + public MetadataService.CaseSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'developerSuffix','label'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class State { - public Boolean active; - public String integrationValue; - public String isoCode; - public String label; - public Boolean standard; - public Boolean visible; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] integrationValue_type_info = new String[]{'integrationValue','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] isoCode_type_info = new String[]{'isoCode','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] standard_type_info = new String[]{'standard','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] visible_type_info = new String[]{'visible','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + public class readCaseSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadCaseSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','integrationValue','isoCode','label','standard','visible'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class PushNotifications { - public MetadataService.PushNotification[] pushNotification; - private String[] pushNotification_type_info = new String[]{'pushNotification','http://soap.sforce.com/2006/04/metadata','PushNotification','0','-1','false'}; + public class ReadCustomObjectResult implements IReadResult { + public MetadataService.CustomObject[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'pushNotification'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class ReportTypeSectionTranslation { - public MetadataService.ReportTypeColumnTranslation[] columns; - public String label; - public String name; - private String[] columns_type_info = new String[]{'columns','http://soap.sforce.com/2006/04/metadata','ReportTypeColumnTranslation','0','-1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class readCustomObjectResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomObjectResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'columns','label','name'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class IpRange { - public String end_x; - public String start; - private String[] end_x_type_info = new String[]{'end','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] start_type_info = new String[]{'start','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + public class ReadLayoutResult implements IReadResult { + public MetadataService.Layout[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'end_x','start'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class FlowApexPluginCallOutputParameter { - public String assignToReference; - public String name; - private String[] assignToReference_type_info = new String[]{'assignToReference','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class readLayoutResponse_element implements IReadResponseElement { + public MetadataService.ReadLayoutResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'assignToReference','name'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class ReportBucketField { - public String bucketType; - public String developerName; - public String masterLabel; - public String nullTreatment; - public String otherBucketLabel; - public String sourceColumnName; - public Boolean useOther; - public MetadataService.ReportBucketFieldValue[] values; - private String[] bucketType_type_info = new String[]{'bucketType','http://soap.sforce.com/2006/04/metadata','ReportBucketFieldType','1','1','false'}; - private String[] developerName_type_info = new String[]{'developerName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] masterLabel_type_info = new String[]{'masterLabel','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] nullTreatment_type_info = new String[]{'nullTreatment','http://soap.sforce.com/2006/04/metadata','ReportBucketFieldNullTreatment','0','1','false'}; - private String[] otherBucketLabel_type_info = new String[]{'otherBucketLabel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sourceColumnName_type_info = new String[]{'sourceColumnName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] useOther_type_info = new String[]{'useOther','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] values_type_info = new String[]{'values','http://soap.sforce.com/2006/04/metadata','ReportBucketFieldValue','0','-1','false'}; + public class ReadEmailTemplateResult implements IReadResult { + public MetadataService.EmailTemplate[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'bucketType','developerName','masterLabel','nullTreatment','otherBucketLabel','sourceColumnName','useOther','values'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class CaseCriteriaBasedSharingRule { - public String booleanFilter; - public String caseAccessLevel; - public String name; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] caseAccessLevel_type_info = new String[]{'caseAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelReadEdit','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class readEmailTemplateResponse_element implements IReadResponseElement { + public MetadataService.ReadEmailTemplateResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'booleanFilter','caseAccessLevel','name'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class Portal { - public Boolean active; - public String admin; - public String defaultLanguage; - public String description; - public String emailSenderAddress; - public String emailSenderName; - public Boolean enableSelfCloseCase; - public String footerDocument; - public String forgotPassTemplate; - public String headerDocument; - public Boolean isSelfRegistrationActivated; - public String loginHeaderDocument; - public String logoDocument; - public String logoutUrl; - public String newCommentTemplate; - public String newPassTemplate; - public String newUserTemplate; - public String ownerNotifyTemplate; - public String selfRegNewUserUrl; - public String selfRegUserDefaultProfile; - public String selfRegUserDefaultRole; - public String selfRegUserTemplate; - public Boolean showActionConfirmation; - public String stylesheetDocument; - public String type_x; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] admin_type_info = new String[]{'admin','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] defaultLanguage_type_info = new String[]{'defaultLanguage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] emailSenderAddress_type_info = new String[]{'emailSenderAddress','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] emailSenderName_type_info = new String[]{'emailSenderName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] enableSelfCloseCase_type_info = new String[]{'enableSelfCloseCase','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] footerDocument_type_info = new String[]{'footerDocument','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] forgotPassTemplate_type_info = new String[]{'forgotPassTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] headerDocument_type_info = new String[]{'headerDocument','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] isSelfRegistrationActivated_type_info = new String[]{'isSelfRegistrationActivated','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] loginHeaderDocument_type_info = new String[]{'loginHeaderDocument','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] logoDocument_type_info = new String[]{'logoDocument','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] logoutUrl_type_info = new String[]{'logoutUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] newCommentTemplate_type_info = new String[]{'newCommentTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] newPassTemplate_type_info = new String[]{'newPassTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] newUserTemplate_type_info = new String[]{'newUserTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] ownerNotifyTemplate_type_info = new String[]{'ownerNotifyTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] selfRegNewUserUrl_type_info = new String[]{'selfRegNewUserUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] selfRegUserDefaultProfile_type_info = new String[]{'selfRegUserDefaultProfile','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] selfRegUserDefaultRole_type_info = new String[]{'selfRegUserDefaultRole','http://soap.sforce.com/2006/04/metadata','PortalRoles','0','1','false'}; - private String[] selfRegUserTemplate_type_info = new String[]{'selfRegUserTemplate','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] showActionConfirmation_type_info = new String[]{'showActionConfirmation','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] stylesheetDocument_type_info = new String[]{'stylesheetDocument','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','PortalType','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','admin','defaultLanguage','description','emailSenderAddress','emailSenderName','enableSelfCloseCase','footerDocument','forgotPassTemplate','headerDocument','isSelfRegistrationActivated','loginHeaderDocument','logoDocument','logoutUrl','newCommentTemplate','newPassTemplate','newUserTemplate','ownerNotifyTemplate','selfRegNewUserUrl','selfRegUserDefaultProfile','selfRegUserDefaultRole','selfRegUserTemplate','showActionConfirmation','stylesheetDocument','type_x'}; + public class ReadScontrolResult implements IReadResult { + public MetadataService.Scontrol[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class DomainWhitelist { - public String[] domain; - private String[] domain_type_info = new String[]{'domain','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + public class readScontrolResponse_element implements IReadResponseElement { + public MetadataService.ReadScontrolResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'domain'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class RunTestFailure { - public String id; - public String message; - public String methodName; - public String name; - public String namespace; - public String packageName; - public String stackTrace; - public Double time_x; - public String type_x; - private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata','ID','1','1','false'}; - private String[] message_type_info = new String[]{'message','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] methodName_type_info = new String[]{'methodName','http://www.w3.org/2001/XMLSchema','string','1','1','true'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] namespace_type_info = new String[]{'namespace','http://www.w3.org/2001/XMLSchema','string','1','1','true'}; - private String[] packageName_type_info = new String[]{'packageName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] stackTrace_type_info = new String[]{'stackTrace','http://www.w3.org/2001/XMLSchema','string','1','1','true'}; - private String[] time_x_type_info = new String[]{'time','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'id','message','methodName','name','namespace','packageName','stackTrace','time_x','type_x'}; + public class ReadApexPageResult implements IReadResult { + public MetadataService.ApexPage[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class Territory { - public String parentTerritory; - private String[] parentTerritory_type_info = new String[]{'parentTerritory','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + public class readApexPageResponse_element implements IReadResponseElement { + public MetadataService.ReadApexPageResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'parentTerritory'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class SharedTo { - public String allCustomerPortalUsers; - public String allInternalUsers; - public String allPartnerUsers; - public String[] group_x; - public String[] groups; - public String[] portalRole; - public String[] portalRoleAndSubordinates; - public String[] queue; - public String[] role; - public String[] roleAndSubordinates; - public String[] roleAndSubordinatesInternal; - public String[] roles; - public String[] rolesAndSubordinates; - public String[] territories; - public String[] territoriesAndSubordinates; - public String[] territory; - public String[] territoryAndSubordinates; - private String[] allCustomerPortalUsers_type_info = new String[]{'allCustomerPortalUsers','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] allInternalUsers_type_info = new String[]{'allInternalUsers','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] allPartnerUsers_type_info = new String[]{'allPartnerUsers','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] group_x_type_info = new String[]{'group','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] groups_type_info = new String[]{'groups','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] portalRole_type_info = new String[]{'portalRole','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] portalRoleAndSubordinates_type_info = new String[]{'portalRoleAndSubordinates','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] queue_type_info = new String[]{'queue','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] role_type_info = new String[]{'role','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] roleAndSubordinates_type_info = new String[]{'roleAndSubordinates','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] roleAndSubordinatesInternal_type_info = new String[]{'roleAndSubordinatesInternal','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] roles_type_info = new String[]{'roles','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] rolesAndSubordinates_type_info = new String[]{'rolesAndSubordinates','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] territories_type_info = new String[]{'territories','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] territoriesAndSubordinates_type_info = new String[]{'territoriesAndSubordinates','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] territory_type_info = new String[]{'territory','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] territoryAndSubordinates_type_info = new String[]{'territoryAndSubordinates','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'allCustomerPortalUsers','allInternalUsers','allPartnerUsers','group_x','groups','portalRole','portalRoleAndSubordinates','queue','role','roleAndSubordinates','roleAndSubordinatesInternal','roles','rolesAndSubordinates','territories','territoriesAndSubordinates','territory','territoryAndSubordinates'}; + public class ReadApexComponentResult implements IReadResult { + public MetadataService.ApexComponent[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class FlowRecordFilter { - public String field; - public String operator; - public MetadataService.FlowElementReferenceOrValue value; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata','FlowRecordFilterOperator','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata','FlowElementReferenceOrValue','0','1','false'}; + public class readApexComponentResponse_element implements IReadResponseElement { + public MetadataService.ReadApexComponentResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'field','operator','value'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class SubtabComponents { - public MetadataService.ConsoleComponent[] component; - private String[] component_type_info = new String[]{'component','http://soap.sforce.com/2006/04/metadata','ConsoleComponent','0','-1','false'}; + public class ReadApexClassResult implements IReadResult { + public MetadataService.ApexClass[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'component'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class FlowScreen { - public Boolean allowBack; - public Boolean allowFinish; - public MetadataService.FlowConnector connector; - public MetadataService.FlowScreenField[] fields; - public String helpText; - private String[] allowBack_type_info = new String[]{'allowBack','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] allowFinish_type_info = new String[]{'allowFinish','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata','FlowScreenField','0','-1','false'}; - private String[] helpText_type_info = new String[]{'helpText','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + public class readApexClassResponse_element implements IReadResponseElement { + public MetadataService.ReadApexClassResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'allowBack','allowFinish','connector','fields','helpText'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class WorkflowAlert { - public String[] ccEmails; - public String description; - public Boolean protected_x; - public MetadataService.WorkflowEmailRecipient[] recipients; - public String senderAddress; - public String senderType; - public String template; - private String[] ccEmails_type_info = new String[]{'ccEmails','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] protected_x_type_info = new String[]{'protected','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] recipients_type_info = new String[]{'recipients','http://soap.sforce.com/2006/04/metadata','WorkflowEmailRecipient','0','-1','false'}; - private String[] senderAddress_type_info = new String[]{'senderAddress','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] senderType_type_info = new String[]{'senderType','http://soap.sforce.com/2006/04/metadata','ActionEmailSenderType','0','1','false'}; - private String[] template_type_info = new String[]{'template','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadApexTriggerResult implements IReadResult { + public MetadataService.ApexTrigger[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'ccEmails','description','protected_x','recipients','senderAddress','senderType','template'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class ForecastRangeSettings { - public Integer beginning; - public Integer displaying; - public String periodType; - private String[] beginning_type_info = new String[]{'beginning','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] displaying_type_info = new String[]{'displaying','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] periodType_type_info = new String[]{'periodType','http://soap.sforce.com/2006/04/metadata','PeriodTypes','1','1','false'}; + public class readApexTriggerResponse_element implements IReadResponseElement { + public MetadataService.ReadApexTriggerResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'beginning','displaying','periodType'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class SFDCMobileSettings { - public Boolean enableMobileLite; - public Boolean enableUserToDeviceLinking; - private String[] enableMobileLite_type_info = new String[]{'enableMobileLite','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableUserToDeviceLinking_type_info = new String[]{'enableUserToDeviceLinking','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + public class ReadStaticResourceResult implements IReadResult { + public MetadataService.StaticResource[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enableMobileLite','enableUserToDeviceLinking'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class LayoutSectionTranslation { - public String label; - public String section; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] section_type_info = new String[]{'section','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class readStaticResourceResponse_element implements IReadResponseElement { + public MetadataService.ReadStaticResourceResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'label','section'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class EntitlementProcessMilestoneItem { - public String criteriaBooleanFilter; - public MetadataService.FilterItem[] milestoneCriteriaFilterItems; - public String milestoneCriteriaFormula; - public String milestoneName; - public Integer minutesToComplete; - public MetadataService.WorkflowActionReference[] successActions; - public MetadataService.EntitlementProcessMilestoneTimeTrigger[] timeTriggers; - public Boolean useCriteriaStartTime; - private String[] criteriaBooleanFilter_type_info = new String[]{'criteriaBooleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] milestoneCriteriaFilterItems_type_info = new String[]{'milestoneCriteriaFilterItems','http://soap.sforce.com/2006/04/metadata','FilterItem','0','-1','false'}; - private String[] milestoneCriteriaFormula_type_info = new String[]{'milestoneCriteriaFormula','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] milestoneName_type_info = new String[]{'milestoneName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] minutesToComplete_type_info = new String[]{'minutesToComplete','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] successActions_type_info = new String[]{'successActions','http://soap.sforce.com/2006/04/metadata','WorkflowActionReference','0','-1','false'}; - private String[] timeTriggers_type_info = new String[]{'timeTriggers','http://soap.sforce.com/2006/04/metadata','EntitlementProcessMilestoneTimeTrigger','0','-1','false'}; - private String[] useCriteriaStartTime_type_info = new String[]{'useCriteriaStartTime','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'criteriaBooleanFilter','milestoneCriteriaFilterItems','milestoneCriteriaFormula','milestoneName','minutesToComplete','successActions','timeTriggers','useCriteriaStartTime'}; - } - public class DataCategoryGroup { - public Boolean active; - public MetadataService.DataCategory dataCategory; - public String description; - public String label; - public MetadataService.ObjectUsage objectUsage; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] dataCategory_type_info = new String[]{'dataCategory','http://soap.sforce.com/2006/04/metadata','DataCategory','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] objectUsage_type_info = new String[]{'objectUsage','http://soap.sforce.com/2006/04/metadata','ObjectUsage','0','1','false'}; + public class ReadDocumentResult implements IReadResult { + public MetadataService.Document[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','dataCategory','description','label','objectUsage'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class listMetadata_element { - public MetadataService.ListMetadataQuery[] queries; - public Double asOfVersion; - private String[] queries_type_info = new String[]{'queries','http://soap.sforce.com/2006/04/metadata','ListMetadataQuery','0','-1','false'}; - private String[] asOfVersion_type_info = new String[]{'asOfVersion','http://www.w3.org/2001/XMLSchema','double','1','1','false'}; + public class readDocumentResponse_element implements IReadResponseElement { + public MetadataService.ReadDocumentResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'queries','asOfVersion'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class ValidationRule { - public Boolean active; - public String description; - public String errorConditionFormula; - public String errorDisplayField; - public String errorMessage; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] errorConditionFormula_type_info = new String[]{'errorConditionFormula','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] errorDisplayField_type_info = new String[]{'errorDisplayField','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] errorMessage_type_info = new String[]{'errorMessage','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadCustomLabelsResult implements IReadResult { + public MetadataService.CustomLabels[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','description','errorConditionFormula','errorDisplayField','errorMessage'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class NamedFilterTranslation { - public String errorMessage; - public String informationalMessage; - public String name; - private String[] errorMessage_type_info = new String[]{'errorMessage','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] informationalMessage_type_info = new String[]{'informationalMessage','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class readCustomLabelsResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomLabelsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'errorMessage','informationalMessage','name'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class ValidationRuleTranslation { - public String errorMessage; - public String name; - private String[] errorMessage_type_info = new String[]{'errorMessage','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadCustomLabelResult implements IReadResult { + public MetadataService.CustomLabel[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'errorMessage','name'}; + private String[] field_order_type_info = new String[]{'records'}; } - public virtual class Metadata { - public String fullName; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + public class readCustomLabelResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomLabelResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'fullName'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class ReportBucketFieldValue { - public MetadataService.ReportBucketFieldSourceValue[] sourceValues; - public String value; - private String[] sourceValues_type_info = new String[]{'sourceValues','http://soap.sforce.com/2006/04/metadata','ReportBucketFieldSourceValue','0','-1','false'}; - private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadAccountSettingsResult implements IReadResult { + public MetadataService.AccountSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'sourceValues','value'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class TouchMobileSettings { - public Boolean enableTouchAppIPad; - public Boolean enableTouchAppIPhone; - public Boolean enableTouchBrowserIPad; - public Boolean enableTouchIosPhone; - public Boolean enableVisualforceInTouch; - private String[] enableTouchAppIPad_type_info = new String[]{'enableTouchAppIPad','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableTouchAppIPhone_type_info = new String[]{'enableTouchAppIPhone','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableTouchBrowserIPad_type_info = new String[]{'enableTouchBrowserIPad','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableTouchIosPhone_type_info = new String[]{'enableTouchIosPhone','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableVisualforceInTouch_type_info = new String[]{'enableVisualforceInTouch','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + public class readAccountSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadAccountSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enableTouchAppIPad','enableTouchAppIPhone','enableTouchBrowserIPad','enableTouchIosPhone','enableVisualforceInTouch'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class FlowSubflow { - public MetadataService.FlowConnector connector; - public String flowName; - public MetadataService.FlowSubflowInputAssignment[] inputAssignments; - public MetadataService.FlowSubflowOutputAssignment[] outputAssignments; - private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; - private String[] flowName_type_info = new String[]{'flowName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] inputAssignments_type_info = new String[]{'inputAssignments','http://soap.sforce.com/2006/04/metadata','FlowSubflowInputAssignment','0','-1','false'}; - private String[] outputAssignments_type_info = new String[]{'outputAssignments','http://soap.sforce.com/2006/04/metadata','FlowSubflowOutputAssignment','0','-1','false'}; + public class ReadQueueResult implements IReadResult { + public MetadataService.Queue[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'connector','flowName','inputAssignments','outputAssignments'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class FlowScreenField { - public String[] choiceReferences; - public String dataType; - public String defaultSelectedChoiceReference; - public MetadataService.FlowElementReferenceOrValue defaultValue; - public String fieldText; - public String fieldType; - public String helpText; - public Boolean isRequired; - public Integer scale; - public MetadataService.FlowInputValidationRule validationRule; - private String[] choiceReferences_type_info = new String[]{'choiceReferences','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata','FlowDataType','0','1','false'}; - private String[] defaultSelectedChoiceReference_type_info = new String[]{'defaultSelectedChoiceReference','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] defaultValue_type_info = new String[]{'defaultValue','http://soap.sforce.com/2006/04/metadata','FlowElementReferenceOrValue','0','1','false'}; - private String[] fieldText_type_info = new String[]{'fieldText','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] fieldType_type_info = new String[]{'fieldType','http://soap.sforce.com/2006/04/metadata','FlowScreenFieldType','1','1','false'}; - private String[] helpText_type_info = new String[]{'helpText','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] isRequired_type_info = new String[]{'isRequired','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] scale_type_info = new String[]{'scale','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] validationRule_type_info = new String[]{'validationRule','http://soap.sforce.com/2006/04/metadata','FlowInputValidationRule','0','1','false'}; + public class readQueueResponse_element implements IReadResponseElement { + public MetadataService.ReadQueueResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'choiceReferences','dataType','defaultSelectedChoiceReference','defaultValue','fieldText','fieldType','helpText','isRequired','scale','validationRule'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class Dashboard { - public String backgroundEndColor; - public String backgroundFadeDirection; - public String backgroundStartColor; - public MetadataService.DashboardFilter[] dashboardFilters; - public String dashboardType; - public String description; - public MetadataService.DashboardComponentSection leftSection; - public MetadataService.DashboardComponentSection middleSection; - public MetadataService.DashboardComponentSection rightSection; - public String runningUser; - public String textColor; - public String title; - public String titleColor; - public Integer titleSize; - private String[] backgroundEndColor_type_info = new String[]{'backgroundEndColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] backgroundFadeDirection_type_info = new String[]{'backgroundFadeDirection','http://soap.sforce.com/2006/04/metadata','ChartBackgroundDirection','1','1','false'}; - private String[] backgroundStartColor_type_info = new String[]{'backgroundStartColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] dashboardFilters_type_info = new String[]{'dashboardFilters','http://soap.sforce.com/2006/04/metadata','DashboardFilter','0','-1','false'}; - private String[] dashboardType_type_info = new String[]{'dashboardType','http://soap.sforce.com/2006/04/metadata','DashboardType','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] leftSection_type_info = new String[]{'leftSection','http://soap.sforce.com/2006/04/metadata','DashboardComponentSection','1','1','false'}; - private String[] middleSection_type_info = new String[]{'middleSection','http://soap.sforce.com/2006/04/metadata','DashboardComponentSection','0','1','false'}; - private String[] rightSection_type_info = new String[]{'rightSection','http://soap.sforce.com/2006/04/metadata','DashboardComponentSection','1','1','false'}; - private String[] runningUser_type_info = new String[]{'runningUser','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] textColor_type_info = new String[]{'textColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] title_type_info = new String[]{'title','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] titleColor_type_info = new String[]{'titleColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] titleSize_type_info = new String[]{'titleSize','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'backgroundEndColor','backgroundFadeDirection','backgroundStartColor','dashboardFilters','dashboardType','description','leftSection','middleSection','rightSection','runningUser','textColor','title','titleColor','titleSize'}; + public class ReadCustomDataTypeResult implements IReadResult { + public MetadataService.CustomDataType[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class FlowAssignment { - public MetadataService.FlowAssignmentItem[] assignmentItems; - public MetadataService.FlowConnector connector; - private String[] assignmentItems_type_info = new String[]{'assignmentItems','http://soap.sforce.com/2006/04/metadata','FlowAssignmentItem','0','-1','false'}; - private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata','FlowConnector','0','1','false'}; + public class readCustomDataTypeResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomDataTypeResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'assignmentItems','connector'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class IdeaReputationLevel { - public String name; - public Integer value; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; + public class ReadExternalDataSourceResult implements IReadResult { + public MetadataService.ExternalDataSource[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'name','value'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class NetworkTabSet { - public String[] customTab; - public String defaultTab; - public String[] standardTab; - private String[] customTab_type_info = new String[]{'customTab','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] defaultTab_type_info = new String[]{'defaultTab','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] standardTab_type_info = new String[]{'standardTab','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + public class readExternalDataSourceResponse_element implements IReadResponseElement { + public MetadataService.ReadExternalDataSourceResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'customTab','defaultTab','standardTab'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class CustomApplicationComponents { - public String alignment; - public String[] customApplicationComponent; - private String[] alignment_type_info = new String[]{'alignment','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] customApplicationComponent_type_info = new String[]{'customApplicationComponent','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + public class ReadGroupResult implements IReadResult { + public MetadataService.Group_x[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'alignment','customApplicationComponent'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class deleteResponse_element { - public MetadataService.AsyncResult[] result; - private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata','AsyncResult','0','-1','false'}; + public class readGroupResponse_element implements IReadResponseElement { + public MetadataService.ReadGroupResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'result'}; } - public class update_element { - public MetadataService.UpdateMetadata[] UpdateMetadata; - private String[] UpdateMetadata_type_info = new String[]{'UpdateMetadata','http://soap.sforce.com/2006/04/metadata','UpdateMetadata','0','-1','false'}; + public class ReadBusinessProcessResult implements IReadResult { + public MetadataService.BusinessProcess[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'UpdateMetadata'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class DashboardFolder { + public class readBusinessProcessResponse_element implements IReadResponseElement { + public MetadataService.ReadBusinessProcessResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{}; + private String[] field_order_type_info = new String[]{'result'}; } - public class PermissionSetApexPageAccess { - public String apexPage; - public Boolean enabled; - private String[] apexPage_type_info = new String[]{'apexPage','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] enabled_type_info = new String[]{'enabled','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + public class ReadCompactLayoutResult implements IReadResult { + public MetadataService.CompactLayout[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apexPage','enabled'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class CustomObject extends Metadata { - public String type = 'CustomObject'; - public String fullName; - public MetadataService.ActionOverride[] actionOverrides; - public MetadataService.ArticleTypeChannelDisplay articleTypeChannelDisplay; - public MetadataService.BusinessProcess[] businessProcesses; - public String customHelp; - public String customHelpPage; - public String customSettingsType; - public String customSettingsVisibility; - public String deploymentStatus; - public Boolean deprecated; - public String description; - public Boolean enableActivities; - public Boolean enableDivisions; - public Boolean enableEnhancedLookup; - public Boolean enableFeeds; - public Boolean enableHistory; - public Boolean enableReports; - public MetadataService.FieldSet[] fieldSets; - public MetadataService.CustomField[] fields; - public String gender; - public Boolean household; - public String label; - public MetadataService.ListView[] listViews; - public MetadataService.CustomField nameField; - public MetadataService.NamedFilter[] namedFilters; - public String pluralLabel; - public Boolean recordTypeTrackFeedHistory; - public Boolean recordTypeTrackHistory; - public MetadataService.RecordType[] recordTypes; - public MetadataService.SearchLayouts searchLayouts; - public String sharingModel; - public MetadataService.SharingReason[] sharingReasons; - public MetadataService.SharingRecalculation[] sharingRecalculations; - public String startsWith; - public MetadataService.ValidationRule[] validationRules; - public MetadataService.WebLink[] webLinks; - private String[] type_att_info = new String[]{'xsi:type'}; - private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] actionOverrides_type_info = new String[]{'actionOverrides','http://soap.sforce.com/2006/04/metadata','ActionOverride','0','-1','false'}; - private String[] articleTypeChannelDisplay_type_info = new String[]{'articleTypeChannelDisplay','http://soap.sforce.com/2006/04/metadata','ArticleTypeChannelDisplay','0','1','false'}; - private String[] businessProcesses_type_info = new String[]{'businessProcesses','http://soap.sforce.com/2006/04/metadata','BusinessProcess','0','-1','false'}; - private String[] customHelp_type_info = new String[]{'customHelp','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] customHelpPage_type_info = new String[]{'customHelpPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] customSettingsType_type_info = new String[]{'customSettingsType','http://soap.sforce.com/2006/04/metadata','CustomSettingsType','0','1','false'}; - private String[] customSettingsVisibility_type_info = new String[]{'customSettingsVisibility','http://soap.sforce.com/2006/04/metadata','CustomSettingsVisibility','0','1','false'}; - private String[] deploymentStatus_type_info = new String[]{'deploymentStatus','http://soap.sforce.com/2006/04/metadata','DeploymentStatus','0','1','false'}; - private String[] deprecated_type_info = new String[]{'deprecated','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] enableActivities_type_info = new String[]{'enableActivities','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableDivisions_type_info = new String[]{'enableDivisions','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableEnhancedLookup_type_info = new String[]{'enableEnhancedLookup','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableFeeds_type_info = new String[]{'enableFeeds','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableHistory_type_info = new String[]{'enableHistory','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableReports_type_info = new String[]{'enableReports','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] fieldSets_type_info = new String[]{'fieldSets','http://soap.sforce.com/2006/04/metadata','FieldSet','0','-1','false'}; - private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata','CustomField','0','-1','false'}; - private String[] gender_type_info = new String[]{'gender','http://soap.sforce.com/2006/04/metadata','Gender','0','1','false'}; - private String[] household_type_info = new String[]{'household','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] listViews_type_info = new String[]{'listViews','http://soap.sforce.com/2006/04/metadata','ListView','0','-1','false'}; - private String[] nameField_type_info = new String[]{'nameField','http://soap.sforce.com/2006/04/metadata','CustomField','0','1','false'}; - private String[] namedFilters_type_info = new String[]{'namedFilters','http://soap.sforce.com/2006/04/metadata','NamedFilter','0','-1','false'}; - private String[] pluralLabel_type_info = new String[]{'pluralLabel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] recordTypeTrackFeedHistory_type_info = new String[]{'recordTypeTrackFeedHistory','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] recordTypeTrackHistory_type_info = new String[]{'recordTypeTrackHistory','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] recordTypes_type_info = new String[]{'recordTypes','http://soap.sforce.com/2006/04/metadata','RecordType','0','-1','false'}; - private String[] searchLayouts_type_info = new String[]{'searchLayouts','http://soap.sforce.com/2006/04/metadata','SearchLayouts','0','1','false'}; - private String[] sharingModel_type_info = new String[]{'sharingModel','http://soap.sforce.com/2006/04/metadata','SharingModel','0','1','false'}; - private String[] sharingReasons_type_info = new String[]{'sharingReasons','http://soap.sforce.com/2006/04/metadata','SharingReason','0','-1','false'}; - private String[] sharingRecalculations_type_info = new String[]{'sharingRecalculations','http://soap.sforce.com/2006/04/metadata','SharingRecalculation','0','-1','false'}; - private String[] startsWith_type_info = new String[]{'startsWith','http://soap.sforce.com/2006/04/metadata','StartsWith','0','1','false'}; - private String[] validationRules_type_info = new String[]{'validationRules','http://soap.sforce.com/2006/04/metadata','ValidationRule','0','-1','false'}; - private String[] webLinks_type_info = new String[]{'webLinks','http://soap.sforce.com/2006/04/metadata','WebLink','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'fullName', 'actionOverrides','articleTypeChannelDisplay','businessProcesses','customHelp','customHelpPage','customSettingsType','customSettingsVisibility','deploymentStatus','deprecated','description','enableActivities','enableDivisions','enableEnhancedLookup','enableFeeds','enableHistory','enableReports','fieldSets','fields','gender','household','label','listViews','nameField','namedFilters','pluralLabel','recordTypeTrackFeedHistory','recordTypeTrackHistory','recordTypes','searchLayouts','sharingModel','sharingReasons','sharingRecalculations','startsWith','validationRules','webLinks'}; - } - public class Translations { - public MetadataService.CustomApplicationTranslation[] customApplications; - public MetadataService.CustomDataTypeTranslation[] customDataTypeTranslations; - public MetadataService.CustomLabelTranslation[] customLabels; - public MetadataService.CustomPageWebLinkTranslation[] customPageWebLinks; - public MetadataService.CustomTabTranslation[] customTabs; - public MetadataService.GlobalQuickActionTranslation[] quickActions; - public MetadataService.ReportTypeTranslation[] reportTypes; - public MetadataService.ScontrolTranslation[] scontrols; - private String[] customApplications_type_info = new String[]{'customApplications','http://soap.sforce.com/2006/04/metadata','CustomApplicationTranslation','0','-1','false'}; - private String[] customDataTypeTranslations_type_info = new String[]{'customDataTypeTranslations','http://soap.sforce.com/2006/04/metadata','CustomDataTypeTranslation','0','-1','false'}; - private String[] customLabels_type_info = new String[]{'customLabels','http://soap.sforce.com/2006/04/metadata','CustomLabelTranslation','0','-1','false'}; - private String[] customPageWebLinks_type_info = new String[]{'customPageWebLinks','http://soap.sforce.com/2006/04/metadata','CustomPageWebLinkTranslation','0','-1','false'}; - private String[] customTabs_type_info = new String[]{'customTabs','http://soap.sforce.com/2006/04/metadata','CustomTabTranslation','0','-1','false'}; - private String[] quickActions_type_info = new String[]{'quickActions','http://soap.sforce.com/2006/04/metadata','GlobalQuickActionTranslation','0','-1','false'}; - private String[] reportTypes_type_info = new String[]{'reportTypes','http://soap.sforce.com/2006/04/metadata','ReportTypeTranslation','0','-1','false'}; - private String[] scontrols_type_info = new String[]{'scontrols','http://soap.sforce.com/2006/04/metadata','ScontrolTranslation','0','-1','false'}; + public class readCompactLayoutResponse_element implements IReadResponseElement { + public MetadataService.ReadCompactLayoutResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'customApplications','customDataTypeTranslations','customLabels','customPageWebLinks','customTabs','quickActions','reportTypes','scontrols'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class ReportTypeTranslation { - public String description; - public String label; - public String name; - public MetadataService.ReportTypeSectionTranslation[] sections; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] sections_type_info = new String[]{'sections','http://soap.sforce.com/2006/04/metadata','ReportTypeSectionTranslation','0','-1','false'}; + public class ReadSharingReasonResult implements IReadResult { + public MetadataService.SharingReason[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'description','label','name','sections'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class FlowAssignmentItem { - public String assignToReference; - public String operator; - public MetadataService.FlowElementReferenceOrValue value; - private String[] assignToReference_type_info = new String[]{'assignToReference','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata','FlowAssignmentOperator','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata','FlowElementReferenceOrValue','0','1','false'}; + public class readSharingReasonResponse_element implements IReadResponseElement { + public MetadataService.ReadSharingReasonResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'assignToReference','operator','value'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class PackageTypeMembers { - public String[] members; - public String name; - private String[] members_type_info = new String[]{'members','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadValidationRuleResult implements IReadResult { + public MetadataService.ValidationRule[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'members','name'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class CustomLabels extends Metadata { - public MetadataService.CustomLabel[] labels; - private String[] labels_type_info = new String[]{'labels','http://soap.sforce.com/2006/04/metadata','CustomLabel','0','-1','false'}; + public class readValidationRuleResponse_element implements IReadResponseElement { + public MetadataService.ReadValidationRuleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'labels'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class EntitlementProcessMilestoneTimeTrigger { - public MetadataService.WorkflowActionReference[] actions; - public Integer timeLength; - public String workflowTimeTriggerUnit; - private String[] actions_type_info = new String[]{'actions','http://soap.sforce.com/2006/04/metadata','WorkflowActionReference','0','-1','false'}; - private String[] timeLength_type_info = new String[]{'timeLength','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] workflowTimeTriggerUnit_type_info = new String[]{'workflowTimeTriggerUnit','http://soap.sforce.com/2006/04/metadata','MilestoneTimeUnits','1','1','false'}; + public class ReadReportTypeResult implements IReadResult { + public MetadataService.ReportType[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'actions','timeLength','workflowTimeTriggerUnit'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class WorkflowSend { - public String action; - public String description; - public String label; - public String language; - public Boolean protected_x; - private String[] action_type_info = new String[]{'action','http://soap.sforce.com/2006/04/metadata','SendAction','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] language_type_info = new String[]{'language','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] protected_x_type_info = new String[]{'protected','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; + public class readReportTypeResponse_element implements IReadResponseElement { + public MetadataService.ReadReportTypeResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'action','description','label','language','protected_x'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class PermissionSetFieldPermissions { - public Boolean editable; - public String field; - public Boolean readable; - private String[] editable_type_info = new String[]{'editable','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] readable_type_info = new String[]{'readable','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + public class ReadReportResult implements IReadResult { + public MetadataService.Report[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'editable','field','readable'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class AnalyticSnapshotMapping { - public String aggregateType; - public String sourceField; - public String sourceType; - public String targetField; - private String[] aggregateType_type_info = new String[]{'aggregateType','http://soap.sforce.com/2006/04/metadata','ReportSummaryType','0','1','false'}; - private String[] sourceField_type_info = new String[]{'sourceField','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] sourceType_type_info = new String[]{'sourceType','http://soap.sforce.com/2006/04/metadata','ReportJobSourceTypes','1','1','false'}; - private String[] targetField_type_info = new String[]{'targetField','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class readReportResponse_element implements IReadResponseElement { + public MetadataService.ReadReportResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'aggregateType','sourceField','sourceType','targetField'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class ReportGrouping { - public String dateGranularity; - public String field; - public String sortOrder; - private String[] dateGranularity_type_info = new String[]{'dateGranularity','http://soap.sforce.com/2006/04/metadata','UserDateGranularity','0','1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata','SortOrder','1','1','false'}; + public class ReadDashboardResult implements IReadResult { + public MetadataService.Dashboard[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'dateGranularity','field','sortOrder'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class ArticleTypeTemplate { - public String channel; - public String page_x; - public String template; - private String[] channel_type_info = new String[]{'channel','http://soap.sforce.com/2006/04/metadata','Channel','1','1','false'}; - private String[] page_x_type_info = new String[]{'page','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] template_type_info = new String[]{'template','http://soap.sforce.com/2006/04/metadata','Template','1','1','false'}; + public class readDashboardResponse_element implements IReadResponseElement { + public MetadataService.ReadDashboardResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'channel','page_x','template'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class SkillProfileAssignments { - public String[] profile; - private String[] profile_type_info = new String[]{'profile','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + public class ReadAnalyticSnapshotResult implements IReadResult { + public MetadataService.AnalyticSnapshot[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'profile'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class CustomShortcut { - public String description; - public String eventName; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] eventName_type_info = new String[]{'eventName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class readAnalyticSnapshotResponse_element implements IReadResponseElement { + public MetadataService.ReadAnalyticSnapshotResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'description','eventName'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class LeadCriteriaBasedSharingRule { - public String booleanFilter; - public String leadAccessLevel; - public String name; - private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] leadAccessLevel_type_info = new String[]{'leadAccessLevel','http://soap.sforce.com/2006/04/metadata','ShareAccessLevelReadEdit','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadCustomPageWebLinkResult implements IReadResult { + public MetadataService.CustomPageWebLink[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'booleanFilter','leadAccessLevel','name'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class CustomTab { - public Boolean customObject; - public String description; - public Integer frameHeight; - public Boolean hasSidebar; - public String icon; - public String label; - public Boolean mobileReady; - public String motif; - public String page_x; - public String scontrol; - public String splashPageLink; - public String url; - public String urlEncodingKey; - private String[] customObject_type_info = new String[]{'customObject','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] frameHeight_type_info = new String[]{'frameHeight','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] hasSidebar_type_info = new String[]{'hasSidebar','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] icon_type_info = new String[]{'icon','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] mobileReady_type_info = new String[]{'mobileReady','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] motif_type_info = new String[]{'motif','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] page_x_type_info = new String[]{'page','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] scontrol_type_info = new String[]{'scontrol','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] splashPageLink_type_info = new String[]{'splashPageLink','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] url_type_info = new String[]{'url','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] urlEncodingKey_type_info = new String[]{'urlEncodingKey','http://soap.sforce.com/2006/04/metadata','Encoding','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'customObject','description','frameHeight','hasSidebar','icon','label','mobileReady','motif','page_x','scontrol','splashPageLink','url','urlEncodingKey'}; - } - public class Letterhead { - public Boolean available; - public String backgroundColor; - public String bodyColor; - public MetadataService.LetterheadLine bottomLine; - public String description; - public MetadataService.LetterheadHeaderFooter footer; - public MetadataService.LetterheadHeaderFooter header; - public MetadataService.LetterheadLine middleLine; - public String name; - public MetadataService.LetterheadLine topLine; - private String[] available_type_info = new String[]{'available','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] backgroundColor_type_info = new String[]{'backgroundColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] bodyColor_type_info = new String[]{'bodyColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] bottomLine_type_info = new String[]{'bottomLine','http://soap.sforce.com/2006/04/metadata','LetterheadLine','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] footer_type_info = new String[]{'footer','http://soap.sforce.com/2006/04/metadata','LetterheadHeaderFooter','1','1','false'}; - private String[] header_type_info = new String[]{'header','http://soap.sforce.com/2006/04/metadata','LetterheadHeaderFooter','1','1','false'}; - private String[] middleLine_type_info = new String[]{'middleLine','http://soap.sforce.com/2006/04/metadata','LetterheadLine','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] topLine_type_info = new String[]{'topLine','http://soap.sforce.com/2006/04/metadata','LetterheadLine','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'available','backgroundColor','bodyColor','bottomLine','description','footer','header','middleLine','name','topLine'}; + public class readCustomPageWebLinkResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomPageWebLinkResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class ReportTypeColumnTranslation { - public String label; - public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadQuickActionResult implements IReadResult { + public MetadataService.QuickAction[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'label','name'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class CustomPageWebLinkTranslation { - public String label; - public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class readQuickActionResponse_element implements IReadResponseElement { + public MetadataService.ReadQuickActionResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'label','name'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class EntitlementSettings { - public Boolean assetLookupLimitedToActiveEntitlementsOnAccount; - public Boolean assetLookupLimitedToActiveEntitlementsOnContact; - public Boolean assetLookupLimitedToSameAccount; - public Boolean assetLookupLimitedToSameContact; - public Boolean enableEntitlementVersioning; - public Boolean enableEntitlements; - public Boolean entitlementLookupLimitedToActiveStatus; - public Boolean entitlementLookupLimitedToSameAccount; - public Boolean entitlementLookupLimitedToSameAsset; - public Boolean entitlementLookupLimitedToSameContact; - private String[] assetLookupLimitedToActiveEntitlementsOnAccount_type_info = new String[]{'assetLookupLimitedToActiveEntitlementsOnAccount','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] assetLookupLimitedToActiveEntitlementsOnContact_type_info = new String[]{'assetLookupLimitedToActiveEntitlementsOnContact','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] assetLookupLimitedToSameAccount_type_info = new String[]{'assetLookupLimitedToSameAccount','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] assetLookupLimitedToSameContact_type_info = new String[]{'assetLookupLimitedToSameContact','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableEntitlementVersioning_type_info = new String[]{'enableEntitlementVersioning','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] enableEntitlements_type_info = new String[]{'enableEntitlements','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] entitlementLookupLimitedToActiveStatus_type_info = new String[]{'entitlementLookupLimitedToActiveStatus','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] entitlementLookupLimitedToSameAccount_type_info = new String[]{'entitlementLookupLimitedToSameAccount','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] entitlementLookupLimitedToSameAsset_type_info = new String[]{'entitlementLookupLimitedToSameAsset','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] entitlementLookupLimitedToSameContact_type_info = new String[]{'entitlementLookupLimitedToSameContact','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + public class ReadFlexiPageResult implements IReadResult { + public MetadataService.FlexiPage[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'assetLookupLimitedToActiveEntitlementsOnAccount','assetLookupLimitedToActiveEntitlementsOnContact','assetLookupLimitedToSameAccount','assetLookupLimitedToSameContact','enableEntitlementVersioning','enableEntitlements','entitlementLookupLimitedToActiveStatus','entitlementLookupLimitedToSameAccount','entitlementLookupLimitedToSameAsset','entitlementLookupLimitedToSameContact'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class DocumentFolder { + public class readFlexiPageResponse_element implements IReadResponseElement { + public MetadataService.ReadFlexiPageResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{}; + private String[] field_order_type_info = new String[]{'result'}; } - public class FlowConstant { - public String dataType; - public MetadataService.FlowElementReferenceOrValue value; - private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata','FlowDataType','1','1','false'}; - private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata','FlowElementReferenceOrValue','0','1','false'}; + public class ReadCustomTabResult implements IReadResult { + public MetadataService.CustomTab[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'dataType','value'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class ChatterMobileSettings { - public Boolean androidAuthorized; - public Boolean blackberryAuthorized; - public Boolean enableChatterMobile; - public Boolean enablePushNotifications; - public Boolean iPadAuthorized; - public Boolean iPhoneAuthorized; - public String sessionTimeout; - private String[] androidAuthorized_type_info = new String[]{'androidAuthorized','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] blackberryAuthorized_type_info = new String[]{'blackberryAuthorized','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableChatterMobile_type_info = new String[]{'enableChatterMobile','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enablePushNotifications_type_info = new String[]{'enablePushNotifications','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] iPadAuthorized_type_info = new String[]{'iPadAuthorized','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] iPhoneAuthorized_type_info = new String[]{'iPhoneAuthorized','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] sessionTimeout_type_info = new String[]{'sessionTimeout','http://soap.sforce.com/2006/04/metadata','MobileSessionTimeout','0','1','false'}; + public class readCustomTabResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomTabResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'androidAuthorized','blackberryAuthorized','enableChatterMobile','enablePushNotifications','iPadAuthorized','iPhoneAuthorized','sessionTimeout'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class CallCenterSection { - public MetadataService.CallCenterItem[] items; - public String label; - public String name; - private String[] items_type_info = new String[]{'items','http://soap.sforce.com/2006/04/metadata','CallCenterItem','0','-1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadCustomApplicationComponentResult implements IReadResult { + public MetadataService.CustomApplicationComponent[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'items','label','name'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class PagesToOpen { - public String[] pageToOpen; - private String[] pageToOpen_type_info = new String[]{'pageToOpen','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + public class readCustomApplicationComponentResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomApplicationComponentResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'pageToOpen'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class ReportChart { - public String backgroundColor1; - public String backgroundColor2; - public String backgroundFadeDir; - public MetadataService.ChartSummary[] chartSummaries; - public String chartType; - public Boolean enableHoverLabels; - public Boolean expandOthers; - public String groupingColumn; - public String legendPosition; - public String location; - public String secondaryGroupingColumn; - public Boolean showAxisLabels; - public Boolean showPercentage; - public Boolean showTotal; - public Boolean showValues; - public String size; - public Double summaryAxisManualRangeEnd; - public Double summaryAxisManualRangeStart; - public String summaryAxisRange; - public String textColor; - public Integer textSize; - public String title; - public String titleColor; - public Integer titleSize; - private String[] backgroundColor1_type_info = new String[]{'backgroundColor1','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] backgroundColor2_type_info = new String[]{'backgroundColor2','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] backgroundFadeDir_type_info = new String[]{'backgroundFadeDir','http://soap.sforce.com/2006/04/metadata','ChartBackgroundDirection','0','1','false'}; - private String[] chartSummaries_type_info = new String[]{'chartSummaries','http://soap.sforce.com/2006/04/metadata','ChartSummary','0','-1','false'}; - private String[] chartType_type_info = new String[]{'chartType','http://soap.sforce.com/2006/04/metadata','ChartType','1','1','false'}; - private String[] enableHoverLabels_type_info = new String[]{'enableHoverLabels','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] expandOthers_type_info = new String[]{'expandOthers','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] groupingColumn_type_info = new String[]{'groupingColumn','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] legendPosition_type_info = new String[]{'legendPosition','http://soap.sforce.com/2006/04/metadata','ChartLegendPosition','0','1','false'}; - private String[] location_type_info = new String[]{'location','http://soap.sforce.com/2006/04/metadata','ChartPosition','0','1','false'}; - private String[] secondaryGroupingColumn_type_info = new String[]{'secondaryGroupingColumn','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] showAxisLabels_type_info = new String[]{'showAxisLabels','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showPercentage_type_info = new String[]{'showPercentage','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showTotal_type_info = new String[]{'showTotal','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showValues_type_info = new String[]{'showValues','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] size_type_info = new String[]{'size','http://soap.sforce.com/2006/04/metadata','ReportChartSize','0','1','false'}; - private String[] summaryAxisManualRangeEnd_type_info = new String[]{'summaryAxisManualRangeEnd','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] summaryAxisManualRangeStart_type_info = new String[]{'summaryAxisManualRangeStart','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] summaryAxisRange_type_info = new String[]{'summaryAxisRange','http://soap.sforce.com/2006/04/metadata','ChartRangeType','0','1','false'}; - private String[] textColor_type_info = new String[]{'textColor','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] textSize_type_info = new String[]{'textSize','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] title_type_info = new String[]{'title','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] titleColor_type_info = new String[]{'titleColor','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] titleSize_type_info = new String[]{'titleSize','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; + public class ReadCustomApplicationResult implements IReadResult { + public MetadataService.CustomApplication[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'backgroundColor1','backgroundColor2','backgroundFadeDir','chartSummaries','chartType','enableHoverLabels','expandOthers','groupingColumn','legendPosition','location','secondaryGroupingColumn','showAxisLabels','showPercentage','showTotal','showValues','size','summaryAxisManualRangeEnd','summaryAxisManualRangeStart','summaryAxisRange','textColor','textSize','title','titleColor','titleSize'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class checkRetrieveStatusResponse_element { - public MetadataService.RetrieveResult result; - private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata','RetrieveResult','1','1','false'}; + public class readCustomApplicationResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomApplicationResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'result'}; } - public class KnowledgeCaseSettings { - public String articlePDFCreationProfile; - public MetadataService.KnowledgeSitesSettings articlePublicSharingSites; - public MetadataService.KnowledgeSitesSettings articlePublicSharingSitesChatterAnswers; - public String assignTo; - public String customizationClass; - public String defaultContributionArticleType; - public String editor; - public Boolean enableArticleCreation; - public Boolean enableArticlePublicSharingSites; - public Boolean useProfileForPDFCreation; - private String[] articlePDFCreationProfile_type_info = new String[]{'articlePDFCreationProfile','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] articlePublicSharingSites_type_info = new String[]{'articlePublicSharingSites','http://soap.sforce.com/2006/04/metadata','KnowledgeSitesSettings','0','1','false'}; - private String[] articlePublicSharingSitesChatterAnswers_type_info = new String[]{'articlePublicSharingSitesChatterAnswers','http://soap.sforce.com/2006/04/metadata','KnowledgeSitesSettings','0','1','false'}; - private String[] assignTo_type_info = new String[]{'assignTo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] customizationClass_type_info = new String[]{'customizationClass','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] defaultContributionArticleType_type_info = new String[]{'defaultContributionArticleType','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] editor_type_info = new String[]{'editor','http://soap.sforce.com/2006/04/metadata','KnowledgeCaseEditor','0','1','false'}; - private String[] enableArticleCreation_type_info = new String[]{'enableArticleCreation','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enableArticlePublicSharingSites_type_info = new String[]{'enableArticlePublicSharingSites','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] useProfileForPDFCreation_type_info = new String[]{'useProfileForPDFCreation','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + public class ReadPortalResult implements IReadResult { + public MetadataService.Portal[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'articlePDFCreationProfile','articlePublicSharingSites','articlePublicSharingSitesChatterAnswers','assignTo','customizationClass','defaultContributionArticleType','editor','enableArticleCreation','enableArticlePublicSharingSites','useProfileForPDFCreation'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class ProfileFieldLevelSecurity { - public Boolean editable; - public String field; - public Boolean readable; - private String[] editable_type_info = new String[]{'editable','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] readable_type_info = new String[]{'readable','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + public class readPortalResponse_element implements IReadResponseElement { + public MetadataService.ReadPortalResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'editable','field','readable'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class SharingReason { - public String label; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadLetterheadResult implements IReadResult { + public MetadataService.Letterhead[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'label'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class MiniLayout { - public String[] fields; - public MetadataService.RelatedListItem[] relatedLists; - private String[] fields_type_info = new String[]{'fields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] relatedLists_type_info = new String[]{'relatedLists','http://soap.sforce.com/2006/04/metadata','RelatedListItem','0','-1','false'}; + public class readLetterheadResponse_element implements IReadResponseElement { + public MetadataService.ReadLetterheadResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'fields','relatedLists'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class ReportBucketFieldSourceValue { - public String from_x; - public String sourceValue; - public String to; - private String[] from_x_type_info = new String[]{'from','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] sourceValue_type_info = new String[]{'sourceValue','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] to_type_info = new String[]{'to','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + public class ReadFlowResult implements IReadResult { + public MetadataService.Flow[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'from_x','sourceValue','to'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class CustomDataTypeComponent { - public String developerSuffix; - public Boolean enforceFieldRequiredness; - public String label; - public Integer length; - public Integer precision; - public Integer scale; - public String sortOrder; - public Integer sortPriority; - public String type_x; - private String[] developerSuffix_type_info = new String[]{'developerSuffix','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] enforceFieldRequiredness_type_info = new String[]{'enforceFieldRequiredness','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] length_type_info = new String[]{'length','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] precision_type_info = new String[]{'precision','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] scale_type_info = new String[]{'scale','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata','SortOrder','0','1','false'}; - private String[] sortPriority_type_info = new String[]{'sortPriority','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata','FieldType','1','1','false'}; + public class readFlowResponse_element implements IReadResponseElement { + public MetadataService.ReadFlowResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'developerSuffix','enforceFieldRequiredness','label','length','precision','scale','sortOrder','sortPriority','type_x'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class CustomObjectTranslation { - public MetadataService.ObjectNameCaseValue[] caseValues; - public MetadataService.CustomFieldTranslation[] fields; - public String gender; - public MetadataService.LayoutTranslation[] layouts; - public String nameFieldLabel; - public MetadataService.NamedFilterTranslation[] namedFilters; - public MetadataService.QuickActionTranslation[] quickActions; - public MetadataService.RecordTypeTranslation[] recordTypes; - public MetadataService.SharingReasonTranslation[] sharingReasons; - public String startsWith; - public MetadataService.ValidationRuleTranslation[] validationRules; - public MetadataService.WebLinkTranslation[] webLinks; - public MetadataService.WorkflowTaskTranslation[] workflowTasks; - private String[] caseValues_type_info = new String[]{'caseValues','http://soap.sforce.com/2006/04/metadata','ObjectNameCaseValue','0','-1','false'}; - private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata','CustomFieldTranslation','0','-1','false'}; - private String[] gender_type_info = new String[]{'gender','http://soap.sforce.com/2006/04/metadata','Gender','0','1','false'}; - private String[] layouts_type_info = new String[]{'layouts','http://soap.sforce.com/2006/04/metadata','LayoutTranslation','0','-1','false'}; - private String[] nameFieldLabel_type_info = new String[]{'nameFieldLabel','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] namedFilters_type_info = new String[]{'namedFilters','http://soap.sforce.com/2006/04/metadata','NamedFilterTranslation','0','-1','false'}; - private String[] quickActions_type_info = new String[]{'quickActions','http://soap.sforce.com/2006/04/metadata','QuickActionTranslation','0','-1','false'}; - private String[] recordTypes_type_info = new String[]{'recordTypes','http://soap.sforce.com/2006/04/metadata','RecordTypeTranslation','0','-1','false'}; - private String[] sharingReasons_type_info = new String[]{'sharingReasons','http://soap.sforce.com/2006/04/metadata','SharingReasonTranslation','0','-1','false'}; - private String[] startsWith_type_info = new String[]{'startsWith','http://soap.sforce.com/2006/04/metadata','StartsWith','0','1','false'}; - private String[] validationRules_type_info = new String[]{'validationRules','http://soap.sforce.com/2006/04/metadata','ValidationRuleTranslation','0','-1','false'}; - private String[] webLinks_type_info = new String[]{'webLinks','http://soap.sforce.com/2006/04/metadata','WebLinkTranslation','0','-1','false'}; - private String[] workflowTasks_type_info = new String[]{'workflowTasks','http://soap.sforce.com/2006/04/metadata','WorkflowTaskTranslation','0','-1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'caseValues','fields','gender','layouts','nameFieldLabel','namedFilters','quickActions','recordTypes','sharingReasons','startsWith','validationRules','webLinks','workflowTasks'}; - } - public class CustomApplication { - public MetadataService.CustomApplicationComponents customApplicationComponents; - public String defaultLandingTab; - public String description; - public String detailPageRefreshMethod; - public MetadataService.DomainWhitelist domainWhitelist; - public Boolean enableKeyboardShortcuts; - public Boolean isServiceCloudConsole; - public MetadataService.KeyboardShortcuts keyboardShortcuts; - public String label; - public MetadataService.ListPlacement listPlacement; - public String listRefreshMethod; - public MetadataService.LiveAgentConfig liveAgentConfig; - public String logo; - public MetadataService.PushNotifications pushNotifications; - public Boolean saveUserSessions; - public String[] tab; - public MetadataService.WorkspaceMappings workspaceMappings; - private String[] customApplicationComponents_type_info = new String[]{'customApplicationComponents','http://soap.sforce.com/2006/04/metadata','CustomApplicationComponents','0','1','false'}; - private String[] defaultLandingTab_type_info = new String[]{'defaultLandingTab','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] detailPageRefreshMethod_type_info = new String[]{'detailPageRefreshMethod','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] domainWhitelist_type_info = new String[]{'domainWhitelist','http://soap.sforce.com/2006/04/metadata','DomainWhitelist','0','1','false'}; - private String[] enableKeyboardShortcuts_type_info = new String[]{'enableKeyboardShortcuts','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] isServiceCloudConsole_type_info = new String[]{'isServiceCloudConsole','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] keyboardShortcuts_type_info = new String[]{'keyboardShortcuts','http://soap.sforce.com/2006/04/metadata','KeyboardShortcuts','0','1','false'}; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] listPlacement_type_info = new String[]{'listPlacement','http://soap.sforce.com/2006/04/metadata','ListPlacement','0','1','false'}; - private String[] listRefreshMethod_type_info = new String[]{'listRefreshMethod','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] liveAgentConfig_type_info = new String[]{'liveAgentConfig','http://soap.sforce.com/2006/04/metadata','LiveAgentConfig','0','1','false'}; - private String[] logo_type_info = new String[]{'logo','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] pushNotifications_type_info = new String[]{'pushNotifications','http://soap.sforce.com/2006/04/metadata','PushNotifications','0','1','false'}; - private String[] saveUserSessions_type_info = new String[]{'saveUserSessions','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] tab_type_info = new String[]{'tab','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] workspaceMappings_type_info = new String[]{'workspaceMappings','http://soap.sforce.com/2006/04/metadata','WorkspaceMappings','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'customApplicationComponents','defaultLandingTab','description','detailPageRefreshMethod','domainWhitelist','enableKeyboardShortcuts','isServiceCloudConsole','keyboardShortcuts','label','listPlacement','listRefreshMethod','liveAgentConfig','logo','pushNotifications','saveUserSessions','tab','workspaceMappings'}; + public class ReadWorkflowResult implements IReadResult { + public MetadataService.Workflow[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class ReportAggregate { - public String acrossGroupingContext; - public String calculatedFormula; - public String datatype; - public String description; - public String developerName; - public String downGroupingContext; - public Boolean isActive; - public Boolean isCrossBlock; - public String masterLabel; - public String reportType; - public Integer scale; - private String[] acrossGroupingContext_type_info = new String[]{'acrossGroupingContext','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] calculatedFormula_type_info = new String[]{'calculatedFormula','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] datatype_type_info = new String[]{'datatype','http://soap.sforce.com/2006/04/metadata','ReportAggregateDatatype','1','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] developerName_type_info = new String[]{'developerName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] downGroupingContext_type_info = new String[]{'downGroupingContext','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] isActive_type_info = new String[]{'isActive','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'}; - private String[] isCrossBlock_type_info = new String[]{'isCrossBlock','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] masterLabel_type_info = new String[]{'masterLabel','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] reportType_type_info = new String[]{'reportType','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] scale_type_info = new String[]{'scale','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; + public class readWorkflowResponse_element implements IReadResponseElement { + public MetadataService.ReadWorkflowResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'acrossGroupingContext','calculatedFormula','datatype','description','developerName','downGroupingContext','isActive','isCrossBlock','masterLabel','reportType','scale'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class AgentConfigUserAssignments { - public String[] user_x; - private String[] user_x_type_info = new String[]{'user','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + public class ReadWorkflowRuleResult implements IReadResult { + public MetadataService.WorkflowRule[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'user_x'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class DashboardMobileSettings { - public Boolean enableDashboardIPadApp; - private String[] enableDashboardIPadApp_type_info = new String[]{'enableDashboardIPadApp','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; + public class readWorkflowRuleResponse_element implements IReadResponseElement { + public MetadataService.ReadWorkflowRuleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'enableDashboardIPadApp'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class NetworkMemberGroup { - public String[] permissionSet; - public String[] profile; - private String[] permissionSet_type_info = new String[]{'permissionSet','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] profile_type_info = new String[]{'profile','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + public class ReadAssignmentRulesResult implements IReadResult { + public MetadataService.AssignmentRules[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'permissionSet','profile'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class CampaignSharingRules { - public MetadataService.CampaignCriteriaBasedSharingRule[] criteriaBasedRules; - public MetadataService.CampaignOwnerSharingRule[] ownerRules; - private String[] criteriaBasedRules_type_info = new String[]{'criteriaBasedRules','http://soap.sforce.com/2006/04/metadata','CampaignCriteriaBasedSharingRule','0','-1','false'}; - private String[] ownerRules_type_info = new String[]{'ownerRules','http://soap.sforce.com/2006/04/metadata','CampaignOwnerSharingRule','0','-1','false'}; + public class readAssignmentRulesResponse_element implements IReadResponseElement { + public MetadataService.ReadAssignmentRulesResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'criteriaBasedRules','ownerRules'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class DebuggingInfo_element { - public String debugLog; - private String[] debugLog_type_info = new String[]{'debugLog','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadAssignmentRuleResult implements IReadResult { + public MetadataService.AssignmentRule[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'debugLog'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class Package_x { - public String apiAccessLevel; - public String description; - public String namespacePrefix; - public MetadataService.ProfileObjectPermissions[] objectPermissions; - public String postInstallClass; - public String setupWeblink; - public MetadataService.PackageTypeMembers[] types; - public String uninstallClass; - public String version; - private String[] apiAccessLevel_type_info = new String[]{'apiAccessLevel','http://soap.sforce.com/2006/04/metadata','APIAccessLevel','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] namespacePrefix_type_info = new String[]{'namespacePrefix','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] objectPermissions_type_info = new String[]{'objectPermissions','http://soap.sforce.com/2006/04/metadata','ProfileObjectPermissions','0','-1','false'}; - private String[] postInstallClass_type_info = new String[]{'postInstallClass','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] setupWeblink_type_info = new String[]{'setupWeblink','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] types_type_info = new String[]{'types','http://soap.sforce.com/2006/04/metadata','PackageTypeMembers','0','-1','false'}; - private String[] uninstallClass_type_info = new String[]{'uninstallClass','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] version_type_info = new String[]{'version','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'apiAccessLevel','description','namespacePrefix','objectPermissions','postInstallClass','setupWeblink','types','uninstallClass','version'}; + public class readAssignmentRuleResponse_element implements IReadResponseElement { + public MetadataService.ReadAssignmentRuleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class FindSimilarOppFilter { - public String[] similarOpportunitiesDisplayColumns; - public String[] similarOpportunitiesMatchFields; - private String[] similarOpportunitiesDisplayColumns_type_info = new String[]{'similarOpportunitiesDisplayColumns','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] similarOpportunitiesMatchFields_type_info = new String[]{'similarOpportunitiesMatchFields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + public class ReadAutoResponseRulesResult implements IReadResult { + public MetadataService.AutoResponseRules[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'similarOpportunitiesDisplayColumns','similarOpportunitiesMatchFields'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class Community { - public Boolean active; - public String communityFeedPage; - public String description; - public String emailFooterDocument; - public String emailHeaderDocument; - public String emailNotificationUrl; - public Boolean enableChatterAnswers; - public Boolean enablePrivateQuestions; - public String expertsGroup; - public String portal; - public MetadataService.ReputationLevels reputationLevels; - public Boolean showInPortal; - public String site; - private String[] active_type_info = new String[]{'active','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] communityFeedPage_type_info = new String[]{'communityFeedPage','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] emailFooterDocument_type_info = new String[]{'emailFooterDocument','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] emailHeaderDocument_type_info = new String[]{'emailHeaderDocument','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] emailNotificationUrl_type_info = new String[]{'emailNotificationUrl','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] enableChatterAnswers_type_info = new String[]{'enableChatterAnswers','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] enablePrivateQuestions_type_info = new String[]{'enablePrivateQuestions','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] expertsGroup_type_info = new String[]{'expertsGroup','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] portal_type_info = new String[]{'portal','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] reputationLevels_type_info = new String[]{'reputationLevels','http://soap.sforce.com/2006/04/metadata','ReputationLevels','0','1','false'}; - private String[] showInPortal_type_info = new String[]{'showInPortal','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] site_type_info = new String[]{'site','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'active','communityFeedPage','description','emailFooterDocument','emailHeaderDocument','emailNotificationUrl','enableChatterAnswers','enablePrivateQuestions','expertsGroup','portal','reputationLevels','showInPortal','site'}; + public class readAutoResponseRulesResponse_element implements IReadResponseElement { + public MetadataService.ReadAutoResponseRulesResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class LayoutItem { - public String behavior; - public String customLink; - public Boolean emptySpace; - public String field; - public Integer height; - public String page_x; - public String scontrol; - public Boolean showLabel; - public Boolean showScrollbars; - public String width; - private String[] behavior_type_info = new String[]{'behavior','http://soap.sforce.com/2006/04/metadata','UiBehavior','0','1','false'}; - private String[] customLink_type_info = new String[]{'customLink','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] emptySpace_type_info = new String[]{'emptySpace','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] field_type_info = new String[]{'field','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] height_type_info = new String[]{'height','http://www.w3.org/2001/XMLSchema','int','0','1','false'}; - private String[] page_x_type_info = new String[]{'page','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] scontrol_type_info = new String[]{'scontrol','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] showLabel_type_info = new String[]{'showLabel','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] showScrollbars_type_info = new String[]{'showScrollbars','http://www.w3.org/2001/XMLSchema','boolean','0','1','false'}; - private String[] width_type_info = new String[]{'width','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; - private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'behavior','customLink','emptySpace','field','height','page_x','scontrol','showLabel','showScrollbars','width'}; + public class ReadAutoResponseRuleResult implements IReadResult { + public MetadataService.AutoResponseRule[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class SharingReasonTranslation { - public String label; - public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class readAutoResponseRuleResponse_element implements IReadResponseElement { + public MetadataService.ReadAutoResponseRuleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'label','name'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class checkDeployStatusResponse_element { - public MetadataService.DeployResult result; - private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata','DeployResult','1','1','false'}; + public class ReadEscalationRulesResult implements IReadResult { + public MetadataService.EscalationRules[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readEscalationRulesResponse_element implements IReadResponseElement { + public MetadataService.ReadEscalationRulesResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; private String[] field_order_type_info = new String[]{'result'}; } - public class ReportColorRange { - public String aggregate; - public String columnName; - public Double highBreakpoint; - public String highColor; - public Double lowBreakpoint; - public String lowColor; - public String midColor; - private String[] aggregate_type_info = new String[]{'aggregate','http://soap.sforce.com/2006/04/metadata','ReportSummaryType','0','1','false'}; - private String[] columnName_type_info = new String[]{'columnName','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] highBreakpoint_type_info = new String[]{'highBreakpoint','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] highColor_type_info = new String[]{'highColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] lowBreakpoint_type_info = new String[]{'lowBreakpoint','http://www.w3.org/2001/XMLSchema','double','0','1','false'}; - private String[] lowColor_type_info = new String[]{'lowColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] midColor_type_info = new String[]{'midColor','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadEscalationRuleResult implements IReadResult { + public MetadataService.EscalationRule[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'aggregate','columnName','highBreakpoint','highColor','lowBreakpoint','lowColor','midColor'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class SearchLayouts { - public String[] customTabListAdditionalFields; - public String[] excludedStandardButtons; - public String[] listViewButtons; - public String[] lookupDialogsAdditionalFields; - public String[] lookupFilterFields; - public String[] lookupPhoneDialogsAdditionalFields; - public String[] searchFilterFields; - public String[] searchResultsAdditionalFields; - public String[] searchResultsCustomButtons; - private String[] customTabListAdditionalFields_type_info = new String[]{'customTabListAdditionalFields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] excludedStandardButtons_type_info = new String[]{'excludedStandardButtons','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] listViewButtons_type_info = new String[]{'listViewButtons','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] lookupDialogsAdditionalFields_type_info = new String[]{'lookupDialogsAdditionalFields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] lookupFilterFields_type_info = new String[]{'lookupFilterFields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] lookupPhoneDialogsAdditionalFields_type_info = new String[]{'lookupPhoneDialogsAdditionalFields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] searchFilterFields_type_info = new String[]{'searchFilterFields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] searchResultsAdditionalFields_type_info = new String[]{'searchResultsAdditionalFields','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; - private String[] searchResultsCustomButtons_type_info = new String[]{'searchResultsCustomButtons','http://www.w3.org/2001/XMLSchema','string','0','-1','false'}; + public class readEscalationRuleResponse_element implements IReadResponseElement { + public MetadataService.ReadEscalationRuleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'customTabListAdditionalFields','excludedStandardButtons','listViewButtons','lookupDialogsAdditionalFields','lookupFilterFields','lookupPhoneDialogsAdditionalFields','searchFilterFields','searchResultsAdditionalFields','searchResultsCustomButtons'}; + private String[] field_order_type_info = new String[]{'result'}; } - public class QuickActionTranslation { - public String label; - public String name; - private String[] label_type_info = new String[]{'label','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; - private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'}; + public class ReadPostTemplateResult implements IReadResult { + public MetadataService.PostTemplate[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'label','name'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readPostTemplateResponse_element implements IReadResponseElement { + public MetadataService.ReadPostTemplateResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadApprovalProcessResult implements IReadResult { + public MetadataService.ApprovalProcess[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readApprovalProcessResponse_element implements IReadResponseElement { + public MetadataService.ReadApprovalProcessResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadHomePageComponentResult implements IReadResult { + public MetadataService.HomePageComponent[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readHomePageComponentResponse_element implements IReadResponseElement { + public MetadataService.ReadHomePageComponentResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadHomePageLayoutResult implements IReadResult { + public MetadataService.HomePageLayout[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readHomePageLayoutResponse_element implements IReadResponseElement { + public MetadataService.ReadHomePageLayoutResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadCustomObjectTranslationResult implements IReadResult { + public MetadataService.CustomObjectTranslation[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readCustomObjectTranslationResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomObjectTranslationResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadTranslationsResult implements IReadResult { + public MetadataService.Translations[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readTranslationsResponse_element implements IReadResponseElement { + public MetadataService.ReadTranslationsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadProfileResult implements IReadResult { + public MetadataService.Profile[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readProfileResponse_element implements IReadResponseElement { + public MetadataService.ReadProfileResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadPermissionSetResult implements IReadResult { + public MetadataService.PermissionSet[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readPermissionSetResponse_element implements IReadResponseElement { + public MetadataService.ReadPermissionSetResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadDataCategoryGroupResult implements IReadResult { + public MetadataService.DataCategoryGroup[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readDataCategoryGroupResponse_element implements IReadResponseElement { + public MetadataService.ReadDataCategoryGroupResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadRemoteSiteSettingResult implements IReadResult { + public MetadataService.RemoteSiteSetting[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readRemoteSiteSettingResponse_element implements IReadResponseElement { + public MetadataService.ReadRemoteSiteSettingResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadPackageResult implements IReadResult { + public MetadataService.Package_x[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readPackageResponse_element implements IReadResponseElement { + public MetadataService.ReadPackageResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadAuthProviderResult implements IReadResult { + public MetadataService.AuthProvider[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readAuthProviderResponse_element implements IReadResponseElement { + public MetadataService.ReadAuthProviderResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadKnowledgeSettingsResult implements IReadResult { + public MetadataService.KnowledgeSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readKnowledgeSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadKnowledgeSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSharingSetResult implements IReadResult { + public MetadataService.SharingSet[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSharingSetResponse_element implements IReadResponseElement { + public MetadataService.ReadSharingSetResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSecuritySettingsResult implements IReadResult { + public MetadataService.SecuritySettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSecuritySettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadSecuritySettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadIdeasSettingsResult implements IReadResult { + public MetadataService.IdeasSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; } - public class AccountSharingRules { - public MetadataService.AccountCriteriaBasedSharingRule[] criteriaBasedRules; - public MetadataService.AccountOwnerSharingRule[] ownerRules; - private String[] criteriaBasedRules_type_info = new String[]{'criteriaBasedRules','http://soap.sforce.com/2006/04/metadata','AccountCriteriaBasedSharingRule','0','-1','false'}; - private String[] ownerRules_type_info = new String[]{'ownerRules','http://soap.sforce.com/2006/04/metadata','AccountOwnerSharingRule','0','-1','false'}; + public class readIdeasSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadIdeasSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; - private String[] field_order_type_info = new String[]{'criteriaBasedRules','ownerRules'}; -} - } \ No newline at end of file + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadChatterAnswersSettingsResult implements IReadResult { + public MetadataService.ChatterAnswersSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readChatterAnswersSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadChatterAnswersSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadCommunityResult implements IReadResult { + public MetadataService.Community[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readCommunityResponse_element implements IReadResponseElement { + public MetadataService.ReadCommunityResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadActivitiesSettingsResult implements IReadResult { + public MetadataService.ActivitiesSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readActivitiesSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadActivitiesSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadContractSettingsResult implements IReadResult { + public MetadataService.ContractSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readContractSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadContractSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadOrderSettingsResult implements IReadResult { + public MetadataService.OrderSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readOrderSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadOrderSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadOpportunitySettingsResult implements IReadResult { + public MetadataService.OpportunitySettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readOpportunitySettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadOpportunitySettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadProductSettingsResult implements IReadResult { + public MetadataService.ProductSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readProductSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadProductSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadQuoteSettingsResult implements IReadResult { + public MetadataService.QuoteSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readQuoteSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadQuoteSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadCallCenterResult implements IReadResult { + public MetadataService.CallCenter[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readCallCenterResponse_element implements IReadResponseElement { + public MetadataService.ReadCallCenterResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadEntitlementProcessResult implements IReadResult { + public MetadataService.EntitlementProcess[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readEntitlementProcessResponse_element implements IReadResponseElement { + public MetadataService.ReadEntitlementProcessResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadMilestoneTypeResult implements IReadResult { + public MetadataService.MilestoneType[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readMilestoneTypeResponse_element implements IReadResponseElement { + public MetadataService.ReadMilestoneTypeResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadEntitlementTemplateResult implements IReadResult { + public MetadataService.EntitlementTemplate[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readEntitlementTemplateResponse_element implements IReadResponseElement { + public MetadataService.ReadEntitlementTemplateResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadEntitlementSettingsResult implements IReadResult { + public MetadataService.EntitlementSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readEntitlementSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadEntitlementSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadBusinessHoursSettingsResult implements IReadResult { + public MetadataService.BusinessHoursSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readBusinessHoursSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadBusinessHoursSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadBusinessHoursEntryResult implements IReadResult { + public MetadataService.BusinessHoursEntry[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readBusinessHoursEntryResponse_element implements IReadResponseElement { + public MetadataService.ReadBusinessHoursEntryResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadConnectedAppResult implements IReadResult { + public MetadataService.ConnectedApp[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readConnectedAppResponse_element implements IReadResponseElement { + public MetadataService.ReadConnectedAppResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadAppMenuResult implements IReadResult { + public MetadataService.AppMenu[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readAppMenuResponse_element implements IReadResponseElement { + public MetadataService.ReadAppMenuResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadMobileSettingsResult implements IReadResult { + public MetadataService.MobileSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readMobileSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadMobileSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadNetworkResult implements IReadResult { + public MetadataService.Network[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readNetworkResponse_element implements IReadResponseElement { + public MetadataService.ReadNetworkResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadCompanySettingsResult implements IReadResult { + public MetadataService.CompanySettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readCompanySettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadCompanySettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadForecastingSettingsResult implements IReadResult { + public MetadataService.ForecastingSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readForecastingSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadForecastingSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSamlSsoConfigResult implements IReadResult { + public MetadataService.SamlSsoConfig[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSamlSsoConfigResponse_element implements IReadResponseElement { + public MetadataService.ReadSamlSsoConfigResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadLiveAgentSettingsResult implements IReadResult { + public MetadataService.LiveAgentSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readLiveAgentSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadLiveAgentSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSkillResult implements IReadResult { + public MetadataService.Skill[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSkillResponse_element implements IReadResponseElement { + public MetadataService.ReadSkillResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadLiveChatDeploymentResult implements IReadResult { + public MetadataService.LiveChatDeployment[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readLiveChatDeploymentResponse_element implements IReadResponseElement { + public MetadataService.ReadLiveChatDeploymentResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadLiveChatButtonResult implements IReadResult { + public MetadataService.LiveChatButton[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readLiveChatButtonResponse_element implements IReadResponseElement { + public MetadataService.ReadLiveChatButtonResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadLiveChatAgentConfigResult implements IReadResult { + public MetadataService.LiveChatAgentConfig[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readLiveChatAgentConfigResponse_element implements IReadResponseElement { + public MetadataService.ReadLiveChatAgentConfigResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSynonymDictionaryResult implements IReadResult { + public MetadataService.SynonymDictionary[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSynonymDictionaryResponse_element implements IReadResponseElement { + public MetadataService.ReadSynonymDictionaryResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadFolderResult implements IReadResult { + public MetadataService.Folder[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readFolderResponse_element implements IReadResponseElement { + public MetadataService.ReadFolderResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadReportFolderResult implements IReadResult { + public MetadataService.ReportFolder[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readReportFolderResponse_element implements IReadResponseElement { + public MetadataService.ReadReportFolderResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadDashboardFolderResult implements IReadResult { + public MetadataService.DashboardFolder[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readDashboardFolderResponse_element implements IReadResponseElement { + public MetadataService.ReadDashboardFolderResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadDocumentFolderResult implements IReadResult { + public MetadataService.DocumentFolder[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readDocumentFolderResponse_element implements IReadResponseElement { + public MetadataService.ReadDocumentFolderResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadEmailFolderResult implements IReadResult { + public MetadataService.EmailFolder[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readEmailFolderResponse_element implements IReadResponseElement { + public MetadataService.ReadEmailFolderResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadRoleOrTerritoryResult implements IReadResult { + public MetadataService.RoleOrTerritory[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readRoleOrTerritoryResponse_element implements IReadResponseElement { + public MetadataService.ReadRoleOrTerritoryResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadWorkflowActionResult implements IReadResult { + public MetadataService.WorkflowAction[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readWorkflowActionResponse_element implements IReadResponseElement { + public MetadataService.ReadWorkflowActionResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSiteDotComResult implements IReadResult { + public MetadataService.SiteDotCom[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSiteDotComResponse_element implements IReadResponseElement { + public MetadataService.ReadSiteDotComResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadWorkflowTaskResult implements IReadResult { + public MetadataService.WorkflowTask[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readWorkflowTaskResponse_element implements IReadResponseElement { + public MetadataService.ReadWorkflowTaskResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadWorkflowSendResult implements IReadResult { + public MetadataService.WorkflowSend[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readWorkflowSendResponse_element implements IReadResponseElement { + public MetadataService.ReadWorkflowSendResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadWorkflowOutboundMessageResult implements IReadResult { + public MetadataService.WorkflowOutboundMessage[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readWorkflowOutboundMessageResponse_element implements IReadResponseElement { + public MetadataService.ReadWorkflowOutboundMessageResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadWorkflowKnowledgePublishResult implements IReadResult { + public MetadataService.WorkflowKnowledgePublish[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readWorkflowKnowledgePublishResponse_element implements IReadResponseElement { + public MetadataService.ReadWorkflowKnowledgePublishResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadWorkflowFieldUpdateResult implements IReadResult { + public MetadataService.WorkflowFieldUpdate[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readWorkflowFieldUpdateResponse_element implements IReadResponseElement { + public MetadataService.ReadWorkflowFieldUpdateResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadWorkflowAlertResult implements IReadResult { + public MetadataService.WorkflowAlert[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readWorkflowAlertResponse_element implements IReadResponseElement { + public MetadataService.ReadWorkflowAlertResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadVisualizationPluginResult implements IReadResult { + public MetadataService.VisualizationPlugin[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readVisualizationPluginResponse_element implements IReadResponseElement { + public MetadataService.ReadVisualizationPluginResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadCustomMetadataResult implements IReadResult { + public MetadataService.CustomMetadata[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readCustomMetadataResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomMetadataResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadNameSettingsResult implements IReadResult { + public MetadataService.NameSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readNameSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadNameSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadMarketingActionSettingsResult implements IReadResult { + public MetadataService.MarketingActionSettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readMarketingActionSettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadMarketingActionSettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadCustomPermissionResult implements IReadResult { + public MetadataService.CustomPermission[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readCustomPermissionResponse_element implements IReadResponseElement { + public MetadataService.ReadCustomPermissionResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadAuraDefinitionBundleResult implements IReadResult { + public MetadataService.AuraDefinitionBundle[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readAuraDefinitionBundleResponse_element implements IReadResponseElement { + public MetadataService.ReadAuraDefinitionBundleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadCorsWhitelistOriginResult implements IReadResult { + public MetadataService.CorsWhitelistOrigin[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readCorsWhitelistOriginResponse_element implements IReadResponseElement { + public MetadataService.ReadCorsWhitelistOriginResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadManagedTopicsResult implements IReadResult { + public MetadataService.ManagedTopics[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readManagedTopicsResponse_element implements IReadResponseElement { + public MetadataService.ReadManagedTopicsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadTerritory2Result implements IReadResult { + public MetadataService.Territory2[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readTerritory2Response_element implements IReadResponseElement { + public MetadataService.ReadTerritory2Result result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadTerritory2ModelResult implements IReadResult { + public MetadataService.Territory2Model[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readTerritory2ModelResponse_element implements IReadResponseElement { + public MetadataService.ReadTerritory2ModelResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadTerritory2SettingsResult implements IReadResult { + public MetadataService.Territory2Settings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readTerritory2SettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadTerritory2SettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadTerritory2TypeResult implements IReadResult { + public MetadataService.Territory2Type[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readTerritory2TypeResponse_element implements IReadResponseElement { + public MetadataService.ReadTerritory2TypeResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadXOrgHubResult implements IReadResult { + public MetadataService.XOrgHub[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readXOrgHubResponse_element implements IReadResponseElement { + public MetadataService.ReadXOrgHubResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadActionLinkGroupTemplateResult implements IReadResult { + public MetadataService.ActionLinkGroupTemplate[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readActionLinkGroupTemplateResponse_element implements IReadResponseElement { + public MetadataService.ReadActionLinkGroupTemplateResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadLicenseDefinitionResult implements IReadResult { + public MetadataService.LicenseDefinition[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readLicenseDefinitionResponse_element implements IReadResponseElement { + public MetadataService.ReadLicenseDefinitionResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadMarketingResourceTypeResult implements IReadResult { + public MetadataService.MarketingResourceType[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readMarketingResourceTypeResponse_element implements IReadResponseElement { + public MetadataService.ReadMarketingResourceTypeResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadMatchingRuleResult implements IReadResult { + public MetadataService.MatchingRule[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readMatchingRuleResponse_element implements IReadResponseElement { + public MetadataService.ReadMatchingRuleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadMatchingRulesResult implements IReadResult { + public MetadataService.MatchingRules[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readMatchingRulesResponse_element implements IReadResponseElement { + public MetadataService.ReadMatchingRulesResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadNamedCredentialResult implements IReadResult { + public MetadataService.NamedCredential[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readNamedCredentialResponse_element implements IReadResponseElement { + public MetadataService.ReadNamedCredentialResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadPersonalJourneySettingsResult implements IReadResult { + public MetadataService.PersonalJourneySettings[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readPersonalJourneySettingsResponse_element implements IReadResponseElement { + public MetadataService.ReadPersonalJourneySettingsResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSharingRulesResult implements IReadResult { + public MetadataService.SharingRules[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSharingRulesResponse_element implements IReadResponseElement { + public MetadataService.ReadSharingRulesResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSharingBaseRuleResult implements IReadResult { + public MetadataService.SharingBaseRule[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSharingBaseRuleResponse_element implements IReadResponseElement { + public MetadataService.ReadSharingBaseRuleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSharingCriteriaRuleResult implements IReadResult { + public MetadataService.SharingCriteriaRule[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSharingCriteriaRuleResponse_element implements IReadResponseElement { + public MetadataService.ReadSharingCriteriaRuleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSharingOwnerRuleResult implements IReadResult { + public MetadataService.SharingOwnerRule[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSharingOwnerRuleResponse_element implements IReadResponseElement { + public MetadataService.ReadSharingOwnerRuleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadSharingTerritoryRuleResult implements IReadResult { + public MetadataService.SharingTerritoryRule[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readSharingTerritoryRuleResponse_element implements IReadResponseElement { + public MetadataService.ReadSharingTerritoryRuleResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadPlatformActionListResult implements IReadResult { + public MetadataService.PlatformActionList[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readPlatformActionListResponse_element implements IReadResponseElement { + public MetadataService.ReadPlatformActionListResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadFlowDefinitionResult implements IReadResult { + public MetadataService.FlowDefinition[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readFlowDefinitionResponse_element implements IReadResponseElement { + public MetadataService.ReadFlowDefinitionResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadPathAssistantResult implements IReadResult { + public MetadataService.PathAssistant[] records; + public MetadataService.Metadata[] getRecords() { return records; } + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class readPathAssistantResponse_element implements IReadResponseElement { + public MetadataService.ReadPathAssistantResult result; + public IReadResult getResult() { return result; } + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReadResult { + public MetadataService.Metadata[] records; + private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'records'}; + } + public class ApprovalProcess extends Metadata { + public String type = 'ApprovalProcess'; + public String fullName; + public Boolean active; + public Boolean allowRecall; + public MetadataService.ApprovalSubmitter[] allowedSubmitters; + public MetadataService.ApprovalPageField approvalPageFields; + public MetadataService.ApprovalStep[] approvalStep; + public String description; + public String emailTemplate; + public Boolean enableMobileDeviceAccess; + public MetadataService.ApprovalEntryCriteria entryCriteria; + public MetadataService.ApprovalAction finalApprovalActions; + public Boolean finalApprovalRecordLock; + public MetadataService.ApprovalAction finalRejectionActions; + public Boolean finalRejectionRecordLock; + public MetadataService.ApprovalAction initialSubmissionActions; + public String label; + public MetadataService.NextAutomatedApprover nextAutomatedApprover; + public String postTemplate; + public MetadataService.ApprovalAction recallActions; + public String recordEditability; + public Boolean showApprovalHistory; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] allowRecall_type_info = new String[]{'allowRecall','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] allowedSubmitters_type_info = new String[]{'allowedSubmitters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] approvalPageFields_type_info = new String[]{'approvalPageFields','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] approvalStep_type_info = new String[]{'approvalStep','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailTemplate_type_info = new String[]{'emailTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableMobileDeviceAccess_type_info = new String[]{'enableMobileDeviceAccess','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] entryCriteria_type_info = new String[]{'entryCriteria','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] finalApprovalActions_type_info = new String[]{'finalApprovalActions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] finalApprovalRecordLock_type_info = new String[]{'finalApprovalRecordLock','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] finalRejectionActions_type_info = new String[]{'finalRejectionActions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] finalRejectionRecordLock_type_info = new String[]{'finalRejectionRecordLock','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] initialSubmissionActions_type_info = new String[]{'initialSubmissionActions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] nextAutomatedApprover_type_info = new String[]{'nextAutomatedApprover','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] postTemplate_type_info = new String[]{'postTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recallActions_type_info = new String[]{'recallActions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recordEditability_type_info = new String[]{'recordEditability','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] showApprovalHistory_type_info = new String[]{'showApprovalHistory','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','allowRecall','allowedSubmitters','approvalPageFields','approvalStep','description','emailTemplate','enableMobileDeviceAccess','entryCriteria','finalApprovalActions','finalApprovalRecordLock','finalRejectionActions','finalRejectionRecordLock','initialSubmissionActions','label','nextAutomatedApprover','postTemplate','recallActions','recordEditability','showApprovalHistory'}; + } + public class MilestoneType extends Metadata { + public String type = 'MilestoneType'; + public String fullName; + public String description; + public String recurrenceType; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recurrenceType_type_info = new String[]{'recurrenceType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'description','recurrenceType'}; + } + public class FileProperties { + public String createdById; + public String createdByName; + public DateTime createdDate; + public String fileName; + public String fullName; + public String id; + public String lastModifiedById; + public String lastModifiedByName; + public DateTime lastModifiedDate; + public String manageableState; + public String namespacePrefix; + public String type_x; + private String[] createdById_type_info = new String[]{'createdById','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] createdByName_type_info = new String[]{'createdByName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] createdDate_type_info = new String[]{'createdDate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] fileName_type_info = new String[]{'fileName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] fullName_type_info = new String[]{'fullName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] lastModifiedById_type_info = new String[]{'lastModifiedById','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] lastModifiedByName_type_info = new String[]{'lastModifiedByName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] lastModifiedDate_type_info = new String[]{'lastModifiedDate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] manageableState_type_info = new String[]{'manageableState','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] namespacePrefix_type_info = new String[]{'namespacePrefix','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'createdById','createdByName','createdDate','fileName','fullName','id','lastModifiedById','lastModifiedByName','lastModifiedDate','manageableState','namespacePrefix','type_x'}; + } + public class QuickActionLayout { + public String layoutSectionStyle; + public MetadataService.QuickActionLayoutColumn[] quickActionLayoutColumns; + private String[] layoutSectionStyle_type_info = new String[]{'layoutSectionStyle','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] quickActionLayoutColumns_type_info = new String[]{'quickActionLayoutColumns','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'layoutSectionStyle','quickActionLayoutColumns'}; + } + public class Flow extends Metadata { + public String type = 'Flow'; + public String fullName; + public MetadataService.FlowActionCall[] actionCalls; + public MetadataService.FlowApexPluginCall[] apexPluginCalls; + public MetadataService.FlowAssignment[] assignments; + public MetadataService.FlowChoice[] choices; + public MetadataService.FlowConstant[] constants; + public MetadataService.FlowDecision[] decisions; + public String description; + public MetadataService.FlowDynamicChoiceSet[] dynamicChoiceSets; + public MetadataService.FlowFormula[] formulas; + public String interviewLabel; + public String label; + public MetadataService.FlowLoop[] loops; + public MetadataService.FlowMetadataValue[] processMetadataValues; + public String processType; + public MetadataService.FlowRecordCreate[] recordCreates; + public MetadataService.FlowRecordDelete[] recordDeletes; + public MetadataService.FlowRecordLookup[] recordLookups; + public MetadataService.FlowRecordUpdate[] recordUpdates; + public MetadataService.FlowScreen[] screens; + public String startElementReference; + public MetadataService.FlowStep[] steps; + public MetadataService.FlowSubflow[] subflows; + public MetadataService.FlowTextTemplate[] textTemplates; + public MetadataService.FlowVariable[] variables; + public MetadataService.FlowWait[] waits; + private String[] actionCalls_type_info = new String[]{'actionCalls','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apexPluginCalls_type_info = new String[]{'apexPluginCalls','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] assignments_type_info = new String[]{'assignments','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] choices_type_info = new String[]{'choices','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] constants_type_info = new String[]{'constants','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] decisions_type_info = new String[]{'decisions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] dynamicChoiceSets_type_info = new String[]{'dynamicChoiceSets','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] formulas_type_info = new String[]{'formulas','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] interviewLabel_type_info = new String[]{'interviewLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] loops_type_info = new String[]{'loops','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] processMetadataValues_type_info = new String[]{'processMetadataValues','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] processType_type_info = new String[]{'processType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recordCreates_type_info = new String[]{'recordCreates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] recordDeletes_type_info = new String[]{'recordDeletes','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] recordLookups_type_info = new String[]{'recordLookups','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] recordUpdates_type_info = new String[]{'recordUpdates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] screens_type_info = new String[]{'screens','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] startElementReference_type_info = new String[]{'startElementReference','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] steps_type_info = new String[]{'steps','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] subflows_type_info = new String[]{'subflows','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] textTemplates_type_info = new String[]{'textTemplates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] variables_type_info = new String[]{'variables','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] waits_type_info = new String[]{'waits','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'actionCalls','apexPluginCalls','assignments','choices','constants','decisions','description','dynamicChoiceSets','formulas','interviewLabel','label','loops','processMetadataValues','processType','recordCreates','recordDeletes','recordLookups','recordUpdates','screens','startElementReference','steps','subflows','textTemplates','variables','waits'}; + } + public class AutoResponseRule extends Metadata { + public String type = 'AutoResponseRule'; + public String fullName; + public Boolean active; + public MetadataService.RuleEntry[] ruleEntry; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] ruleEntry_type_info = new String[]{'ruleEntry','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','ruleEntry'}; + } + public class PermissionSetObjectPermissions { + public Boolean allowCreate; + public Boolean allowDelete; + public Boolean allowEdit; + public Boolean allowRead; + public Boolean modifyAllRecords; + public String object_x; + public Boolean viewAllRecords; + private String[] allowCreate_type_info = new String[]{'allowCreate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] allowDelete_type_info = new String[]{'allowDelete','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] allowEdit_type_info = new String[]{'allowEdit','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] allowRead_type_info = new String[]{'allowRead','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] modifyAllRecords_type_info = new String[]{'modifyAllRecords','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] object_x_type_info = new String[]{'object','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] viewAllRecords_type_info = new String[]{'viewAllRecords','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'allowCreate','allowDelete','allowEdit','allowRead','modifyAllRecords','object_x','viewAllRecords'}; + } + public class ReportCrossFilter { + public MetadataService.ReportFilterItem[] criteriaItems; + public String operation; + public String primaryTableColumn; + public String relatedTable; + public String relatedTableJoinColumn; + private String[] criteriaItems_type_info = new String[]{'criteriaItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] operation_type_info = new String[]{'operation','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] primaryTableColumn_type_info = new String[]{'primaryTableColumn','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] relatedTable_type_info = new String[]{'relatedTable','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] relatedTableJoinColumn_type_info = new String[]{'relatedTableJoinColumn','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'criteriaItems','operation','primaryTableColumn','relatedTable','relatedTableJoinColumn'}; + } + public class BusinessHoursSettings extends Metadata { + public String type = 'BusinessHoursSettings'; + public String fullName; + public MetadataService.BusinessHoursEntry[] businessHours; + public MetadataService.Holiday[] holidays; + private String[] businessHours_type_info = new String[]{'businessHours','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] holidays_type_info = new String[]{'holidays','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'businessHours','holidays'}; + } + public class FlowWaitEventOutputParameter { + public String assignToReference; + public String name; + private String[] assignToReference_type_info = new String[]{'assignToReference','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'assignToReference','name'}; + } + public class Report extends Metadata { + public String type = 'Report'; + public String fullName; + public MetadataService.ReportAggregate[] aggregates; + public MetadataService.Report[] block; + public MetadataService.ReportBlockInfo blockInfo; + public MetadataService.ReportBucketField[] buckets; + public MetadataService.ReportChart chart; + public MetadataService.ReportColorRange[] colorRanges; + public MetadataService.ReportColumn[] columns; + public MetadataService.ReportCrossFilter[] crossFilters; + public String currency_x; + public MetadataService.ReportDataCategoryFilter[] dataCategoryFilters; + public String description; + public String division; + public MetadataService.ReportFilter filter; + public String format; + public MetadataService.ReportGrouping[] groupingsAcross; + public MetadataService.ReportGrouping[] groupingsDown; + public MetadataService.ReportHistoricalSelector historicalSelector; + public String name; + public MetadataService.ReportParam[] params; + public String reportType; + public String roleHierarchyFilter; + public Integer rowLimit; + public String scope; + public Boolean showCurrentDate; + public Boolean showDetails; + public String sortColumn; + public String sortOrder; + public String territoryHierarchyFilter; + public MetadataService.ReportTimeFrameFilter timeFrameFilter; + public String userFilter; + private String[] aggregates_type_info = new String[]{'aggregates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] block_type_info = new String[]{'block','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] blockInfo_type_info = new String[]{'blockInfo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] buckets_type_info = new String[]{'buckets','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] chart_type_info = new String[]{'chart','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] colorRanges_type_info = new String[]{'colorRanges','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] columns_type_info = new String[]{'columns','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] crossFilters_type_info = new String[]{'crossFilters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] currency_x_type_info = new String[]{'currency','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] dataCategoryFilters_type_info = new String[]{'dataCategoryFilters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] division_type_info = new String[]{'division','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] filter_type_info = new String[]{'filter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] format_type_info = new String[]{'format','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] groupingsAcross_type_info = new String[]{'groupingsAcross','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] groupingsDown_type_info = new String[]{'groupingsDown','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] historicalSelector_type_info = new String[]{'historicalSelector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] params_type_info = new String[]{'params','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] reportType_type_info = new String[]{'reportType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] roleHierarchyFilter_type_info = new String[]{'roleHierarchyFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] rowLimit_type_info = new String[]{'rowLimit','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scope_type_info = new String[]{'scope','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showCurrentDate_type_info = new String[]{'showCurrentDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showDetails_type_info = new String[]{'showDetails','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sortColumn_type_info = new String[]{'sortColumn','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] territoryHierarchyFilter_type_info = new String[]{'territoryHierarchyFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] timeFrameFilter_type_info = new String[]{'timeFrameFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] userFilter_type_info = new String[]{'userFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'aggregates','block','blockInfo','buckets','chart','colorRanges','columns','crossFilters','currency_x','dataCategoryFilters','description','division','filter','format','groupingsAcross','groupingsDown','historicalSelector','name','params','reportType','roleHierarchyFilter','rowLimit','scope','showCurrentDate','showDetails','sortColumn','sortOrder','territoryHierarchyFilter','timeFrameFilter','userFilter'}; + } + public class ListView extends Metadata { + public String type = 'ListView'; + public String fullName; + public String booleanFilter; + public String[] columns; + public String division; + public String filterScope; + public MetadataService.ListViewFilter[] filters; + public String label; + public String language; + public String queue; + public MetadataService.SharedTo sharedTo; + private String[] booleanFilter_type_info = new String[]{'booleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] columns_type_info = new String[]{'columns','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] division_type_info = new String[]{'division','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] filterScope_type_info = new String[]{'filterScope','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] filters_type_info = new String[]{'filters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] queue_type_info = new String[]{'queue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'booleanFilter','columns','division','filterScope','filters','label','language','queue','sharedTo'}; + } + public class FlowRecordCreate { + public String assignRecordIdToReference; + public MetadataService.FlowConnector connector; + public MetadataService.FlowConnector faultConnector; + public MetadataService.FlowInputFieldAssignment[] inputAssignments; + public String inputReference; + public String object_x; + private String[] assignRecordIdToReference_type_info = new String[]{'assignRecordIdToReference','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] faultConnector_type_info = new String[]{'faultConnector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] inputAssignments_type_info = new String[]{'inputAssignments','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] inputReference_type_info = new String[]{'inputReference','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] object_x_type_info = new String[]{'object','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'assignRecordIdToReference','connector','faultConnector','inputAssignments','inputReference','object_x'}; + } + public class DashboardTableColumn { + public String aggregateType; + public Boolean calculatePercent; + public String column; + public Integer decimalPlaces; + public Boolean showTotal; + public String sortBy; + private String[] aggregateType_type_info = new String[]{'aggregateType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] calculatePercent_type_info = new String[]{'calculatePercent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] column_type_info = new String[]{'column','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] decimalPlaces_type_info = new String[]{'decimalPlaces','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showTotal_type_info = new String[]{'showTotal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sortBy_type_info = new String[]{'sortBy','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'aggregateType','calculatePercent','column','decimalPlaces','showTotal','sortBy'}; + } + public class CaseSettings extends Metadata { + public String type = 'CaseSettings'; + public String fullName; + public String caseAssignNotificationTemplate; + public String caseCloseNotificationTemplate; + public String caseCommentNotificationTemplate; + public String caseCreateNotificationTemplate; + public MetadataService.FeedItemSettings[] caseFeedItemSettings; + public Boolean closeCaseThroughStatusChange; + public String defaultCaseOwner; + public String defaultCaseOwnerType; + public String defaultCaseUser; + public String emailActionDefaultsHandlerClass; + public MetadataService.EmailToCaseSettings emailToCase; + public Boolean enableCaseFeed; + public Boolean enableDraftEmails; + public Boolean enableEarlyEscalationRuleTriggers; + public Boolean enableEmailActionDefaultsHandler; + public Boolean enableSuggestedArticlesApplication; + public Boolean enableSuggestedArticlesCustomerPortal; + public Boolean enableSuggestedArticlesPartnerPortal; + public Boolean enableSuggestedSolutions; + public Boolean keepRecordTypeOnAssignmentRule; + public Boolean notifyContactOnCaseComment; + public Boolean notifyDefaultCaseOwner; + public Boolean notifyOwnerOnCaseComment; + public Boolean notifyOwnerOnCaseOwnerChange; + public Boolean showFewerCloseActions; + public Boolean useSystemEmailAddress; + public MetadataService.WebToCaseSettings webToCase; + private String[] caseAssignNotificationTemplate_type_info = new String[]{'caseAssignNotificationTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] caseCloseNotificationTemplate_type_info = new String[]{'caseCloseNotificationTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] caseCommentNotificationTemplate_type_info = new String[]{'caseCommentNotificationTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] caseCreateNotificationTemplate_type_info = new String[]{'caseCreateNotificationTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] caseFeedItemSettings_type_info = new String[]{'caseFeedItemSettings','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] closeCaseThroughStatusChange_type_info = new String[]{'closeCaseThroughStatusChange','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultCaseOwner_type_info = new String[]{'defaultCaseOwner','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultCaseOwnerType_type_info = new String[]{'defaultCaseOwnerType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultCaseUser_type_info = new String[]{'defaultCaseUser','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailActionDefaultsHandlerClass_type_info = new String[]{'emailActionDefaultsHandlerClass','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailToCase_type_info = new String[]{'emailToCase','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableCaseFeed_type_info = new String[]{'enableCaseFeed','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableDraftEmails_type_info = new String[]{'enableDraftEmails','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableEarlyEscalationRuleTriggers_type_info = new String[]{'enableEarlyEscalationRuleTriggers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableEmailActionDefaultsHandler_type_info = new String[]{'enableEmailActionDefaultsHandler','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableSuggestedArticlesApplication_type_info = new String[]{'enableSuggestedArticlesApplication','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableSuggestedArticlesCustomerPortal_type_info = new String[]{'enableSuggestedArticlesCustomerPortal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableSuggestedArticlesPartnerPortal_type_info = new String[]{'enableSuggestedArticlesPartnerPortal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableSuggestedSolutions_type_info = new String[]{'enableSuggestedSolutions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] keepRecordTypeOnAssignmentRule_type_info = new String[]{'keepRecordTypeOnAssignmentRule','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] notifyContactOnCaseComment_type_info = new String[]{'notifyContactOnCaseComment','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] notifyDefaultCaseOwner_type_info = new String[]{'notifyDefaultCaseOwner','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] notifyOwnerOnCaseComment_type_info = new String[]{'notifyOwnerOnCaseComment','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] notifyOwnerOnCaseOwnerChange_type_info = new String[]{'notifyOwnerOnCaseOwnerChange','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showFewerCloseActions_type_info = new String[]{'showFewerCloseActions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] useSystemEmailAddress_type_info = new String[]{'useSystemEmailAddress','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] webToCase_type_info = new String[]{'webToCase','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'caseAssignNotificationTemplate','caseCloseNotificationTemplate','caseCommentNotificationTemplate','caseCreateNotificationTemplate','caseFeedItemSettings','closeCaseThroughStatusChange','defaultCaseOwner','defaultCaseOwnerType','defaultCaseUser','emailActionDefaultsHandlerClass','emailToCase','enableCaseFeed','enableDraftEmails','enableEarlyEscalationRuleTriggers','enableEmailActionDefaultsHandler','enableSuggestedArticlesApplication','enableSuggestedArticlesCustomerPortal','enableSuggestedArticlesPartnerPortal','enableSuggestedSolutions','keepRecordTypeOnAssignmentRule','notifyContactOnCaseComment','notifyDefaultCaseOwner','notifyOwnerOnCaseComment','notifyOwnerOnCaseOwnerChange','showFewerCloseActions','useSystemEmailAddress','webToCase'}; + } + public class PicklistEntry { + public Boolean active; + public Boolean defaultValue; + public String label; + public String validFor; + public String value; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] defaultValue_type_info = new String[]{'defaultValue','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] validFor_type_info = new String[]{'validFor','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'active','defaultValue','label','validFor','value'}; + } + public class NameSettings extends Metadata { + public String type = 'NameSettings'; + public String fullName; + public Boolean enableMiddleName; + public Boolean enableNameSuffix; + private String[] enableMiddleName_type_info = new String[]{'enableMiddleName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableNameSuffix_type_info = new String[]{'enableNameSuffix','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'enableMiddleName','enableNameSuffix'}; + } + public class AsyncResult { + public Boolean done; + public String id; + public String message; + public String state; + public String statusCode; + private String[] done_type_info = new String[]{'done','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] message_type_info = new String[]{'message','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] state_type_info = new String[]{'state','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] statusCode_type_info = new String[]{'statusCode','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'done','id','message','state','statusCode'}; + } + public class ArticleTypeChannelDisplay { + public MetadataService.ArticleTypeTemplate[] articleTypeTemplates; + private String[] articleTypeTemplates_type_info = new String[]{'articleTypeTemplates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'articleTypeTemplates'}; + } + public class checkRetrieveStatus_element { + public String asyncProcessId; + public Boolean includeZip; + private String[] asyncProcessId_type_info = new String[]{'asyncProcessId','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] includeZip_type_info = new String[]{'includeZip','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'asyncProcessId','includeZip'}; + } + public class ProfileLayoutAssignment { + public String layout; + public String recordType; + private String[] layout_type_info = new String[]{'layout','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] recordType_type_info = new String[]{'recordType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'layout','recordType'}; + } + public class FeedLayoutFilter { + public String feedFilterType; + public String feedItemType; + private String[] feedFilterType_type_info = new String[]{'feedFilterType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] feedItemType_type_info = new String[]{'feedItemType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'feedFilterType','feedItemType'}; + } + public class ReportHistoricalSelector { + public String[] snapshot; + private String[] snapshot_type_info = new String[]{'snapshot','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'snapshot'}; + } + public class FlowTextTemplate { + public String text; + private String[] text_type_info = new String[]{'text','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'text'}; + } + public class ReportFolder extends Folder { + public String type = 'ReportFolder'; + public String fullName; + public String accessType; + public MetadataService.FolderShare[] folderShares; + public String name; + public String publicFolderAccess; + public MetadataService.SharedTo sharedTo; + private String[] accessType_type_info = new String[]{'accessType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] folderShares_type_info = new String[]{'folderShares','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] publicFolderAccess_type_info = new String[]{'publicFolderAccess','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName','accessType','folderShares','name','publicFolderAccess','sharedTo'}; + } + public class RelatedListItem { + public String[] customButtons; + public String[] excludeButtons; + public String[] fields; + public String relatedList; + public String sortField; + public String sortOrder; + private String[] customButtons_type_info = new String[]{'customButtons','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] excludeButtons_type_info = new String[]{'excludeButtons','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] relatedList_type_info = new String[]{'relatedList','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sortField_type_info = new String[]{'sortField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'customButtons','excludeButtons','fields','relatedList','sortField','sortOrder'}; + } + public class FlowNode { + public String label; + public Integer locationX; + public Integer locationY; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] locationX_type_info = new String[]{'locationX','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] locationY_type_info = new String[]{'locationY','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'label','locationX','locationY'}; + } + public class ProfileApexClassAccess { + public String apexClass; + public Boolean enabled; + private String[] apexClass_type_info = new String[]{'apexClass','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enabled_type_info = new String[]{'enabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'apexClass','enabled'}; + } + public class CustomDataTypeComponentTranslation { + public String developerSuffix; + public String label; + private String[] developerSuffix_type_info = new String[]{'developerSuffix','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'developerSuffix','label'}; + } + public class ReputationPointsRules { + public MetadataService.ReputationPointsRule[] pointsRule; + private String[] pointsRule_type_info = new String[]{'pointsRule','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'pointsRule'}; + } + public class State { + public Boolean active; + public String integrationValue; + public String isoCode; + public String label; + public Boolean standard; + public Boolean visible; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] integrationValue_type_info = new String[]{'integrationValue','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isoCode_type_info = new String[]{'isoCode','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] standard_type_info = new String[]{'standard','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] visible_type_info = new String[]{'visible','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'active','integrationValue','isoCode','label','standard','visible'}; + } + public class PushNotifications { + public MetadataService.PushNotification[] pushNotification; + private String[] pushNotification_type_info = new String[]{'pushNotification','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'pushNotification'}; + } + public class ConnectedAppCanvasConfig { + public String accessMethod; + public String canvasUrl; + public String lifecycleClass; + public String[] locations; + public String[] options; + public String samlInitiationMethod; + private String[] accessMethod_type_info = new String[]{'accessMethod','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] canvasUrl_type_info = new String[]{'canvasUrl','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] lifecycleClass_type_info = new String[]{'lifecycleClass','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] locations_type_info = new String[]{'locations','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] options_type_info = new String[]{'options','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] samlInitiationMethod_type_info = new String[]{'samlInitiationMethod','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'accessMethod','canvasUrl','lifecycleClass','locations','options','samlInitiationMethod'}; + } + public class ReportTypeSectionTranslation { + public MetadataService.ReportTypeColumnTranslation[] columns; + public String label; + public String name; + private String[] columns_type_info = new String[]{'columns','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'columns','label','name'}; + } + public class FlowWaitEvent { + public String conditionLogic; + public MetadataService.FlowCondition[] conditions; + public MetadataService.FlowConnector connector; + public String eventType; + public MetadataService.FlowWaitEventInputParameter[] inputParameters; + public String label; + public MetadataService.FlowWaitEventOutputParameter[] outputParameters; + private String[] conditionLogic_type_info = new String[]{'conditionLogic','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] conditions_type_info = new String[]{'conditions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] eventType_type_info = new String[]{'eventType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] inputParameters_type_info = new String[]{'inputParameters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] outputParameters_type_info = new String[]{'outputParameters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'conditionLogic','conditions','connector','eventType','inputParameters','label','outputParameters'}; + } + public class IpRange { + public String description; + public String end_x; + public String start; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] end_x_type_info = new String[]{'end','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] start_type_info = new String[]{'start','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'description','end_x','start'}; + } + public class FlowApexPluginCallOutputParameter { + public String assignToReference; + public String name; + private String[] assignToReference_type_info = new String[]{'assignToReference','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'assignToReference','name'}; + } + public class ReportBucketField { + public String bucketType; + public String developerName; + public String masterLabel; + public String nullTreatment; + public String otherBucketLabel; + public String sourceColumnName; + public Boolean useOther; + public MetadataService.ReportBucketFieldValue[] values; + private String[] bucketType_type_info = new String[]{'bucketType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] developerName_type_info = new String[]{'developerName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] nullTreatment_type_info = new String[]{'nullTreatment','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] otherBucketLabel_type_info = new String[]{'otherBucketLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sourceColumnName_type_info = new String[]{'sourceColumnName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] useOther_type_info = new String[]{'useOther','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] values_type_info = new String[]{'values','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'bucketType','developerName','masterLabel','nullTreatment','otherBucketLabel','sourceColumnName','useOther','values'}; + } + public class Portal extends Metadata { + public String type = 'Portal'; + public String fullName; + public Boolean active; + public String admin; + public String defaultLanguage; + public String description; + public String emailSenderAddress; + public String emailSenderName; + public Boolean enableSelfCloseCase; + public String footerDocument; + public String forgotPassTemplate; + public String headerDocument; + public Boolean isSelfRegistrationActivated; + public String loginHeaderDocument; + public String logoDocument; + public String logoutUrl; + public String newCommentTemplate; + public String newPassTemplate; + public String newUserTemplate; + public String ownerNotifyTemplate; + public String selfRegNewUserUrl; + public String selfRegUserDefaultProfile; + public String selfRegUserDefaultRole; + public String selfRegUserTemplate; + public Boolean showActionConfirmation; + public String stylesheetDocument; + public String type_x; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] admin_type_info = new String[]{'admin','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultLanguage_type_info = new String[]{'defaultLanguage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailSenderAddress_type_info = new String[]{'emailSenderAddress','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] emailSenderName_type_info = new String[]{'emailSenderName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enableSelfCloseCase_type_info = new String[]{'enableSelfCloseCase','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] footerDocument_type_info = new String[]{'footerDocument','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] forgotPassTemplate_type_info = new String[]{'forgotPassTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] headerDocument_type_info = new String[]{'headerDocument','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isSelfRegistrationActivated_type_info = new String[]{'isSelfRegistrationActivated','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] loginHeaderDocument_type_info = new String[]{'loginHeaderDocument','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] logoDocument_type_info = new String[]{'logoDocument','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] logoutUrl_type_info = new String[]{'logoutUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] newCommentTemplate_type_info = new String[]{'newCommentTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] newPassTemplate_type_info = new String[]{'newPassTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] newUserTemplate_type_info = new String[]{'newUserTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] ownerNotifyTemplate_type_info = new String[]{'ownerNotifyTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] selfRegNewUserUrl_type_info = new String[]{'selfRegNewUserUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] selfRegUserDefaultProfile_type_info = new String[]{'selfRegUserDefaultProfile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] selfRegUserDefaultRole_type_info = new String[]{'selfRegUserDefaultRole','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] selfRegUserTemplate_type_info = new String[]{'selfRegUserTemplate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showActionConfirmation_type_info = new String[]{'showActionConfirmation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] stylesheetDocument_type_info = new String[]{'stylesheetDocument','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','admin','defaultLanguage','description','emailSenderAddress','emailSenderName','enableSelfCloseCase','footerDocument','forgotPassTemplate','headerDocument','isSelfRegistrationActivated','loginHeaderDocument','logoDocument','logoutUrl','newCommentTemplate','newPassTemplate','newUserTemplate','ownerNotifyTemplate','selfRegNewUserUrl','selfRegUserDefaultProfile','selfRegUserDefaultRole','selfRegUserTemplate','showActionConfirmation','stylesheetDocument','type_x'}; + } + public class DomainWhitelist { + public String[] domain; + private String[] domain_type_info = new String[]{'domain','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'domain'}; + } + public class RunTestFailure { + public String id; + public String message; + public String methodName; + public String name; + public String namespace; + public String packageName; + public Boolean seeAllData; + public String stackTrace; + public Double time_x; + public String type_x; + private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] message_type_info = new String[]{'message','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] methodName_type_info = new String[]{'methodName','http://soap.sforce.com/2006/04/metadata',null,'1','1','true'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] namespace_type_info = new String[]{'namespace','http://soap.sforce.com/2006/04/metadata',null,'1','1','true'}; + private String[] packageName_type_info = new String[]{'packageName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] seeAllData_type_info = new String[]{'seeAllData','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] stackTrace_type_info = new String[]{'stackTrace','http://soap.sforce.com/2006/04/metadata',null,'1','1','true'}; + private String[] time_x_type_info = new String[]{'time','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'id','message','methodName','name','namespace','packageName','seeAllData','stackTrace','time_x','type_x'}; + } + public class Territory { + public String accountAccessLevel; + public String parentTerritory; + private String[] accountAccessLevel_type_info = new String[]{'accountAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] parentTerritory_type_info = new String[]{'parentTerritory','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'accountAccessLevel','parentTerritory'}; + } + public class SharedTo { + public String allCustomerPortalUsers; + public String allInternalUsers; + public String allPartnerUsers; + public String[] group_x; + public String[] groups; + public String[] managerSubordinates; + public String[] managers; + public String[] portalRole; + public String[] portalRoleAndSubordinates; + public String[] queue; + public String[] role; + public String[] roleAndSubordinates; + public String[] roleAndSubordinatesInternal; + public String[] roles; + public String[] rolesAndSubordinates; + public String[] territories; + public String[] territoriesAndSubordinates; + public String[] territory; + public String[] territoryAndSubordinates; + private String[] allCustomerPortalUsers_type_info = new String[]{'allCustomerPortalUsers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] allInternalUsers_type_info = new String[]{'allInternalUsers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] allPartnerUsers_type_info = new String[]{'allPartnerUsers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] group_x_type_info = new String[]{'group','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] groups_type_info = new String[]{'groups','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] managerSubordinates_type_info = new String[]{'managerSubordinates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] managers_type_info = new String[]{'managers','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] portalRole_type_info = new String[]{'portalRole','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] portalRoleAndSubordinates_type_info = new String[]{'portalRoleAndSubordinates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] queue_type_info = new String[]{'queue','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] role_type_info = new String[]{'role','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] roleAndSubordinates_type_info = new String[]{'roleAndSubordinates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] roleAndSubordinatesInternal_type_info = new String[]{'roleAndSubordinatesInternal','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] roles_type_info = new String[]{'roles','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] rolesAndSubordinates_type_info = new String[]{'rolesAndSubordinates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] territories_type_info = new String[]{'territories','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] territoriesAndSubordinates_type_info = new String[]{'territoriesAndSubordinates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] territory_type_info = new String[]{'territory','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] territoryAndSubordinates_type_info = new String[]{'territoryAndSubordinates','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'allCustomerPortalUsers','allInternalUsers','allPartnerUsers','group_x','groups','managerSubordinates','managers','portalRole','portalRoleAndSubordinates','queue','role','roleAndSubordinates','roleAndSubordinatesInternal','roles','rolesAndSubordinates','territories','territoriesAndSubordinates','territory','territoryAndSubordinates'}; + } + public class DeployDetails { + public MetadataService.DeployMessage[] componentFailures; + public MetadataService.DeployMessage[] componentSuccesses; + public MetadataService.RetrieveResult retrieveResult; + public MetadataService.RunTestsResult runTestResult; + private String[] componentFailures_type_info = new String[]{'componentFailures','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] componentSuccesses_type_info = new String[]{'componentSuccesses','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] retrieveResult_type_info = new String[]{'retrieveResult','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] runTestResult_type_info = new String[]{'runTestResult','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'componentFailures','componentSuccesses','retrieveResult','runTestResult'}; + } + public class FlowRecordFilter { + public String field; + public String operator; + public MetadataService.FlowElementReferenceOrValue value; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'field','operator','value'}; + } + public class Group_x extends Metadata { + public String type = 'Group_x'; + public String fullName; + public Boolean doesIncludeBosses; + public String name; + private String[] doesIncludeBosses_type_info = new String[]{'doesIncludeBosses','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'doesIncludeBosses','name'}; + } + public class SubtabComponents { + public MetadataService.Container[] containers; + private String[] containers_type_info = new String[]{'containers','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'containers'}; + } + public class FlowScreen { + public Boolean allowBack; + public Boolean allowFinish; + public Boolean allowPause; + public MetadataService.FlowConnector connector; + public MetadataService.FlowScreenField[] fields; + public String helpText; + public String pausedText; + private String[] allowBack_type_info = new String[]{'allowBack','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] allowFinish_type_info = new String[]{'allowFinish','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] allowPause_type_info = new String[]{'allowPause','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] helpText_type_info = new String[]{'helpText','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] pausedText_type_info = new String[]{'pausedText','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'allowBack','allowFinish','allowPause','connector','fields','helpText','pausedText'}; + } + public class WorkflowAlert extends WorkflowAction { + public String type = 'WorkflowAlert'; + public String fullName; + public String[] ccEmails; + public String description; + public Boolean protected_x; + public MetadataService.WorkflowEmailRecipient[] recipients; + public String senderAddress; + public String senderType; + public String template; + private String[] ccEmails_type_info = new String[]{'ccEmails','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] recipients_type_info = new String[]{'recipients','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] senderAddress_type_info = new String[]{'senderAddress','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] senderType_type_info = new String[]{'senderType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] template_type_info = new String[]{'template','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'ccEmails','description','protected_x','recipients','senderAddress','senderType','template'}; + } + public class CustomPermissionDependencyRequired { + public String customPermission; + public Boolean dependency; + private String[] customPermission_type_info = new String[]{'customPermission','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] dependency_type_info = new String[]{'dependency','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'customPermission','dependency'}; + } + public class ReputationBranding { + public String smallImage; + private String[] smallImage_type_info = new String[]{'smallImage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'smallImage'}; + } + public class ForecastRangeSettings { + public Integer beginning; + public Integer displaying; + public String periodType; + private String[] beginning_type_info = new String[]{'beginning','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] displaying_type_info = new String[]{'displaying','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] periodType_type_info = new String[]{'periodType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'beginning','displaying','periodType'}; + } + public class SFDCMobileSettings { + public Boolean enableMobileLite; + public Boolean enableUserToDeviceLinking; + private String[] enableMobileLite_type_info = new String[]{'enableMobileLite','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableUserToDeviceLinking_type_info = new String[]{'enableUserToDeviceLinking','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'enableMobileLite','enableUserToDeviceLinking'}; + } + public class LayoutSectionTranslation { + public String label; + public String section; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] section_type_info = new String[]{'section','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'label','section'}; + } + public class EntitlementProcessMilestoneItem { + public String businessHours; + public String criteriaBooleanFilter; + public MetadataService.FilterItem[] milestoneCriteriaFilterItems; + public String milestoneCriteriaFormula; + public String milestoneName; + public String minutesCustomClass; + public Integer minutesToComplete; + public MetadataService.WorkflowActionReference[] successActions; + public MetadataService.EntitlementProcessMilestoneTimeTrigger[] timeTriggers; + public Boolean useCriteriaStartTime; + private String[] businessHours_type_info = new String[]{'businessHours','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] criteriaBooleanFilter_type_info = new String[]{'criteriaBooleanFilter','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] milestoneCriteriaFilterItems_type_info = new String[]{'milestoneCriteriaFilterItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] milestoneCriteriaFormula_type_info = new String[]{'milestoneCriteriaFormula','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] milestoneName_type_info = new String[]{'milestoneName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] minutesCustomClass_type_info = new String[]{'minutesCustomClass','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] minutesToComplete_type_info = new String[]{'minutesToComplete','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] successActions_type_info = new String[]{'successActions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] timeTriggers_type_info = new String[]{'timeTriggers','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] useCriteriaStartTime_type_info = new String[]{'useCriteriaStartTime','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'businessHours','criteriaBooleanFilter','milestoneCriteriaFilterItems','milestoneCriteriaFormula','milestoneName','minutesCustomClass','minutesToComplete','successActions','timeTriggers','useCriteriaStartTime'}; + } + public class DataCategoryGroup extends Metadata { + public String type = 'DataCategoryGroup'; + public String fullName; + public Boolean active; + public MetadataService.DataCategory dataCategory; + public String description; + public String label; + public MetadataService.ObjectUsage objectUsage; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] dataCategory_type_info = new String[]{'dataCategory','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] objectUsage_type_info = new String[]{'objectUsage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','dataCategory','description','label','objectUsage'}; + } + public class listMetadata_element { + public MetadataService.ListMetadataQuery[] queries; + public Double asOfVersion; + private String[] queries_type_info = new String[]{'queries','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] asOfVersion_type_info = new String[]{'asOfVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'queries','asOfVersion'}; + } + public class ValidationRule extends Metadata { + public String type = 'ValidationRule'; + public String fullName; + public Boolean active; + public String description; + public String errorConditionFormula; + public String errorDisplayField; + public String errorMessage; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] errorConditionFormula_type_info = new String[]{'errorConditionFormula','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] errorDisplayField_type_info = new String[]{'errorDisplayField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] errorMessage_type_info = new String[]{'errorMessage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','description','errorConditionFormula','errorDisplayField','errorMessage'}; + } + public class AuraDefinitionBundle extends Metadata { + public String type = 'AuraDefinitionBundle'; + public String fullName; + public String SVGContent; + public String controllerContent; + public String designContent; + public String documentationContent; + public String helperContent; + public String markup; + public String modelContent; + public String rendererContent; + public String styleContent; + public String testsuiteContent; + public String type_x; + private String[] SVGContent_type_info = new String[]{'SVGContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] controllerContent_type_info = new String[]{'controllerContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] designContent_type_info = new String[]{'designContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] documentationContent_type_info = new String[]{'documentationContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] helperContent_type_info = new String[]{'helperContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] markup_type_info = new String[]{'markup','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] modelContent_type_info = new String[]{'modelContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] rendererContent_type_info = new String[]{'rendererContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] styleContent_type_info = new String[]{'styleContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] testsuiteContent_type_info = new String[]{'testsuiteContent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'SVGContent','controllerContent','designContent','documentationContent','helperContent','markup','modelContent','rendererContent','styleContent','testsuiteContent','type_x'}; + } + public class FlowMetadataValue { + public String name; + public MetadataService.FlowElementReferenceOrValue value; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'name','value'}; + } + public class ValueTypeField { + public MetadataService.ValueTypeField[] fields; + public String[] foreignKeyDomain; + public Boolean isForeignKey; + public Boolean isNameField; + public Integer minOccurs; + public String name; + public MetadataService.PicklistEntry[] picklistValues; + public String soapType; + public Boolean valueRequired; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] foreignKeyDomain_type_info = new String[]{'foreignKeyDomain','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] isForeignKey_type_info = new String[]{'isForeignKey','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isNameField_type_info = new String[]{'isNameField','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] minOccurs_type_info = new String[]{'minOccurs','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] picklistValues_type_info = new String[]{'picklistValues','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] soapType_type_info = new String[]{'soapType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] valueRequired_type_info = new String[]{'valueRequired','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'fields','foreignKeyDomain','isForeignKey','isNameField','minOccurs','name','picklistValues','soapType','valueRequired'}; + } + public class VisualizationResource { + public String description; + public String file; + public Integer rank; + public String type_x; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] file_type_info = new String[]{'file','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] rank_type_info = new String[]{'rank','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'description','file','rank','type_x'}; + } + public class ValidationRuleTranslation { + public String errorMessage; + public String name; + private String[] errorMessage_type_info = new String[]{'errorMessage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'errorMessage','name'}; + } + public virtual class Metadata { + public String fullName; + } + public class ReportBucketFieldValue { + public MetadataService.ReportBucketFieldSourceValue[] sourceValues; + public String value; + private String[] sourceValues_type_info = new String[]{'sourceValues','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'sourceValues','value'}; + } + public class FeedItemSettings { + public Integer characterLimit; + public Boolean collapseThread; + public String displayFormat; + public String feedItemType; + private String[] characterLimit_type_info = new String[]{'characterLimit','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] collapseThread_type_info = new String[]{'collapseThread','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] displayFormat_type_info = new String[]{'displayFormat','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] feedItemType_type_info = new String[]{'feedItemType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'characterLimit','collapseThread','displayFormat','feedItemType'}; + } + public class FlowSubflow { + public MetadataService.FlowConnector connector; + public String flowName; + public MetadataService.FlowSubflowInputAssignment[] inputAssignments; + public MetadataService.FlowSubflowOutputAssignment[] outputAssignments; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] flowName_type_info = new String[]{'flowName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] inputAssignments_type_info = new String[]{'inputAssignments','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] outputAssignments_type_info = new String[]{'outputAssignments','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'connector','flowName','inputAssignments','outputAssignments'}; + } + public class TouchMobileSettings { + public Boolean enableTouchAppIPad; + public Boolean enableTouchAppIPhone; + public Boolean enableTouchBrowserIPad; + public Boolean enableTouchIosPhone; + public Boolean enableVisualforceInTouch; + private String[] enableTouchAppIPad_type_info = new String[]{'enableTouchAppIPad','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableTouchAppIPhone_type_info = new String[]{'enableTouchAppIPhone','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableTouchBrowserIPad_type_info = new String[]{'enableTouchBrowserIPad','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableTouchIosPhone_type_info = new String[]{'enableTouchIosPhone','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableVisualforceInTouch_type_info = new String[]{'enableVisualforceInTouch','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'enableTouchAppIPad','enableTouchAppIPhone','enableTouchBrowserIPad','enableTouchIosPhone','enableVisualforceInTouch'}; + } + public class FlowScreenField { + public String[] choiceReferences; + public String dataType; + public String defaultSelectedChoiceReference; + public MetadataService.FlowElementReferenceOrValue defaultValue; + public String fieldText; + public String fieldType; + public String helpText; + public Boolean isRequired; + public Integer scale; + public MetadataService.FlowInputValidationRule validationRule; + private String[] choiceReferences_type_info = new String[]{'choiceReferences','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultSelectedChoiceReference_type_info = new String[]{'defaultSelectedChoiceReference','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultValue_type_info = new String[]{'defaultValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fieldText_type_info = new String[]{'fieldText','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fieldType_type_info = new String[]{'fieldType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] helpText_type_info = new String[]{'helpText','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isRequired_type_info = new String[]{'isRequired','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scale_type_info = new String[]{'scale','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] validationRule_type_info = new String[]{'validationRule','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'choiceReferences','dataType','defaultSelectedChoiceReference','defaultValue','fieldText','fieldType','helpText','isRequired','scale','validationRule'}; + } + public class Dashboard extends Metadata { + public String type = 'Dashboard'; + public String fullName; + public String backgroundEndColor; + public String backgroundFadeDirection; + public String backgroundStartColor; + public MetadataService.DashboardFilter[] dashboardFilters; + public String dashboardResultRefreshedDate; + public String dashboardResultRunningUser; + public String dashboardType; + public String description; + public MetadataService.DashboardComponentSection leftSection; + public MetadataService.DashboardComponentSection middleSection; + public MetadataService.DashboardComponentSection rightSection; + public String runningUser; + public String textColor; + public String title; + public String titleColor; + public Integer titleSize; + private String[] backgroundEndColor_type_info = new String[]{'backgroundEndColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] backgroundFadeDirection_type_info = new String[]{'backgroundFadeDirection','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] backgroundStartColor_type_info = new String[]{'backgroundStartColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] dashboardFilters_type_info = new String[]{'dashboardFilters','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] dashboardResultRefreshedDate_type_info = new String[]{'dashboardResultRefreshedDate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] dashboardResultRunningUser_type_info = new String[]{'dashboardResultRunningUser','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] dashboardType_type_info = new String[]{'dashboardType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] leftSection_type_info = new String[]{'leftSection','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] middleSection_type_info = new String[]{'middleSection','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] rightSection_type_info = new String[]{'rightSection','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] runningUser_type_info = new String[]{'runningUser','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] textColor_type_info = new String[]{'textColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] title_type_info = new String[]{'title','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] titleColor_type_info = new String[]{'titleColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] titleSize_type_info = new String[]{'titleSize','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'backgroundEndColor','backgroundFadeDirection','backgroundStartColor','dashboardFilters','dashboardResultRefreshedDate','dashboardResultRunningUser','dashboardType','description','leftSection','middleSection','rightSection','runningUser','textColor','title','titleColor','titleSize'}; + } + public class ReportDataCategoryFilter { + public String dataCategory; + public String dataCategoryGroup; + public String operator; + private String[] dataCategory_type_info = new String[]{'dataCategory','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] dataCategoryGroup_type_info = new String[]{'dataCategoryGroup','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'dataCategory','dataCategoryGroup','operator'}; + } + public class MarketingActionSettings extends Metadata { + public String type = 'MarketingActionSettings'; + public String fullName; + public Boolean enableMarketingAction; + private String[] enableMarketingAction_type_info = new String[]{'enableMarketingAction','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'enableMarketingAction'}; + } + public class FlowAssignment { + public MetadataService.FlowAssignmentItem[] assignmentItems; + public MetadataService.FlowConnector connector; + private String[] assignmentItems_type_info = new String[]{'assignmentItems','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] connector_type_info = new String[]{'connector','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'assignmentItems','connector'}; + } + public class IdeaReputationLevel { + public String name; + public Integer value; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'name','value'}; + } + public class NetworkTabSet { + public String[] customTab; + public String defaultTab; + public String[] standardTab; + private String[] customTab_type_info = new String[]{'customTab','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] defaultTab_type_info = new String[]{'defaultTab','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] standardTab_type_info = new String[]{'standardTab','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'customTab','defaultTab','standardTab'}; + } + public class CustomApplicationComponents { + public String alignment; + public String[] customApplicationComponent; + private String[] alignment_type_info = new String[]{'alignment','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] customApplicationComponent_type_info = new String[]{'customApplicationComponent','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'alignment','customApplicationComponent'}; + } + public class SynonymGroup { + public String[] languages; + public String[] terms; + private String[] languages_type_info = new String[]{'languages','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] terms_type_info = new String[]{'terms','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'languages','terms'}; + } + public class VisualizationType { + public String description; + public String developerName; + public String icon; + public String masterLabel; + public String scriptBootstrapMethod; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] developerName_type_info = new String[]{'developerName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] icon_type_info = new String[]{'icon','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] scriptBootstrapMethod_type_info = new String[]{'scriptBootstrapMethod','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'description','developerName','icon','masterLabel','scriptBootstrapMethod'}; + } + public class DashboardFolder extends Folder { + public String type = 'DashboardFolder'; + public String fullName; + public String accessType; + public MetadataService.FolderShare[] folderShares; + public String name; + public String publicFolderAccess; + public MetadataService.SharedTo sharedTo; + private String[] accessType_type_info = new String[]{'accessType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] folderShares_type_info = new String[]{'folderShares','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] publicFolderAccess_type_info = new String[]{'publicFolderAccess','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName','accessType','folderShares','name','publicFolderAccess','sharedTo'}; + } + public class PermissionSetApexPageAccess { + public String apexPage; + public Boolean enabled; + private String[] apexPage_type_info = new String[]{'apexPage','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enabled_type_info = new String[]{'enabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'apexPage','enabled'}; + } + public class CustomObject extends Metadata { + public String type = 'CustomObject'; + public String fullName; + public MetadataService.ActionOverride[] actionOverrides; + public Boolean allowInChatterGroups; + public MetadataService.ArticleTypeChannelDisplay articleTypeChannelDisplay; + public MetadataService.BusinessProcess[] businessProcesses; + public String compactLayoutAssignment; + public MetadataService.CompactLayout[] compactLayouts; + public String customHelp; + public String customHelpPage; + public String customSettingsType; + public String deploymentStatus; + public Boolean deprecated; + public String description; + public Boolean enableActivities; + public Boolean enableBulkApi; + public Boolean enableDivisions; + public Boolean enableEnhancedLookup; + public Boolean enableFeeds; + public Boolean enableHistory; + public Boolean enableReports; + public Boolean enableSharing; + public Boolean enableStreamingApi; + public String externalDataSource; + public String externalName; + public String externalRepository; + public String externalSharingModel; + public MetadataService.FieldSet[] fieldSets; + public MetadataService.CustomField[] fields; + public String gender; + public MetadataService.HistoryRetentionPolicy historyRetentionPolicy; + public Boolean household; + public String label; + public MetadataService.ListView[] listViews; + public MetadataService.CustomField nameField; + public String pluralLabel; + public Boolean recordTypeTrackFeedHistory; + public Boolean recordTypeTrackHistory; + public MetadataService.RecordType[] recordTypes; + public MetadataService.SearchLayouts searchLayouts; + public String sharingModel; + public MetadataService.SharingReason[] sharingReasons; + public MetadataService.SharingRecalculation[] sharingRecalculations; + public String startsWith; + public MetadataService.ValidationRule[] validationRules; + public String visibility; + public MetadataService.WebLink[] webLinks; + private String[] actionOverrides_type_info = new String[]{'actionOverrides','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] allowInChatterGroups_type_info = new String[]{'allowInChatterGroups','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] articleTypeChannelDisplay_type_info = new String[]{'articleTypeChannelDisplay','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] businessProcesses_type_info = new String[]{'businessProcesses','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] compactLayoutAssignment_type_info = new String[]{'compactLayoutAssignment','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] compactLayouts_type_info = new String[]{'compactLayouts','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] customHelp_type_info = new String[]{'customHelp','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customHelpPage_type_info = new String[]{'customHelpPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customSettingsType_type_info = new String[]{'customSettingsType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] deploymentStatus_type_info = new String[]{'deploymentStatus','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] deprecated_type_info = new String[]{'deprecated','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableActivities_type_info = new String[]{'enableActivities','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableBulkApi_type_info = new String[]{'enableBulkApi','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableDivisions_type_info = new String[]{'enableDivisions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableEnhancedLookup_type_info = new String[]{'enableEnhancedLookup','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableFeeds_type_info = new String[]{'enableFeeds','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableHistory_type_info = new String[]{'enableHistory','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableReports_type_info = new String[]{'enableReports','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableSharing_type_info = new String[]{'enableSharing','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableStreamingApi_type_info = new String[]{'enableStreamingApi','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] externalDataSource_type_info = new String[]{'externalDataSource','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] externalName_type_info = new String[]{'externalName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] externalRepository_type_info = new String[]{'externalRepository','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] externalSharingModel_type_info = new String[]{'externalSharingModel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] fieldSets_type_info = new String[]{'fieldSets','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] gender_type_info = new String[]{'gender','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] historyRetentionPolicy_type_info = new String[]{'historyRetentionPolicy','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] household_type_info = new String[]{'household','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] listViews_type_info = new String[]{'listViews','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] nameField_type_info = new String[]{'nameField','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] pluralLabel_type_info = new String[]{'pluralLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recordTypeTrackFeedHistory_type_info = new String[]{'recordTypeTrackFeedHistory','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recordTypeTrackHistory_type_info = new String[]{'recordTypeTrackHistory','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] recordTypes_type_info = new String[]{'recordTypes','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] searchLayouts_type_info = new String[]{'searchLayouts','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sharingModel_type_info = new String[]{'sharingModel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sharingReasons_type_info = new String[]{'sharingReasons','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] sharingRecalculations_type_info = new String[]{'sharingRecalculations','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] startsWith_type_info = new String[]{'startsWith','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] validationRules_type_info = new String[]{'validationRules','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] visibility_type_info = new String[]{'visibility','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] webLinks_type_info = new String[]{'webLinks','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'actionOverrides','allowInChatterGroups','articleTypeChannelDisplay','businessProcesses','compactLayoutAssignment','compactLayouts','customHelp','customHelpPage','customSettingsType','deploymentStatus','deprecated','description','enableActivities','enableBulkApi','enableDivisions','enableEnhancedLookup','enableFeeds','enableHistory','enableReports','enableSharing','enableStreamingApi','externalDataSource','externalName','externalRepository','externalSharingModel','fieldSets','fields','gender','historyRetentionPolicy','household','label','listViews','nameField','pluralLabel','recordTypeTrackFeedHistory','recordTypeTrackHistory','recordTypes','searchLayouts','sharingModel','sharingReasons','sharingRecalculations','startsWith','validationRules','visibility','webLinks'}; + } + public class CustomMetadataValue { + public String field; + public String value; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'1','1','true'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'field','value'}; + } + public class Translations extends Metadata { + public String type = 'Translations'; + public String fullName; + public MetadataService.CustomApplicationTranslation[] customApplications; + public MetadataService.CustomDataTypeTranslation[] customDataTypeTranslations; + public MetadataService.CustomLabelTranslation[] customLabels; + public MetadataService.CustomPageWebLinkTranslation[] customPageWebLinks; + public MetadataService.CustomTabTranslation[] customTabs; + public MetadataService.GlobalQuickActionTranslation[] quickActions; + public MetadataService.ReportTypeTranslation[] reportTypes; + public MetadataService.ScontrolTranslation[] scontrols; + private String[] customApplications_type_info = new String[]{'customApplications','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] customDataTypeTranslations_type_info = new String[]{'customDataTypeTranslations','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] customLabels_type_info = new String[]{'customLabels','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] customPageWebLinks_type_info = new String[]{'customPageWebLinks','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] customTabs_type_info = new String[]{'customTabs','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] quickActions_type_info = new String[]{'quickActions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] reportTypes_type_info = new String[]{'reportTypes','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] scontrols_type_info = new String[]{'scontrols','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'customApplications','customDataTypeTranslations','customLabels','customPageWebLinks','customTabs','quickActions','reportTypes','scontrols'}; + } + public class ReportTypeTranslation { + public String description; + public String label; + public String name; + public MetadataService.ReportTypeSectionTranslation[] sections; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sections_type_info = new String[]{'sections','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'description','label','name','sections'}; + } + public class FlowAssignmentItem { + public String assignToReference; + public String operator; + public MetadataService.FlowElementReferenceOrValue value; + private String[] assignToReference_type_info = new String[]{'assignToReference','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] operator_type_info = new String[]{'operator','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'assignToReference','operator','value'}; + } + public class Territory2SettingsOpportunityFilter { + public String apexClassName; + public Boolean enableFilter; + public Boolean runOnCreate; + private String[] apexClassName_type_info = new String[]{'apexClassName','http://soap.sforce.com/2006/04/metadata',null,'1','1','true'}; + private String[] enableFilter_type_info = new String[]{'enableFilter','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] runOnCreate_type_info = new String[]{'runOnCreate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'apexClassName','enableFilter','runOnCreate'}; + } + public class CustomLabels extends Metadata { + public String type = 'CustomLabels'; + public String fullName; + public MetadataService.CustomLabel[] labels; + private String[] labels_type_info = new String[]{'labels','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'labels'}; + } + public class PackageTypeMembers { + public String[] members; + public String name; + private String[] members_type_info = new String[]{'members','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'members','name'}; + } + public class renameMetadataResponse_element { + public MetadataService.SaveResult result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class HistoryRetentionPolicy { + public Integer archiveAfterMonths; + public Integer archiveRetentionYears; + public String description; + private String[] archiveAfterMonths_type_info = new String[]{'archiveAfterMonths','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] archiveRetentionYears_type_info = new String[]{'archiveRetentionYears','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'archiveAfterMonths','archiveRetentionYears','description'}; + } + public class cancelDeploy_element { + public String String_x; + private String[] String_x_type_info = new String[]{'String','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'String_x'}; + } + public class WorkflowSend extends WorkflowAction { + public String type = 'WorkflowSend'; + public String fullName; + public String action; + public String description; + public String label; + public String language; + public Boolean protected_x; + private String[] action_type_info = new String[]{'action','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] language_type_info = new String[]{'language','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'action','description','label','language','protected_x'}; + } + public class EntitlementProcessMilestoneTimeTrigger { + public MetadataService.WorkflowActionReference[] actions; + public Integer timeLength; + public String workflowTimeTriggerUnit; + private String[] actions_type_info = new String[]{'actions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] timeLength_type_info = new String[]{'timeLength','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] workflowTimeTriggerUnit_type_info = new String[]{'workflowTimeTriggerUnit','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'actions','timeLength','workflowTimeTriggerUnit'}; + } + public class ArticleTypeTemplate { + public String channel; + public String page_x; + public String template; + private String[] channel_type_info = new String[]{'channel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] page_x_type_info = new String[]{'page','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] template_type_info = new String[]{'template','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'channel','page_x','template'}; + } + public class AnalyticSnapshotMapping { + public String aggregateType; + public String sourceField; + public String sourceType; + public String targetField; + private String[] aggregateType_type_info = new String[]{'aggregateType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sourceField_type_info = new String[]{'sourceField','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sourceType_type_info = new String[]{'sourceType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] targetField_type_info = new String[]{'targetField','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'aggregateType','sourceField','sourceType','targetField'}; + } + public class PermissionSetFieldPermissions { + public Boolean editable; + public String field; + public Boolean readable; + private String[] editable_type_info = new String[]{'editable','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] readable_type_info = new String[]{'readable','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'editable','field','readable'}; + } + public class ReportGrouping { + public String aggregateType; + public String dateGranularity; + public String field; + public String sortByName; + public String sortOrder; + public String sortType; + private String[] aggregateType_type_info = new String[]{'aggregateType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] dateGranularity_type_info = new String[]{'dateGranularity','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sortByName_type_info = new String[]{'sortByName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sortType_type_info = new String[]{'sortType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'aggregateType','dateGranularity','field','sortByName','sortOrder','sortType'}; + } + public class SkillProfileAssignments { + public String[] profile; + private String[] profile_type_info = new String[]{'profile','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'profile'}; + } + public class CancelDeployResult { + public Boolean done; + public String id; + private String[] done_type_info = new String[]{'done','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'done','id'}; + } + public class CustomShortcut { + public String description; + public String eventName; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] eventName_type_info = new String[]{'eventName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'description','eventName'}; + } + public class SynonymDictionary extends Metadata { + public String type = 'SynonymDictionary'; + public String fullName; + public MetadataService.SynonymGroup[] groups; + public Boolean isProtected; + public String label; + private String[] groups_type_info = new String[]{'groups','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] isProtected_type_info = new String[]{'isProtected','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'groups','isProtected','label'}; + } + public class CustomTab extends Metadata { + public String type = 'CustomTab'; + public String fullName; + public String auraComponent; + public Boolean customObject; + public String description; + public String flexiPage; + public Integer frameHeight; + public Boolean hasSidebar; + public String icon; + public String label; + public Boolean mobileReady; + public String motif; + public String page_x; + public String scontrol; + public String splashPageLink; + public String url; + public String urlEncodingKey; + private String[] auraComponent_type_info = new String[]{'auraComponent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customObject_type_info = new String[]{'customObject','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] flexiPage_type_info = new String[]{'flexiPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] frameHeight_type_info = new String[]{'frameHeight','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] hasSidebar_type_info = new String[]{'hasSidebar','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] icon_type_info = new String[]{'icon','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] mobileReady_type_info = new String[]{'mobileReady','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] motif_type_info = new String[]{'motif','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] page_x_type_info = new String[]{'page','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scontrol_type_info = new String[]{'scontrol','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] splashPageLink_type_info = new String[]{'splashPageLink','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] url_type_info = new String[]{'url','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] urlEncodingKey_type_info = new String[]{'urlEncodingKey','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'auraComponent','customObject','description','flexiPage','frameHeight','hasSidebar','icon','label','mobileReady','motif','page_x','scontrol','splashPageLink','url','urlEncodingKey'}; + } + public class Letterhead extends Metadata { + public String type = 'Letterhead'; + public String fullName; + public Boolean available; + public String backgroundColor; + public String bodyColor; + public MetadataService.LetterheadLine bottomLine; + public String description; + public MetadataService.LetterheadHeaderFooter footer; + public MetadataService.LetterheadHeaderFooter header; + public MetadataService.LetterheadLine middleLine; + public String name; + public MetadataService.LetterheadLine topLine; + private String[] available_type_info = new String[]{'available','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] backgroundColor_type_info = new String[]{'backgroundColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] bodyColor_type_info = new String[]{'bodyColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] bottomLine_type_info = new String[]{'bottomLine','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] footer_type_info = new String[]{'footer','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] header_type_info = new String[]{'header','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] middleLine_type_info = new String[]{'middleLine','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] topLine_type_info = new String[]{'topLine','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'available','backgroundColor','bodyColor','bottomLine','description','footer','header','middleLine','name','topLine'}; + } + public class ReportTypeColumnTranslation { + public String label; + public String name; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'label','name'}; + } + public class CustomPageWebLinkTranslation { + public String label; + public String name; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'label','name'}; + } + public class EntitlementSettings extends Metadata { + public String type = 'EntitlementSettings'; + public String fullName; + public Boolean assetLookupLimitedToActiveEntitlementsOnAccount; + public Boolean assetLookupLimitedToActiveEntitlementsOnContact; + public Boolean assetLookupLimitedToSameAccount; + public Boolean assetLookupLimitedToSameContact; + public Boolean enableEntitlementVersioning; + public Boolean enableEntitlements; + public Boolean entitlementLookupLimitedToActiveStatus; + public Boolean entitlementLookupLimitedToSameAccount; + public Boolean entitlementLookupLimitedToSameAsset; + public Boolean entitlementLookupLimitedToSameContact; + private String[] assetLookupLimitedToActiveEntitlementsOnAccount_type_info = new String[]{'assetLookupLimitedToActiveEntitlementsOnAccount','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] assetLookupLimitedToActiveEntitlementsOnContact_type_info = new String[]{'assetLookupLimitedToActiveEntitlementsOnContact','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] assetLookupLimitedToSameAccount_type_info = new String[]{'assetLookupLimitedToSameAccount','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] assetLookupLimitedToSameContact_type_info = new String[]{'assetLookupLimitedToSameContact','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableEntitlementVersioning_type_info = new String[]{'enableEntitlementVersioning','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enableEntitlements_type_info = new String[]{'enableEntitlements','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] entitlementLookupLimitedToActiveStatus_type_info = new String[]{'entitlementLookupLimitedToActiveStatus','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] entitlementLookupLimitedToSameAccount_type_info = new String[]{'entitlementLookupLimitedToSameAccount','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] entitlementLookupLimitedToSameAsset_type_info = new String[]{'entitlementLookupLimitedToSameAsset','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] entitlementLookupLimitedToSameContact_type_info = new String[]{'entitlementLookupLimitedToSameContact','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'assetLookupLimitedToActiveEntitlementsOnAccount','assetLookupLimitedToActiveEntitlementsOnContact','assetLookupLimitedToSameAccount','assetLookupLimitedToSameContact','enableEntitlementVersioning','enableEntitlements','entitlementLookupLimitedToActiveStatus','entitlementLookupLimitedToSameAccount','entitlementLookupLimitedToSameAsset','entitlementLookupLimitedToSameContact'}; + } + public class FlowBaseElement { + public MetadataService.FlowMetadataValue[] processMetadataValues; + private String[] processMetadataValues_type_info = new String[]{'processMetadataValues','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'processMetadataValues'}; + } + public class cancelDeployResponse_element { + public MetadataService.CancelDeployResult result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class DocumentFolder extends Folder { + public String type = 'DocumentFolder'; + public String fullName; + public String accessType; + public MetadataService.FolderShare[] folderShares; + public String name; + public String publicFolderAccess; + public MetadataService.SharedTo sharedTo; + private String[] accessType_type_info = new String[]{'accessType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] folderShares_type_info = new String[]{'folderShares','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] publicFolderAccess_type_info = new String[]{'publicFolderAccess','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName','accessType','folderShares','name','publicFolderAccess','sharedTo'}; + } + public class FlowConstant { + public String dataType; + public MetadataService.FlowElementReferenceOrValue value; + private String[] dataType_type_info = new String[]{'dataType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] value_type_info = new String[]{'value','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'dataType','value'}; + } + public class ChatterMobileSettings { + public Boolean enablePushNotifications; + private String[] enablePushNotifications_type_info = new String[]{'enablePushNotifications','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'enablePushNotifications'}; + } + public class CallCenterSection { + public MetadataService.CallCenterItem[] items; + public String label; + public String name; + private String[] items_type_info = new String[]{'items','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'items','label','name'}; + } + public class PagesToOpen { + public String[] pageToOpen; + private String[] pageToOpen_type_info = new String[]{'pageToOpen','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'pageToOpen'}; + } + public class ReportChart { + public String backgroundColor1; + public String backgroundColor2; + public String backgroundFadeDir; + public MetadataService.ChartSummary[] chartSummaries; + public String chartType; + public Boolean enableHoverLabels; + public Boolean expandOthers; + public String groupingColumn; + public String legendPosition; + public String location; + public String secondaryGroupingColumn; + public Boolean showAxisLabels; + public Boolean showPercentage; + public Boolean showTotal; + public Boolean showValues; + public String size; + public Double summaryAxisManualRangeEnd; + public Double summaryAxisManualRangeStart; + public String summaryAxisRange; + public String textColor; + public Integer textSize; + public String title; + public String titleColor; + public Integer titleSize; + private String[] backgroundColor1_type_info = new String[]{'backgroundColor1','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] backgroundColor2_type_info = new String[]{'backgroundColor2','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] backgroundFadeDir_type_info = new String[]{'backgroundFadeDir','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] chartSummaries_type_info = new String[]{'chartSummaries','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] chartType_type_info = new String[]{'chartType','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enableHoverLabels_type_info = new String[]{'enableHoverLabels','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] expandOthers_type_info = new String[]{'expandOthers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] groupingColumn_type_info = new String[]{'groupingColumn','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] legendPosition_type_info = new String[]{'legendPosition','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] location_type_info = new String[]{'location','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] secondaryGroupingColumn_type_info = new String[]{'secondaryGroupingColumn','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showAxisLabels_type_info = new String[]{'showAxisLabels','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showPercentage_type_info = new String[]{'showPercentage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showTotal_type_info = new String[]{'showTotal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showValues_type_info = new String[]{'showValues','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] size_type_info = new String[]{'size','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] summaryAxisManualRangeEnd_type_info = new String[]{'summaryAxisManualRangeEnd','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] summaryAxisManualRangeStart_type_info = new String[]{'summaryAxisManualRangeStart','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] summaryAxisRange_type_info = new String[]{'summaryAxisRange','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] textColor_type_info = new String[]{'textColor','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] textSize_type_info = new String[]{'textSize','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] title_type_info = new String[]{'title','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] titleColor_type_info = new String[]{'titleColor','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] titleSize_type_info = new String[]{'titleSize','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'backgroundColor1','backgroundColor2','backgroundFadeDir','chartSummaries','chartType','enableHoverLabels','expandOthers','groupingColumn','legendPosition','location','secondaryGroupingColumn','showAxisLabels','showPercentage','showTotal','showValues','size','summaryAxisManualRangeEnd','summaryAxisManualRangeStart','summaryAxisRange','textColor','textSize','title','titleColor','titleSize'}; + } + public class checkRetrieveStatusResponse_element { + public MetadataService.RetrieveResult result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class KnowledgeCaseSettings { + public String articlePDFCreationProfile; + public MetadataService.KnowledgeSitesSettings articlePublicSharingSites; + public MetadataService.KnowledgeSitesSettings articlePublicSharingSitesChatterAnswers; + public String assignTo; + public String customizationClass; + public String defaultContributionArticleType; + public String editor; + public Boolean enableArticleCreation; + public Boolean enableArticlePublicSharingSites; + public Boolean useProfileForPDFCreation; + private String[] articlePDFCreationProfile_type_info = new String[]{'articlePDFCreationProfile','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] articlePublicSharingSites_type_info = new String[]{'articlePublicSharingSites','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] articlePublicSharingSitesChatterAnswers_type_info = new String[]{'articlePublicSharingSitesChatterAnswers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] assignTo_type_info = new String[]{'assignTo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customizationClass_type_info = new String[]{'customizationClass','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultContributionArticleType_type_info = new String[]{'defaultContributionArticleType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] editor_type_info = new String[]{'editor','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableArticleCreation_type_info = new String[]{'enableArticleCreation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableArticlePublicSharingSites_type_info = new String[]{'enableArticlePublicSharingSites','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] useProfileForPDFCreation_type_info = new String[]{'useProfileForPDFCreation','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'articlePDFCreationProfile','articlePublicSharingSites','articlePublicSharingSitesChatterAnswers','assignTo','customizationClass','defaultContributionArticleType','editor','enableArticleCreation','enableArticlePublicSharingSites','useProfileForPDFCreation'}; + } + public class SharingReason extends Metadata { + public String type = 'SharingReason'; + public String fullName; + public String label; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'label'}; + } + public class ProfileFieldLevelSecurity { + public Boolean editable; + public String field; + public Boolean readable; + private String[] editable_type_info = new String[]{'editable','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] readable_type_info = new String[]{'readable','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'editable','field','readable'}; + } + public class SharingOwnerRule extends SharingBaseRule { + public String type = 'SharingOwnerRule'; + public String fullName; + public String accessLevel; + public MetadataService.AccountSharingRuleSettings accountSettings; + public String description; + public String label; + public MetadataService.SharedTo sharedTo; + private String[] accessLevel_type_info = new String[]{'accessLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] accountSettings_type_info = new String[]{'accountSettings','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sharedTo_type_info = new String[]{'sharedTo','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + public MetadataService.SharedTo sharedFrom; + private String[] sharedFrom_type_info = new String[]{'sharedFrom','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName','accessLevel','accountSettings','description','label','sharedTo', 'sharedFrom'}; + } + public class CompactLayout extends Metadata { + public String type = 'CompactLayout'; + public String fullName; + public String[] fields; + public String label; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'fields','label'}; + } + public class MiniLayout { + public String[] fields; + public MetadataService.RelatedListItem[] relatedLists; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] relatedLists_type_info = new String[]{'relatedLists','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'fields','relatedLists'}; + } + public class ReportBucketFieldSourceValue { + public String from_x; + public String sourceValue; + public String to; + private String[] from_x_type_info = new String[]{'from','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sourceValue_type_info = new String[]{'sourceValue','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] to_type_info = new String[]{'to','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'from_x','sourceValue','to'}; + } + public class UpsertResult { + public Boolean created; + public MetadataService.Error[] errors; + public String fullName; + public Boolean success; + private String[] created_type_info = new String[]{'created','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] errors_type_info = new String[]{'errors','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] fullName_type_info = new String[]{'fullName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] success_type_info = new String[]{'success','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'created','errors','fullName','success'}; + } + public class AccessMapping { + public String accessLevel; + public String object_x; + public String objectField; + public String userField; + private String[] accessLevel_type_info = new String[]{'accessLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] object_x_type_info = new String[]{'object','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] objectField_type_info = new String[]{'objectField','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] userField_type_info = new String[]{'userField','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'accessLevel','object_x','objectField','userField'}; + } + public class CustomDataTypeComponent { + public String developerSuffix; + public Boolean enforceFieldRequiredness; + public String label; + public Integer length; + public Integer precision; + public Integer scale; + public String sortOrder; + public Integer sortPriority; + public String type_x; + private String[] developerSuffix_type_info = new String[]{'developerSuffix','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] enforceFieldRequiredness_type_info = new String[]{'enforceFieldRequiredness','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] length_type_info = new String[]{'length','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] precision_type_info = new String[]{'precision','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scale_type_info = new String[]{'scale','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sortOrder_type_info = new String[]{'sortOrder','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] sortPriority_type_info = new String[]{'sortPriority','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'developerSuffix','enforceFieldRequiredness','label','length','precision','scale','sortOrder','sortPriority','type_x'}; + } + public class CustomObjectTranslation extends Metadata { + public String type = 'CustomObjectTranslation'; + public String fullName; + public MetadataService.ObjectNameCaseValue[] caseValues; + public MetadataService.CustomFieldTranslation[] fields; + public String gender; + public MetadataService.LayoutTranslation[] layouts; + public String nameFieldLabel; + public MetadataService.QuickActionTranslation[] quickActions; + public MetadataService.RecordTypeTranslation[] recordTypes; + public MetadataService.SharingReasonTranslation[] sharingReasons; + public MetadataService.StandardFieldTranslation[] standardFields; + public String startsWith; + public MetadataService.ValidationRuleTranslation[] validationRules; + public MetadataService.WebLinkTranslation[] webLinks; + public MetadataService.WorkflowTaskTranslation[] workflowTasks; + private String[] caseValues_type_info = new String[]{'caseValues','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] fields_type_info = new String[]{'fields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] gender_type_info = new String[]{'gender','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] layouts_type_info = new String[]{'layouts','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] nameFieldLabel_type_info = new String[]{'nameFieldLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] quickActions_type_info = new String[]{'quickActions','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] recordTypes_type_info = new String[]{'recordTypes','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] sharingReasons_type_info = new String[]{'sharingReasons','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] standardFields_type_info = new String[]{'standardFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] startsWith_type_info = new String[]{'startsWith','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] validationRules_type_info = new String[]{'validationRules','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] webLinks_type_info = new String[]{'webLinks','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] workflowTasks_type_info = new String[]{'workflowTasks','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'caseValues','fields','gender','layouts','nameFieldLabel','quickActions','recordTypes','sharingReasons','standardFields','startsWith','validationRules','webLinks','workflowTasks'}; + } + public class CustomApplication extends Metadata { + public String type = 'CustomApplication'; + public String fullName; + public MetadataService.CustomApplicationComponents customApplicationComponents; + public String defaultLandingTab; + public String description; + public String detailPageRefreshMethod; + public MetadataService.DomainWhitelist domainWhitelist; + public Boolean enableCustomizeMyTabs; + public Boolean enableKeyboardShortcuts; + public Boolean enableMultiMonitorComponents; + public Boolean enablePinTabs; + public Boolean isServiceCloudConsole; + public MetadataService.KeyboardShortcuts keyboardShortcuts; + public String label; + public MetadataService.ListPlacement listPlacement; + public String listRefreshMethod; + public MetadataService.LiveAgentConfig liveAgentConfig; + public String logo; + public MetadataService.PushNotifications pushNotifications; + public Boolean saveUserSessions; + public String[] tab; + public MetadataService.WorkspaceMappings workspaceMappings; + private String[] customApplicationComponents_type_info = new String[]{'customApplicationComponents','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] defaultLandingTab_type_info = new String[]{'defaultLandingTab','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] detailPageRefreshMethod_type_info = new String[]{'detailPageRefreshMethod','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] domainWhitelist_type_info = new String[]{'domainWhitelist','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableCustomizeMyTabs_type_info = new String[]{'enableCustomizeMyTabs','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableKeyboardShortcuts_type_info = new String[]{'enableKeyboardShortcuts','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableMultiMonitorComponents_type_info = new String[]{'enableMultiMonitorComponents','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enablePinTabs_type_info = new String[]{'enablePinTabs','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isServiceCloudConsole_type_info = new String[]{'isServiceCloudConsole','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] keyboardShortcuts_type_info = new String[]{'keyboardShortcuts','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] listPlacement_type_info = new String[]{'listPlacement','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] listRefreshMethod_type_info = new String[]{'listRefreshMethod','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] liveAgentConfig_type_info = new String[]{'liveAgentConfig','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] logo_type_info = new String[]{'logo','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] pushNotifications_type_info = new String[]{'pushNotifications','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] saveUserSessions_type_info = new String[]{'saveUserSessions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] tab_type_info = new String[]{'tab','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] workspaceMappings_type_info = new String[]{'workspaceMappings','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'customApplicationComponents','defaultLandingTab','description','detailPageRefreshMethod','domainWhitelist','enableCustomizeMyTabs','enableKeyboardShortcuts','enableMultiMonitorComponents','enablePinTabs','isServiceCloudConsole','keyboardShortcuts','label','listPlacement','listRefreshMethod','liveAgentConfig','logo','pushNotifications','saveUserSessions','tab','workspaceMappings'}; + } + public class ReportAggregate { + public String acrossGroupingContext; + public String calculatedFormula; + public String datatype; + public String description; + public String developerName; + public String downGroupingContext; + public Boolean isActive; + public Boolean isCrossBlock; + public String masterLabel; + public String reportType; + public Integer scale; + private String[] acrossGroupingContext_type_info = new String[]{'acrossGroupingContext','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] calculatedFormula_type_info = new String[]{'calculatedFormula','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] datatype_type_info = new String[]{'datatype','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] developerName_type_info = new String[]{'developerName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] downGroupingContext_type_info = new String[]{'downGroupingContext','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isActive_type_info = new String[]{'isActive','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] isCrossBlock_type_info = new String[]{'isCrossBlock','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] masterLabel_type_info = new String[]{'masterLabel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] reportType_type_info = new String[]{'reportType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scale_type_info = new String[]{'scale','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'acrossGroupingContext','calculatedFormula','datatype','description','developerName','downGroupingContext','isActive','isCrossBlock','masterLabel','reportType','scale'}; + } + public class AgentConfigUserAssignments { + public String[] user_x; + private String[] user_x_type_info = new String[]{'user','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'user_x'}; + } + public class DashboardMobileSettings { + public Boolean enableDashboardIPadApp; + private String[] enableDashboardIPadApp_type_info = new String[]{'enableDashboardIPadApp','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'enableDashboardIPadApp'}; + } + public class NetworkMemberGroup { + public String[] permissionSet; + public String[] profile; + private String[] permissionSet_type_info = new String[]{'permissionSet','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] profile_type_info = new String[]{'profile','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'permissionSet','profile'}; + } + public class DebuggingInfo_element { + public String debugLog; + private String[] debugLog_type_info = new String[]{'debugLog','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'debugLog'}; + } + public class Territory2 extends Metadata { + public String type = 'Territory2'; + public String fullName; + public String accountAccessLevel; + public String caseAccessLevel; + public String contactAccessLevel; + public MetadataService.FieldValue[] customFields; + public String description; + public String name; + public String opportunityAccessLevel; + public String parentTerritory; + public MetadataService.Territory2RuleAssociation[] ruleAssociations; + public String territory2Type; + private String[] accountAccessLevel_type_info = new String[]{'accountAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] caseAccessLevel_type_info = new String[]{'caseAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] contactAccessLevel_type_info = new String[]{'contactAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customFields_type_info = new String[]{'customFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] opportunityAccessLevel_type_info = new String[]{'opportunityAccessLevel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] parentTerritory_type_info = new String[]{'parentTerritory','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] ruleAssociations_type_info = new String[]{'ruleAssociations','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] territory2Type_type_info = new String[]{'territory2Type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'accountAccessLevel','caseAccessLevel','contactAccessLevel','customFields','description','name','opportunityAccessLevel','parentTerritory','ruleAssociations','territory2Type'}; + } + public class Container { + public Integer height; + public Boolean isContainerAutoSizeEnabled; + public String region; + public MetadataService.SidebarComponent[] sidebarComponents; + public String style; + public String unit; + public Integer width; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] isContainerAutoSizeEnabled_type_info = new String[]{'isContainerAutoSizeEnabled','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] region_type_info = new String[]{'region','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] sidebarComponents_type_info = new String[]{'sidebarComponents','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] style_type_info = new String[]{'style','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] unit_type_info = new String[]{'unit','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'height','isContainerAutoSizeEnabled','region','sidebarComponents','style','unit','width'}; + } + public class FindSimilarOppFilter { + public String[] similarOpportunitiesDisplayColumns; + public String[] similarOpportunitiesMatchFields; + private String[] similarOpportunitiesDisplayColumns_type_info = new String[]{'similarOpportunitiesDisplayColumns','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] similarOpportunitiesMatchFields_type_info = new String[]{'similarOpportunitiesMatchFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'similarOpportunitiesDisplayColumns','similarOpportunitiesMatchFields'}; + } + public class Community extends Metadata { + public String type = 'Community'; + public String fullName; + public Boolean active; + public String communityFeedPage; + public String description; + public String emailFooterDocument; + public String emailHeaderDocument; + public String emailNotificationUrl; + public Boolean enableChatterAnswers; + public Boolean enablePrivateQuestions; + public String expertsGroup; + public String portal; + public MetadataService.ReputationLevels reputationLevels; + public Boolean showInPortal; + public String site; + private String[] active_type_info = new String[]{'active','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] communityFeedPage_type_info = new String[]{'communityFeedPage','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailFooterDocument_type_info = new String[]{'emailFooterDocument','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailHeaderDocument_type_info = new String[]{'emailHeaderDocument','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emailNotificationUrl_type_info = new String[]{'emailNotificationUrl','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enableChatterAnswers_type_info = new String[]{'enableChatterAnswers','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] enablePrivateQuestions_type_info = new String[]{'enablePrivateQuestions','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] expertsGroup_type_info = new String[]{'expertsGroup','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] portal_type_info = new String[]{'portal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] reputationLevels_type_info = new String[]{'reputationLevels','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showInPortal_type_info = new String[]{'showInPortal','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] site_type_info = new String[]{'site','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'active','communityFeedPage','description','emailFooterDocument','emailHeaderDocument','emailNotificationUrl','enableChatterAnswers','enablePrivateQuestions','expertsGroup','portal','reputationLevels','showInPortal','site'}; + } + public class DeleteResult { + public MetadataService.Error[] errors; + public String fullName; + public Boolean success; + private String[] errors_type_info = new String[]{'errors','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] fullName_type_info = new String[]{'fullName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] success_type_info = new String[]{'success','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'errors','fullName','success'}; + } + public class LayoutItem { + public MetadataService.AnalyticsCloudComponentLayoutItem analyticsCloudComponent; + public String behavior; + public String canvas; + public String component; + public String customLink; + public Boolean emptySpace; + public String field; + public Integer height; + public String page_x; + public MetadataService.ReportChartComponentLayoutItem reportChartComponent; + public String scontrol; + public Boolean showLabel; + public Boolean showScrollbars; + public String width; + private String[] analyticsCloudComponent_type_info = new String[]{'analyticsCloudComponent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] behavior_type_info = new String[]{'behavior','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] canvas_type_info = new String[]{'canvas','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] component_type_info = new String[]{'component','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] customLink_type_info = new String[]{'customLink','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] emptySpace_type_info = new String[]{'emptySpace','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] height_type_info = new String[]{'height','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] page_x_type_info = new String[]{'page','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] reportChartComponent_type_info = new String[]{'reportChartComponent','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] scontrol_type_info = new String[]{'scontrol','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showLabel_type_info = new String[]{'showLabel','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] showScrollbars_type_info = new String[]{'showScrollbars','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] width_type_info = new String[]{'width','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'analyticsCloudComponent','behavior','canvas','component','customLink','emptySpace','field','height','page_x','reportChartComponent','scontrol','showLabel','showScrollbars','width'}; + } + public class SharingReasonTranslation { + public String label; + public String name; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'label','name'}; + } + public class SharingSet extends Metadata { + public String type = 'SharingSet'; + public String fullName; + public MetadataService.AccessMapping[] accessMappings; + public String description; + public String name; + public String[] profiles; + private String[] accessMappings_type_info = new String[]{'accessMappings','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] profiles_type_info = new String[]{'profiles','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] type_att_info = new String[]{'xsi:type'}; + private String[] fullName_type_info = new String[]{'fullName','http://www.w3.org/2001/XMLSchema','string','0','1','false'}; + private String[] field_order_type_info = new String[]{'fullName', 'accessMappings','description','name','profiles'}; + } + public class checkDeployStatusResponse_element { + public MetadataService.DeployResult result; + private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'result'}; + } + public class ReportColorRange { + public String aggregate; + public String columnName; + public Double highBreakpoint; + public String highColor; + public Double lowBreakpoint; + public String lowColor; + public String midColor; + private String[] aggregate_type_info = new String[]{'aggregate','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] columnName_type_info = new String[]{'columnName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] highBreakpoint_type_info = new String[]{'highBreakpoint','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] highColor_type_info = new String[]{'highColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] lowBreakpoint_type_info = new String[]{'lowBreakpoint','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'}; + private String[] lowColor_type_info = new String[]{'lowColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] midColor_type_info = new String[]{'midColor','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'aggregate','columnName','highBreakpoint','highColor','lowBreakpoint','lowColor','midColor'}; + } + public class SearchLayouts { + public String[] customTabListAdditionalFields; + public String[] excludedStandardButtons; + public String[] listViewButtons; + public String[] lookupDialogsAdditionalFields; + public String[] lookupFilterFields; + public String[] lookupPhoneDialogsAdditionalFields; + public String[] searchFilterFields; + public String[] searchResultsAdditionalFields; + public String[] searchResultsCustomButtons; + private String[] customTabListAdditionalFields_type_info = new String[]{'customTabListAdditionalFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] excludedStandardButtons_type_info = new String[]{'excludedStandardButtons','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] listViewButtons_type_info = new String[]{'listViewButtons','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] lookupDialogsAdditionalFields_type_info = new String[]{'lookupDialogsAdditionalFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] lookupFilterFields_type_info = new String[]{'lookupFilterFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] lookupPhoneDialogsAdditionalFields_type_info = new String[]{'lookupPhoneDialogsAdditionalFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] searchFilterFields_type_info = new String[]{'searchFilterFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] searchResultsAdditionalFields_type_info = new String[]{'searchResultsAdditionalFields','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] searchResultsCustomButtons_type_info = new String[]{'searchResultsCustomButtons','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'customTabListAdditionalFields','excludedStandardButtons','listViewButtons','lookupDialogsAdditionalFields','lookupFilterFields','lookupPhoneDialogsAdditionalFields','searchFilterFields','searchResultsAdditionalFields','searchResultsCustomButtons'}; + } + public class QuickActionTranslation { + public String label; + public String name; + private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] name_type_info = new String[]{'name','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'}; + private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; + private String[] field_order_type_info = new String[]{'label','name'}; + } + public class MetadataPort { + public String endpoint_x = URL.getSalesforceBaseUrl().toExternalForm() + '/services/Soap/m/34.0'; + public Map inputHttpHeaders_x; + public Map outputHttpHeaders_x; + public String clientCertName_x; + public String clientCert_x; + public String clientCertPasswd_x; + public Integer timeout_x; + public MetadataService.SessionHeader_element SessionHeader; + public MetadataService.DebuggingInfo_element DebuggingInfo; + public MetadataService.AllOrNoneHeader_element AllOrNoneHeader; + public MetadataService.CallOptions_element CallOptions; + public MetadataService.DebuggingHeader_element DebuggingHeader; + private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/2006/04/metadata'; + private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/2006/04/metadata'; + private String AllOrNoneHeader_hns = 'AllOrNoneHeader=http://soap.sforce.com/2006/04/metadata'; + private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/2006/04/metadata'; + private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/2006/04/metadata'; + private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata', 'MetadataService'}; + public MetadataService.SaveResult[] updateMetadata(MetadataService.Metadata[] metadata) { + MetadataService.updateMetadata_element request_x = new MetadataService.updateMetadata_element(); + request_x.metadata = metadata; + MetadataService.updateMetadataResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'updateMetadata', + 'http://soap.sforce.com/2006/04/metadata', + 'updateMetadataResponse', + 'MetadataService.updateMetadataResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.CancelDeployResult cancelDeploy(String String_x) { + MetadataService.cancelDeploy_element request_x = new MetadataService.cancelDeploy_element(); + request_x.String_x = String_x; + MetadataService.cancelDeployResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'cancelDeploy', + 'http://soap.sforce.com/2006/04/metadata', + 'cancelDeployResponse', + 'MetadataService.cancelDeployResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.FileProperties[] listMetadata(MetadataService.ListMetadataQuery[] queries,Double asOfVersion) { + MetadataService.listMetadata_element request_x = new MetadataService.listMetadata_element(); + request_x.queries = queries; + request_x.asOfVersion = asOfVersion; + MetadataService.listMetadataResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'listMetadata', + 'http://soap.sforce.com/2006/04/metadata', + 'listMetadataResponse', + 'MetadataService.listMetadataResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.UpsertResult[] upsertMetadata(MetadataService.Metadata[] metadata) { + MetadataService.upsertMetadata_element request_x = new MetadataService.upsertMetadata_element(); + request_x.metadata = metadata; + MetadataService.upsertMetadataResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'upsertMetadata', + 'http://soap.sforce.com/2006/04/metadata', + 'upsertMetadataResponse', + 'MetadataService.upsertMetadataResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.RetrieveResult checkRetrieveStatus(String asyncProcessId,Boolean includeZip) { + MetadataService.checkRetrieveStatus_element request_x = new MetadataService.checkRetrieveStatus_element(); + request_x.asyncProcessId = asyncProcessId; + request_x.includeZip = includeZip; + MetadataService.checkRetrieveStatusResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'checkRetrieveStatus', + 'http://soap.sforce.com/2006/04/metadata', + 'checkRetrieveStatusResponse', + 'MetadataService.checkRetrieveStatusResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.AsyncResult deploy(String ZipFile,MetadataService.DeployOptions DeployOptions) { + MetadataService.deploy_element request_x = new MetadataService.deploy_element(); + request_x.ZipFile = ZipFile; + request_x.DeployOptions = DeployOptions; + MetadataService.deployResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'deploy', + 'http://soap.sforce.com/2006/04/metadata', + 'deployResponse', + 'MetadataService.deployResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public String deployRecentValidation(String validationId) { + MetadataService.deployRecentValidation_element request_x = new MetadataService.deployRecentValidation_element(); + request_x.validationId = validationId; + MetadataService.deployRecentValidationResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'deployRecentValidation', + 'http://soap.sforce.com/2006/04/metadata', + 'deployRecentValidationResponse', + 'MetadataService.deployRecentValidationResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.AsyncResult retrieve(MetadataService.RetrieveRequest retrieveRequest) { + MetadataService.retrieve_element request_x = new MetadataService.retrieve_element(); + request_x.retrieveRequest = retrieveRequest; + MetadataService.retrieveResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'retrieve', + 'http://soap.sforce.com/2006/04/metadata', + 'retrieveResponse', + 'MetadataService.retrieveResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.DeployResult checkDeployStatus(String asyncProcessId,Boolean includeDetails) { + MetadataService.checkDeployStatus_element request_x = new MetadataService.checkDeployStatus_element(); + request_x.asyncProcessId = asyncProcessId; + request_x.includeDetails = includeDetails; + MetadataService.checkDeployStatusResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'checkDeployStatus', + 'http://soap.sforce.com/2006/04/metadata', + 'checkDeployStatusResponse', + 'MetadataService.checkDeployStatusResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.DescribeValueTypeResult describeValueType(String type_x) { + MetadataService.describeValueType_element request_x = new MetadataService.describeValueType_element(); + request_x.type_x = type_x; + MetadataService.describeValueTypeResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'describeValueType', + 'http://soap.sforce.com/2006/04/metadata', + 'describeValueTypeResponse', + 'MetadataService.describeValueTypeResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.SaveResult renameMetadata(String type_x,String oldFullName,String newFullName) { + MetadataService.renameMetadata_element request_x = new MetadataService.renameMetadata_element(); + request_x.type_x = type_x; + request_x.oldFullName = oldFullName; + request_x.newFullName = newFullName; + MetadataService.renameMetadataResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'renameMetadata', + 'http://soap.sforce.com/2006/04/metadata', + 'renameMetadataResponse', + 'MetadataService.renameMetadataResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.DeleteResult[] deleteMetadata(String type_x,String[] fullNames) { + MetadataService.deleteMetadata_element request_x = new MetadataService.deleteMetadata_element(); + request_x.type_x = type_x; + request_x.fullNames = fullNames; + MetadataService.deleteMetadataResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'deleteMetadata', + 'http://soap.sforce.com/2006/04/metadata', + 'deleteMetadataResponse', + 'MetadataService.deleteMetadataResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.SaveResult[] createMetadata(MetadataService.Metadata[] metadata) { + MetadataService.createMetadata_element request_x = new MetadataService.createMetadata_element(); + request_x.metadata = metadata; + MetadataService.createMetadataResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'createMetadata', + 'http://soap.sforce.com/2006/04/metadata', + 'createMetadataResponse', + 'MetadataService.createMetadataResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.DescribeMetadataResult describeMetadata(Double asOfVersion) { + MetadataService.describeMetadata_element request_x = new MetadataService.describeMetadata_element(); + request_x.asOfVersion = asOfVersion; + MetadataService.describeMetadataResponse_element response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'describeMetadata', + 'http://soap.sforce.com/2006/04/metadata', + 'describeMetadataResponse', + 'MetadataService.describeMetadataResponse_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.result; + } + public MetadataService.IReadResult readMetadata(String type_x,String[] fullNames) { + MetadataService.readMetadata_element request_x = new MetadataService.readMetadata_element(); + request_x.type_x = type_x; + request_x.fullNames = fullNames; + MetadataService.IReadResponseElement response_x; + Map response_map_x = new Map(); + response_map_x.put('response_x', response_x); + WebServiceCallout.invoke( + this, + request_x, + response_map_x, + new String[]{endpoint_x, + '', + 'http://soap.sforce.com/2006/04/metadata', + 'readMetadata', + 'http://soap.sforce.com/2006/04/metadata', + 'readMetadataResponse', + 'MetadataService.read' + type_x + 'Response_element'} + ); + response_x = response_map_x.get('response_x'); + return response_x.getResult(); + } + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/MetadataService.cls-meta.xml b/rolluptool/src/classes/MetadataService.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/MetadataService.cls-meta.xml +++ b/rolluptool/src/classes/MetadataService.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/MetadataServiceTest.cls b/rolluptool/src/classes/MetadataServiceTest.cls index bc6e32c5..bf10fa0c 100644 --- a/rolluptool/src/classes/MetadataServiceTest.cls +++ b/rolluptool/src/classes/MetadataServiceTest.cls @@ -1,5 +1,5 @@ /** - * Copyright (c), Andrew Fawcett, + * Copyright (c) 2012, FinancialForce.com, inc * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -10,7 +10,7 @@ * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * @@ -29,97 +29,113 @@ * You should follow the usual practices to cover your other code, as shown in the MetadataCreateJobTest.cls **/ @isTest -private class MetadataServiceTest +private class MetadataServiceTest { /** * Dummy Metadata API web service mock class (see MetadataCreateJobTest.cls for a better example) **/ - private class WebServiceMockImpl implements WebServiceMock - { - public void doInvoke( - Object stub, Object request, Map response, - String endpoint, String soapAction, String requestName, - String responseNS, String responseName, String responseType) - { - if(request instanceof MetadataService.retrieve_element) - response.put('response_x', new MetadataService.retrieveResponse_element()); - else if(request instanceof MetadataService.checkDeployStatus_element) - response.put('response_x', new MetadataService.checkDeployStatusResponse_element()); - else if(request instanceof MetadataService.update_element) - response.put('response_x', new MetadataService.updateResponse_element()); - else if(request instanceof MetadataService.listMetadata_element) - response.put('response_x', new MetadataService.listMetadataResponse_element()); - else if(request instanceof MetadataService.checkStatus_element) - response.put('response_x', new MetadataService.checkStatusResponse_element()); - else if(request instanceof MetadataService.create_element) - response.put('response_x', new MetadataService.createResponse_element()); - else if(request instanceof MetadataService.checkRetrieveStatus_element) - response.put('response_x', new MetadataService.checkRetrieveStatusResponse_element()); - else if(request instanceof MetadataService.delete_element) - response.put('response_x', new MetadataService.deleteResponse_element()); - else if(request instanceof MetadataService.describeMetadata_element) - response.put('response_x', new MetadataService.describeMetadataResponse_element()); - else if(request instanceof MetadataService.deploy_element) - response.put('response_x', new MetadataService.deployResponse_element()); - return; - } - } - - @IsTest - private static void coverGeneratedCodeCRUDOperations() - { - // Null Web Service mock implementation - Test.setMock(WebServiceMock.class, new WebServiceMockImpl()); + private class WebServiceMockImpl implements WebServiceMock + { + public void doInvoke( + Object stub, Object request, Map response, + String endpoint, String soapAction, String requestName, + String responseNS, String responseName, String responseType) + { + if(request instanceof MetadataService.retrieve_element) + response.put('response_x', new MetadataService.retrieveResponse_element()); + else if(request instanceof MetadataService.checkDeployStatus_element) + response.put('response_x', new MetadataService.checkDeployStatusResponse_element()); + else if(request instanceof MetadataService.listMetadata_element) + response.put('response_x', new MetadataService.listMetadataResponse_element()); + else if(request instanceof MetadataService.checkRetrieveStatus_element) + response.put('response_x', new MetadataService.checkRetrieveStatusResponse_element()); + else if(request instanceof MetadataService.describeMetadata_element) + response.put('response_x', new MetadataService.describeMetadataResponse_element()); + else if(request instanceof MetadataService.deploy_element) + response.put('response_x', new MetadataService.deployResponse_element()); + else if(request instanceof MetadataService.updateMetadata_element) + response.put('response_x', new MetadataService.updateMetadataResponse_element()); + else if(request instanceof MetadataService.renameMetadata_element) + response.put('response_x', new MetadataService.renameMetadataResponse_element()); + else if(request instanceof MetadataService.cancelDeploy_element) + response.put('response_x', new MetadataService.cancelDeployResponse_element()); + else if(request instanceof MetadataService.deleteMetadata_element) + response.put('response_x', new MetadataService.deleteMetadataResponse_element()); + else if(request instanceof MetadataService.upsertMetadata_element) + response.put('response_x', new MetadataService.upsertMetadataResponse_element()); + else if(request instanceof MetadataService.createMetadata_element) + response.put('response_x', new MetadataService.createMetadataResponse_element()); + else if(request instanceof MetadataService.deployRecentValidation_element) + response.put('response_x', new MetadataService.deployRecentValidationResponse_element()); + else if(request instanceof MetadataService.describeValueType_element) + response.put('response_x', new MetadataService.describeValueTypeResponse_element()); + return; + } + } + + @IsTest + private static void coverGeneratedCodeCRUDOperations() + { + // Null Web Service mock implementation + System.Test.setMock(WebServiceMock.class, new WebServiceMockImpl()); // Only required to workaround a current code coverage bug in the platform MetadataService metaDataService = new MetadataService(); // Invoke operations MetadataService.MetadataPort metaDataPort = new MetadataService.MetadataPort(); - metaDataPort.create(null); - metaDataPort.deleteMetadata(null); - metaDataPort.updateMetadata(null); - } - - @IsTest - private static void coverGeneratedCodeFileBasedOperations() - { - // Null Web Service mock implementation - Test.setMock(WebServiceMock.class, new WebServiceMockImpl()); + } + + @IsTest + private static void coverGeneratedCodeFileBasedOperations1() + { + // Null Web Service mock implementation + System.Test.setMock(WebServiceMock.class, new WebServiceMockImpl()); // Only required to workaround a current code coverage bug in the platform MetadataService metaDataService = new MetadataService(); // Invoke operations MetadataService.MetadataPort metaDataPort = new MetadataService.MetadataPort(); metaDataPort.retrieve(null); - metaDataPort.checkDeployStatus(null); - metaDataPort.updateMetadata(null); + metaDataPort.checkDeployStatus(null, false); metaDataPort.listMetadata(null, null); - metaDataPort.checkStatus(null); metaDataPort.describeMetadata(null); - metaDataPort.checkRetrieveStatus(null); metaDataPort.deploy(null, null); - metaDataPort.checkDeployStatus(null); + metaDataPort.checkDeployStatus(null, false); + metaDataPort.updateMetadata(null); + metaDataPort.renameMetadata(null, null, null); + metaDataPort.cancelDeploy(null); + } + + @IsTest + private static void coverGeneratedCodeFileBasedOperations2() + { + // Null Web Service mock implementation + System.Test.setMock(WebServiceMock.class, new WebServiceMockImpl()); + // Only required to workaround a current code coverage bug in the platform + MetadataService metaDataService = new MetadataService(); + // Invoke operations + MetadataService.MetadataPort metaDataPort = new MetadataService.MetadataPort(); + metaDataPort.deleteMetadata(null, null); + metaDataPort.upsertMetadata(null); + metaDataPort.createMetadata(null); + metaDataPort.deployRecentValidation(null); + metaDataPort.describeValueType(null); } - @IsTest + @IsTest private static void coverGeneratedCodeTypes() - { + { // Reference types new MetadataService(); new MetadataService.listMetadataResponse_element(); new MetadataService.WorkflowRule(); - new MetadataService.AccountOwnerSharingRule(); new MetadataService.RecordTypeTranslation(); new MetadataService.checkDeployStatus_element(); new MetadataService.CodeCoverageWarning(); new MetadataService.FlowApexPluginCall(); new MetadataService.FlowInputValidationRule(); new MetadataService.FlowFormula(); - new MetadataService.CustomObjectCriteriaBasedSharingRule(); new MetadataService.PasswordPolicies(); new MetadataService.QueueSobject(); - new MetadataService.CaseSharingRules(); new MetadataService.PicklistValueTranslation(); - new MetadataService.OpportunityOwnerSharingRule(); - new MetadataService.ContactOwnerSharingRule(); new MetadataService.CustomDataType(); new MetadataService.PrimaryTabComponents(); new MetadataService.WorkflowEmailRecipient(); @@ -127,7 +143,6 @@ private class MetadataServiceTest new MetadataService.RecordType(); new MetadataService.Scontrol(); new MetadataService.DashboardComponent(); - new MetadataService.ContactCriteriaBasedSharingRule(); new MetadataService.FilterItem(); new MetadataService.Profile(); new MetadataService.ReportFilter(); @@ -143,7 +158,6 @@ private class MetadataServiceTest new MetadataService.DashboardComponentSection(); new MetadataService.ReportTypeColumn(); new MetadataService.CallOptions_element(); - new MetadataService.CustomObjectOwnerSharingRule(); new MetadataService.CustomFieldTranslation(); new MetadataService.AnalyticSnapshot(); new MetadataService.FlowRule(); @@ -151,7 +165,6 @@ private class MetadataServiceTest new MetadataService.CustomSite(); new MetadataService.ReportBlockInfo(); new MetadataService.describeMetadataResponse_element(); - new MetadataService.CaseOwnerSharingRule(); new MetadataService.ScontrolTranslation(); new MetadataService.DeployMessage(); new MetadataService.FlowSubflowInputAssignment(); @@ -161,7 +174,6 @@ private class MetadataServiceTest new MetadataService.CustomPageWebLink(); new MetadataService.CodeCoverageResult(); new MetadataService.ApexComponent(); - new MetadataService.BaseSharingRule(); new MetadataService.WorkflowKnowledgePublish(); new MetadataService.NetworkAccess(); new MetadataService.Workflow(); @@ -177,26 +189,16 @@ private class MetadataServiceTest new MetadataService.ProfileObjectPermissions(); new MetadataService.Role(); new MetadataService.RetrieveResult(); - new MetadataService.delete_element(); new MetadataService.SecuritySettings(); new MetadataService.WorkflowTimeTrigger(); - new MetadataService.CustomObjectSharingRules(); - new MetadataService.updateResponse_element(); new MetadataService.retrieve_element(); - new MetadataService.create_element(); new MetadataService.DescribeMetadataObject(); - new MetadataService.createResponse_element(); new MetadataService.DashboardFilterOption(); - new MetadataService.checkStatus_element(); new MetadataService.LayoutColumn(); new MetadataService.WorkflowOutboundMessage(); new MetadataService.RunTestSuccess(); new MetadataService.Queue(); - new MetadataService.LeadSharingRules(); - new MetadataService.NamedFilter(); new MetadataService.ListViewFilter(); - new MetadataService.CampaignOwnerSharingRule(); - new MetadataService.checkStatusResponse_element(); new MetadataService.CustomField(); new MetadataService.WorkflowTask(); new MetadataService.deployResponse_element(); @@ -217,8 +219,6 @@ private class MetadataServiceTest new MetadataService.ListView(); new MetadataService.FlowRecordCreate(); new MetadataService.DashboardTableColumn(); - new MetadataService.ContactSharingRules(); - new MetadataService.AccountTerritorySharingRules(); new MetadataService.AsyncResult(); new MetadataService.ArticleTypeChannelDisplay(); new MetadataService.checkRetrieveStatus_element(); @@ -231,10 +231,9 @@ private class MetadataServiceTest new MetadataService.ListMetadataQuery(); new MetadataService.FlowConnector(); new MetadataService.CustomApplicationComponent(); - new MetadataService.FlowRecordLookup(); + new MetadataService.FlowRecordLookup(); new MetadataService.FieldSet(); new MetadataService.ProfileApexClassAccess(); - new MetadataService.AccountCriteriaBasedSharingRule(); new MetadataService.DebuggingHeader_element(); new MetadataService.CustomDataTypeComponentTranslation(); new MetadataService.FlowRecordDelete(); @@ -243,7 +242,6 @@ private class MetadataServiceTest new MetadataService.IpRange(); new MetadataService.FlowApexPluginCallOutputParameter(); new MetadataService.ReportBucketField(); - new MetadataService.CaseCriteriaBasedSharingRule(); new MetadataService.CustomLabel(); new MetadataService.Attachment(); new MetadataService.SharingRules(); @@ -267,15 +265,11 @@ private class MetadataServiceTest new MetadataService.DataCategoryGroup(); new MetadataService.listMetadata_element(); new MetadataService.ValidationRule(); - new MetadataService.NamedFilterTranslation(); new MetadataService.WorkspaceMapping(); new MetadataService.MetadataWithContent(); new MetadataService.ValidationRuleTranslation(); - new MetadataService.AccountTerritorySharingRule(); new MetadataService.Metadata(); - new MetadataService.ConsoleComponent(); new MetadataService.ReportBucketFieldValue(); - new MetadataService.OpportunitySharingRules(); new MetadataService.HomePageLayout(); new MetadataService.FlowSubflow(); new MetadataService.FlowScreenField(); @@ -289,7 +283,6 @@ private class MetadataServiceTest new MetadataService.DeployOptions(); new MetadataService.FlowAssignment(); new MetadataService.ProfileApplicationVisibility(); - new MetadataService.UpdateMetadata(); new MetadataService.CustomApplicationComponents(); new MetadataService.FlowElementReferenceOrValue(); new MetadataService.EntitlementTemplate(); @@ -297,8 +290,6 @@ private class MetadataServiceTest new MetadataService.ActionOverride(); new MetadataService.WorkspaceMappings(); new MetadataService.WorkflowAction(); - new MetadataService.deleteResponse_element(); - new MetadataService.update_element(); new MetadataService.DashboardFolder(); new MetadataService.PermissionSetApexPageAccess(); new MetadataService.LayoutTranslation(); @@ -318,17 +309,14 @@ private class MetadataServiceTest new MetadataService.ReportGrouping(); new MetadataService.PermissionSetFieldPermissions(); new MetadataService.AnalyticSnapshotMapping(); - new MetadataService.LeadCriteriaBasedSharingRule(); new MetadataService.SharingRecalculation(); new MetadataService.ProfileLoginIpRange(); new MetadataService.WebLinkTranslation(); new MetadataService.ObjectRelationship(); new MetadataService.ListPlacement(); new MetadataService.SiteRedirectMapping(); - new MetadataService.OwnerSharingRule(); new MetadataService.WorkflowFieldUpdate(); new MetadataService.LetterheadLine(); - new MetadataService.OpportunityCriteriaBasedSharingRule(); new MetadataService.CustomTab(); new MetadataService.FlowChoiceUserInput(); new MetadataService.Letterhead(); @@ -341,7 +329,6 @@ private class MetadataServiceTest new MetadataService.CustomLabelTranslation(); new MetadataService.ReportChart(); new MetadataService.checkRetrieveStatusResponse_element(); - new MetadataService.LeadOwnerSharingRule(); new MetadataService.ProfileFieldLevelSecurity(); new MetadataService.SharingReason(); new MetadataService.RunTestsResult(); @@ -360,14 +347,12 @@ private class MetadataServiceTest new MetadataService.CustomApplication(); new MetadataService.ReportAggregate(); new MetadataService.ApexClass(); - new MetadataService.CampaignSharingRules(); new MetadataService.DebuggingInfo_element(); new MetadataService.Package_x(); new MetadataService.SessionSettings(); new MetadataService.Document(); new MetadataService.Folder(); new MetadataService.DeployResult(); - new MetadataService.CampaignCriteriaBasedSharingRule(); new MetadataService.LayoutItem(); new MetadataService.ProfileApexPageAccess(); new MetadataService.SharingReasonTranslation(); @@ -376,7 +361,6 @@ private class MetadataServiceTest new MetadataService.SearchLayouts(); new MetadataService.LetterheadHeaderFooter(); new MetadataService.HomePageComponent(); - new MetadataService.AccountSharingRules(); new MetadataService.MobileSettings(); new MetadataService.EscalationRules(); new MetadataService.KnowledgeAnswerSettings(); @@ -414,7 +398,6 @@ private class MetadataServiceTest new MetadataService.EmailToCaseRoutingAddress(); new MetadataService.RuleEntry(); new MetadataService.EntitlementSettings(); - new MetadataService.CriteriaBasedSharingRule(); new MetadataService.ApexPage(); new MetadataService.WorkflowSend(); new MetadataService.ChatterMobileSettings(); @@ -441,52 +424,469 @@ private class MetadataServiceTest new MetadataService.InstalledPackage(); new MetadataService.PushNotification(); new MetadataService.LiveChatAgentConfig(); - new MetadataService.AdjustmentsSettings(); - new MetadataService.ForecastingSettings(); - new MetadataService.QuickActionListItem(); - new MetadataService.Branding(); - new MetadataService.QuickActionLayoutItem(); - new MetadataService.OpportunityListFieldsSelectedSettings(); - new MetadataService.ApprovalStepRejectBehavior(); - new MetadataService.FolderShare(); - new MetadataService.ApprovalEntryCriteria(); - new MetadataService.ProductSettings(); - new MetadataService.OpportunitySettings(); - new MetadataService.LiveChatDeployment(); - new MetadataService.QuickActionLayoutColumn(); - new MetadataService.GlobalQuickActionTranslation(); - new MetadataService.ApprovalStepApprover(); - new MetadataService.QuoteSettings(); - new MetadataService.LiveChatButton(); - new MetadataService.Network(); - new MetadataService.LiveChatDeploymentDomainWhitelist(); - new MetadataService.KnowledgeLanguageSettings(); - new MetadataService.Approver(); - new MetadataService.SamlSsoConfig(); - new MetadataService.ApprovalSubmitter(); - new MetadataService.DataSourceSettings(); - new MetadataService.KeyboardShortcuts(); - new MetadataService.ApprovalStep(); - new MetadataService.AgentConfigAssignments(); - new MetadataService.QuickAction(); - new MetadataService.DefaultShortcut(); - new MetadataService.ApprovalAction(); - new MetadataService.KnowledgeLanguage(); - new MetadataService.LiveChatButtonSkills(); - new MetadataService.SkillUserAssignments(); - new MetadataService.NextAutomatedApprover(); - new MetadataService.ApprovalProcess(); - new MetadataService.QuickActionLayout(); - new MetadataService.PushNotifications(); - new MetadataService.ForecastRangeSettings(); - new MetadataService.IdeaReputationLevel(); - new MetadataService.NetworkTabSet(); - new MetadataService.SkillProfileAssignments(); - new MetadataService.CustomShortcut(); - new MetadataService.PagesToOpen(); - new MetadataService.AgentConfigUserAssignments(); - new MetadataService.NetworkMemberGroup(); - new MetadataService.FindSimilarOppFilter(); - new MetadataService.QuickActionTranslation(); + new MetadataService.AdjustmentsSettings(); + new MetadataService.ForecastingSettings(); + new MetadataService.QuickActionListItem(); + new MetadataService.Branding(); + new MetadataService.QuickActionLayoutItem(); + new MetadataService.OpportunityListFieldsSelectedSettings(); + new MetadataService.ApprovalStepRejectBehavior(); + new MetadataService.FolderShare(); + new MetadataService.ApprovalEntryCriteria(); + new MetadataService.ProductSettings(); + new MetadataService.OpportunitySettings(); + new MetadataService.LiveChatDeployment(); + new MetadataService.QuickActionLayoutColumn(); + new MetadataService.GlobalQuickActionTranslation(); + new MetadataService.ApprovalStepApprover(); + new MetadataService.QuoteSettings(); + new MetadataService.LiveChatButton(); + new MetadataService.Network(); + new MetadataService.LiveChatDeploymentDomainWhitelist(); + new MetadataService.KnowledgeLanguageSettings(); + new MetadataService.Approver(); + new MetadataService.SamlSsoConfig(); + new MetadataService.ApprovalSubmitter(); + new MetadataService.KeyboardShortcuts(); + new MetadataService.ApprovalStep(); + new MetadataService.AgentConfigAssignments(); + new MetadataService.QuickAction(); + new MetadataService.DefaultShortcut(); + new MetadataService.ApprovalAction(); + new MetadataService.KnowledgeLanguage(); + new MetadataService.LiveChatButtonSkills(); + new MetadataService.SkillUserAssignments(); + new MetadataService.NextAutomatedApprover(); + new MetadataService.ApprovalProcess(); + new MetadataService.QuickActionLayout(); + new MetadataService.PushNotifications(); + new MetadataService.ForecastRangeSettings(); + new MetadataService.IdeaReputationLevel(); + new MetadataService.NetworkTabSet(); + new MetadataService.SkillProfileAssignments(); + new MetadataService.CustomShortcut(); + new MetadataService.PagesToOpen(); + new MetadataService.AgentConfigUserAssignments(); + new MetadataService.NetworkMemberGroup(); + new MetadataService.FindSimilarOppFilter(); + new MetadataService.QuickActionTranslation(); + new MetadataService.WorkflowFlowActionParameter(); + new MetadataService.ConnectedAppOauthConfig(); + new MetadataService.FlowLoop(); + new MetadataService.renameMetadata_element(); + new MetadataService.ForecastingTypeSettings(); + new MetadataService.PermissionSetApplicationVisibility(); + new MetadataService.FeedLayout(); + new MetadataService.AppMenuItem(); + new MetadataService.deleteMetadataResponse_element(); + new MetadataService.ConnectedAppAttribute(); + new MetadataService.ReportChartComponentLayoutItem(); + new MetadataService.AppMenu(); + new MetadataService.ConnectedAppIpRange(); + new MetadataService.Error(); + new MetadataService.ComponentInstanceProperty(); + new MetadataService.BusinessHoursEntry(); + new MetadataService.RelatedContent(); + new MetadataService.SupervisorAgentConfigSkills(); + new MetadataService.ComponentInstance(); + new MetadataService.SidebarComponent(); + new MetadataService.Holiday(); + new MetadataService.SaveResult(); + new MetadataService.readMetadataResponse_element(); + new MetadataService.FlexiPageRegion(); + new MetadataService.deleteMetadata_element(); + new MetadataService.ConnectedAppMobileDetailConfig(); + new MetadataService.AccountSettings(); + new MetadataService.PermissionSetRecordTypeVisibility(); + new MetadataService.OrderSettings(); + new MetadataService.ProfileUserPermission(); + new MetadataService.LookupFilterTranslation(); + new MetadataService.WorkflowFlowAction(); + new MetadataService.ConnectedApp(); + new MetadataService.SiteDotCom(); + new MetadataService.createMetadataResponse_element(); + new MetadataService.updateMetadata_element(); + new MetadataService.LookupFilter(); + new MetadataService.updateMetadataResponse_element(); + new MetadataService.FlexiPage(); + new MetadataService.ConnectedAppSamlConfig(); + new MetadataService.createMetadata_element(); + new MetadataService.FeedLayoutComponent(); + new MetadataService.PostTemplate(); + new MetadataService.RelatedContentItem(); + new MetadataService.readMetadata_element(); + new MetadataService.ReadWorkflowRuleResult(); + new MetadataService.readWorkflowRuleResponse_element(); + new MetadataService.ReadSamlSsoConfigResult(); + new MetadataService.readSamlSsoConfigResponse_element(); + new MetadataService.ReadCustomLabelResult(); + new MetadataService.readCustomLabelResponse_element(); + new MetadataService.ReadBusinessHoursEntryResult(); + new MetadataService.readBusinessHoursEntryResponse_element(); + new MetadataService.ReadMobileSettingsResult(); + new MetadataService.readMobileSettingsResponse_element(); + new MetadataService.ReadChatterAnswersSettingsResult(); + new MetadataService.readChatterAnswersSettingsResponse_element(); + new MetadataService.ReadSharingRulesResult(); + new MetadataService.readSharingRulesResponse_element(); + new MetadataService.ReadPortalResult(); + new MetadataService.readPortalResponse_element(); + new MetadataService.ReadSkillResult(); + new MetadataService.readSkillResponse_element(); + new MetadataService.ReadEscalationRulesResult(); + new MetadataService.readEscalationRulesResponse_element(); + new MetadataService.ReadCustomDataTypeResult(); + new MetadataService.readCustomDataTypeResponse_element(); + new MetadataService.ReadExternalDataSourceResult(); + new MetadataService.readExternalDataSourceResponse_element(); + new MetadataService.ReadEntitlementProcessResult(); + new MetadataService.readEntitlementProcessResponse_element(); + new MetadataService.ReadRecordTypeResult(); + new MetadataService.readRecordTypeResponse_element(); + new MetadataService.ReadScontrolResult(); + new MetadataService.readScontrolResponse_element(); + new MetadataService.ReadDataCategoryGroupResult(); + new MetadataService.readDataCategoryGroupResponse_element(); + new MetadataService.ReadValidationRuleResult(); + new MetadataService.readValidationRuleResponse_element(); + new MetadataService.ReadProfileResult(); + new MetadataService.readProfileResponse_element(); + new MetadataService.ReadIdeasSettingsResult(); + new MetadataService.readIdeasSettingsResponse_element(); + new MetadataService.ReadConnectedAppResult(); + new MetadataService.readConnectedAppResponse_element(); + new MetadataService.ReadApexPageResult(); + new MetadataService.readApexPageResponse_element(); + new MetadataService.ReadProductSettingsResult(); + new MetadataService.readProductSettingsResponse_element(); + new MetadataService.ReadLiveAgentSettingsResult(); + new MetadataService.readLiveAgentSettingsResponse_element(); + new MetadataService.ReadOpportunitySettingsResult(); + new MetadataService.readOpportunitySettingsResponse_element(); + new MetadataService.ReadLiveChatDeploymentResult(); + new MetadataService.readLiveChatDeploymentResponse_element(); + new MetadataService.ReadActivitiesSettingsResult(); + new MetadataService.readActivitiesSettingsResponse_element(); + new MetadataService.ReadLayoutResult(); + new MetadataService.readLayoutResponse_element(); + new MetadataService.ReadWebLinkResult(); + new MetadataService.readWebLinkResponse_element(); + new MetadataService.ReadSiteDotComResult(); + new MetadataService.readSiteDotComResponse_element(); + new MetadataService.ReadCompanySettingsResult(); + new MetadataService.readCompanySettingsResponse_element(); + new MetadataService.ReadHomePageLayoutResult(); + new MetadataService.readHomePageLayoutResponse_element(); + new MetadataService.ReadDashboardResult(); + new MetadataService.readDashboardResponse_element(); + new MetadataService.ReadAssignmentRulesResult(); + new MetadataService.readAssignmentRulesResponse_element(); + new MetadataService.ReadAnalyticSnapshotResult(); + new MetadataService.readAnalyticSnapshotResponse_element(); + new MetadataService.ReadEscalationRuleResult(); + new MetadataService.readEscalationRuleResponse_element(); + new MetadataService.ReadCustomSiteResult(); + new MetadataService.readCustomSiteResponse_element(); + new MetadataService.ReadGroupResult(); + new MetadataService.readGroupResponse_element(); + new MetadataService.ReadReportTypeResult(); + new MetadataService.readReportTypeResponse_element(); + new MetadataService.ReadQuickActionResult(); + new MetadataService.readQuickActionResponse_element(); + new MetadataService.ReadCustomPageWebLinkResult(); + new MetadataService.readCustomPageWebLinkResponse_element(); + new MetadataService.ReadApexComponentResult(); + new MetadataService.readApexComponentResponse_element(); + new MetadataService.ReadEntitlementTemplateResult(); + new MetadataService.readEntitlementTemplateResponse_element(); + new MetadataService.ReadFlexiPageResult(); + new MetadataService.readFlexiPageResponse_element(); + new MetadataService.ReadWorkflowResult(); + new MetadataService.readWorkflowResponse_element(); + new MetadataService.ReadWorkflowActionResult(); + new MetadataService.readWorkflowActionResponse_element(); + new MetadataService.ReadAddressSettingsResult(); + new MetadataService.readAddressSettingsResponse_element(); + new MetadataService.ReadContractSettingsResult(); + new MetadataService.readContractSettingsResponse_element(); + new MetadataService.ReadCustomObjectResult(); + new MetadataService.readCustomObjectResponse_element(); + new MetadataService.ReadTranslationsResult(); + new MetadataService.readTranslationsResponse_element(); + new MetadataService.ReadRoleOrTerritoryResult(); + new MetadataService.readRoleOrTerritoryResponse_element(); + new MetadataService.ReadApexTriggerResult(); + new MetadataService.readApexTriggerResponse_element(); + new MetadataService.ReadCustomLabelsResult(); + new MetadataService.readCustomLabelsResponse_element(); + new MetadataService.ReadSecuritySettingsResult(); + new MetadataService.readSecuritySettingsResponse_element(); + new MetadataService.ReadCallCenterResult(); + new MetadataService.readCallCenterResponse_element(); + new MetadataService.ReadPicklistValueResult(); + new MetadataService.readPicklistValueResponse_element(); + new MetadataService.ReadRemoteSiteSettingResult(); + new MetadataService.readRemoteSiteSettingResponse_element(); + new MetadataService.ReadQuoteSettingsResult(); + new MetadataService.readQuoteSettingsResponse_element(); + new MetadataService.ReadSynonymDictionaryResult(); + new MetadataService.readSynonymDictionaryResponse_element(); + new MetadataService.ReadPostTemplateResult(); + new MetadataService.readPostTemplateResponse_element(); + new MetadataService.ReadCustomTabResult(); + new MetadataService.readCustomTabResponse_element(); + new MetadataService.ReadLetterheadResult(); + new MetadataService.readLetterheadResponse_element(); + new MetadataService.ReadInstalledPackageResult(); + new MetadataService.readInstalledPackageResponse_element(); + new MetadataService.ReadQueueResult(); + new MetadataService.readQueueResponse_element(); + new MetadataService.ReadAuthProviderResult(); + new MetadataService.readAuthProviderResponse_element(); + new MetadataService.ReadEntitlementSettingsResult(); + new MetadataService.readEntitlementSettingsResponse_element(); + new MetadataService.ReadCustomFieldResult(); + new MetadataService.readCustomFieldResponse_element(); + new MetadataService.ReadStaticResourceResult(); + new MetadataService.readStaticResourceResponse_element(); + new MetadataService.ReadEmailTemplateResult(); + new MetadataService.readEmailTemplateResponse_element(); + new MetadataService.ReadSharingReasonResult(); + new MetadataService.readSharingReasonResponse_element(); + new MetadataService.ReadLiveChatButtonResult(); + new MetadataService.readLiveChatButtonResponse_element(); + new MetadataService.ReadNetworkResult(); + new MetadataService.readNetworkResponse_element(); + new MetadataService.ReadApprovalProcessResult(); + new MetadataService.readApprovalProcessResponse_element(); + new MetadataService.ReadMilestoneTypeResult(); + new MetadataService.readMilestoneTypeResponse_element(); + new MetadataService.ReadAssignmentRuleResult(); + new MetadataService.readAssignmentRuleResponse_element(); + new MetadataService.ReadCompactLayoutResult(); + new MetadataService.readCompactLayoutResponse_element(); + new MetadataService.ReadLiveChatAgentConfigResult(); + new MetadataService.readLiveChatAgentConfigResponse_element(); + new MetadataService.ReadAccountSettingsResult(); + new MetadataService.readAccountSettingsResponse_element(); + new MetadataService.ReadBusinessProcessResult(); + new MetadataService.readBusinessProcessResponse_element(); + new MetadataService.ReadFlowResult(); + new MetadataService.readFlowResponse_element(); + new MetadataService.ReadAutoResponseRuleResult(); + new MetadataService.readAutoResponseRuleResponse_element(); + new MetadataService.ReadPermissionSetResult(); + new MetadataService.readPermissionSetResponse_element(); + new MetadataService.ReadBusinessHoursSettingsResult(); + new MetadataService.readBusinessHoursSettingsResponse_element(); + new MetadataService.ReadForecastingSettingsResult(); + new MetadataService.readForecastingSettingsResponse_element(); + new MetadataService.ReadReportResult(); + new MetadataService.readReportResponse_element(); + new MetadataService.ReadAppMenuResult(); + new MetadataService.readAppMenuResponse_element(); + new MetadataService.ReadListViewResult(); + new MetadataService.readListViewResponse_element(); + new MetadataService.ReadOrderSettingsResult(); + new MetadataService.readOrderSettingsResponse_element(); + new MetadataService.ReadCustomObjectTranslationResult(); + new MetadataService.readCustomObjectTranslationResponse_element(); + new MetadataService.ReadCustomApplicationResult(); + new MetadataService.readCustomApplicationResponse_element(); + new MetadataService.ReadKnowledgeSettingsResult(); + new MetadataService.readKnowledgeSettingsResponse_element(); + new MetadataService.ReadCaseSettingsResult(); + new MetadataService.readCaseSettingsResponse_element(); + new MetadataService.ReadApexClassResult(); + new MetadataService.readApexClassResponse_element(); + new MetadataService.ReadPackageResult(); + new MetadataService.readPackageResponse_element(); + new MetadataService.ReadCommunityResult(); + new MetadataService.readCommunityResponse_element(); + new MetadataService.ReadDocumentResult(); + new MetadataService.readDocumentResponse_element(); + new MetadataService.ReadAutoResponseRulesResult(); + new MetadataService.readAutoResponseRulesResponse_element(); + new MetadataService.ReadFolderResult(); + new MetadataService.readFolderResponse_element(); + new MetadataService.ReadCustomApplicationComponentResult(); + new MetadataService.readCustomApplicationComponentResponse_element(); + new MetadataService.ReadFieldSetResult(); + new MetadataService.readFieldSetResponse_element(); + new MetadataService.ReadSharingSetResult(); + new MetadataService.readSharingSetResponse_element(); + new MetadataService.ReadHomePageComponentResult(); + new MetadataService.readHomePageComponentResponse_element(); + new MetadataService.ReadResult(); + new MetadataService.BusinessHoursSettings(); + new MetadataService.FeedLayoutFilter(); + new MetadataService.ReportHistoricalSelector(); + new MetadataService.ConnectedAppCanvasConfig(); + new MetadataService.DeployDetails(); + new MetadataService.ReportDataCategoryFilter(); + new MetadataService.SynonymGroup(); + new MetadataService.renameMetadataResponse_element(); + new MetadataService.cancelDeploy_element(); + new MetadataService.CancelDeployResult(); + new MetadataService.SynonymDictionary(); + new MetadataService.cancelDeployResponse_element(); + new MetadataService.CompactLayout(); + new MetadataService.AccessMapping(); + new MetadataService.Container(); + new MetadataService.DeleteResult(); + new MetadataService.SharingSet(); + new MetadataService.ReputationPointsRule(); + new MetadataService.FlowActionCallInputParameter(); + new MetadataService.CustomMetadata(); + new MetadataService.VisualizationPlugin(); + new MetadataService.RelatedList(); + new MetadataService.FlowActionCallOutputParameter(); + new MetadataService.FlowActionCall(); + new MetadataService.CustomPermission(); + new MetadataService.ReputationLevelDefinitions(); + new MetadataService.PermissionSetCustomPermissions(); + new MetadataService.upsertMetadata_element(); + new MetadataService.ProfileCustomPermissions(); + new MetadataService.AgentConfigButtons(); + new MetadataService.AgentConfigSkills(); + new MetadataService.upsertMetadataResponse_element(); + new MetadataService.ReputationLevel(); + new MetadataService.ReadWorkflowAlertResult(); + new MetadataService.readWorkflowAlertResponse_element(); + new MetadataService.ReadCustomPermissionResult(); + new MetadataService.readCustomPermissionResponse_element(); + new MetadataService.ReadSiteDotComResult(); + new MetadataService.ReadEmailFolderResult(); + new MetadataService.readEmailFolderResponse_element(); + new MetadataService.ReadCustomMetadataResult(); + new MetadataService.readCustomMetadataResponse_element(); + new MetadataService.ReadAnalyticSnapshotResult(); + new MetadataService.readAnalyticSnapshotResponse_element(); + new MetadataService.ReadVisualizationPluginResult(); + new MetadataService.readVisualizationPluginResponse_element(); + new MetadataService.ReadEscalationRuleResult(); + new MetadataService.ReadMarketingActionSettingsResult(); + new MetadataService.readMarketingActionSettingsResponse_element(); + new MetadataService.ReadWorkflowKnowledgePublishResult(); + new MetadataService.readWorkflowKnowledgePublishResponse_element(); + new MetadataService.ReadDashboardFolderResult(); + new MetadataService.readDashboardFolderResponse_element(); + new MetadataService.ReadWorkflowSendResult(); + new MetadataService.readWorkflowSendResponse_element(); + new MetadataService.ReadWorkflowOutboundMessageResult(); + new MetadataService.readWorkflowOutboundMessageResponse_element(); + new MetadataService.ReadWorkflowFieldUpdateResult(); + new MetadataService.readWorkflowFieldUpdateResponse_element(); + new MetadataService.ReadDocumentFolderResult(); + new MetadataService.readDocumentFolderResponse_element(); + new MetadataService.ReadWorkflowTaskResult(); + new MetadataService.readWorkflowTaskResponse_element(); + new MetadataService.ReadNameSettingsResult(); + new MetadataService.readNameSettingsResponse_element(); + new MetadataService.ReadReportFolderResult(); + new MetadataService.readReportFolderResponse_element(); + new MetadataService.ReadCustomApplicationComponentResult(); + new MetadataService.NameSettings(); + new MetadataService.ReputationPointsRules(); + new MetadataService.FlowMetadataValue(); + new MetadataService.VisualizationResource(); + new MetadataService.MarketingActionSettings(); + new MetadataService.VisualizationType(); + new MetadataService.CustomMetadataValue(); + new MetadataService.HistoryRetentionPolicy(); + new MetadataService.UpsertResult(); + new MetaDataService.Territory2RuleAssociation(); + new MetadataService.ManagedTopics(); + new MetaDataService.XOrgHub(); + new MetaDataService.FlowWaitEventInputParameter(); + new MetadataService.ManagedTopic(); + new MetadataService.Territory2RuleItem(); + new MetadataService.DataPipeline(); + new MetadataService.UiPlugin(); + new MetadataService.Territory2Rule(); + new MetaDataService.XOrgHubSharedObject(); + new MetadataService.Territory2Type(); + new MetadataService.CorsWhitelistOrigin(); + new MetadataService.StandardFieldTranslation(); + new MetadataService.Territory2Model(); + new MetadataService.PersonListSettings(); + new MetadataService.ChannelLayoutItem(); + new MetadataService.FlowWait(); + new MetadataService.Territory2Settings(); + new MetadataService.FieldValue(); + new MetadataService.ChannelLayout(); + new MetadataService.ReadXOrgHubResult(); + new MetadataService.readXOrgHubResponse_element(); + new MetadataService.ReadAuraDefinitionBundleResult(); + new MetadataService.readAuraDefinitionBundleResponse_element(); + new MetadataService.ReadTerritory2SettingsResult(); + new MetadataService.readTerritory2SettingsResponse_element(); + new MetadataService.ReadTerritory2TypeResult(); + new MetadataService.readTerritory2TypeResponse_element(); + new MetadataService.ReadQuoteSettingsResult(); + new MetadataService.readQuoteSettingsResponse_element(); + new MetadataService.ReadCorsWhitelistOriginResult(); + new MetadataService.readCorsWhitelistOriginResponse_element(); + new MetadataService.ReadManagedTopicsResult(); + new MetadataService.readManagedTopicsResponse_element(); + new MetadataService.ReadTerritory2Result(); + new MetadataService.readTerritory2Response_element(); + new MetadataService.ReadCommunityResult(); + new MetadataService.readCommunityResponse_element(); + new MetadataService.ReadDocumentResult(); + new MetadataService.readDocumentResponse_element(); + new MetadataService.ReadTerritory2ModelResult(); + new MetadataService.readTerritory2ModelResponse_element(); + new MetadataService.FlowWaitEventOutputParameter(); + new MetadataService.FlowWaitEvent(); + new MetadataService.CustomPermissionDependencyRequired(); + new MetadataService.ReputationBranding(); + new MetadataService.AuraDefinitionBundle(); + new MetadataService.FeedItemSettings(); + new MetadataService.FlowBaseElement(); + new MetadataService.Territory2(); + new MetaDataService.deployRecentValidationResponse_element(); + new MetaDataService.SharingCriteriaRule(); + new MetaDataService.ActionLinkGroupTemplate(); + new MetaDataService.MatchingRule(); + new MetaDataService.describeValueType_element(); + new MetaDataService.LicensedCustomPermissions(); + new MetaDataService.MatchingRuleItem(); + new MetaDataService.MarketingResourceType(); + new MetaDataService.SharingBaseRule(); + new MetaDataService.MatchingRules(); + new MetaDataService.deployRecentValidation_element(); + new MetaDataService.ActionLinkTemplate(); + new MetaDataService.SharingTerritoryRule(); + new MetaDataService.PersonalJourneySettings(); + new MetaDataService.LicenseDefinition(); + new MetaDataService.AccountSharingRuleSettings(); + new MetaDataService.NamedCredential(); + new MetaDataService.DescribeValueTypeResult(); + new MetaDataService.ReadSharingTerritoryRuleResult(); + new MetaDataService.readSharingTerritoryRuleResponse_element(); + new MetadataService.ReadPersonalJourneySettingsResult(); + new MetaDataService.readPersonalJourneySettingsResponse_element(); + new MetaDataService.ReadMarketingResourceTypeResult(); + new MetaDataService.readMarketingResourceTypeResponse_element(); + new MetaDataService.ReadSharingCriteriaRuleResult(); + new MetaDataService.readSharingCriteriaRuleResponse_element(); + new MetaDataService.ReadLicenseDefinitionResult(); + new MetaDataService.readLicenseDefinitionResponse_element(); + new MetaDataService.ReadActionLinkGroupTemplateResult(); + new MetaDataService.readActionLinkGroupTemplateResponse_element(); + new MetaDataService.ReadNamedCredentialResult(); + new MetaDataService.readNamedCredentialResponse_element(); + new MetaDataService.ReadSharingOwnerRuleResult(); + new MetaDataService.readSharingOwnerRuleResponse_element(); + new MetaDataService.ReadSharingBaseRuleResult(); + new MetaDataService.readSharingBaseRuleResponse_element(); + new MetaDataService.ReadMatchingRulesResult(); + new MetaDataService.readMatchingRulesResponse_element(); + new MetaDataService.ReadMatchingRuleResult(); + new MetaDataService.readMatchingRuleResponse_element(); + new MetaDataService.SharingOwnerRule(); + new MetaDataService.PicklistEntry(); + new MetaDataService.ValueTypeField(); } } \ No newline at end of file diff --git a/rolluptool/src/classes/MetadataServiceTest.cls-meta.xml b/rolluptool/src/classes/MetadataServiceTest.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/MetadataServiceTest.cls-meta.xml +++ b/rolluptool/src/classes/MetadataServiceTest.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/StringBuilder.cls b/rolluptool/src/classes/RollupActionCalculate.cls similarity index 50% rename from rolluptool/src/classes/StringBuilder.cls rename to rolluptool/src/classes/RollupActionCalculate.cls index a7c13746..092051b5 100644 --- a/rolluptool/src/classes/StringBuilder.cls +++ b/rolluptool/src/classes/RollupActionCalculate.cls @@ -1,5 +1,5 @@ /** - * Copyright (c), Andrew Fawcett, + * Copyright (c) 2013, Andrew Fawcett * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,78 +24,35 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **/ -public virtual with sharing class StringBuilder +/** + * Invocable method allows Processs Builder and Visual Flow to invoke the rollup engine + * (rollup summaries needed to be set to Process Builder) + **/ +global with sharing class RollupActionCalculate { - protected String m_stringValue; - - public StringBuilder() {} - - public StringBuilder(List values) - { - add(values); - } - - public virtual void add(List values) - { - for(String value : values) - add(value); - } - - public virtual void add(String value) - { - m_stringValue = ( m_stringValue==null ? value : m_stringValue + value ); - } - - public virtual String getStringValue() - { - return m_stringValue; - } - - - /** Subclasses **/ - - public virtual with sharing class CSVBuilder extends StringBuilder - { - public CSVBuilder() {} - - public CSVBuilder(List values) - { - super(values); - } - - public virtual override void add(String value) - { - m_stringValue = ( m_stringValue==null ? '{0}' + value : m_stringValue + ',{0}' + value ); - } - - public override String getStringValue() - { - return getStringValue(''); - } - - public String getStringValue(String itemPrefix) - { - return m_stringValue==null ? null : String.format(m_stringValue,new List{itemPrefix}); + /** + * Describes a specific rollup to process + **/ + global class RollupToCalculate { + @InvocableVariable(label='Parent Record Id' required=true) + global Id ParentId; + @InvocableVariable(label='Rollup Summary Unique Name' required=true) + global String RollupSummaryUniqueName; + private RollupService.RollupToCalculate toServiceRollupToCalculate() { + RollupService.RollupToCalculate rollupToCalculate = new RollupService.RollupToCalculate(); + rollupToCalculate.parentId = parentId; + rollupToCalculate.rollupSummaryUniqueName = rollupSummaryUniqueName; + return rollupToCalculate; } } - public virtual with sharing class FieldListBuilder extends CSVBuilder - { - public FieldListBuilder(List values) - { - for(Schema.SObjectField value : values) - add(value.getDescribe().getName()); - } - } - - public with sharing class MultiCurrencyFieldListBuilder extends FieldListBuilder - { - public MultiCurrencyFieldListBuilder(List values) - { - super(values); - - if(Userinfo.isMultiCurrencyOrganization()) - add('CurrencyIsoCode'); - } + @InvocableMethod( + label='Calculates a rollup' + description='Provide the Id of the parent record and the unique name of the rollup to calculate, you specificy the same Id multiple times to invoke multiple rollups') + global static void calculate(List rollupsToCalculate) { + List rollupsToCalc = new List(); + for(RollupToCalculate rollupToCalc : rollupsToCalculate) + rollupsToCalc.add(rollupToCalc.toServiceRollupToCalculate()); + RollupService.rollup(rollupsToCalc); } } \ No newline at end of file diff --git a/rolluptool/src/classes/SObjectDomainTest.cls-meta.xml b/rolluptool/src/classes/RollupActionCalculate.cls-meta.xml similarity index 80% rename from rolluptool/src/classes/SObjectDomainTest.cls-meta.xml rename to rolluptool/src/classes/RollupActionCalculate.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/SObjectDomainTest.cls-meta.xml +++ b/rolluptool/src/classes/RollupActionCalculate.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupActionCalculateTest.cls b/rolluptool/src/classes/RollupActionCalculateTest.cls new file mode 100644 index 00000000..c3d33c81 --- /dev/null +++ b/rolluptool/src/classes/RollupActionCalculateTest.cls @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2013, Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@IsTest +private class RollupActionCalculateTest { + + private testmethod static void testCalculateAction() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + // Configure rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Total Opportunities into Annual Revenue on Account'; + rollupSummary.UniqueName__c = 'RollupAnnualRevenue'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Opportunity'; + rollupSummary.RelationShipField__c = 'AccountId'; + rollupSummary.RelationShipCriteria__c = null; + rollupSummary.FieldToAggregate__c = 'Amount'; + rollupSummary.AggregateOperation__c = 'Sum'; + rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Process Builder'; + insert new List { rollupSummary }; + + // Test data + Account account = new Account(); + account.Name = 'Test Account'; + account.AnnualRevenue = 0; + insert account; + Opportunity opp = new Opportunity(); + opp.Name = 'Test Opportunity'; + opp.StageName = 'Open'; + opp.CloseDate = System.today(); + opp.AccountId = account.Id; + opp.Amount = 100; + insert opp; + + // Call Process Builder action + RollupActionCalculate.RollupToCalculate rollupToCalc = new RollupActionCalculate.RollupToCalculate(); + rollupToCalc.parentId = account.Id; + rollupToCalc.rollupSummaryUniqueName = 'RollupAnnualRevenue'; + RollupActionCalculate.calculate(new List { rollupToCalc }); + + // Assert rollup + System.assertEquals(100, [select AnnualRevenue from Account where Id = :account.Id].AnnualRevenue); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupActionCalculateTest.cls-meta.xml b/rolluptool/src/classes/RollupActionCalculateTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/RollupActionCalculateTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/RollupCalculateController.cls b/rolluptool/src/classes/RollupCalculateController.cls index 760d0324..b3a38083 100644 --- a/rolluptool/src/classes/RollupCalculateController.cls +++ b/rolluptool/src/classes/RollupCalculateController.cls @@ -27,6 +27,7 @@ public with sharing class RollupCalculateController { private ApexPages.StandardController standardController; + public String masterObjectWhere { get; set; } public RollupCalculateController(ApexPages.StandardController standardController) { @@ -42,7 +43,7 @@ public with sharing class RollupCalculateController try { // Kickoff the calculate job for this lookup - RollupService.runJobToCalculate(standardController.getId()); + RollupService.runJobToCalculate(standardController.getId(), this.masterObjectWhere); ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Calculate job started for this lookup.')); } catch (Exception e) @@ -50,6 +51,14 @@ public with sharing class RollupCalculateController ApexPages.addMessages(e); return null; } + + // Custom Metadata backed rollup? + if(standardController.getRecord() instanceof LookupRollupSummary2__mdt) { + PageReference manageRollupsPage = Page.managelookuprollupsummaries; + manageRollupsPage.getParameters().put('id', standardController.getId()); + return manageRollupsPage; + } + return standardController.view(); } } \ No newline at end of file diff --git a/rolluptool/src/classes/RollupCalculateController.cls-meta.xml b/rolluptool/src/classes/RollupCalculateController.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupCalculateController.cls-meta.xml +++ b/rolluptool/src/classes/RollupCalculateController.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupCalculateJob.cls b/rolluptool/src/classes/RollupCalculateJob.cls index 4c292180..dbc97e7d 100644 --- a/rolluptool/src/classes/RollupCalculateJob.cls +++ b/rolluptool/src/classes/RollupCalculateJob.cls @@ -30,28 +30,35 @@ public with sharing class RollupCalculateJob implements Database.Batchable { - private Id lookupId; + private String lookupId; + private String masterWhereClause; public RollupCalculateJob(String lookupId) { this.lookupId = lookupId; } + + public RollupCalculateJob(String lookupId, String masterWhereClause) + { + this.lookupId = lookupId; + this.masterWhereClause = masterWhereClause; + } public Database.QueryLocator start(Database.BatchableContext BC) { // Query all the parent records as per the lookup definition - return RollupService.masterRecordsAsQueryLocator(lookupId); + return RollupService.masterRecordsAsQueryLocator(lookupId, masterWhereClause); } public void execute(Database.BatchableContext BC, List masterRecords) { // Update the master records as per the lookup definition - RollupService.updateMasterRollups(new Set { lookupId }, new Map(masterRecords).keySet()); + RollupService.updateMasterRollups(new Set { lookupId }, new Map(masterRecords).keySet()); } public void finish(Database.BatchableContext BC) { // Clear the Job Id which was preventing another calculate job running while this one was running - RollupService.clearCalculateJobId(new Set { lookupId }); + RollupService.clearCalculateJobId(new Set { lookupId }); } } \ No newline at end of file diff --git a/rolluptool/src/classes/RollupCalculateJob.cls-meta.xml b/rolluptool/src/classes/RollupCalculateJob.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupCalculateJob.cls-meta.xml +++ b/rolluptool/src/classes/RollupCalculateJob.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupCalculateJobSchedulable.cls b/rolluptool/src/classes/RollupCalculateJobSchedulable.cls new file mode 100644 index 00000000..69184df0 --- /dev/null +++ b/rolluptool/src/classes/RollupCalculateJobSchedulable.cls @@ -0,0 +1,13 @@ +public with sharing class RollupCalculateJobSchedulable implements Schedulable { + private String rollupRecordId; + private String masterWhereClause; + + public RollupCalculateJobSchedulable(String rollupRecordId, String masterWhereClause) { + this.rollupRecordId = rollupRecordId; + this.masterWhereClause = masterWhereClause; + } + + public void execute(SchedulableContext sc) { + RollupService.runJobToCalculate(rollupRecordId, masterWhereClause); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupCalculateJobSchedulable.cls-meta.xml b/rolluptool/src/classes/RollupCalculateJobSchedulable.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/RollupCalculateJobSchedulable.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/RollupController.cls b/rolluptool/src/classes/RollupController.cls index c060a129..ad6a3dd5 100644 --- a/rolluptool/src/classes/RollupController.cls +++ b/rolluptool/src/classes/RollupController.cls @@ -27,24 +27,36 @@ /** * Handles the Manage Trigger and Calculate Custom Buttons **/ -public with sharing class RollupController +public with sharing class RollupController { public String ZipData { get; set; } public MetadataService.AsyncResult AsyncResult {get; private set;} - public LookupRollupSummary__c RollupSummary { get; set; } + public RollupSummary RollupSummary { get; set; } public String RollupTriggerName { get; set; } public String RollupTriggerTestName { get; set; } + + public String RollupParentTriggerName { get; set; } + + public String RollupParentTriggerTestName { get; set; } public Boolean Deployed { get; set; } + + public Boolean ParentMergeable { get; set; } + + public Boolean ParentTriggerRequired { get; set; } public ApexTrigger RollupTrigger { get; private set; } public ApexClass RollupTriggerTest { get; private set; } + public ApexTrigger RollupParentTrigger { get; private set; } + + public ApexClass RollupParentTriggerTest { get; private set; } + public Integer deployCount; public Boolean MetadataConnectionError {get;set;} @@ -52,12 +64,19 @@ public with sharing class RollupController public RollupController(ApexPages.StandardController standardController) { // Query Lookup Rollup Summary record - RollupSummary = new RollupSummariesSelector().selectById(new Set { standardController.getId() })[0]; + RollupSummary = new RollupSummariesSelector().selectById(new Set { (String) standardController.getId() })[0]; // Generate names for test and triggers to deploy / undeploy RollupTriggerName = RollupSummaries.makeTriggerName(RollupSummary); RollupTriggerTestName = RollupSummaries.makeTriggerTestName(RollupSummary); - + RollupParentTriggerName = RollupSummaries.makeParentTriggerName(RollupSummary); + RollupParentTriggerTestName = RollupSummaries.makeParentTriggerTestName(RollupSummary); + + // Does the parent object support merge? + Map gd = Schema.getGlobalDescribe(); + SObjectType parentObjectType = gd.get(RollupSummary.ParentObject); + ParentTriggerRequired = ParentMergeable = parentObjectType.getDescribe().isMergeable(); + // Initialise view state init(); } @@ -69,7 +88,7 @@ public with sharing class RollupController return '' + '' + - '28.0' + + '32.0' + ''; else // package.xml for deploy @@ -84,7 +103,16 @@ public with sharing class RollupController ''+RollupTriggerTestName+'' + 'ApexClass' + '' + - '28.0' + + (ParentTriggerRequired ? + ('' + + ''+RollupParentTriggerName+'' + + 'ApexTrigger' + + '' + + '' + + ''+RollupParentTriggerTestName+'' + + 'ApexClass' + + '') : '') + + '32.0' + ''; } @@ -101,16 +129,29 @@ public with sharing class RollupController ''+RollupTriggerTestName+'' + 'ApexClass' + '' + - '28.0' + + (ParentTriggerRequired ? + ('' + + ''+RollupParentTriggerName+'' + + 'ApexTrigger' + + '' + + '' + + ''+RollupParentTriggerTestName+'' + + 'ApexClass' + + '') : '') + + '32.0' + ''; } + /** + * CHILD OBJECT CODE + **/ + public String getTriggerTestCodeMetadata() { return '' + '' + - '28.0' + + '32.0' + 'Active' + ''; } @@ -121,6 +162,9 @@ public with sharing class RollupController // Display currently deployed code for confirmation return RollupTriggerTest.Body; else + { + // Namespace? + String namespace = Utilities.namespace(); // Deploy generated code return '/**\n' + @@ -129,12 +173,18 @@ public with sharing class RollupController '@IsTest\n' + 'private class ' + RollupTriggerTestName + '\n' + '{\n' + - ' private static testmethod void testTrigger()\n' + + (RollupSummary.TestCodeSeeAllData == true ? ' @IsTest(SeeAllData=true)\n' : ' @IsTest\n') + + ' private static void testTrigger()\n' + ' {\n' + - ' // Code to cover the one line trigger, the method called has been tested separately by the packaged tests.\n' + - ' try { insert new ' + RollupSummary.ChildObject__c + '(); } catch(Exception e) { }\n' + + ((RollupSummary.TestCode!=null && RollupSummary.TestCode.length()>0) ? + RollupSummary.TestCode + '\n' : + ( + ' // Force the ' + RollupTriggerName + ' to be invoked, fails the test if org config or other Apex code prevents this.\n' + + ' ' + (namespace.length() > 0 ? namespace + '.' : '') + 'RollupService.testHandler(new ' + RollupSummary.ChildObject + '());\n') + ) + ' }\n' + - '}'; + '}'; + } } public String getTriggerCodeMetadata() @@ -142,7 +192,7 @@ public with sharing class RollupController return '' + '' + - '28.0' + + '32.0' + 'Active' + ''; } @@ -157,16 +207,88 @@ public with sharing class RollupController else { // Namespace? - Schema.DescribeSObjectResult describe = LookupRollupSummary__c.sObjectType.getDescribe(); - String name = describe.getName(); - String localName = describe.getLocalName(); - String namespace = name.removeEnd(localName).removeEnd('__'); + String namespace = Utilities.namespace(); + // Deploy generated code + return + '/**\n' + + ' * Auto Generated and Deployed by the Declarative Lookup Rollup Summaries Tool package (dlrs)\n' + + ' **/\n' + + 'trigger ' + RollupTriggerName + ' on ' + RollupSummary.ChildObject + '\n' + + ' (before delete, before insert, before update, after delete, after insert, after undelete, after update)\n'+ + '{\n'+ + ' '+ (namespace.length() > 0 ? namespace + '.' : '') + 'RollupService.triggerHandler();\n'+ + '}\n'; + } + } + + /** + * PARENT OBJECT CODE + **/ + + public String getParentTriggerTestCodeMetadata() + { + return + '' + + '' + + '32.0' + + 'Active' + + ''; + } + + public String getParentTriggerTestCode() + { + if(Deployed && RollupTriggerTest!=null) + // Display currently deployed code for confirmation + return RollupParentTriggerTest.Body; + else + { + // Namespace? + String namespace = Utilities.namespace(); + // Deploy generated code + return + '/**\n' + + ' * Auto Generated and Deployed by the Declarative Lookup Rollup Summaries Tool package (dlrs)\n' + + ' **/\n' + + '@IsTest\n' + + 'private class ' + RollupParentTriggerTestName + '\n' + + '{\n' + + (RollupSummary.TestCodeSeeAllData == true ? ' @IsTest(SeeAllData=true)\n' : ' @IsTest\n') + + ' private static void testTrigger()\n' + + ' {\n' + + ' // Force the ' + RollupParentTriggerName + ' to be invoked, fails the test if org config or other Apex code prevents this.\n' + + ' ' + (namespace.length() > 0 ? namespace + '.' : '') + 'RollupService.testHandler(new ' + RollupSummary.ParentObject + '());\n' + + ' }\n' + + '}'; + } + } + + public String getParentTriggerCodeMetadata() + { + return + '' + + '' + + '32.0' + + 'Active' + + ''; + } + + public String getParentTriggerCode() + { + if(Deployed && RollupTrigger!=null) + { + // Display currently deployed code for confirmation + return RollupParentTrigger.Body; + } + else + { + // Namespace? + String namespace = Utilities.namespace(); // Deploy generated code return '/**\n' + ' * Auto Generated and Deployed by the Declarative Lookup Rollup Summaries Tool package (dlrs)\n' + ' **/\n' + - 'trigger ' + RollupTriggerName + ' on ' + RollupSummary.ChildObject__c + '\n' + + 'trigger ' + RollupParentTriggerName + ' on ' + RollupSummary.ParentObject + '\n' + ' (before delete, before insert, before update, after delete, after insert, after undelete, after update)\n'+ '{\n'+ ' '+ (namespace.length() > 0 ? namespace + '.' : '') + 'RollupService.triggerHandler();\n'+ @@ -181,6 +303,11 @@ public with sharing class RollupController // Deploy zip file posted back from the page action function MetadataService.MetadataPort service = createService(); MetadataService.DeployOptions deployOptions = new MetadataService.DeployOptions(); + deployOptions.testLevel = 'RunSpecifiedTests'; + deployOptions.runTests = new List { RollupTriggerTestName }; + if(ParentTriggerRequired) { + deployOptions.runTests.add(RollupParentTriggerTestName); + } deployOptions.allowMissingFiles = false; deployOptions.autoUpdatePackage = false; deployOptions.checkOnly = false; @@ -188,8 +315,6 @@ public with sharing class RollupController deployOptions.performRetrieve = false; deployOptions.purgeOnDelete = false; deployOptions.rollbackOnError = true; - deployOptions.runAllTests = false; - deployOptions.runTests = null; deployOptions.singlePackage = true; AsyncResult = service.deploy(ZipData, DeployOptions); return null; @@ -199,61 +324,58 @@ public with sharing class RollupController { // Check the status of the retrieve request MetadataService.MetadataPort service = createService(); - MetadataService.AsyncResult[] aysncResults = service.checkStatus(new String[] { AsyncResult.Id }); - if(aysncResults[0].done) + MetadataService.DeployResult deployResult = service.checkDeployStatus(AsyncResult.Id, true); + if(deployResult.done) { - // Errors? - if(aysncResults[0].state == 'Error') - { - ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, aysncResults[0].message)); - AsyncResult = null; - } - else - { - ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, Deployed ? 'Remove complete.' : 'Deployment complete.')); + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, Deployed ? 'Remove complete.' : 'Deployment complete.')); - // Deployment errors? - MetadataService.DeployResult deployResult = service.checkDeployStatus(AsyncResult.Id); - for(MetadataService.DeployMessage deployMessage : deployResult.messages) + // Deployment errors? + if(deployResult.details!=null && deployResult.details.componentFailures!=null) + for(MetadataService.DeployMessage deployMessage : deployResult.details.componentFailures) if(deployMessage.problem!=null) ApexPages.addMessage( new ApexPages.Message(ApexPages.Severity.Error, deployMessage.fileName + ' (Line: ' + deployMessage.lineNumber + ': Column:' + deployMessage.columnNumber + ') : ' + deployMessage.problem)); - // Test errors? - MetadataService.RunTestsResult runTestResult = deployResult.runTestResult; - if(runTestResult.numFailures > 0) - for(MetadataService.RunTestFailure testFailure : runTestResult.failures) - ApexPages.addMessage( - new ApexPages.Message(ApexPages.Severity.Error, - testFailure.name + '.' + testFailure.methodName + ' ' + testFailure.message + ' ' + testFailure.stackTrace)); - // Code coverage warnings? - if(runTestResult.codeCoverageWarnings!=null) - for(MetadataService.CodeCoverageWarning codeCoverageWarning : runTestResult.codeCoverageWarnings) - ApexPages.addMessage( - new ApexPages.Message(ApexPages.Severity.Warning, - (codeCoverageWarning.namespace!=null ? codeCoverageWarning.namespace+'.' : '') + - codeCoverageWarning.name + ':' + - codeCoverageWarning.message)); - - AsyncResult = null; - - // If this was an undeploy and was successful? - if(Deployed && !ApexPages.hasMessages(ApexPages.Severity.Error)) - { - // Determine active rollups for this child and deactivate them - List rollups = - new RollupSummariesSelector().selectActiveByChildObject( - RollupSummaries.CalculationMode.Realtime, new Set { RollupSummary.ChildObject__c }); - for(LookupRollupSummary__c rollup : rollups) - rollup.Active__c = false; - update rollups; + // Test errors? + MetadataService.RunTestsResult runTestResult = deployResult.details.runTestResult; + if(runTestResult.numFailures > 0) + for(MetadataService.RunTestFailure testFailure : runTestResult.failures) + ApexPages.addMessage( + new ApexPages.Message(ApexPages.Severity.Error, + testFailure.name + '.' + testFailure.methodName + ' ' + testFailure.message + ' ' + testFailure.stackTrace)); + // Code coverage warnings? + if(runTestResult.codeCoverageWarnings!=null) + for(MetadataService.CodeCoverageWarning codeCoverageWarning : runTestResult.codeCoverageWarnings) + ApexPages.addMessage( + new ApexPages.Message(ApexPages.Severity.Warning, + (codeCoverageWarning.namespace!=null ? codeCoverageWarning.namespace+'.' : '') + + codeCoverageWarning.name + ':' + + codeCoverageWarning.message)); + + AsyncResult = null; + + // If this was an undeploy and was successful? + if(Deployed && !ApexPages.hasMessages(ApexPages.Severity.Error)) + { + // Determine active rollups for this child and deactivate them + List rollups = + new RollupSummariesSelector().selectActiveByChildObject( + RollupSummaries.CalculationMode.Realtime, new Set { RollupSummary.ChildObject }); + List recordsToUpdate = new List(); + for(RollupSummary rollup : rollups) { + // TODO: Can only auto deactivate Custom Object based rollups + if(rollup.Record instanceof LookupRollupSummary__c) { + rollup.Active = false; + recordsToUpdate.add((LookupRollupSummary__c) rollup.Record); + } } - - // Initialise view state to try again - init(); + update recordsToUpdate; } + + // Initialise view state to try again + init(); } else { @@ -273,11 +395,20 @@ public with sharing class RollupController } // Already deployed? - Map apexTriggers = new ApexTriggersSelector().selectByName(new Set { RollupTriggerName }); - Map apexClasses = new ApexClassesSelector().selectByName(new Set { RollupTriggerTestName }); - Deployed = apexTriggers.size()==1 && apexClasses.size()==1; - RollupTrigger = Deployed ? apexTriggers.values()[0] : null; - RollupTriggerTest = Deployed ? apexClasses.values()[0] : null; + Set triggerNames = new Set { RollupTriggerName }; + Set testNames = new Set { RollupTriggerTestName }; + if(ParentMergeable) { + triggerNames.add(RollupParentTriggerName); + testNames.add(RollupParentTriggerTestName); + } + Map apexTriggers = new ApexTriggersSelector().selectByName(triggerNames); + Map apexClasses = new ApexClassesSelector().selectByName(testNames); + Deployed = apexTriggers.containsKey(RollupTriggerName) && apexClasses.containsKey(RollupTriggerTestName); + RollupTrigger = Deployed ? apexTriggers.get(RollupTriggerName) : null; + RollupTriggerTest = Deployed ? apexClasses.get(RollupTriggerTestName) : null; + RollupParentTrigger = Deployed ? apexTriggers.get(RollupParentTriggerName) : null; + RollupParentTriggerTest = Deployed ? apexClasses.get(RollupParentTriggerTestName) : null; + ParentTriggerRequired = Deployed ? RollupParentTrigger!=null && RollupParentTriggerTest!=null : ParentTriggerRequired; deployCount = 0; // Message to confirm current status @@ -285,6 +416,12 @@ public with sharing class RollupController { ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Apex Trigger ' + RollupTriggerName + ' is installed.')); ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Apex Class ' + RollupTriggerTestName + ' is installed.')); + if(RollupParentTrigger!=null) { + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Apex Trigger ' + RollupParentTriggerName + ' is installed.')); + } + if(RollupParentTriggerTest!=null) { + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Apex Trigger ' + RollupParentTriggerTestName + ' is installed.')); + } ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Click Remove to uninstall the Apex Trigger and Apex Class for this child object.')); } else diff --git a/rolluptool/src/classes/RollupController.cls-meta.xml b/rolluptool/src/classes/RollupController.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupController.cls-meta.xml +++ b/rolluptool/src/classes/RollupController.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupControllerTest.cls b/rolluptool/src/classes/RollupControllerTest.cls index 1d79c1a5..1465cecd 100644 --- a/rolluptool/src/classes/RollupControllerTest.cls +++ b/rolluptool/src/classes/RollupControllerTest.cls @@ -25,7 +25,7 @@ **/ @IsTest -private with sharing class RollupControllerTest +private class RollupControllerTest { private testmethod static void testDeployedStatus() { @@ -76,7 +76,7 @@ private with sharing class RollupControllerTest System.assertEquals( '' + '' + - '28.0' + + '32.0' + '', controller.getPackageXml()); System.assertEquals( @@ -90,20 +90,20 @@ private with sharing class RollupControllerTest ''+controller.RollupTriggerTestName+'' + 'ApexClass' + '' + - '28.0' + + '32.0' + '', controller.getDestructiveChangesXml()); System.assertEquals( '' + '' + - '28.0' + + '32.0' + 'Active' + '', controller.getTriggerCodeMetadata()); System.assertEquals( '' + '' + - '28.0' + + '32.0' + 'Active' + '', controller.getTriggerTestCodeMetadata()); @@ -155,8 +155,6 @@ private with sharing class RollupControllerTest // Assert initial state of controller when the trigger for the child object is deployed RollupController controller = new RollupController(new ApexPages.StandardController( rollupSummary )); System.assertEquals(false, controller.Deployed); - System.assertEquals('dlrs_ContactTrigger', controller.RollupTriggerName); - System.assertEquals('dlrs_ContactTest', controller.RollupTriggerTestName); System.assertEquals(null, controller.RollupTrigger); System.assertEquals(null, controller.RollupTriggerTest); System.assertEquals( @@ -166,7 +164,7 @@ private with sharing class RollupControllerTest 'trigger ' + controller.RollupTriggerName + ' on ' + rollupSummary.ChildObject__c + '\n' + ' (before delete, before insert, before update, after delete, after insert, after undelete, after update)\n'+ '{\n'+ - ' dlrs.RollupService.triggerHandler();\n'+ + ' ' + Utilities.classPrefix() + 'RollupService.triggerHandler();\n'+ '}\n', controller.getTriggerCode()); System.assertEquals( '/**\n' + @@ -175,10 +173,11 @@ private with sharing class RollupControllerTest '@IsTest\n' + 'private class ' + controller.RollupTriggerTestName + '\n' + '{\n' + - ' private static testmethod void testTrigger()\n' + + ' @IsTest\n' + + ' private static void testTrigger()\n' + ' {\n' + - ' // Code to cover the one line trigger, the method called has been tested separately by the packaged tests.\n' + - ' try { insert new ' + rollupSummary.ChildObject__c + '(); } catch(Exception e) { }\n' + + ' // Force the ' + controller.RollupTriggerName + ' to be invoked, fails the test if org config or other Apex code prevents this.\n' + + ' ' + Utilities.classPrefix() + 'RollupService.testHandler(new ' + rollupSummary.ChildObject__c + '());\n' + ' }\n' + '}', controller.getTriggerTestCode()); System.assertEquals( @@ -192,26 +191,79 @@ private with sharing class RollupControllerTest ''+controller.RollupTriggerTestName+'' + 'ApexClass' + '' + - '28.0' + + '' + + ''+controller.RollupParentTriggerName+'' + + 'ApexTrigger' + + '' + + '' + + ''+controller.RollupParentTriggerTestName+'' + + 'ApexClass' + + '' + + '32.0' + '', controller.getPackageXml()); System.assertEquals( '' + '' + - '28.0' + + '32.0' + 'Active' + '', controller.getTriggerCodeMetadata()); System.assertEquals( '' + '' + - '28.0' + + '32.0' + 'Active' + '', controller.getTriggerTestCodeMetadata()); Test.stopTest(); } + + private testmethod static void testWithCustomTestCode() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + // Metadata API web Service mock implementation for tests + Test.setMock(WebServiceMock.class, new WebServiceMockImpl()); + + // Test data + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Total Opportunities greater than 200 into Annual Revenue on Account'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Contact'; + rollupSummary.RelationShipField__c = 'AccountId'; + rollupSummary.RelationShipCriteria__c = null; + rollupSummary.FieldToAggregate__c = 'LastCURequestDate'; + rollupSummary.AggregateOperation__c = 'Count'; + rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.Active__c = false; + rollupSummary.CalculationMode__c = 'Realtime'; + rollupSummary.TestCode__c = 'System.assertEquals(1,1);'; + rollupSummary.TestCodeSeeAllData__c = true; + insert rollupSummary; + + // Open test context, permits callouts following DML + Test.startTest(); + + // Assert initial state of controller when the trigger for the child object is deployed + RollupController controller = new RollupController(new ApexPages.StandardController( rollupSummary )); + System.assertEquals( + '/**\n' + + ' * Auto Generated and Deployed by the Declarative Lookup Rollup Summaries Tool package (dlrs)\n' + + ' **/\n' + + '@IsTest\n' + + 'private class ' + controller.RollupTriggerTestName + '\n' + + '{\n' + + ' @IsTest(SeeAllData=true)\n' + + ' private static void testTrigger()\n' + + ' {\n' + + 'System.assertEquals(1,1);\n' + + ' }\n' + + '}', controller.getTriggerTestCode()); + } /** * Metadata API web service mock class for tests above @@ -232,14 +284,15 @@ private with sharing class RollupControllerTest response_x.result.state = 'Complete'; response.put('response_x', response_x); } - else if(request instanceof MetadataService.checkStatus_element) + else if(request instanceof MetadataService.checkDeployStatus_element) { - System.assertEquals('someid', ((MetadataService.checkStatus_element) request).asyncProcessId[0]); - MetadataService.checkStatusResponse_element response_x = new MetadataService.checkStatusResponse_element(); - response_x.result = new List(); - response_x.result.add(new MetadataService.AsyncResult()); - response_x.result[0].done = true; - response_x.result[0].state = 'Complete'; + System.assertEquals('someid', ((MetadataService.checkDeployStatus_element) request).asyncProcessId); + MetadataService.checkDeployStatusResponse_element response_x = new MetadataService.checkDeployStatusResponse_element(); + response_x.result = new MetadataService.DeployResult(); + response_x.result.details = new MetadataService.DeployDetails(); + response_x.result.details.runTestResult = new MetadataService.RunTestsResult(); + response_x.result.details.runTestResult.numFailures = 0; + response_x.result.details.componentFailures = new List(); response.put('response_x', response_x); } else if(request instanceof MetadataService.checkDeployStatus_element) @@ -247,9 +300,10 @@ private with sharing class RollupControllerTest System.assertEquals('someid', ((MetadataService.checkDeployStatus_element) request).asyncProcessId); MetadataService.checkDeployStatusResponse_element response_x = new MetadataService.checkDeployStatusResponse_element(); response_x.result = new MetadataService.DeployResult(); - response_x.result.runTestResult = new MetadataService.RunTestsResult(); - response_x.result.runTestResult.numFailures = 0; - response_x.result.messages = new List(); + response_x.result.details = new MetadataService.DeployDetails(); + response_x.result.details.runTestResult = new MetadataService.RunTestsResult(); + response_x.result.details.runTestResult.numFailures = 0; + response_x.result.details.componentFailures = new List(); response.put('response_x', response_x); } else if(request instanceof MetadataService.listMetadata_element) diff --git a/rolluptool/src/classes/RollupControllerTest.cls-meta.xml b/rolluptool/src/classes/RollupControllerTest.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupControllerTest.cls-meta.xml +++ b/rolluptool/src/classes/RollupControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupJob.cls-meta.xml b/rolluptool/src/classes/RollupJob.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupJob.cls-meta.xml +++ b/rolluptool/src/classes/RollupJob.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupJobTest.cls b/rolluptool/src/classes/RollupJobTest.cls index 35488ed3..5ff5fc6b 100644 --- a/rolluptool/src/classes/RollupJobTest.cls +++ b/rolluptool/src/classes/RollupJobTest.cls @@ -25,7 +25,7 @@ **/ @IsTest -private with sharing class RollupJobTest +private class RollupJobTest { } \ No newline at end of file diff --git a/rolluptool/src/classes/RollupJobTest.cls-meta.xml b/rolluptool/src/classes/RollupJobTest.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupJobTest.cls-meta.xml +++ b/rolluptool/src/classes/RollupJobTest.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupScheduledCalculateController.cls b/rolluptool/src/classes/RollupScheduledCalculateController.cls new file mode 100644 index 00000000..07202d78 --- /dev/null +++ b/rolluptool/src/classes/RollupScheduledCalculateController.cls @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2013, Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +public with sharing class RollupScheduledCalculateController +{ + private ApexPages.StandardController standardController; + public String masterObjectWhere { get; set; } + public String minute { get; set; } + public List minutes { get; set; } + public List hour { get; set; } + public List day { get; set; } + public List month { get; set; } + public List weekday { get; set; } + + public RollupScheduledCalculateController (ApexPages.StandardController standardController) + { + this.standardController = standardController; + + // Page load messages + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Clicking the Schedule Calculate Job will schedule a recurring background rebuild for this rollup only.')); + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'The default shown below will run the Calculate job at 2am every day.')); + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Once the job completes any failed rollups will be shown in the Rollup Summary Logs tab.')); + + // Minutes + minutes = new List(); + for(Integer minute=0; minute<60; minute++) { + minutes.add(new SelectOption(minute+'', minute+'')); + } + + // Default is 2am everyday + minute = '0'; + hour = new List { '2' }; + day = new List { '*' } ; + month = new List { '*' }; + weekday = new List { '?' }; + } + + public PageReference scheduleCalculateJob() + { + try + { + // Build the CRON string + String cronString = + String.join( + new List { + '0', + minute, + String.join(hour, ','), + String.join(day, ','), + String.join(month, ','), + String.join(weekday, ',') }, + ' '); + + // Kickoff the calculate job for this lookup + System.schedule('rollup_'+standardController.getId(), cronString, new RollupCalculateJobSchedulable(standardController.getId(), masterObjectWhere)); + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Calculate job scheduled for this lookup.')); + } + catch (Exception e) + { + ApexPages.addMessages(e); + return null; + } + + // Custom Metadata backed rollup? + if(standardController.getRecord() instanceof LookupRollupSummary2__mdt) { + PageReference manageRollupsPage = Page.managelookuprollupsummaries; + manageRollupsPage.getParameters().put('id', standardController.getId()); + return manageRollupsPage; + } + + return standardController.view(); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupScheduledCalculateController.cls-meta.xml b/rolluptool/src/classes/RollupScheduledCalculateController.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/RollupScheduledCalculateController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/RollupScheduledCalculateControllerTest.cls b/rolluptool/src/classes/RollupScheduledCalculateControllerTest.cls new file mode 100644 index 00000000..e9f50018 --- /dev/null +++ b/rolluptool/src/classes/RollupScheduledCalculateControllerTest.cls @@ -0,0 +1,126 @@ +/** + * Copyright (c) 2013, Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@IsTest +private class RollupScheduledCalculateControllerTest { + + @IsTest + private static void testCronHelperDefault() { + + // Between Task and Account + LookupRollupSummary__c rollupSummaryAccount = new LookupRollupSummary__c(); + rollupSummaryAccount.Name = 'Test Rollup'; + rollupSummaryAccount.ParentObject__c = 'Account'; + rollupSummaryAccount.ChildObject__c = 'Task'; + rollupSummaryAccount.RelationShipField__c = 'WhatId'; + rollupSummaryAccount.FieldToAggregate__c = 'Id'; + rollupSummaryAccount.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryAccount.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryAccount.Active__c = true; + rollupSummaryAccount.CalculationMode__c = 'Scheduled'; + insert rollupSummaryAccount; + + // Test default behaviour + Test.startTest(); + ApexPages.StandardController standardController = + new ApexPages.StandardController(rollupSummaryAccount); + RollupScheduledCalculateController controller = + new RollupScheduledCalculateController(standardController); + controller.scheduleCalculateJob(); + Test.stopTest(); + + // Assert correct Cron job has been inserted + CronTrigger cronTrigger = [select Id, CronJobDetail.Name, CronExpression from CronTrigger Limit 1][0]; + System.assertEquals('0 0 2 * * ?', cronTrigger.CronExpression); + System.assertEquals('rollup_'+standardController.getId(), cronTrigger.CronJobDetail.Name); + } + + @IsTest + private static void testCronHelperError() { + + // Between Task and Account + LookupRollupSummary__c rollupSummaryAccount = new LookupRollupSummary__c(); + rollupSummaryAccount.Name = 'Test Rollup'; + rollupSummaryAccount.ParentObject__c = 'Account'; + rollupSummaryAccount.ChildObject__c = 'Task'; + rollupSummaryAccount.RelationShipField__c = 'WhatId'; + rollupSummaryAccount.FieldToAggregate__c = 'Id'; + rollupSummaryAccount.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryAccount.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryAccount.Active__c = true; + rollupSummaryAccount.CalculationMode__c = 'Scheduled'; + insert rollupSummaryAccount; + + // Test default behaviour + Test.startTest(); + ApexPages.StandardController standardController = + new ApexPages.StandardController(rollupSummaryAccount); + RollupScheduledCalculateController controller = + new RollupScheduledCalculateController(standardController); + controller.day = new List { '?' }; + controller.scheduleCalculateJob(); + Test.stopTest(); + + // Assert nothing has been scheduled and we got an error + System.assertEquals(0, [select Id, CronJobDetail.Name, CronExpression from CronTrigger].size()); + System.assert(ApexPages.hasMessages(ApexPages.Severity.Error)); + System.assertEquals('\'?\' can only be specified for Day-of-Month -OR- Day-of-Week.', ApexPages.getMessages()[3].getDetail()); + } + + + @IsTest + private static void testCronHelperCustomised() { + + // Between Task and Account + LookupRollupSummary__c rollupSummaryAccount = new LookupRollupSummary__c(); + rollupSummaryAccount.Name = 'Test Rollup'; + rollupSummaryAccount.ParentObject__c = 'Account'; + rollupSummaryAccount.ChildObject__c = 'Task'; + rollupSummaryAccount.RelationShipField__c = 'WhatId'; + rollupSummaryAccount.FieldToAggregate__c = 'Id'; + rollupSummaryAccount.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryAccount.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryAccount.Active__c = true; + rollupSummaryAccount.CalculationMode__c = 'Scheduled'; + insert rollupSummaryAccount; + + // Test default behaviour + Test.startTest(); + ApexPages.StandardController standardController = + new ApexPages.StandardController(rollupSummaryAccount); + RollupScheduledCalculateController controller = + new RollupScheduledCalculateController(standardController); + controller.hour = new List { '4' }; + controller.day = new List { '2' }; + controller.scheduleCalculateJob(); + Test.stopTest(); + + // Assert correct Cron job has been inserted + CronTrigger cronTrigger = [select Id, CronJobDetail.Name, CronExpression from CronTrigger Limit 1][0]; + System.assertEquals('0 0 4 2 * ?', cronTrigger.CronExpression); + System.assertEquals('rollup_'+standardController.getId(), cronTrigger.CronJobDetail.Name); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupScheduledCalculateControllerTest.cls-meta.xml b/rolluptool/src/classes/RollupScheduledCalculateControllerTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/RollupScheduledCalculateControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/RollupService.cls b/rolluptool/src/classes/RollupService.cls index 128f4218..5294413c 100644 --- a/rolluptool/src/classes/RollupService.cls +++ b/rolluptool/src/classes/RollupService.cls @@ -25,14 +25,16 @@ **/ /** - * Service class implements rollup functionality using LREngine library and based on lookups described in LookupRollupSummary__c + * Service class implements rollup functionality using LREngine library and based on lookups described in RollupSummary * * TODO: This class could do with using the fflib_Describe util class, it would cut down on describe cahcing logic and make things cleaner * * TODO: As this class has developed to support schedule and develoepr API entry points some further refactoring for reuse can be done **/ -global with sharing class RollupService +global with sharing class RollupService { + global static Exception LastMetadataAPIConnectionException {get; private set;} + global static Boolean checkMetadataAPIConnection() { try { @@ -45,8 +47,10 @@ global with sharing class RollupService queries.add(remoteSites); service.listMetadata(queries, 28); } catch (Exception e) { + LastMetadataAPIConnectionException = e; return false; } + LastMetadataAPIConnectionException = null; return true; } @@ -54,28 +58,63 @@ global with sharing class RollupService * Starts the Job to recalculate the given rollup **/ global static Id runJobToCalculate(Id lookupId) + { + return runJobToCalculate((String)lookupId, null); + } + + /** + * Starts the Job to recalculate the given rollup filtering the master object records by the WHERE clause + **/ + global static Id runJobToCalculate(Id lookupId, String masterWhereClause) + { + return runJobToCalculate((String) lookupId, masterWhereClause); + } + + /** + * Starts the Job to recalculate the given rollup + **/ + global static Id runJobToCalculate(String lookupId) + { + return runJobToCalculate(lookupId, null); + } + + /** + * Starts the Job to recalculate the given rollup filtering the master object records by the WHERE clause + **/ + global static Id runJobToCalculate(String lookupId, String masterWhereClause) { // Is another calculate job running for this lookup? - List lookups = new RollupSummariesSelector().selectById(new Set { lookupId }); + List lookups = new RollupSummariesSelector().selectById(new Set { (String) lookupId }); if(lookups.size()==0) throw RollupServiceException.rollupNotFound(lookupId); - LookupRollupSummary__c lookup = lookups[0]; - if(lookup.CalculateJobId__c!=null) + RollupSummary lookup = lookups[0]; + + // Already running? + try { + // This object has a unique constraint over LookupRollupSummaryId__c + insert new LookupRollupCalculateJob__c(LookupRollupSummaryId__c = lookupId); + } catch (Exception e) { throw RollupServiceException.jobAlreadyRunning(lookup.Name); - + } + // Already active? - if(lookup.Active__c==null || lookup.Active__c==false) + if((lookup.Active==null || lookup.Active==false) && lookup.CalculationMode=='Realtime' ) throw new RollupServiceException('The rollup must be Active before you can run a Calculate job.'); // Start the job and record the Job Id Integer scopeSize = (Integer) DeclarativeLookupRollupSummaries__c.getInstance().CalculateJobScopeSize__c; - Id jobId = Database.executeBatch(new RollupCalculateJob(lookupId), scopeSize == null ? 100 : scopeSize); - lookup.CalculateJobId__c = jobId; - update lookup; - + Id jobId = Database.executeBatch(new RollupCalculateJob(lookupId, masterWhereClause), scopeSize == null ? 100 : scopeSize); + + // Update CalculateJobId__c for Custom Object based rollups? + if(lookup.Record instanceof LookupRollupSummary__c) { + LookupRollupSummary__c rollupSummary = (LookupRollupSummary__c) lookup.Record; + rollupSummary.CalculateJobId__c = jobId; + update lookup.Record; + } + return jobId; } - + /** * Starts the Job to process the scheduled items for rollup **/ @@ -90,6 +129,87 @@ global with sharing class RollupService return Database.executeBatch(new RollupJob(), scopeSize == null ? 100 : scopeSize); } + /** + * Describes a specific rollup to process + **/ + global class RollupToCalculate { + global Id parentId; + global String rollupSummaryUniqueName; + } + + /** + * Executes Process Builder rollups + **/ + global static void rollup(List rollupsToCalculate) { + + // Anything to process? + if(rollupsToCalculate==null || rollupsToCalculate.size()==0) + return; + + // Load summaries + Set uniqueNames = new Set(); + Set masterIds = new Set(); + for(RollupToCalculate rollupToCalc : rollupsToCalculate) { + uniqueNames.add(rollupToCalc.rollupSummaryUniqueName); + masterIds.add(rollupToCalc.parentId); + } + List lookups = + new RollupSummariesSelector().selectActiveByUniqueName(uniqueNames); + if(lookups.size()==0) + return; + + // Process each context (parent child relationship) and its associated rollups + Map masterRecords = new Map(); + for(LREngine.Context ctx : createLREngineContexts(lookups)) + { + // Produce a set of master Id's applicable to this context (parent only) + Set ctxMasterIds = new Set(); + for(Id masterId : masterIds) + if(masterId.getSObjectType() == ctx.master) + ctxMasterIds.add(masterId); + // Execute the rollup and process the resulting updated master records + for(SObject masterRecord : LREngine.rollup(ctx, ctxMasterIds)) + { + // Skip master records without Id's (LREngine can return these where there was + // no related master records to children, for examlpe where a relationship is optional) + if(masterRecord.Id==null) + break; + // Merge this master record result into a previous one from another rollup ctx? + SObject existingRecord = masterRecords.get(masterRecord.Id); + if(existingRecord==null) + masterRecords.put(masterRecord.Id, masterRecord); + else + for(LREngine.RollupSummaryField fieldToRoll : ctx.fieldsToRoll) + existingRecord.put(fieldToRoll.master.getSObjectField(), + masterRecord.get(fieldToRoll.master.getSObjectField())); + } + } + + // Update the master records + update masterRecords.values(); + } + + /** + * Developer API for the tool, only executes Rollup Summmaries with Calculation Mode set to Developer + * + * Automatically resolves child records to process via LREngine and lookups described in RollupSummary + * also determines if based on the old records if the rollup processing needs to occur + * + * @param existingRecords Deleted or existing version of Updated records + * @param newRecords Inserted/Updated/Undeleted records + * @param sObjectType SObjectType of the existing/new records + * + * @usage rollup(Trigger.oldMap, Trigger.newMap, Account.SObjectType) + * + * @remark All SObjects (existing and new) must be of the same SObjectType + * @remark Supports mixture of old/new records. For example, you can include a record in existing + * that was deleted and a record in new that was inserted. + **/ + global static void rollup(Map existingRecords, Map newRecords, Schema.SObjectType sObjectType) + { + handleRollups(existingRecords, newRecords, sObjectType, new List { RollupSummaries.CalculationMode.Developer }); + } + /** * Developer API for the tool, only executes Rollup Summmaries with Calculation Mode set to Developer * @@ -105,7 +225,7 @@ global with sharing class RollupService // Describe Developer rollups for these child records SObjectType childObjectType = childRecords[0].Id.getSObjectType(); Schema.DescribeSObjectResult childRecordDescribe = childObjectType.getDescribe(); - List lookups = + List lookups = new RollupSummariesSelector().selectActiveByChildObject( new List { RollupSummaries.CalculationMode.Developer }, new Set { childRecordDescribe.getName() }); @@ -115,13 +235,13 @@ global with sharing class RollupService // Rollup child records and update master records Set masterRecordIds = new Set(); for(SObject childRecord : childRecords) - for(LookupRollupSummary__c lookup : lookups) - if(childRecord.get(lookup.RelationShipField__c)!=null) - masterRecordIds.add((Id)childRecord.get(lookup.RelationShipField__c)); + for(RollupSummary lookup : lookups) + if(childRecord.get(lookup.RelationShipField)!=null) + masterRecordIds.add((Id)childRecord.get(lookup.RelationShipField)); // Process each context (parent child relationship) and its associated rollups Map masterRecords = new Map(); - for(LREngine.Context ctx : createLREngineContexts(lookups).values()) + for(LREngine.Context ctx : createLREngineContexts(lookups)) { // Produce a set of master Id's applicable to this context (parent only) Set ctxMasterIds = new Set(); @@ -147,13 +267,36 @@ global with sharing class RollupService } return masterRecords.values(); } + + /** + * Apex Test handler (call from Apex Test only) + **/ + global static void testHandler(SObject dummyChildRecord) + { + try { + insert dummyChildRecord; + } catch (Exception e) { + // If the auto generated trigger was invoked this test served its purpose (code coverage wise) ignore this error + if(triggerHandleInvoked) + return; + // Otherwise fail the test with the underlying exception as it prevented our trigger being invoked + throw e; + } + } /** - * Apex Trigger helper, automatically resolves child records to process via LREngine and lookups described in LookupRollupSummary__c + * Used in a test context to determine if errors from the dummy child insert should fail the test + **/ + private static boolean triggerHandleInvoked = false; + + /** + * Apex Trigger helper, automatically resolves child records to process via LREngine and lookups described in RollupSummary * also determines if based on the old trigger records if the rollup processing needs to occur **/ global static void triggerHandler() { + triggerHandleInvoked = true; + // Currently no processing in the before phase if(Trigger.isBefore) return; @@ -161,107 +304,36 @@ global with sharing class RollupService // Anything to rollup? List childRecords = Trigger.isDelete ? Trigger.old : Trigger.new; SObjectType childObjectType = childRecords[0].Id.getSObjectType(); - List lookups = describeRollups(childRecords[0].Id.getSObjectType()); - if(lookups.size()==0) - return; // Nothing to see here! :) - - // Has anything changed on the child records in respect to the fields referenced on the lookup definition? - if(Trigger.isUpdate) - { - // Master records to update - Set masterRecordIds = new Set(); - - // Set of field names from the child used in the rollup to search for changes on - Set fieldsToSearchForChanges = new Set(); - Set relationshipFields = new Set(); - for(LookupRollupSummary__c lookup : lookups) - { - fieldsToSearchForChanges.add(lookup.FieldToAggregate__c); - fieldsToSearchForChanges.add(lookup.RelationShipField__c); - if(lookup.RelationshipCriteriaFields__c!=null) - for(String criteriaField : lookup.RelationshipCriteriaFields__c.split('\r\n')) - fieldsToSearchForChanges.add(criteriaField); - relationshipFields.add(lookup.RelationShipField__c); - } - - // Determine if a a field referenced on the lookup has changed and thus if the lookup itself needs recalculating - Set fieldsChanged = new Set(); - for(SObject childRecord : childRecords) - { - // Determine if any of the fields referenced on our selected rollups have changed on this record - for(String fieldToSearch : fieldsToSearchForChanges) - { - SObject oldChildRecord = Trigger.oldMap.get(childRecord.Id); - Object newValue = childRecord.get(fieldToSearch); - Object oldValue = oldChildRecord.get(fieldToSearch); - // Register this field as having changed? - if(newValue != oldValue) - fieldsChanged.add(fieldToSearch); - // Add both old and new value to master record Id list for relationship fields to ensure old and new parent master records are updated (re-parenting) - if(relationshipFields.contains(fieldToSearch)) - { - if(newValue!=null) - masterRecordIds.add((Id) newValue); - if(oldValue!=null) - masterRecordIds.add((Id) oldValue); - } - } - } - - // Build a revised list of lookups to process that includes only where fields used in the rollup have changed - List lookupsToProcess = new List(); - for(LookupRollupSummary__c lookup : lookups) - { - // Are any of the changed fields used by this lookup? - Boolean processLookup = false; - if(fieldsChanged.contains(lookup.FieldToAggregate__c) || - fieldsChanged.contains(lookup.RelationShipField__c)) - processLookup = true; - if(lookup.RelationshipCriteriaFields__c!=null) - for(String criteriaField : lookup.RelationshipCriteriaFields__c.split('\r\n')) - if(fieldsChanged.contains(criteriaField)) - processLookup = true; - if(processLookup) - lookupsToProcess.add(lookup); - } - lookups = lookupsToProcess; - - // Rollup child records and update master records - if(lookupsToProcess.size()>0) - updateRecords(updateMasterRollupsTrigger(lookups, masterRecordIds), false, true); - return; - } - - // Rollup child records and update master records - Set masterRecordIds = new Set(); - for(SObject childRecord : childRecords) - for(LookupRollupSummary__c lookup : lookups) - if(childRecord.get(lookup.RelationShipField__c)!=null) - masterRecordIds.add((Id)childRecord.get(lookup.RelationShipField__c)); - updateRecords(updateMasterRollupsTrigger(lookups, masterRecordIds), false, true); + handleRollups(Trigger.oldMap, Trigger.newMap, childObjectType, new List { RollupSummaries.CalculationMode.Realtime, RollupSummaries.CalculationMode.Scheduled }); } - + /** * Method returns a QueryLocator that returns master records (as per the lookup definition) meeting the criteria expressed (if defined) **/ public static Database.QueryLocator masterRecordsAsQueryLocator(Id lookupId) - { - List lookups = new RollupSummariesSelector().selectById(new Set { lookupId }); + { + return masterRecordsAsQueryLocator(lookupId, null); + } + + public static Database.QueryLocator masterRecordsAsQueryLocator(Id lookupId, String whereClause) + { + List lookups = new RollupSummariesSelector().selectById(new Set { (String) lookupId }); if(lookups.size()==0) - throw RollupServiceException.rollupNotFound(lookupId); - LookupRollupSummary__c lookup = lookups[0]; - return Database.getQueryLocator('Select Id From ' + lookup.ParentObject__c); + throw RollupServiceException.rollupNotFound(lookupId); + RollupSummary lookup = lookups[0]; + if (String.isBlank(whereClause)) { + return Database.getQueryLocator('Select Id From ' + lookup.ParentObject); + } else { + return Database.getQueryLocator(String.format('Select Id From {0} WHERE {1}', new List{lookup.ParentObject, whereClause})); + } } /** * Clears the Calcualte Job Id's on the given lookups preventng concurrent Calculate jobs **/ - public static void clearCalculateJobId(Set lookupIds) + public static void clearCalculateJobId(Set lookupIds) { - List lookups = new RollupSummariesSelector().selectById(lookupIds); - for(LookupRollupSummary__c lookup : lookups) - lookup.CalculateJobId__c = null; - update lookups; + delete [select Id from LookupRollupCalculateJob__c where LookupRollupSummaryId__c in :lookupIds]; } /** @@ -270,47 +342,58 @@ global with sharing class RollupService public static void processScheduleItems(List rollupSummaryScheduleItems) { // Load related Lookup summaries for the scheduled items - Set lookupIds = new Set(); - for(LookupRollupSummaryScheduleItems__c scheduleItem : rollupSummaryScheduleItems) - lookupIds.add(scheduleItem.LookupRollupSummary__c); - Map lookups = - new Map(new RollupSummariesSelector().selectById(lookupIds)); + Set lookupIds = new Set(); + for(LookupRollupSummaryScheduleItems__c scheduleItem : rollupSummaryScheduleItems) { + if(scheduleItem.LookupRollupSummary2__c!=null) + lookupIds.add(scheduleItem.LookupRollupSummary2__c); + else + lookupIds.add(scheduleItem.LookupRollupSummary__c); + } + Map lookups = + RollupSummary.toMap(new RollupSummariesSelector().selectById(lookupIds)); // Group the parent Id's by parent type + Map gd = Schema.getGlobalDescribe(); Map> parentIdsByParentType = new Map>(); for(LookupRollupSummaryScheduleItems__c scheduleItem : rollupSummaryScheduleItems) { Id parentId = scheduleItem.ParentId__c; - LookupRollupSummary__c lookup = lookups.get(scheduleItem.LookupRollupSummary__c); - Set parentIds = parentIdsByParentType.get(lookup.ParentObject__c); + RollupSummary lookup = lookups.get(scheduleItem.LookupRollupSummary2__c!=null ? scheduleItem.LookupRollupSummary2__c : scheduleItem.LookupRollupSummary__c); + // The lookup definition could have been changed or due to a historic bug in correctly associated + if(parentId.getSobjectType() != gd.get(lookup.ParentObject)) + continue; + Set parentIds = parentIdsByParentType.get(lookup.ParentObject); if(parentIds==null) - parentIdsByParentType.put(lookup.ParentObject__c, (parentIds = new Set())); + parentIdsByParentType.put(lookup.ParentObject, (parentIds = new Set())); parentIds.add(parentId); } // Group lookups by parent and relationship into LREngine ctx's - Map engineCtxByParentRelationship = createLREngineContexts(lookups.values()); + List engineCtxByParentRelationship = createLREngineContexts(lookups.values()); // Process each context (parent child relationship) and its associated rollups Map masterRecords = new Map(); - for(LREngine.Context ctx : engineCtxByParentRelationship.values()) + for(LREngine.Context ctx : engineCtxByParentRelationship) { Set masterIds = parentIdsByParentType.get(ctx.master.getDescribe().getName()); - for(SObject masterRecord : LREngine.rollup(ctx, masterIds)) - { - // Skip master records without Id's (LREngine can return these where there was - // no related master records to children, for examlpe where a relationship is optional) - if(masterRecord.Id==null) - break; - // Merge this master record result into a previous one from another rollup ctx? - SObject existingRecord = masterRecords.get(masterRecord.Id); - if(existingRecord==null) - masterRecords.put(masterRecord.Id, masterRecord); - else - for(LREngine.RollupSummaryField fieldToRoll : ctx.fieldsToRoll) - existingRecord.put(fieldToRoll.master.getSObjectField(), - masterRecord.get(fieldToRoll.master.getSObjectField())); - } + // This maybe null if the reconcilation check above to match master ID to lookup parent failed + if(masterIds!=null && masterIds.size()>0) { + for(SObject masterRecord : LREngine.rollup(ctx, masterIds)) + { + // Skip master records without Id's (LREngine can return these where there was + // no related master records to children, for examlpe where a relationship is optional) + if(masterRecord.Id==null) + continue; + // Merge this master record result into a previous one from another rollup ctx? + SObject existingRecord = masterRecords.get(masterRecord.Id); + if(existingRecord==null) + masterRecords.put(masterRecord.Id, masterRecord); + else + for(LREngine.RollupSummaryField fieldToRoll : ctx.fieldsToRoll) + existingRecord.put(fieldToRoll.master.getSObjectField(), + masterRecord.get(fieldToRoll.master.getSObjectField())); + } + } } // Map rollup summary schedule items by parent id, in order to remove only those whos parent/master record actually gets updated below @@ -339,17 +422,27 @@ global with sharing class RollupService // Errors? if(!saveResult.isSuccess()) { + // Was this failure due to the parent record no longer existing? + Boolean masterRecordDeletionError = false; // Log the failure updating the master record for review LookupRollupSummaryLog__c logEntry = new LookupRollupSummaryLog__c(); logEntry.ErrorMessage__c = ''; logEntry.ParentId__c = masterRecordList[masterRecordIdx].Id; logEntry.ParentObject__c = masterRecordList[masterRecordIdx].Id.getSObjectType().getDescribe().getName(); List databaseErrors = saveResult.getErrors(); - for(Database.Error databaseError : databaseErrors) + for(Database.Error databaseError : databaseErrors) { logEntry.ErrorMessage__c+= databaseError.getMessage() + ' : ' + databaseError.getStatusCode() + ' ' + databaseError.getFields() + '\n'; - rollupSummaryLogs.add(logEntry); - // Remove from scheduled items to be deleted to allow a retry - rollupSummaryScheduleItemsByParentId.remove(masterRecordList[masterRecordIdx].Id); + if(databaseError.getStatusCode() == StatusCode.ENTITY_IS_DELETED) { + masterRecordDeletionError = true; + break; + } + } + // Was this error a result of the parent record being deleted? + if(!masterRecordDeletionError) { + rollupSummaryLogs.add(logEntry); + // Remove from scheduled items to be deleted to allow a retry + rollupSummaryScheduleItemsByParentId.remove(masterRecordList[masterRecordIdx].Id); + } } masterRecordIdx++; } @@ -373,12 +466,12 @@ global with sharing class RollupService * @param lookups Lookup to calculate perform * @param childRecords Child records being modified **/ - public static void updateMasterRollups(Set lookupIds, Set masterRecordIds) + public static void updateMasterRollups(Set lookupIds, Set masterRecordIds) { // Process rollup - List lookups = new RollupSummariesSelector().selectById(lookupIds); + List lookups = new RollupSummariesSelector().selectById(lookupIds); Map masterRecords = new Map(); - for(LREngine.Context ctx : createLREngineContexts(lookups).values()) + for(LREngine.Context ctx : createLREngineContexts(lookups)) { // Produce a set of master Id's applicable to this context (parent only) Set ctxMasterIds = new Set(); @@ -440,49 +533,421 @@ global with sharing class RollupService // Delete any old logs entries for master records that have now been updated successfully delete [select Id from LookupRollupSummaryLog__c where ParentId__c in :masterRecordsUpdatedId]; } + + /** + * Insert the given rollup summaries (only supports Custom Metadata backed records) + **/ + public static List create(List rollupSummaryRecords) { + // Valid records? + List validRecords = validateRollups(rollupSummaryRecords); + // Create + CustomMetadataService.createMetadata(validRecords); + return null; + } + + /** + * Update the given rollup summaries (only supports Custom Metadata backed records) + **/ + public static List update_x(List rollupSummaryRecords) { + // Valid records? + List validRecords = validateRollups(rollupSummaryRecords); + // Create + CustomMetadataService.updateMetadata(validRecords); + return null; + } + + /** + * Delete the given rollup summaries (only supports Custom Metadata backed records) + **/ + public static void delete_x(List rollupSummaryIds) { + // Currently assumes the Id's are Custom Metadata record DeveloperName's + CustomMetadataService.deleteMetadata(LookupRollupSummary2__mdt.getSObjectType(), rollupSummaryIds); + } + + /** + * Validates records (currenyly only Custom Metadata based ones) + **/ + private static List validateRollups(List rollupSummaryRecords) { + + // Process only Custom Metadata records here + List mdtRecords = new List(); + for(SObject rollupSummaryRecord : rollupSummaryRecords) { + if(rollupSummaryRecord instanceof LookupRollupSummary2__mdt) { + mdtRecords.add((LookupRollupSummary2__mdt) rollupSummaryRecord); + } + } + if(mdtRecords.size()==0) + return mdtRecords; + + // Validate via Domain class and throw appropirte exception + RollupSummaries rollupSummaries = new RollupSummaries(mdtRecords); + rollupSummaries.onValidate(); + RollupValidationException validationException = new RollupValidationException(); + for(RollupSummary rollupSummaryRecord : rollupSummaries.Records) { + if(rollupSummaryRecord.Error!=null || + rollupSummaryRecord.Fields.Errors.size() >0) { + RollupRecordValidationError recordError = new RollupRecordValidationError(); + recordError.Error = rollupSummaryRecord.Error; + recordError.FieldErrors = rollupSummaryRecord.Fields.Errors; + validationException.RecordErrors.add(recordError); + } + } + if(validationException.RecordErrors.size()>0) + throw validationException; + + return (List) mdtRecords; + } + + /** + * Represents a rollup validation exception, contains a list of record errors + **/ + public class RollupValidationException extends Exception { + public final List RecordErrors = new List(); + } + + /** + * Represents record level error and/or field level errors + **/ + public class RollupRecordValidationError { + public Id Id {get; private set;} + public String Error {get; private set;} + public List FieldErrors {get; private set;} + } + + /** + * Process rollups for specified modes + * + * @param childRecords List of childRecords to process rollups against + * @param existingRecords Map of existing records. Pass null if no existing records are available. + * @param calculationModes Modes to use to determine which rollups to evaluate and process + * + * @remark Will process both lists looking for insert/update/delete/undelete and execute rollups on the following conditions: + * 1) if in newRecords and not in existingRecords (insert and undelete) + * 2) if in existingRecords and not in newRecords (delete) + * 3) if in existingRecords and newRecords and rollup FieldToAggregate__c has changed (update) + * + **/ + private static void handleRollups(Map existingRecords, Map newRecords, Schema.SObjectType sObjectType, List calculationModes) + { + // make sure we have Maps to avoid conditional statements in loops below + if (existingRecords == null) { + existingRecords = new Map(); + } + if (newRecords == null) { + newRecords = new Map(); + } + + // Anything to process? + if (existingRecords.isEmpty() && newRecords.isEmpty()) { + return; + } + + // Its possible for the user to deploy a trigger on parent objects, to monitor for merge operations... + DescribeSObjectResult sObjectDescribe = sObjectType.getDescribe(); + Set masterRecordIdsFromMerge = new Set(); + if(sObjectDescribe.isMergeable()) { + for(SObject existingRecord : existingRecords.values()) { + Id masterRecordId = (Id) existingRecord.get('MasterRecordId'); + if(masterRecordId!=null) { + masterRecordIdsFromMerge.add(masterRecordId); + } + } + } + + // If this is a parent record merge operation, determine child object rollups to recalculate... + Boolean scheduleAllRollups = false; + Set childObjects = new Set(); + childObjects.add(sObjectType); + if(masterRecordIdsFromMerge.size()>0) { + // If a parent record is being merged, include a recalc of any related child rollups + List childRelationships = sObjectDescribe.getChildRelationships(); + for(Schema.ChildRelationship childRelationship : childRelationships) { + childObjects.add(childRelationship.getChildSObject()); + } + // Any rollups associated with these child objects will need to done in async, + // as parent records cannot be updated realtime since the platform is also updating them + scheduleAllRollups = true; + } + + // Are there any rollups to process? + List lookups = describeRollups(childObjects, calculationModes); + if(lookups.isEmpty()) + return; // Nothing to see here! :) + + // if records exist in both maps, then we need to go through change detection. + // Has anything changed on the child records in respect to the fields referenced on the lookup definition? + // Or does a record exist in one map but not the other + if(!existingRecords.isEmpty() && !newRecords.isEmpty()) + { + // Master records to update + Set masterRecordIds = new Set(); + + // Set of field names from the child used in the rollup to search for changes on + Set fieldsToSearchForChanges = new Set(); + Set relationshipFields = new Set(); + // keep track of fields that should trigger a rollup to be processed + // this avoids having to re-parse RelationshipCriteria & OrderBy fields during field change detection + Map> fieldsInvolvedInLookup = new Map>(); + for(RollupSummary lookup : lookups) + { + Set lookupFields = new Set(); + lookupFields.add(lookup.FieldToAggregate); + if(!String.isBlank(lookup.RelationshipCriteriaFields)) { + for(String criteriaField : lookup.RelationshipCriteriaFields.split('[\r\n]+')) { + lookupFields.add(criteriaField); + } + } + // only include order by fields when query based rollup (concat, first, last, etc.) since changes to them + // will not impact the outcome of an aggregate based rollup (sum, count, etc.) + if(LREngine.isQueryBasedRollup(RollupSummaries.OPERATION_PICKLIST_TO_ENUMS.get(lookup.AggregateOperation)) && !String.isBlank(lookup.FieldToOrderBy)) { + List orderByFields = Utilities.parseOrderByClause(lookup.FieldToOrderBy); + if (orderByFields != null && !orderByFields.isEmpty()) { + for (Utilities.Ordering orderByField :orderByFields) { + lookupFields.add(orderByField.getField()); + } + } + } + + // add all lookup fields to our master list of fields to search for + fieldsToSearchForChanges.addAll(lookupFields); + + // add relationshipfield to fields for this lookup + // this comes after adding to fieldsToSearchForChanges because we handle + // change detection separately for non-relationship fields and relationship fields + lookupFields.add(lookup.RelationShipField); + + // add to map for later use + fieldsInvolvedInLookup.put(lookup.Id, lookupFields); + + // add relationship field to master list of relationship fields + relationshipFields.add(lookup.RelationShipField); + } + + // merge all record Id's + Set mergedRecordIds = new Set(existingRecords.keySet()); + mergedRecordIds.addAll(newRecords.keySet()); + + // Determine if a a field referenced on the lookup has changed and thus if the lookup itself needs recalculating + Set fieldsChanged = new Set(); + for(Id recordId : mergedRecordIds) + { + // keep track of whether or not this child has changed in any of the fields involved in + // lookups that are NOT relationship fields themselves. We'll check relationship fields + // separately to avoid unnecessary rollups firing on master records that don't require updating + Boolean nonRelationshipFieldsChanged = false; + + // Determine if any of the fields referenced on our selected rollups have changed on this record + for(String fieldToSearch : fieldsToSearchForChanges) + { + // retrieve old and new records and values if they exist + SObject oldRecord = existingRecords.get(recordId); + Object oldValue = oldRecord == null ? null : oldRecord.get(fieldToSearch); + SObject newRecord = newRecords.get(recordId); + Object newValue = newRecord == null ? null : newRecord.get(fieldToSearch); + + // Register this field as having changed? + // if in old but not in new then its a delete and rollup should be processed + // if in new but not in old then its an insert and rollup should be processed + // if in both then its an update and field change detection should occur and rollup should be processed if different + if((oldRecord == null) || (newRecord == null) || (newValue != oldValue)) { + fieldsChanged.add(fieldToSearch); + // mark record as having a non-relationship field changed + nonRelationshipFieldsChanged = true; + } + } + + // iterate relationship fields looking and track old/new master id + // if there were changes to the relationship field itself or any + // other fields involved in a lookup + for(String relationshipField : relationshipFields) + { + // should we add associated master to list? + // default to whether or not a non-relationship field on record has changed + Boolean addMasterIds = nonRelationshipFieldsChanged; + + // retrieve old and new records and values if they exist + SObject oldRecord = existingRecords.get(recordId); + Object oldValue = oldRecord == null ? null : oldRecord.get(relationshipField); + SObject newRecord = newRecords.get(recordId); + Object newValue = newRecord == null ? null : newRecord.get(relationshipField); + + // Register this field as having changed? + // if in old but not in new then its a delete and rollup should be processed and master ids included + // if in new but not in old then its an insert and rollup should be processed and master ids included + // if in both then its an update and field change detection should occur and rollup should be processed and master ids included if different + if((oldRecord == null) || (newRecord == null) || (newValue != oldValue)) { + fieldsChanged.add(relationshipField); + // master field itself changed so we force old/new master ids to be added for processing + addMasterIds = true; + } + + // if relationship field itself changed or if change in another non-relationship field + // Add both old and new value to master record Id list for relationship fields + // to ensure old and new parent master records are updated (re-parenting) + if (addMasterIds) + { + if(newValue!=null) + masterRecordIds.add((Id) newValue); + if(oldValue!=null) + masterRecordIds.add((Id) oldValue); + } + } + } + + // Build a revised list of lookups to process that includes only where fields used in the rollup have changed + List lookupsToProcess = new List(); + for(RollupSummary lookup : lookups) + { + // Are any of the changed fields used by this lookup? + Set lookupFields = fieldsInvolvedInLookup.get(lookup.Id); + for (String lookupField :lookupFields) { + if (fieldsChanged.contains(lookupField)) { + // add lookup to be processed and exit for loop since we have our answer + lookupsToProcess.add(lookup); + break; + } + } + } + lookups = lookupsToProcess; + + // Rollup child records and update master records + if(lookupsToProcess.size()>0) + updateRecords(updateMasterRollupsTrigger(lookups, masterRecordIds, false), false, true); + return; + } + + // Rollup whichever side has records and update master records + // only one map should have records at this point + Boolean isDeleting = newRecords.isEmpty(); + Set masterRecordIds = new Set(masterRecordIdsFromMerge); + Map recordsToProcess = existingRecords.isEmpty() ? newRecords : existingRecords; + for(SObject childRecord : recordsToProcess.values()) { + for(RollupSummary lookup : lookups) { + // Does this rollup apply to this child record? + if(lookup.ChildObject.equalsIgnoreCase(sObjectDescribe.getName())) { + if(childRecord.get(lookup.RelationShipField)!=null) { + // Check for self referencing rollups, https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/39 + Id masterRecordId = (Id)childRecord.get(lookup.RelationShipField); + if(isDeleting && masterRecordId == childRecord.Id) { + continue; + } + masterRecordIds.add(masterRecordId); + } + } + } + } + + // Process the rollups and update the master records + updateRecords( + updateMasterRollupsTrigger(lookups, masterRecordIds, scheduleAllRollups), false, true); + } /** - * Method wraps the LREngine.rolup method, provides context via the lookups described in LookupRollupSummary__c + * Method wraps the LREngine.rolup method, provides context via the lookups described in RollupSummary * * @param lookups Lookup to calculate perform * @param childRecords Child records being modified * @returns Array of master records containing the updated rollups, calling code must perform update DML operation **/ - private static List updateMasterRollupsTrigger(List lookups, Set masterRecordIds) + private static List updateMasterRollupsTrigger(List lookups, Set masterRecordIds, Boolean scheduleAllRollups) { // Process lookups, - // Realtime are added to a list for later LRE context creation and processing, + // Realtime & Developer are added to a list for later LRE context creation and processing, // Scheduled result in parent Id's being emitted to scheduled item object for later processing - List realtimeLookups = new List(); + Map gd = Schema.getGlobalDescribe(); + List runnowLookups = new List(); List scheduledItems = new List(); - for(LookupRollupSummary__c lookup : lookups) + List scheduledItemsForMDTs = new List(); + for(RollupSummary lookup : lookups) { - if(lookup.CalculationMode__c == RollupSummaries.CalculationMode.Realtime.name()) - { - // Filter realtime looks in order to generate LRE contexts below - realtimeLookups.add(lookup); - } - else if(lookup.CalculationMode__c == RollupSummaries.CalculationMode.Scheduled.name()) + if(lookup.CalculationMode == RollupSummaries.CalculationMode.Scheduled.name() || scheduleAllRollups) { + // For polymoprhic relationships the master Id list maybe mixed types, associated with the correct rollup + SObjectType parentType = gd.get(lookup.ParentObject); + if(parentType==null) + continue; // For scheduled rollups queue the parent Id record for processing for (Id parentId : masterRecordIds) { - LookupRollupSummaryScheduleItems__c scheduledItem = new LookupRollupSummaryScheduleItems__c(); - scheduledItem.Name = parentId; - scheduledItem.LookupRollupSummary__c = lookup.Id; - scheduledItem.ParentId__c = parentId; - scheduledItem.QualifiedParentID__c = parentId + '#' + lookup.Id; - scheduledItems.add(scheduledItem); + if(parentId.getSobjectType() == parentType) { + LookupRollupSummaryScheduleItems__c scheduledItem = new LookupRollupSummaryScheduleItems__c(); + scheduledItem.Name = parentId; + scheduledItem.LookupRollupSummary__c = lookup.Record instanceof LookupRollupSummary2__mdt ? null : lookup.Id; + scheduledItem.LookupRollupSummary2__c = lookup.Id; + scheduledItem.ParentId__c = parentId; + scheduledItem.QualifiedParentID__c = parentId + '#' + lookup.Id; + scheduledItems.add(scheduledItem); + if(lookup.Record instanceof LookupRollupSummary2__mdt) { + scheduledItemsForMDTs.add(scheduledItem); + } + } } } + else if(lookup.CalculationMode == RollupSummaries.CalculationMode.Realtime.name() || + lookup.CalculationMode == RollupSummaries.CalculationMode.Developer.name()) + { + // Filter realtime & Developer lookups in order to generate LRE contexts below + runnowLookups.add(lookup); + } } + // Any parent scheduled calculations that relate to Custom Metadata based rollups? + if(scheduledItemsForMDTs.size()>0) { + + // Look for existing shadow rollup records + Set uniqueNames = new Set(); + for(LookupRollupSummaryScheduleItems__c scheduledItem : scheduledItemsForMDTs) + uniqueNames.add('mdt:' + scheduledItem.LookupRollupSummary2__c); + Map shadowRollupsByMdtId = new Map(); + for(RollupSummary shadowRollup : new RollupSummariesSelector.CustomObjectSelector(false).selectByUniqueName(uniqueNames)) { + String uniqueName = shadowRollup.UniqueName; + String mdtRollupId = uniqueName.split(':')[1]; + shadowRollupsByMdtId.put(mdtRollupId, shadowRollup); + } + + // Associate the Schedule Items with the correct shadow rollup record + Map lookupsById = RollupSummary.toMap(lookups); + Map shadowRollupsToInsertByRollupId = new Map(); + for(LookupRollupSummaryScheduleItems__c scheduledItem : scheduledItemsForMDTs) { + String rollupId = scheduledItem.LookupRollupSummary2__c; + RollupSummary shadowRollup = shadowRollupsByMdtId.get(rollupId); + if(shadowRollup!=null) { + scheduledItem.LookupRollupSummary__c = shadowRollup.Id; + } else if(shadowRollupsToInsertByRollupId.containsKey(rollupId) == false) { + shadowRollupsToInsertByRollupId.put(rollupId, + new LookupRollupSummary__c( + Name = lookupsById.get(rollupId).Name, + UniqueName__c = 'mdt:' + rollupId, + ParentObject__c = 'N/A', + ChildObject__c = 'N/A', + RelationshipField__c = 'N/A', + AggregateResultField__c = 'N/A', + FieldToAggregate__c = 'N/A', + CalculationMode__c = null, + CalculationSharingMode__c = null, + AggregateOperation__c = null, + Active__c = false, + Description__c = 'System managed do not touch.')); + } + } + if(shadowRollupsToInsertByRollupId.size()>0) { + // Insert new shadow rollups and associate with the correct schedule item + insert shadowRollupsToInsertByRollupId.values(); + for(LookupRollupSummaryScheduleItems__c scheduledItem : scheduledItemsForMDTs) { + String rollupId = scheduledItem.LookupRollupSummary2__c; + if(scheduledItem.LookupRollupSummary__c == null) { + scheduledItem.LookupRollupSummary__c = shadowRollupsToInsertByRollupId.get(rollupId).Id; + } + } + } + } + // Add parent Id's to schedule items object upsert scheduledItems QualifiedParentID__c; // Process each context (parent child relationship) and its associated rollups Map masterRecords = new Map(); - for(LREngine.Context ctx : createLREngineContexts(realtimeLookups).values()) + for(LREngine.Context ctx : createLREngineContexts(runnowLookups)) { // Produce a set of master Id's applicable to this context (parent only) Set ctxMasterIds = new Set(); @@ -516,71 +981,218 @@ global with sharing class RollupService * * @returns List of rollup summary definitions **/ - private static List describeRollups(SObjectType childObjectType) + private static List describeRollups(Set childObjectTypes, List calculationModes) { // Query applicable lookup definitions - Schema.DescribeSObjectResult childRecordDescribe = childObjectType.getDescribe(); - List lookups = - new RollupSummariesSelector().selectActiveByChildObject( - new List { RollupSummaries.CalculationMode.Realtime, RollupSummaries.CalculationMode.Scheduled }, - new Set { childRecordDescribe.getName() }); + Set childNames = new Set(); + for(SObjectType sobjectType : childObjectTypes) { + childNames.add( sobjectType.getDescribe().getName()); + } + List lookups = + new RollupSummariesSelector(false).selectActiveByChildObject( + calculationModes, + childNames); return lookups; } /** * Method takes a list of Lookups and creates the most optimum list of LREngine.Context's to execute **/ - private static Map createLREngineContexts(List lookups) + private static List createLREngineContexts(List lookups) { - // Group lookups by parent and relationship into LREngine ctx's - Map gd = Schema.getGlobalDescribe(); - Map> gdFields = new Map>(); - Map engineCtxByParentRelationship = - new Map(); + // list of contexts generated + List engineContexts = new List(); + // map of context criteria (except for order by) to a map of orderby with context + Map> engineCtxByParentRelationship = + new Map>(); + // list of rollupsummaryfields that do not have a specific orderby + List noOrderByLookupWrappers = new List(); Map scheduledItems = new Map(); - for(LookupRollupSummary__c lookup : lookups) + for(RollupSummary lookup : lookups) { - // Resolve (and cache) SObjectType's and fields for Parent and Child objects - SObjectType parentObjectType = gd.get(lookup.ParentObject__c); - if(parentObjectType==null) - throw RollupServiceException.invalidRollup(lookup); - Map parentFields = gdFields.get(parentObjectType); - if(parentFields==null) - gdFields.put(parentObjectType, ((parentFields = parentObjectType.getDescribe().fields.getMap()))); - SObjectType childObjectType = gd.get(lookup.ChildObject__c); - if(childObjectType==null) - throw RollupServiceException.invalidRollup(lookup); - Map childFields = gdFields.get(childObjectType); - if(childFields==null) - gdFields.put(childObjectType, ((childFields = childObjectType.getDescribe().fields.getMap()))); - SObjectField fieldToAggregate = childFields.get(lookup.FieldToAggregate__c); - SObjectField relationshipField = childFields.get(lookup.RelationshipField__c); - SObjectField aggregateResultField = parentFields.get(lookup.AggregateResultField__c); - if(fieldToAggregate==null || relationshipField==null || aggregateResultField==null) - throw RollupServiceException.invalidRollup(lookup); - - // Determine if an LREngine Context has been created for this parent child relationship and filter combination? - String contextKey = lookup.ParentObject__c + '#' + lookup.RelationshipField__c + '#' + lookup.RelationShipCriteria__c; - LREngine.Context lreContext = engineCtxByParentRelationship.get(contextKey); - if(lreContext==null) - { - // Construct LREngine.Context - lreContext = new LREngine.Context( - parentObjectType, // parent object - childObjectType, // child object - relationshipField.getDescribe(), // relationship field name - lookup.RelationShipCriteria__c); - engineCtxByParentRelationship.put(contextKey, lreContext); - } - // Add the lookup - lreContext.add( - new LREngine.RollupSummaryField( - aggregateResultField.getDescribe(), - fieldToAggregate.getDescribe(), - RollupSummaries.OPERATION_PICKLIST_TO_ENUMS.get(lookup.AggregateOperation__c))); - } - return engineCtxByParentRelationship; + // if no order is specified, we'll defer context identification until after we build contexts for + // all the lookups that contain a specific order by + LookupRollupSummaryWrapper lookupWrapper = createLSFWrapper(lookup); + if (!lookupWrapper.OrderByRequired) { + // add to the list of lookups that do not have an order by specified + noOrderByLookupWrappers.add(lookupWrapper); + } else { + // Note that context key here will not include the order by + String contextKey = getContextKey(lookupWrapper); + // obtain the map of orderby to context based on contextKey + Map lreContextByOrderBy = engineCtxByParentRelationship.get(contextKey); + // if we don't have a map yet, create it + if (lreContextByOrderBy == null) { + lreContextByOrderBy = new Map(); + engineCtxByParentRelationship.put(contextKey, lreContextByOrderBy); + } + String orderBy = lookupWrapper.OrderByClause; // this will be the FieldToOrderBy__c from the RollupSummary + // Lowering case on Describable fields is only required for Legacy purposes since RollupSummary records + // will be updated with describe names on insert/update moving forward. + String orderByKey = orderBy.toLowerCase(); + // obtain the context for this orderby key + LREngine.Context lreContext = lreContextByOrderBy.get(orderByKey); + // if not context yet, create one + if(lreContext==null) + { + // Construct LREngine.Context + lreContext = createContext(lookupWrapper); + lreContextByOrderBy.put(orderByKey, lreContext); + engineContexts.add(lreContext); + } + // Add the rollup summary field to the context + lreContext.add(lookupWrapper.RollupSummaryField); + } + } + + // now that we have contexts built for all lookups that have a specific order by + // we iterate those that do not and pick the first one that matches all other criteria + // if there is not one that matches other criteria, we create a new context + if (!noOrderByLookupWrappers.isEmpty()) + { + // loop through our list of lookups that do not have an orderby specified + for (LookupRollupSummaryWrapper lookupWrapper :noOrderByLookupWrappers) + { + // Note that context key here will not include the order by + String contextKey = getContextKey(lookupWrapper); + // obtain the map of orderby to context based on contextKey + Map lreContextByOrderBy = engineCtxByParentRelationship.get(contextKey); + // if we don't have a map yet, create it + if (lreContextByOrderBy == null) { + lreContextByOrderBy = new Map(); + engineCtxByParentRelationship.put(contextKey, lreContextByOrderBy); + } + + LREngine.Context lreContext = null; + if (lreContextByOrderBy.isEmpty()) + { + // if we do not have any contexts yet then create one + // when created, the OrderBy on the context will be set null since no order by was specified + // Construct LREngine.Context + lreContext = createContext(lookupWrapper); + // ensure key is lowered + lreContextByOrderBy.put('####NOORDERBY####', lreContext); + engineContexts.add(lreContext); + } + else + { + // since no orderby was specified we can execute in a non-deterministic manner + // so for that reason we'll just grab the first one + // Note - In an effort to support some backwards compat here, we could try to find a context + // whos first orderby field (ASC NULLS FIRST) matches this lookups FieldToAggregate__c + // however for performance reasons, we'll forgo that and just pick the first + lreContext = lreContextByOrderBy.values()[0]; + } + + // Add the rollup summary field to the context + lreContext.add(lookupWrapper.RollupSummaryField); + } + } + + return engineContexts; + } + + private static LREngine.Context createContext(LookupRollupSummaryWrapper lookupWrapper) + { + return new LREngine.Context( + lookupWrapper.ParentObjectType, // parent object + lookupWrapper.ChildObjectType, // child object + lookupWrapper.RelationshipField.getDescribe(), // relationship field name + lookupWrapper.Lookup.RelationShipCriteria, + lookupWrapper.SharingMode, + lookupWrapper.OrderByClause, + lookupWrapper.AggregateAllRows); + } + + private static SObjectType getSObjectType(String sObjectName) + { + fflib_SObjectDescribe describe = fflib_SObjectDescribe.getDescribe(sObjectName); + return (describe == null) ? null : describe.getSObjectType(); + + } + + private static Map getSObjectTypeFields(SObjectType sObjectType) + { + return fflib_SObjectDescribe.getDescribe(sObjectType).getFieldsMap(); + } + + private class LookupRollupSummaryWrapper + { + public RollupSummary Lookup; + public Schema.SObjectType ParentObjectType; + public Schema.SObjectType ChildObjectType; + public Schema.SObjectField FieldToAggregate; + public Schema.SObjectField RelationshipField; + public Schema.SObjectField AggregateResultField; + public Boolean AggregateAllRows; + public LREngine.SharingMode SharingMode; + public Boolean OrderByRequired; // true if FieldToOrderBy__c is not blank + public String OrderByClause; // FieldToOrderBy__c if OrderByRequired is true; null otherwise + public LREngine.RollupSummaryField RollupSummaryField; + } + + private static LookupRollupSummaryWrapper createLSFWrapper(RollupSummary lookup) + { + // Resolve (and cache) SObjectType's and fields for Parent and Child objects + SObjectType parentObjectType = getSObjectType(lookup.ParentObject); + if(parentObjectType==null) + throw RollupServiceException.invalidRollup(lookup); + Map parentFields = getSObjectTypeFields(parentObjectType); + SObjectType childObjectType = getSObjectType(lookup.ChildObject); + if(childObjectType==null) + throw RollupServiceException.invalidRollup(lookup); + Map childFields = getSObjectTypeFields(childObjectType); + SObjectField fieldToAggregate = childFields.get(lookup.FieldToAggregate); + SObjectField relationshipField = childFields.get(lookup.RelationshipField); + SObjectField aggregateResultField = parentFields.get(lookup.AggregateResultField); + if(fieldToAggregate==null || relationshipField==null || aggregateResultField==null) + throw RollupServiceException.invalidRollup(lookup); + + // Summary field definition used by LREngine + LREngine.RollupSummaryField rsf = + new LREngine.RollupSummaryField( + aggregateResultField.getDescribe(), + fieldToAggregate.getDescribe(), + RollupSummaries.OPERATION_PICKLIST_TO_ENUMS.get(lookup.AggregateOperation), + lookup.ConcatenateDelimiter, + Integer.valueOf(lookup.RowLimit)); + + LookupRollupSummaryWrapper wrapper = new LookupRollupSummaryWrapper(); + wrapper.Lookup = lookup; + wrapper.ParentObjectType = parentObjectType; + wrapper.ChildObjectType = childObjectType; + wrapper.FieldToAggregate = fieldToAggregate; + wrapper.RelationshipField = relationshipField; + wrapper.AggregateResultField = aggregateResultField; + wrapper.AggregateAllRows = lookup.AggregateAllRows; + wrapper.SharingMode = + lookup.CalculationSharingMode == null || lookup.CalculationSharingMode == 'User' ? + LREngine.SharingMode.User : LREngine.SharingMode.System_x; + // if order by is not specified, orderby will be null else it will be FieldToOrderBy__c + wrapper.OrderByRequired = !String.isBlank(lookup.FieldToOrderBy); + wrapper.OrderByClause = wrapper.OrderByRequired ? lookup.FieldToOrderBy : null; + wrapper.RollupSummaryField = rsf; + + return wrapper; + } + + private static String getContextKey(LookupRollupSummaryWrapper lookupWrapper) + { + // Context Key Based On: ParentObject__c, RelationshipField__c, RelationShipCriteria__c, rsfType, SharingMode, AggergateAllRows + // Note we do not include OrderBy here because orderby map is contained within the map of contextKeys + String rsfType = lookupWrapper.RollupSummaryField.isAggregateBasedRollup() ? 'aggregate' : 'query'; + // Lowering case on Describable fields is only required for Legacy purposes since RollupSummary records + // will be updated with describe names on insert/update moving forward. + // Ideally this would not be needed to save CPU cycles but including to ensure context is properly re-used when possible for + // rollups that have not been updated/inserted after the insert/update enhancement is applied + // Unable to lower RelationShipCriteria__c because of field value case-(in)sensitivity configuration + return (lookupWrapper.Lookup.ParentObject.toLowerCase() + '#' + + lookupWrapper.Lookup.RelationshipField.toLowerCase() + '#' + + lookupWrapper.Lookup.RelationShipCriteria + '#' + + rsfType + '#' + + lookupWrapper.SharingMode + '#' + + lookupWrapper.AggregateAllRows); } /** @@ -639,4 +1251,4 @@ global with sharing class RollupService public override List updateRecords(boolean allOrNothing) { return super.updateRecords(allOrNothing); } } -} +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupService.cls-meta.xml b/rolluptool/src/classes/RollupService.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupService.cls-meta.xml +++ b/rolluptool/src/classes/RollupService.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupServiceException.cls b/rolluptool/src/classes/RollupServiceException.cls index 753be371..5775f2ef 100644 --- a/rolluptool/src/classes/RollupServiceException.cls +++ b/rolluptool/src/classes/RollupServiceException.cls @@ -32,7 +32,7 @@ public class RollupServiceException extends Exception /** * Generic exception when aspects of the rollup summary definition are found to be in error at runtime **/ - public static RollupServiceException invalidRollup(LookupRollupSummary__c lookup) + public static RollupServiceException invalidRollup(RollupSummary lookup) { return new RollupServiceException('Lookup Rollup Summary \'' + lookup.Name + '\' is invalid, your org configuration may have changed.'); } @@ -50,7 +50,7 @@ public class RollupServiceException extends Exception **/ public static RollupServiceException jobAlreadyRunning(String name) { - return new RollupServiceException('A calculate job for rollup \'' + name + '\' is already executing. If you suspect it is not aleady running try clearing the Calculate Job Id field and try again.'); + return new RollupServiceException('A calculate job for rollup \'' + name + '\' is already executing. If you suspect it is not aleady running try clearing the applicable record from the Lookup Rollup Calculate Jobs tab and try again.'); } /** diff --git a/rolluptool/src/classes/RollupServiceException.cls-meta.xml b/rolluptool/src/classes/RollupServiceException.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupServiceException.cls-meta.xml +++ b/rolluptool/src/classes/RollupServiceException.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupServiceTest.cls b/rolluptool/src/classes/RollupServiceTest.cls index 98ce8dc0..2b917a5e 100644 --- a/rolluptool/src/classes/RollupServiceTest.cls +++ b/rolluptool/src/classes/RollupServiceTest.cls @@ -35,9 +35,9 @@ private with sharing class RollupServiceTest static { // Dynamically resolve these fields, if they are not present when the test runs, the test will return as passed to avoid failures in subscriber org when packaged - Map accountFields = Schema.SObjectType.Account.fields.getMap(); - ACCOUNT_SLA_EXPIRATION_DATE = accountFields.get('SLAExpirationDate__c'); - ACCOUNT_NUMBER_OF_LOCATIONS = accountFields.get('NumberOfLocations__c'); + fflib_SObjectDescribe describe = fflib_SObjectDescribe.getDescribe(Account.SObjectType); + ACCOUNT_SLA_EXPIRATION_DATE = describe.getField('SLAExpirationDate__c'); + ACCOUNT_NUMBER_OF_LOCATIONS = describe.getField('NumberOfLocations__c'); } private testmethod static void testSingleSumRollup() @@ -64,7 +64,12 @@ private with sharing class RollupServiceTest { testSingleRollup(new List { 250, 250, 50, 50 }, 4, RollupSummaries.AggregateOperation.Count, null); } - + + private testmethod static void testSingleCountDistinctRollup() + { + testSingleRollup(new List { 250, 250, 50, 50 }, 2, RollupSummaries.AggregateOperation.Count_Distinct, null); + } + private testmethod static void testSingleSumRollupConditional() { testSingleRollup(new List { 250, 250, 50, 50 }, 500, RollupSummaries.AggregateOperation.Sum, 'Amount > 200'); @@ -142,6 +147,79 @@ private with sharing class RollupServiceTest System.assertEquals(expectedResultA, accountResult.AnnualRevenue); System.assertEquals(expectedResultB, accountResult.get(ACCOUNT_NUMBER_OF_LOCATIONS)); } + + private testmethod static void testMultiRollupSumAndAvg() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + // Test data + List rollups = new List { 250, 250, 50, 50 }; + + // Test data for rollup A + Decimal expectedResultA = 600; + RollupSummaries.AggregateOperation operationA = RollupSummaries.AggregateOperation.Sum; + String conditionA = null; + + // Test data for rollup B + Decimal expectedResultB = 150; + RollupSummaries.AggregateOperation operationB = RollupSummaries.AggregateOperation.Avg; + String conditionB = null; + + // Configure rollup A + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Total Opportunities into Annual Revenue on Account'; + rollupSummaryA.ParentObject__c = 'Account'; + rollupSummaryA.ChildObject__c = 'Opportunity'; + rollupSummaryA.RelationShipField__c = 'AccountId'; + rollupSummaryA.RelationShipCriteria__c = conditionA; + rollupSummaryA.FieldToAggregate__c = 'Amount'; + rollupSummaryA.AggregateOperation__c = operationA.name(); + rollupSummaryA.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = 'Realtime'; + + // Configure rollup B + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Avg Opportunities into Annual Revenue on Account'; + rollupSummaryB.ParentObject__c = 'Account'; + rollupSummaryB.ChildObject__c = 'Opportunity'; + rollupSummaryB.RelationShipField__c = 'AccountId'; + rollupSummaryB.RelationShipCriteria__c = conditionB; + rollupSummaryB.FieldToAggregate__c = 'Amount'; + rollupSummaryB.AggregateOperation__c = operationB.name(); + rollupSummaryB.AggregateResultField__c = 'NumberOfLocations__c'; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = 'Realtime'; + + // Insert rollup definitions + insert new List { rollupSummaryA, rollupSummaryB }; + + // Test data + Account account = new Account(); + account.Name = 'Test Account'; + account.AnnualRevenue = 0; + insert account; + List opps = new List(); + for(Decimal rollupValue : rollups) + { + Opportunity opp = new Opportunity(); + opp.Name = 'Test Opportunity'; + opp.StageName = 'Open'; + opp.CloseDate = System.today(); + opp.AccountId = account.Id; + opp.Amount = rollupValue; + opps.add(opp); + } + insert opps; + + // Assert rollup + Id accountId = account.Id; + Account accountResult = Database.query('select AnnualRevenue, NumberOfLocations__c from Account where Id = :accountId'); + System.assertEquals(expectedResultA, accountResult.AnnualRevenue); + System.assertEquals(expectedResultB, accountResult.get(ACCOUNT_NUMBER_OF_LOCATIONS)); + } private testmethod static void testMultiRollupNoConditions() { @@ -680,7 +758,6 @@ private with sharing class RollupServiceTest // Sample various limits prior to an update Integer beforeQueries = Limits.getQueries(); Integer beforeRows = Limits.getQueryRows(); - Integer beforeDescribes = Limits.getFieldsDescribes(); // Update opportunities (no changes to the field being aggregted, thus no rollup processng) update opps; @@ -688,7 +765,6 @@ private with sharing class RollupServiceTest // Assert no further limits have been used since the field to aggregate on the detail has not changed System.assertEquals(beforeQueries + 1, Limits.getQueries()); // Only tolerate a query for the Lookup definition System.assertEquals(beforeRows + 1, Limits.getQueryRows()); // Only tolerate a row for the Lookup definition - System.assertEquals(beforeDescribes, Limits.getFieldsDescribes()); // Zero tolerance on field describes } private testmethod static void testLimitsConsumedWithConditions() @@ -762,10 +838,11 @@ private with sharing class RollupServiceTest // One query on ApexTrigger (in the TestContext.isSupported method) // One query on ApexTrigger (validation when inserting rollups) + // One query on Database.newQueryLocator (validation when insert rollup a) // One query on Rollup object // One query on Opportunity for rollup a // One query on Opportunity for rollup b - System.assertEquals(5, Limits.getQueries()); + System.assertEquals(6, Limits.getQueries()); // One row for ApexTrigger (in the TestContext.isSupported method) // One row for ApexTrigger @@ -773,13 +850,6 @@ private with sharing class RollupServiceTest // Two rows for Opportunity for rollup a // Four rows for Opportunity for rollup b System.assertEquals(10, Limits.getQueryRows()); - - // One for the statics at the top of the test - // One for the parent object validation on insert of lookup - // One for the child object validaiton on insert of lookup - // One for the lookup of the field type for the parent object during trigger - // One for the lookup of the field type for the child object during trigger - System.assertEquals(5, Limits.getFieldsDescribes()); // Assert rollup Id accountId = account.Id; @@ -795,16 +865,12 @@ private with sharing class RollupServiceTest // + One query for the Account query above // + One query on Rollup object // + One query on Opportunity for rollup a - System.assertEquals(8, Limits.getQueries()); + System.assertEquals(9, Limits.getQueries()); // + One query for the Account query above // + Two rows for Rollup object // + Two rows for Opportunity for rollup a System.assertEquals(15, Limits.getQueryRows()); - - // + One for the lookup of the field type for the parent object during trigger - // + One for the lookup of the field type for the child object during trigger - System.assertEquals(7, Limits.getFieldsDescribes()); // Assert rollup accountResult = Database.query('select AnnualRevenue, NumberOfLocations__c from Account where Id = :accountId'); @@ -892,13 +958,6 @@ private with sharing class RollupServiceTest // Two rows for Rollup object // Four rows for Opportunity for rollup a and b System.assertEquals(8, Limits.getQueryRows()); - - // One for the statics at the top of the test - // One for the parent object validation on insert of lookup - // One for the child object validaiton on insert of lookup - // One for the lookup of the field type for the parent object during trigger - // One for the lookup of the field type for the child object during trigger - System.assertEquals(5, Limits.getFieldsDescribes()); // Assert rollup Id accountId = account.Id; @@ -920,10 +979,6 @@ private with sharing class RollupServiceTest // + Two rows for Rollup object // + Four rows for Opportunity for rollup a and System.assertEquals(15, Limits.getQueryRows()); - - // + One for the lookup of the field type for the parent object during trigger - // + One for the lookup of the field type for the child object during trigger - System.assertEquals(7, Limits.getFieldsDescribes()); // Assert rollup accountResult = Database.query('select AnnualRevenue, NumberOfLocations__c from Account where Id = :accountId'); @@ -945,7 +1000,7 @@ private with sharing class RollupServiceTest rollupSummary.RelationShipField__c = 'AccountId'; rollupSummary.RelationShipCriteria__c = condition; // 'Amount > 200'; rollupSummary.FieldToAggregate__c = 'Amount'; - rollupSummary.AggregateOperation__c = operation.name(); + rollupSummary.AggregateOperation__c = operation.name().replace('_', ' '); rollupSummary.AggregateResultField__c = 'AnnualRevenue'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; @@ -972,4 +1027,947 @@ private with sharing class RollupServiceTest // Assert rollup System.assertEquals(expectedResult, [select AnnualRevenue from Account where Id = :account.Id].AnnualRevenue); } -} + + private testmethod static void testMultiRollupOfDifferentTypes() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + // Test data + List rollups = new List { 250, 250, 50, 50 }; + + // Test data for rollup A + Decimal expectedResultA = 600; + RollupSummaries.AggregateOperation operationA = RollupSummaries.AggregateOperation.Sum; + String conditionA = null; + + // Test data for rollup B + String expectedResultB = 'Open,Open,Open,Open'; + RollupSummaries.AggregateOperation operationB = RollupSummaries.AggregateOperation.Concatenate; + String conditionB = null; + + // Configure rollup A + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Total Opportunities into Annual Revenue on Account'; + rollupSummaryA.ParentObject__c = 'Account'; + rollupSummaryA.ChildObject__c = 'Opportunity'; + rollupSummaryA.RelationShipField__c = 'AccountId'; + rollupSummaryA.RelationShipCriteria__c = conditionA; + rollupSummaryA.FieldToAggregate__c = 'Amount'; + rollupSummaryA.AggregateOperation__c = operationA.name(); + rollupSummaryA.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = 'Realtime'; + + // Configure rollup B + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Concatenate Opportunities Stage Name into Description on Account'; + rollupSummaryB.ParentObject__c = 'Account'; + rollupSummaryB.ChildObject__c = 'Opportunity'; + rollupSummaryB.RelationShipField__c = 'AccountId'; + rollupSummaryB.RelationShipCriteria__c = conditionB; + rollupSummaryB.FieldToAggregate__c = 'StageName'; + rollupSummaryB.AggregateOperation__c = operationB.name(); + rollupSummaryB.AggregateResultField__c = 'Description'; + rollupSummaryB.ConcatenateDelimiter__c = ','; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = 'Realtime'; + + // Insert rollup definitions + insert new List { rollupSummaryA, rollupSummaryB }; + + // Test data + Account account = new Account(); + account.Name = 'Test Account'; + account.AnnualRevenue = 0; + insert account; + List opps = new List(); + for(Decimal rollupValue : rollups) + { + Opportunity opp = new Opportunity(); + opp.Name = 'Test Opportunity'; + opp.StageName = 'Open'; + opp.CloseDate = System.today(); + opp.AccountId = account.Id; + opp.Amount = rollupValue; + opps.add(opp); + } + insert opps; + + // Assert rollup + Id accountId = account.Id; + Account accountResult = Database.query('select AnnualRevenue, Description from Account where Id = :accountId'); + System.assertEquals(expectedResultA, accountResult.AnnualRevenue); + System.assertEquals(expectedResultB, accountResult.Description); + } + + /** + * Current default behavior of LREngine is to apply RelationshipField__c in the order by + * for all contexts. Beyond that, if no order by is specified, no orderby is applied. + * + * This results in all queries having an order by of at least RelationshipField__c even if no orderby + * is specified in FieldToOrderBy__c. Ordering by RelationshipField__c does not impact Query based rollup results + * and is only applied to assist in materializing the results on master records + * + * Current default behavior of DLRS is to build the context with all rollupsummaries + * retrieving them ordered by ParentObject__c (Account) and then by RelationshipField__c (e.g. AccountId) + * which results in non-deterministic result when no orderby is specified so a test cannot reliabily be written against + * multiple rollups on same parent/child relationship when no orderby is specified. + */ + private static Id setupMultiRollupDifferentTypes(Map opportunityData, RollupSummaries.AggregateOperation operationA, String orderByFieldA, RollupSummaries.AggregateOperation operationB, String orderByFieldB) + { + // Configure rollup A + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'First Opportunity Name into Sic on Account'; + rollupSummaryA.ParentObject__c = 'Account'; + rollupSummaryA.ChildObject__c = 'Opportunity'; + rollupSummaryA.RelationShipField__c = 'AccountId'; + rollupSummaryA.RelationShipCriteria__c = null; + rollupSummaryA.FieldToAggregate__c = 'StageName'; + rollupSummaryA.FieldToOrderBy__c = orderByFieldA; + rollupSummaryA.AggregateOperation__c = operationA.name(); + rollupSummaryA.AggregateResultField__c = 'Sic'; + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = 'Realtime'; + + // Configure rollup B + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Concatenate Opportunities Stage Name into Description on Account'; + rollupSummaryB.ParentObject__c = 'Account'; + rollupSummaryB.ChildObject__c = 'Opportunity'; + rollupSummaryB.RelationShipField__c = 'AccountId'; + rollupSummaryB.RelationShipCriteria__c = null; + rollupSummaryB.FieldToAggregate__c = 'Name'; + rollupSummaryB.FieldToOrderBy__c = orderByFieldB; + rollupSummaryB.AggregateOperation__c = operationB.name(); + rollupSummaryB.AggregateResultField__c = 'Description'; + rollupSummaryB.ConcatenateDelimiter__c = ','; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = 'Realtime'; + + // Insert rollup definitions + insert new List { rollupSummaryA, rollupSummaryB }; + + // Test data + Account account = new Account(); + account.Name = 'Test Account'; + account.AnnualRevenue = 0; + insert account; + + Date today = System.today(); + List opps = new List(); + for (String opportunityName :opportunityData.keySet()) + { + List oppFieldValues = opportunityData.get(opportunityName).split(';'); + Opportunity opp = new Opportunity(); + opp.Name = opportunityName; + opp.AccountId = account.Id; + opp.Amount = Decimal.valueOf(oppFieldValues[0]); + opp.CloseDate = today.addMonths(Integer.valueOf(oppFieldValues[1])); + opp.StageName = oppFieldValues[2]; + opps.add(opp); + } + insert opps; + + return account.Id; + } + + /** + * Test default behavior with different order by on each rollup + */ + private testmethod static void testMultiRollupOfDifferentTypesDifferentOrderBy() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + // Test data + // OpportunityName => Amount;CloseDateAddMonthsToToday;StageName + Map opportunityData = new Map { + 'Joe' => '250;0;Open', + 'Steve' => '50;1;Prospecting', + 'Kim' => '100;-2;Closed Won', + 'Charlie' => '225;-1;Needs Analysis'}; + + // Test data for rollup A + String expectedResultA = 'Closed Won'; + RollupSummaries.AggregateOperation operationA = RollupSummaries.AggregateOperation.First; + String orderByClauseA = Schema.SObjectType.Opportunity.fields.CloseDate.getName(); + + // Test data for rollup B + String expectedResultB = 'Steve,Kim,Charlie,Joe'; + RollupSummaries.AggregateOperation operationB = RollupSummaries.AggregateOperation.Concatenate; + String orderByClauseB = Schema.SObjectType.Opportunity.fields.Amount.getName(); + + // generate rollups and data + Id accountId = setupMultiRollupDifferentTypes(opportunityData, operationA, orderByClauseA, operationB, orderByClauseB); + + // Assert rollup + Account accountResult = Database.query('select Sic, Description from Account where Id = :accountId'); + System.assertEquals(expectedResultA, accountResult.Sic); + System.assertEquals(expectedResultB, accountResult.Description); + } + + /** + * Test default behavior with different order by containing multiple fields on each rollup + * for Issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/216 + */ + private testmethod static void testMultiRollupOfDifferentTypesDifferentMultipleFieldsOrderBy() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + // Test data + // OpportunityName => Amount;CloseDateAddMonthsToToday;StageName + Map opportunityData = new Map { + 'Joe' => '100;0;Open', + 'Steve' => '100;-2;Prospecting', + 'Kim' => '100;1;Closed Won', + 'Charlie' => '100;-1;Needs Analysis'}; + + // Test data for rollup A + String expectedResultA = 'Prospecting'; + RollupSummaries.AggregateOperation operationA = RollupSummaries.AggregateOperation.First; + String orderByClauseA = 'Amount ASC NULLS FIRST, CloseDate ASC NULLS FIRST, Name'; + + // Test data for rollup B + String expectedResultB = 'Kim,Joe,Charlie,Steve'; + RollupSummaries.AggregateOperation operationB = RollupSummaries.AggregateOperation.Concatenate; + String orderByClauseB = 'Amount ASC NULLS FIRST, CloseDate DESC NULLS FIRST, Name'; + + // generate rollups and data + Id accountId = setupMultiRollupDifferentTypes(opportunityData, operationA, orderByClauseA, operationB, orderByClauseB); + + // Assert rollup + Account accountResult = Database.query('select Sic, Description from Account where Id = :accountId'); + System.assertEquals(expectedResultA, accountResult.Sic); + System.assertEquals(expectedResultB, accountResult.Description); + } + + private testmethod static void testPicklistRollup() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Colours__c.getDescribe().getName(); + + // Create a picklist rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Concatenate.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.ConcatenateDelimiter__c = ';'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + insert rollupSummary; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + String name = (String) parent.get('Name'); + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 'Red'); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 'Yellow'); + children.add(child2); + if(name.equals('ParentA') || name.equals('ParentB')) + { + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 'Blue'); + children.add(child3); + } + } + insert children; + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals('Red;Yellow;Blue', (String) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals('Red;Yellow;Blue', (String) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals('Red;Yellow', (String) assertParents.get(parentC.id).get(aggregateResultField)); + } + + + private testmethod static void testPicklistRollupWithLimits() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Colours__c.getDescribe().getName(); + + // Create a picklist rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Concatenate.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.ConcatenateDelimiter__c = ';'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + rollupSummary.RowLimit__c = 2; + rollupSummary.AggregateAllRows__c = true; + insert rollupSummary; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + String name = (String) parent.get('Name'); + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 'Red'); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 'Yellow'); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 'Blue'); + children.add(child3); + } + insert children; + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals('Red;Yellow', (String) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals('Red;Yellow', (String) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals('Red;Yellow', (String) assertParents.get(parentC.id).get(aggregateResultField)); + } + + + private testmethod static void testLastRollupWithLimits() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Colours__c.getDescribe().getName(); + + // Create a picklist rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.FieldToOrderBy__c = aggregateField + ' DESC'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + rollupSummary.RowLimit__c = 2; + rollupSummary.AggregateAllRows__c = true; + insert rollupSummary; + + // Insert parents + SObject parent = parentType.newSObject(); + parent.put('Name', 'ParentA'); + List parents = new List { parent }; + insert parents; + + // Insert children + List children = new List(); + String name = (String) parent.get('Name'); + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, '1'); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, '2'); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, '3'); + children.add(child3); + insert children; + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals('2', (String) assertParents.get(parent.id).get(aggregateResultField)); + } + + private testmethod static void testLimitsConsumedWithSingleChildChanged() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + // Disable the Account trigger for this test, its carefully caluculated test actuals are thrown when this is enabled as well + TestContext.AccountTestTriggerEnabled = false; + + // Configure rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Total Opportunities into Annual Revenue on Account'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Opportunity'; + rollupSummary.RelationShipField__c = 'AccountId'; + rollupSummary.RelationShipCriteria__c = null; + rollupSummary.FieldToAggregate__c = 'Amount'; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + insert rollupSummary; + + // Test data + Integer numAccounts = 3; + Account parentAccount1 = new Account(); + parentAccount1.Name = 'Parent Account 1'; + parentAccount1.AnnualRevenue = 0; + Account parentAccount2 = new Account(); + parentAccount2.Name = 'Parent Account 2'; + parentAccount2.AnnualRevenue = 0; + Account parentAccount3 = new Account(); + parentAccount3.Name = 'Parent Account 3'; + parentAccount3.AnnualRevenue = 0; + List parentAccounts = new List { parentAccount1, parentAccount2, parentAccount3 }; + insert parentAccounts; + + List oppAmounts = new List { 100, 200, 300, 400 }; + Decimal expectedAnnualRevenue = 1000; + List childOpportunities = new List(); + for (Account acct :parentAccounts) + { + for(Decimal oppAmount :oppAmounts) + { + Opportunity opp = new Opportunity(); + opp.Name = 'Test Opportunity for ' + acct.Name; + opp.StageName = 'Open'; + opp.CloseDate = System.today(); + opp.AccountId = acct.Id; + opp.Amount = oppAmount; + childOpportunities.add(opp); + } + } + insert childOpportunities; + + // assert rollup produced correct values + System.assertEquals(expectedAnnualRevenue, [select AnnualRevenue from Account where Id = :parentAccount1.Id].AnnualRevenue); + System.assertEquals(expectedAnnualRevenue, [select AnnualRevenue from Account where Id = :parentAccount2.Id].AnnualRevenue); + System.assertEquals(expectedAnnualRevenue, [select AnnualRevenue from Account where Id = :parentAccount3.Id].AnnualRevenue); + + // change opportunities on 'Parent Account 1' leaving 'Parent Account 2' opportunities untouched + List oppsToModify = [SELECT Id, Name, Amount FROM Opportunity]; + System.assertEquals(oppAmounts.size() * parentAccounts.size(), oppsToModify.size()); + for (Opportunity oppToModify :oppsToModify) + { + // modify the CloseDate for all opps + // this simulates a change to a record on a field that is not involved any rollup + oppToModify.CloseDate = System.today().addMonths(1); + + // modify Amount on the Opportunity associated to Parent Account 1 and it's current amount is 100 + // this simulates a change to a single record on a field that is involved in a rollup + if (oppToModify.Name.endsWith(parentAccount1.Name) && oppToModify.Amount == 100) + { + oppToModify.Amount++; + } + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // Update opportunities (1 record has change to field being aggregated, all others do not have changes to that field) + update oppsToModify; + + // Assert limits + // + One query on Rollup object + // + One query on Opportunity for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + One row for Rollup object + // + Four rows for Opportunity on Parent 1 + System.assertEquals(beforeRows + 5, Limits.getQueryRows()); + + // + Twelve rows for Oppportunities (from the update statement itself) + // + One row for Parent Account 1 (from lookup processing) + System.assertEquals(beforeDMLRows + 13, Limits.getDMLRows()); + + // assert rollups produced correct result + System.assertEquals(expectedAnnualRevenue + 1, [select AnnualRevenue from Account where Id = :parentAccount1.Id].AnnualRevenue); + System.assertEquals(expectedAnnualRevenue, [select AnnualRevenue from Account where Id = :parentAccount2.Id].AnnualRevenue); + System.assertEquals(expectedAnnualRevenue, [select AnnualRevenue from Account where Id = :parentAccount3.Id].AnnualRevenue); + } + + private testmethod static void testLimitsConsumedWithReparentOnly() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField1 = LookupChild__c.LookupParent__c.getDescribe().getName(); + String relationshipField2 = LookupChild__c.LookupParent2__c.getDescribe().getName(); + String aggregateField1 = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateField2 = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Colours__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup'; + rollupSummaryA.ParentObject__c = parentObjectName; + rollupSummaryA.ChildObject__c = childObjectName; + rollupSummaryA.RelationShipField__c = relationshipField1; + rollupSummaryA.FieldToAggregate__c = aggregateField1; + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.Concatenate.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1; + rollupSummaryA.ConcatenateDelimiter__c = ';'; + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField2; + rollupSummaryB.FieldToAggregate__c = aggregateField2; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + SObject child1 = childType.newSObject(); + child1.put(relationshipField1, parentA.Id); + child1.put(relationshipField2, parentB.Id); + child1.put(aggregateField1, 'Red'); + child1.put(aggregateField2, 20); + SObject child2 = childType.newSObject(); + child2.put(relationshipField1, parentA.Id); + child2.put(relationshipField2, parentB.Id); + child2.put(aggregateField1, 'Yellow'); + child2.put(aggregateField2, 22); + + List children = new List { child1, child2 }; + insert children; + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals('Red;Yellow', (String) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(0.0, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals(null, (String) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals(null, (String) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + + // change LookupParent2__c from Parent B to Parent C + child1.put(relationshipField2, parentC.Id); + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // update including all children but only one child and only one field (LookupParent2__c) on that child has changed + update children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + Two rows for Rollup object + // + Two rows for LookupChild__c for rollup B (One on Parent B and One on Parent C) + System.assertEquals(beforeRows + 4, Limits.getQueryRows()); + + // + Two rows for LookupChild__c (from the update statement itself) + // + Two rows for LookupParent__c (One for B and One for C) + System.assertEquals(beforeDMLRows + 4, Limits.getDMLRows()); + + // Assert rollups + assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals('Red;Yellow', (String) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(0.0, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals(null, (String) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(22, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals(null, (String) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(20, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + } + + private static void assertOrdering(Utilities.Ordering o, String orderBy, Boolean useAsSpecifiedString, String field, Utilities.SortOrder direction, Boolean nullsLast) + { + System.assertEquals(orderBy, useAsSpecifiedString ? o.toAsSpecifiedString() : o.toString()); + System.assertEquals(field, o.getField()); + System.assertEquals(direction, o.getDirection()); + System.assertEquals(nullsLast, o.getNullsLast()); + } + + static testMethod void testOrderingStringification() + { + Utilities.Ordering o = new Utilities.Ordering('CloseDate'); + assertOrdering(o, 'CloseDate ASC NULLS FIRST', false, 'CloseDate', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('closedate'); + assertOrdering(o, 'closedate ASC NULLS FIRST', false, 'closedate', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('cLoSeDaTe'); + assertOrdering(o, 'cLoSeDaTe ASC NULLS FIRST', false, 'cLoSeDaTe', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.ASCENDING); + assertOrdering(o, 'CloseDate ASC NULLS FIRST', false, 'CloseDate', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.DESCENDING); + assertOrdering(o, 'CloseDate DESC NULLS FIRST', false, 'CloseDate', Utilities.SortOrder.DESCENDING, false); + + o = new Utilities.Ordering('CloseDate', null, false); + assertOrdering(o, 'CloseDate ASC NULLS FIRST', false, 'CloseDate', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('CloseDate', null, true); + assertOrdering(o, 'CloseDate ASC NULLS LAST', false,'CloseDate', Utilities.SortOrder.ASCENDING, true); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.ASCENDING, false); + assertOrdering(o, 'CloseDate ASC NULLS FIRST', false, 'CloseDate', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.ASCENDING, true); + assertOrdering(o, 'CloseDate ASC NULLS LAST', false, 'CloseDate', Utilities.SortOrder.ASCENDING, true); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.DESCENDING, false); + assertOrdering(o, 'CloseDate DESC NULLS FIRST', false, 'CloseDate', Utilities.SortOrder.DESCENDING, false); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.DESCENDING, true); + assertOrdering(o, 'CloseDate DESC NULLS LAST', false, 'CloseDate', Utilities.SortOrder.DESCENDING, true); + + try { + o = new Utilities.Ordering(null); + System.assert(false, 'Expecting an exception'); + } + catch (Utilities.BadOrderingStateException e) { + System.assertEquals('field cannot be blank.', e.getMessage()); + } + } + + static testMethod void testOrderingAsSpecifiedStringification() + { + Utilities.Ordering o = new Utilities.Ordering('CloseDate'); + assertOrdering(o, 'CloseDate', true, 'CloseDate', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('closedate'); + assertOrdering(o, 'closedate', true, 'closedate', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('cLoSeDaTe'); + assertOrdering(o, 'cLoSeDaTe', true, 'cLoSeDaTe', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.ASCENDING); + assertOrdering(o, 'CloseDate ASC', true, 'CloseDate', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.DESCENDING); + assertOrdering(o, 'CloseDate DESC', true, 'CloseDate', Utilities.SortOrder.DESCENDING, false); + + o = new Utilities.Ordering('CloseDate', null, false); + assertOrdering(o, 'CloseDate NULLS FIRST', true, 'CloseDate', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('CloseDate', null, true); + assertOrdering(o, 'CloseDate NULLS LAST', true, 'CloseDate', Utilities.SortOrder.ASCENDING, true); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.ASCENDING, false); + assertOrdering(o, 'CloseDate ASC NULLS FIRST', true, 'CloseDate', Utilities.SortOrder.ASCENDING, false); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.ASCENDING, true); + assertOrdering(o, 'CloseDate ASC NULLS LAST', true, 'CloseDate', Utilities.SortOrder.ASCENDING, true); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.DESCENDING, false); + assertOrdering(o, 'CloseDate DESC NULLS FIRST', true, 'CloseDate', Utilities.SortOrder.DESCENDING, false); + + o = new Utilities.Ordering('CloseDate', Utilities.SortOrder.DESCENDING, true); + assertOrdering(o, 'CloseDate DESC NULLS LAST', true, 'CloseDate', Utilities.SortOrder.DESCENDING, true); + } + + private testmethod static void testSingleQueryBasedRollupUpdateOrderByFieldChanged() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Colours__c.getDescribe().getName(); + String orderByField = LookupChild__c.Amount__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.FieldToOrderBy__c = orderByField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.ConcatenateDelimiter__c = ';'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + + List rollups = new List { rollupSummary }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 'Red'); + child1.put(orderByField, 10); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 'Yellow'); + child2.put(orderByField, 20); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 'Blue'); + child3.put(orderByField, 30); + children.add(child3); + } + insert children; + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals('Red', (String) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals('Red', (String) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals('Red', (String) assertParents.get(parentC.id).get(aggregateResultField)); + + // change Amount__c to effect order by result of rollup + // this change will result in rollup being processed because it is a query based rollup + // and order by influences rolled up value + List childrenToUpdate = new List(); + for (SObject child :children) + { + Decimal orderByFieldValue = (Decimal)child.get(orderByField); + if (orderByFieldValue == 10) { + child.put(orderByField, 40); + childrenToUpdate.add(child); + } + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // update children + update childrenToUpdate; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + One row for Rollup object + // + Nine rows for LookupChild__c for rollup + System.assertEquals(beforeRows + 10, Limits.getQueryRows()); + + // + Three rows for LookupChild__c (from the update statement itself) + // + Three rows for LookupParent__c for the rollup + System.assertEquals(beforeDMLRows + 6, Limits.getDMLRows()); + + // Assert rollups + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals('Yellow', (String) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals('Yellow', (String) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals('Yellow', (String) assertParents.get(parentC.id).get(aggregateResultField)); + } + + private testmethod static void testSingleAggregateBasedRollupUpdateOrderByFieldChanged() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + String orderByField = LookupChild__c.Color__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.FieldToOrderBy__c = orderByField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.ConcatenateDelimiter__c = ';'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + + List rollups = new List { rollupSummary }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 10); + child1.put(orderByField, 'Red'); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + child2.put(orderByField, 'Yellow'); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 12); + child3.put(orderByField, 'Blue'); + children.add(child3); + } + insert children; + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // change Color__c to effect order by result of rollup + // this change will NOT result in rollup being processed because it is a aggregate based rollup + // and order by does NOT influence rolled up result + List childrenToUpdate = new List(); + for (SObject child :children) + { + String orderByFieldValue = (String)child.get(orderByField); + if (orderByFieldValue == 'Red') { + child.put(orderByField, 'Green'); + childrenToUpdate.add(child); + } + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // update children + update childrenToUpdate; + + // Assert limits + // + One query on Rollup object + // No query on LookupChild__c because the changed Color__c should not be considered a change that would trigger the rollup to be processed + System.assertEquals(beforeQueries + 1, Limits.getQueries()); + + // + One row for Rollup object + // No rows on LookupChild__c because the changed Color__c should not be considered a change that would trigger the rollup to be processed + System.assertEquals(beforeRows + 1, Limits.getQueryRows()); + + // + Three rows for LookupChild__c (from the update statement itself) + // No query on LookupParent__c because the changed Color__c should not be considered a change that would trigger the rollup to be processed + System.assertEquals(beforeDMLRows + 3, Limits.getDMLRows()); + + // Assert rollups + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupServiceTest.cls-meta.xml b/rolluptool/src/classes/RollupServiceTest.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupServiceTest.cls-meta.xml +++ b/rolluptool/src/classes/RollupServiceTest.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupServiceTest2.cls b/rolluptool/src/classes/RollupServiceTest2.cls index 7ec7f7dd..13a1ba55 100644 --- a/rolluptool/src/classes/RollupServiceTest2.cls +++ b/rolluptool/src/classes/RollupServiceTest2.cls @@ -32,13 +32,13 @@ private with sharing class RollupServiceTest2 { static Schema.SObjectField ACCOUNT_SLA_EXPIRATION_DATE; static Schema.SObjectField ACCOUNT_NUMBER_OF_LOCATIONS; - static - { - // Dynamically resolve these fields, if they are not present when the test runs, the test will return as passed to avoid failures in subscriber org when packaged - Map accountFields = Schema.SObjectType.Account.fields.getMap(); - ACCOUNT_SLA_EXPIRATION_DATE = accountFields.get('SLAExpirationDate__c'); - ACCOUNT_NUMBER_OF_LOCATIONS = accountFields.get('NumberOfLocations__c'); - } + static + { + // Dynamically resolve these fields, if they are not present when the test runs, the test will return as passed to avoid failures in subscriber org when packaged + fflib_SObjectDescribe describe = fflib_SObjectDescribe.getDescribe(Account.SObjectType); + ACCOUNT_SLA_EXPIRATION_DATE = describe.getField('SLAExpirationDate__c'); + ACCOUNT_NUMBER_OF_LOCATIONS = describe.getField('NumberOfLocations__c'); + } private testmethod static void testMultiRollupBothScheduledWithConditions() { @@ -207,27 +207,34 @@ private with sharing class RollupServiceTest2 accountResult = Database.query('select AnnualRevenue, NumberOfLocations__c from Account where Id = :accountId'); System.assertEquals(expectedResultB, accountResult.get(ACCOUNT_NUMBER_OF_LOCATIONS)); } - + private testmethod static void testScheduleItemsAndLogs() { // Test supported? if(!TestContext.isSupported()) return; - + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); rollupSummary.Name = 'Test Rollup'; - rollupSummary.ParentObject__c = 'dlrs__LookupParent__c'; - rollupSummary.ChildObject__c = 'dlrs__LookupChild__c'; - rollupSummary.RelationShipField__c = 'dlrs__LookupParent__c'; - rollupSummary.FieldToAggregate__c = 'dlrs__Amount__c'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); - rollupSummary.AggregateResultField__c = 'dlrs__Total__c'; + rollupSummary.AggregateResultField__c = aggregateResultField; rollupSummary.Active__c = true; - rollupSummary.CalculationMode__c = 'Scheduled'; + rollupSummary.CalculationMode__c = 'Scheduled'; insert rollupSummary; - + // Insert parents - Schema.SObjectType parentType = Schema.getGlobalDescribe().get('dlrs__LookupParent__c'); SObject parentA = parentType.newSObject(); parentA.put('Name', 'ParentA'); SObject parentB = parentType.newSObject(); @@ -236,37 +243,36 @@ private with sharing class RollupServiceTest2 parentC.put('Name', 'ParentC'); List parents = new List { parentA, parentB, parentC }; insert parents; - + // Insert children - Schema.SObjectType childType = Schema.getGlobalDescribe().get('dlrs__LookupChild__c'); List children = new List(); - for(SObject parent : parents) + for(SObject parent : parents) { String name = (String) parent.get('Name'); SObject child1 = childType.newSObject(); - child1.put('dlrs__LookupParent__c', parent.Id); - child1.put('dlrs__Amount__c', 20); - children.add(child1); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); SObject child2 = childType.newSObject(); - child2.put('dlrs__LookupParent__c', parent.Id); - child2.put('dlrs__Amount__c', 20); - children.add(child2); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); if(name.equals('ParentA') || name.equals('ParentB')) { SObject child3 = childType.newSObject(); - child3.put('dlrs__LookupParent__c', parent.Id); - child3.put('dlrs__Amount__c', 2); - children.add(child3); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); } } insert children; - + // Assert scheduled items and log records System.assertEquals(3, [select id from LookupRollupSummaryScheduleItems__c].size()); System.assertEquals(0, [select id from LookupRollupSummaryLog__c].size()); - + // Run rollup job - Test.startTest(); + Test.startTest(); RollupService.runJobToProcessScheduledItems(); try { // Assert not able to run more than one scheduled job at a time @@ -274,40 +280,47 @@ private with sharing class RollupServiceTest2 System.assert(false, 'Expected exception'); } catch(Exception e) { System.assertEquals('A previous Declarative Rollup Summary scheduled job \'RollupJob\' is still running, this scheduled execution will not occur.', e.getMessage()); - } + } Test.stopTest(); // Assert the selector now reports the job is no longer running System.assertEquals(false, new AsyncApexJobsSelector().jobsExecuting(new Set { 'RollupJob' })); - + // Assert scheduled items and log records List logs = [select id, ParentId__c, ParentObject__c, ErrorMessage__c from LookupRollupSummaryLog__c]; System.assertEquals(parentC.Id, logs[0].ParentId__c); - System.assertEquals('dlrs__LookupParent__c', logs[0].ParentObject__c); + System.assertEquals(parentObjectName, logs[0].ParentObject__c); System.assertEquals(1, logs.size()); - System.assertEquals('The answer is not 42! : FIELD_CUSTOM_VALIDATION_EXCEPTION (dlrs__Total__c)', logs[0].ErrorMessage__c); + System.assertEquals('The answer is not 42! : FIELD_CUSTOM_VALIDATION_EXCEPTION (' + aggregateResultField + ')', logs[0].ErrorMessage__c); System.assertEquals(1, [select id from LookupRollupSummaryScheduleItems__c].size()); } - + private testmethod static void testScheduleItemsAndLogsCleanup() { // Test supported? if(!TestContext.isSupported()) return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); rollupSummary.Name = 'Test Rollup'; - rollupSummary.ParentObject__c = 'dlrs__LookupParent__c'; - rollupSummary.ChildObject__c = 'dlrs__LookupChild__c'; - rollupSummary.RelationShipField__c = 'dlrs__LookupParent__c'; - rollupSummary.FieldToAggregate__c = 'dlrs__Amount__c'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); - rollupSummary.AggregateResultField__c = 'dlrs__Total__c'; + rollupSummary.AggregateResultField__c = aggregateResultField; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Scheduled'; insert rollupSummary; // Insert parents - Schema.SObjectType parentType = Schema.getGlobalDescribe().get('dlrs__LookupParent__c'); SObject parentA = parentType.newSObject(); parentA.put('Name', 'ParentA'); SObject parentB = parentType.newSObject(); @@ -318,22 +331,21 @@ private with sharing class RollupServiceTest2 insert parents; // Insert children - Schema.SObjectType childType = Schema.getGlobalDescribe().get('dlrs__LookupChild__c'); List children = new List(); for(SObject parent : parents) { String name = (String) parent.get('Name'); SObject child1 = childType.newSObject(); - child1.put('dlrs__LookupParent__c', parent.Id); - child1.put('dlrs__Amount__c', 20); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); children.add(child1); SObject child2 = childType.newSObject(); - child2.put('dlrs__LookupParent__c', parent.Id); - child2.put('dlrs__Amount__c', 20); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); children.add(child2); SObject child3 = childType.newSObject(); - child3.put('dlrs__LookupParent__c', parent.Id); - child3.put('dlrs__Amount__c', 2); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); children.add(child3); } insert children; @@ -345,8 +357,8 @@ private with sharing class RollupServiceTest2 // Insert dummy log record for Parent C (emulate position left from above test) insert new LookupRollupSummaryLog__c( ParentId__c = parentC.id, - ParentObject__c = 'dlrs__LookupParent__c', - ErrorMessage__c = 'The answer is not 42! : FIELD_CUSTOM_VALIDATION_EXCEPTION (dlrs__Total__c)' + ParentObject__c = parentObjectName, + ErrorMessage__c = 'The answer is not 42! : FIELD_CUSTOM_VALIDATION_EXCEPTION (' + aggregateResultField + ')' ); // Run rollup job @@ -358,7 +370,80 @@ private with sharing class RollupServiceTest2 System.assertEquals(0, [select id, ParentId__c, ErrorMessage__c from LookupRollupSummaryLog__c].size()); System.assertEquals(0, [select id from LookupRollupSummaryScheduleItems__c].size()); } - + + private testmethod static void testScheduleItemsAndLogsCleanupDeletedParent() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Scheduled'; + insert rollupSummary; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + String name = (String) parent.get('Name'); + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); + } + insert children; + + // Assert scheduled items and log records + System.assertEquals(3, [select id from LookupRollupSummaryScheduleItems__c].size()); + System.assertEquals(0, [select id from LookupRollupSummaryLog__c].size()); + + // Delete a parent record (leaving log entries still to be processed) + delete parentA; + + // Run rollup job (schedule item row should be cleaned up for deleted parent record) + Test.startTest(); + RollupService.runJobToProcessScheduledItems(); + Test.stopTest(); + + // Assert scheduled items and log records are all gone! + System.assertEquals(0, [select id, ParentId__c, ErrorMessage__c from LookupRollupSummaryLog__c].size()); + System.assertEquals(0, [select id from LookupRollupSummaryScheduleItems__c].size()); + } + /** * Test to reproduce issue raised here, https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/11 **/ diff --git a/rolluptool/src/classes/RollupServiceTest2.cls-meta.xml b/rolluptool/src/classes/RollupServiceTest2.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupServiceTest2.cls-meta.xml +++ b/rolluptool/src/classes/RollupServiceTest2.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupServiceTest3.cls b/rolluptool/src/classes/RollupServiceTest3.cls index 55b53325..3202be46 100644 --- a/rolluptool/src/classes/RollupServiceTest3.cls +++ b/rolluptool/src/classes/RollupServiceTest3.cls @@ -32,22 +32,29 @@ private with sharing class RollupServiceTest3 { static Schema.SObjectField ACCOUNT_SLA_EXPIRATION_DATE; static Schema.SObjectField ACCOUNT_NUMBER_OF_LOCATIONS; - static - { - // Dynamically resolve these fields, if they are not present when the test runs, the test will return as passed to avoid failures in subscriber org when packaged - Map accountFields = Schema.SObjectType.Account.fields.getMap(); - ACCOUNT_SLA_EXPIRATION_DATE = accountFields.get('SLAExpirationDate__c'); - ACCOUNT_NUMBER_OF_LOCATIONS = accountFields.get('NumberOfLocations__c'); - } + static + { + // Dynamically resolve these fields, if they are not present when the test runs, the test will return as passed to avoid failures in subscriber org when packaged + fflib_SObjectDescribe describe = fflib_SObjectDescribe.getDescribe(Account.SObjectType); + ACCOUNT_SLA_EXPIRATION_DATE = describe.getField('SLAExpirationDate__c'); + ACCOUNT_NUMBER_OF_LOCATIONS = describe.getField('NumberOfLocations__c'); + } private testmethod static void testCalculateJob() { // Test supported? if(!TestContext.isSupported()) return; - + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + // Insert parents - Schema.SObjectType parentType = Schema.getGlobalDescribe().get('dlrs__LookupParent__c'); SObject parentA = parentType.newSObject(); parentA.put('Name', 'ParentA'); SObject parentB = parentType.newSObject(); @@ -56,86 +63,172 @@ private with sharing class RollupServiceTest3 parentC.put('Name', 'ParentC'); List parents = new List { parentA, parentB, parentC }; insert parents; - + // Insert children - Schema.SObjectType childType = Schema.getGlobalDescribe().get('dlrs__LookupChild__c'); List children = new List(); - for(SObject parent : parents) + for(SObject parent : parents) { String name = (String) parent.get('Name'); SObject child1 = childType.newSObject(); - child1.put('dlrs__LookupParent__c', parent.Id); - child1.put('dlrs__Amount__c', 20); - children.add(child1); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); SObject child2 = childType.newSObject(); - child2.put('dlrs__LookupParent__c', parent.Id); - child2.put('dlrs__Amount__c', 20); - children.add(child2); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); if(name.equals('ParentA') || name.equals('ParentB')) { SObject child3 = childType.newSObject(); - child3.put('dlrs__LookupParent__c', parent.Id); - child3.put('dlrs__Amount__c', 2); - children.add(child3); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); } } insert children; - // Create rollup AFTER the data exists + // Create rollup AFTER the data exists LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); rollupSummary.Name = 'Test Rollup'; - rollupSummary.ParentObject__c = 'dlrs__LookupParent__c'; - rollupSummary.ChildObject__c = 'dlrs__LookupChild__c'; - rollupSummary.RelationShipField__c = 'dlrs__LookupParent__c'; - rollupSummary.FieldToAggregate__c = 'dlrs__Amount__c'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); - rollupSummary.AggregateResultField__c = 'dlrs__Total__c'; + rollupSummary.AggregateResultField__c = aggregateResultField; rollupSummary.Active__c = true; - rollupSummary.CalculationMode__c = 'Scheduled'; + rollupSummary.CalculationMode__c = 'Scheduled'; insert rollupSummary; - + // Run rollup calculate job - Test.startTest(); + Test.startTest(); Id jobId = RollupService.runJobToCalculate(rollupSummary.Id); - rollupSummary = [select Id, CalculateJobId__c from LookupRollupSummary__c where Id = :rollupSummary.Id]; - System.assertEquals(jobId, rollupSummary.CalculateJobId__c); // Assert job id captured - try { + System.assertEquals(1, [select Id from LookupRollupCalculateJob__c].size()); + try { // Assert not possible to start another RollupService.runJobToCalculate(rollupSummary.Id); System.assert(false, 'Expected an exception'); } catch (Exception e) { - System.assert(e.getMessage().equals('A calculate job for rollup \'Test Rollup\' is already executing. If you suspect it is not aleady running try clearing the Calculate Job Id field and try again.')); - } + System.assert(e.getMessage().equals('A calculate job for rollup \'Test Rollup\' is already executing. If you suspect it is not aleady running try clearing the applicable record from the Lookup Rollup Calculate Jobs tab and try again.')); + } Test.stopTest(); // Assert job id cleared - rollupSummary = [select Id, CalculateJobId__c from LookupRollupSummary__c where Id = :rollupSummary.Id]; - System.assertEquals(null, rollupSummary.CalculateJobId__c); + rollupSummary = [select Id, CalculateJobId__c from LookupRollupSummary__c where Id = :rollupSummary.Id]; + System.assertEquals(jobId, rollupSummary.CalculateJobId__c); + // Assert job cleared + System.assertEquals(0, [select Id from LookupRollupCalculateJob__c].size()); - // This should not generate any schedule items + // This should not generate any schedule items System.assertEquals(0, [select id from LookupRollupSummaryScheduleItems__c].size()); - - // Assert rollups - Map assertParents = new Map(Database.query('select id, dlrs__Total__c from dlrs__LookupParent__c')); - System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get('dlrs__Total__c')); - System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get('dlrs__Total__c')); - System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get('dlrs__Total__c')); - + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + // Assert scheduled items and log records List logs = [select id, ParentId__c, ParentObject__c, ErrorMessage__c from LookupRollupSummaryLog__c]; System.assertEquals(parentC.Id, logs[0].ParentId__c); - System.assertEquals('dlrs__LookupParent__c', logs[0].ParentObject__c); + System.assertEquals(parentObjectName, logs[0].ParentObject__c); System.assertEquals(1, logs.size()); - System.assertEquals('The answer is not 42! : FIELD_CUSTOM_VALIDATION_EXCEPTION (dlrs__Total__c)', logs[0].ErrorMessage__c); + System.assertEquals('The answer is not 42! : FIELD_CUSTOM_VALIDATION_EXCEPTION (' + aggregateResultField + ')', logs[0].ErrorMessage__c); + } + + private testmethod static void testFilteredCalculateJob() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + String name = (String) parent.get('Name'); + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); + if(name.equals('ParentA') || name.equals('ParentB')) + { + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); + } + } + insert children; + + // Create rollup AFTER the data exists + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Scheduled'; + insert rollupSummary; + + // Run rollup calculate job with WHERE clause + Test.startTest(); + Id jobId = RollupService.runJobToCalculate(rollupSummary.Id, 'Name = \'ParentB\''); + Test.stopTest(); + + // This should not generate any schedule items + System.assertEquals(0, [select id from LookupRollupSummaryScheduleItems__c].size()); + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // Assert scheduled items and log records + List logs = [select id, ParentId__c, ParentObject__c, ErrorMessage__c from LookupRollupSummaryLog__c]; + System.assertEquals(0, logs.size()); } private testmethod static void testCalculateJobNotActive() - { + { // Test supported? if(!TestContext.isSupported()) return; - + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + // Insert parents - Schema.SObjectType parentType = Schema.getGlobalDescribe().get('dlrs__LookupParent__c'); SObject parentA = parentType.newSObject(); parentA.put('Name', 'ParentA'); SObject parentB = parentType.newSObject(); @@ -144,77 +237,173 @@ private with sharing class RollupServiceTest3 parentC.put('Name', 'ParentC'); List parents = new List { parentA, parentB, parentC }; insert parents; - + // Insert children - Schema.SObjectType childType = Schema.getGlobalDescribe().get('dlrs__LookupChild__c'); List children = new List(); - for(SObject parent : parents) + for(SObject parent : parents) { String name = (String) parent.get('Name'); SObject child1 = childType.newSObject(); - child1.put('dlrs__LookupParent__c', parent.Id); - child1.put('dlrs__Amount__c', 20); - children.add(child1); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); SObject child2 = childType.newSObject(); - child2.put('dlrs__LookupParent__c', parent.Id); - child2.put('dlrs__Amount__c', 20); - children.add(child2); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); if(name.equals('ParentA') || name.equals('ParentB')) { SObject child3 = childType.newSObject(); - child3.put('dlrs__LookupParent__c', parent.Id); - child3.put('dlrs__Amount__c', 2); - children.add(child3); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); } } insert children; - // Create rollup AFTER the data exists + // Create rollup AFTER the data exists LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); rollupSummary.Name = 'Test Rollup'; - rollupSummary.ParentObject__c = 'dlrs__LookupParent__c'; - rollupSummary.ChildObject__c = 'dlrs__LookupChild__c'; - rollupSummary.RelationShipField__c = 'dlrs__LookupParent__c'; - rollupSummary.FieldToAggregate__c = 'dlrs__Amount__c'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); - rollupSummary.AggregateResultField__c = 'dlrs__Total__c'; + rollupSummary.AggregateResultField__c = aggregateResultField; rollupSummary.Active__c = false; - rollupSummary.CalculationMode__c = 'Scheduled'; + rollupSummary.CalculationMode__c = 'Realtime'; insert rollupSummary; - + // Run rollup calculate job - Test.startTest(); - try { + Test.startTest(); + try { // Assert not possible to start another RollupService.runJobToCalculate(rollupSummary.Id); System.assert(false, 'Expected an exception'); } catch (Exception e) { System.assert(e.getMessage().equals('The rollup must be Active before you can run a Calculate job.')); - } + } Test.stopTest(); } - + + private testmethod static void testScheduleCalculateJob() { + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + String name = (String) parent.get('Name'); + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); + if(name.equals('ParentA') || name.equals('ParentB')) + { + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); + } + } + insert children; + + // Create rollup AFTER the data exists + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Scheduled'; + insert rollupSummary; + + ApexPages.StandardController standardController = new ApexPages.StandardController(rollupSummary); + RollupScheduledCalculateController controller = new RollupScheduledCalculateController(standardController); + + Test.startTest(); + controller.scheduleCalculateJob(); + //attempt to schedule a second job + Boolean exceptionCaught = false; + String jobName = 'rollup_' + String.valueOf(rollupSummary.Id).substring(0,15); + try{ + System.schedule('rollup_'+standardController.getId(), '0 0 2 * * ?', new RollupCalculateJobSchedulable(standardController.getId(), controller.masterObjectWhere)); + } catch (AsyncException ex) { + exceptionCaught = true; + System.assertEquals(ex.getMessage(), 'The Apex job named "'+jobName+'" is already scheduled for execution.'); + } + + System.assert(exceptionCaught); + + CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime, CronJobDetail.Name FROM CronTrigger WHERE CronJobDetail.Name = :jobName]; + //assert our job is scheduled for 2am + System.assertEquals('0 0 2 * * ?', ct.CronExpression); + DateTime nextFiretime = ct.NextFireTime; + System.assertEquals(2, nextFiretime.hour()); + //assert our job has never fired + System.assertEquals(0, ct.TimesTriggered); + Test.stopTest(); + + //RollupCalculateJob does not execute until after Test.stopTest(); + //we cannot assert anything about the rollup job itself, only that we queued it. + //see http://salesforce.stackexchange.com/a/36884/11152 + System.assert([SELECT Count() FROM AsyncApexJob WHERE ApexClass.Name = 'RollupCalculateJobSchedulable'] > 0); + } + private testmethod static void testDeveloperAPI() - { + { // Test supported? if(!TestContext.isSupported()) return; - - // Create rollup + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + + // Create rollup LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); rollupSummary.Name = 'Test Rollup'; - rollupSummary.ParentObject__c = 'dlrs__LookupParent__c'; - rollupSummary.ChildObject__c = 'dlrs__LookupChild__c'; - rollupSummary.RelationShipField__c = 'dlrs__LookupParent__c'; - rollupSummary.FieldToAggregate__c = 'dlrs__Amount__c'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); - rollupSummary.AggregateResultField__c = 'dlrs__Total__c'; + rollupSummary.AggregateResultField__c = aggregateResultField; rollupSummary.Active__c = true; - rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Developer.name(); + rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Developer.name(); insert rollupSummary; - + // Insert parents - Schema.SObjectType parentType = Schema.getGlobalDescribe().get('dlrs__LookupParent__c'); SObject parentA = parentType.newSObject(); parentA.put('Name', 'ParentA'); SObject parentB = parentType.newSObject(); @@ -223,55 +412,53 @@ private with sharing class RollupServiceTest3 parentC.put('Name', 'ParentC'); List parents = new List { parentA, parentB, parentC }; insert parents; - + // Insert children - Schema.SObjectType childType = Schema.getGlobalDescribe().get('dlrs__LookupChild__c'); List children = new List(); - for(SObject parent : parents) + for(SObject parent : parents) { String name = (String) parent.get('Name'); SObject child1 = childType.newSObject(); - child1.put('dlrs__LookupParent__c', parent.Id); - child1.put('dlrs__Amount__c', 20); - children.add(child1); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); SObject child2 = childType.newSObject(); - child2.put('dlrs__LookupParent__c', parent.Id); - child2.put('dlrs__Amount__c', 20); - children.add(child2); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); if(name.equals('ParentA') || name.equals('ParentB')) { SObject child3 = childType.newSObject(); - child3.put('dlrs__LookupParent__c', parent.Id); - child3.put('dlrs__Amount__c', 2); - children.add(child3); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); } } insert children; - - // Assert nothing has changed on db - Map assertParents = new Map(Database.query('select id, dlrs__Total__c from dlrs__LookupParent__c')); - System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get('dlrs__Total__c')); - System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get('dlrs__Total__c')); - System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get('dlrs__Total__c')); - + + // Assert nothing has changed on db + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + // Call developer API List masterRecords = RollupService.rollup(children); - // Assert nothing has changed on db - assertParents = new Map(Database.query('select id, dlrs__Total__c from dlrs__LookupParent__c')); - System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get('dlrs__Total__c')); - System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get('dlrs__Total__c')); - System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get('dlrs__Total__c')); - + // Assert nothing has changed on db + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + // Assert rollups produced assertParents = new Map(masterRecords); - System.assertEquals(3, masterRecords.size()); - System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get('dlrs__Total__c')); - System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get('dlrs__Total__c')); - System.assertEquals(40, (Decimal) assertParents.get(parentC.id).get('dlrs__Total__c')); - } - - + System.assertEquals(3, masterRecords.size()); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(40, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + } + /** * https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/23 */ @@ -322,6 +509,7 @@ private with sharing class RollupServiceTest3 /** * https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/23 */ + private testmethod static void testDateRollupInsertConditionalChild() { // Test supported? @@ -371,59 +559,694 @@ private with sharing class RollupServiceTest3 // Test supported? if(!TestContext.isSupported()) return; - + + // Abort if the sharing model does not support this test (some older orgs who have upgraded won't have this) + SObjectType sharingType = Schema.getGlobalDescribe().get(Utilities.objectPrefix()+'LookupChild__Share'); + if(sharingType==null) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + // Configure rollup LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); rollupSummary.Name = 'Test Rollup'; - rollupSummary.ParentObject__c = 'dlrs__LookupParent__c'; - rollupSummary.ChildObject__c = 'dlrs__LookupChild__c'; - rollupSummary.RelationShipField__c = 'dlrs__LookupParent__c'; - rollupSummary.FieldToAggregate__c = 'dlrs__Amount__c'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); - rollupSummary.AggregateResultField__c = 'dlrs__Total__c'; + rollupSummary.AggregateResultField__c = aggregateResultField; rollupSummary.Active__c = true; - rollupSummary.CalculationMode__c = 'Realtime'; + rollupSummary.CalculationMode__c = 'Realtime'; insert rollupSummary; - + // Insert parents - Schema.SObjectType parentType = Schema.getGlobalDescribe().get('dlrs__LookupParent__c'); SObject parentA = parentType.newSObject(); parentA.put('Name', 'ParentA'); insert parentA; - + // Insert children - Schema.SObjectType childType = Schema.getGlobalDescribe().get('dlrs__LookupChild__c'); SObject child1 = childType.newSObject(); - child1.put('dlrs__LookupParent__c', parentA.Id); + child1.put(relationshipField, parentA.Id); insert child1; - - // Assert rollup - Map assertParents = new Map(Database.query('select id, dlrs__Total__c from dlrs__LookupParent__c')); - System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get('dlrs__Total__c')); - + + // Assert rollup + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + // Create test user User testUser = null; System.runAs ( new User(Id = UserInfo.getUserId()) ) { - testUser = createUser(); + testUser = createUser(); } - + + // Grant access to the child record since it is using private sharing model + SObject childSharing = sharingType.newSObject(); + childSharing.put('AccessLevel', 'Edit'); + childSharing.put('ParentId', child1.Id); + childSharing.put('UserOrGroupId', testUser.Id); + insert childSharing; + // Test data insert children as new user (who cannot see the parent) System.runAs(testUser) { // Ensure this user can read it (the Sharing setting for LookupParent__c is Public Read Only) - assertParents = new Map(Database.query('select id, dlrs__Total__c from dlrs__LookupParent__c')); - System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get('dlrs__Total__c')); - + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + // Attempt to indirectly via rollup trigger to update parent record - child1.put('dlrs__Amount__c', 42); + child1.put(aggregateField, 42); update child1; } - + // Assert rollup - assertParents = new Map(Database.query('select id, dlrs__Total__c from dlrs__LookupParent__c')); - System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get('dlrs__Total__c')); + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); } - + + /** + * Test simulation of isInsert + */ + private testmethod static void testDeveloperTriggerLikeAPI_SingleSumInserted() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + + // Create rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Developer.name(); + insert rollupSummary; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); + } + insert children; + + // Assert nothing has changed on db + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeQueryRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // Call developer 'trigger like' API + RollupService.rollup(null, new Map(children), childType); + + // Assert no further limits have been used since the field to aggregate on the detail has not changed + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + // + One row for Rollup object + // + Nine rows for LookupChild__c for rollup + System.assertEquals(beforeQueryRows + 10, Limits.getQueryRows()); + // + Three rows for LookupParent__c for rollup target + System.assertEquals(beforeDMLRows + 3, Limits.getDMLRows()); + + // Assert parents are updated + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(3, assertParents.size()); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + } + + /** + * Test simulation of isUpdate with no field changes + */ + private testmethod static void testDeveloperTriggerLikeAPI_SingleSumUpdatedFieldDoesNotChange() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + + // Create rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Developer.name(); + insert rollupSummary; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); + } + insert children; + + // Assert nothing has changed on db + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeQueryRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // Call developer 'trigger like' API + // No changes to the field being aggregted, thus no rollup processing should occur + RollupService.rollup(new Map(children), new Map(children), childType); + + // Assert no further limits have been used since the field to aggregate on the detail has not changed + System.assertEquals(beforeQueries + 1, Limits.getQueries()); // Only tolerate a query for the Lookup definition + System.assertEquals(beforeQueryRows + 1, Limits.getQueryRows()); // Only tolerate a row for the Lookup definition + System.assertEquals(beforeDMLRows, Limits.getDMLRows()); // No changes so no record should be operated against + + // Assert parents are updated + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(3, assertParents.size()); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + } + + /** + * Test simulation of isUpdate with field changes + */ + private testmethod static void testDeveloperTriggerLikeAPI_SingleSumUpdatedFieldDoesChange() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + + // Create rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Developer.name(); + insert rollupSummary; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 0); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 0); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 0); + children.add(child3); + } + insert children; + + // Assert nothing has changed on db + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // update the children + List modifiedChildren = Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateField, relationshipField, childObjectName })); + System.assertEquals(9, modifiedChildren.size()); + for (SObject child :modifiedChildren) + { + // do not update ParentC children so we can simulate + // only updated records being processed, non-changed records being ignored + // and assert governor limits to confirm + if (child.get(relationshipField) != parentC.Id) + { + child.put(aggregateField, 14); + } + } + update modifiedChildren; + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeQueryRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // Call developer 'trigger like' API simulating an update + RollupService.rollup(new Map(children), new Map(modifiedChildren), childType); + + // Assert no further limits have been used since the field to aggregate on the detail has not changed + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + // + One row for Rollup object + // + Six rows for LookupChild__c for rollup for Parent A & Parent B + System.assertEquals(beforeQueryRows + 7, Limits.getQueryRows()); + // + Two rows for LookupParent__c for rollup target for Parent A & Parent B + System.assertEquals(beforeDMLRows + 2, Limits.getDMLRows()); + + // Assert parents are updated + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(3, assertParents.size()); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + } + + /** + * Test simulation of combination of isInsert and isUpdate but updates do not effect rollups + */ + private testmethod static void testDeveloperTriggerLikeAPI_SingleSumInsertedWithExistingThatDoNotChange() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + + // Create rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Developer.name(); + insert rollupSummary; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); + } + insert children; + + // Assert nothing has changed on db + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // insert a new child + List newChildren = new List(); + for(SObject parent : parents) + { + // do not create new child for ParentC so we can simulate + // only inserted records being processed, non-changed records being ignored + // and assert governor limits to confirm + String name = (String) parent.get('Name'); + if(!name.equals('ParentC')) + { + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + newChildren.add(child3); + } + } + insert newChildren; + + // Assert nothing has changed on db + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // combine the new and old + List newAndOldChildren = children.clone(); + newAndOldChildren.addAll(newChildren); + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeQueryRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // Call developer 'trigger like' API simulating an update + RollupService.rollup(new Map(children), new Map(newAndOldChildren), childType); + + // Assert no further limits have been used since the field to aggregate on the detail has not changed + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + // + One row for Rollup object + // + Six rows for LookupChild__c for rollup for Parent A & Parent B + System.assertEquals(beforeQueryRows + 7, Limits.getQueryRows()); + // + Two rows for LookupParent__c for rollup target for Parent A & Parent B + System.assertEquals(beforeDMLRows + 2, Limits.getDMLRows()); + + // Assert parents are updated + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(3, assertParents.size()); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + } + + /** + * Test simulation of isDelete + */ + private testmethod static void testDeveloperTriggerLikeAPI_SingleSumDeleted() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + Integer child1Amount = 42; + Integer child2Amount = 1; + + // Create rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Developer.name(); + insert rollupSummary; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + String name = (String) parent.get('Name'); + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, child1Amount); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, child2Amount); + children.add(child2); + } + insert children; + + // Assert nothing has changed on db + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // delete existing child that have specified aggregateField value leaving a total to rollup of expected + List deletedChildren = Database.query(String.format('select id, {0}, {1} from {2} WHERE {0} = {3}', new List{ aggregateField, relationshipField, childObjectName, String.valueOf(child2Amount) })); + System.assertEquals(3, deletedChildren.size()); + delete deletedChildren; + + // Assert nothing has changed on db + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeQueryRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // Call developer 'trigger like' API simulating a delete + RollupService.rollup(new Map(deletedChildren), null, childType); + + // Assert no further limits have been used since the field to aggregate on the detail has not changed + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + // + One row for Rollup object + // + Three rows for LookupChild__c + System.assertEquals(beforeQueryRows + 4, Limits.getQueryRows()); + // + Three rows for LookupParent__c + System.assertEquals(beforeDMLRows + 3, Limits.getDMLRows()); + + // Assert parents are updated + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(3, assertParents.size()); + System.assertEquals(child1Amount, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(child1Amount, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(child1Amount, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + } + + /** + * Test simulation of isUndelete + */ + private testmethod static void testDeveloperTriggerLikeAPI_SingleSumUndeleted() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total__c.getDescribe().getName(); + Integer child1Amount = 40; + Integer child2Amount = 2; + Integer expectedAmount = 42; + + // Create rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Developer.name(); + insert rollupSummary; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + String name = (String) parent.get('Name'); + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, child1Amount); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, child2Amount); + children.add(child2); + } + insert children; + + // Assert nothing has changed on db + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // delete existing children that have specified aggregateField value + List childrenToDelete = Database.query(String.format('select id, {0}, {1} from {2} WHERE {0} = {3}', new List{ aggregateField, relationshipField, childObjectName, String.valueOf(child2Amount) })); + System.assertEquals(3, childrenToDelete.size()); + delete childrenToDelete; + + // Assert nothing has changed on db + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // assert remaining children + List remainingChildren = Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateField, relationshipField, childObjectName })); + System.assertEquals(3, remainingChildren.size()); + + // retrieve children to undelete + List childrenToUndelete = Database.query(String.format('select id, {0}, {1} from {2} WHERE IsDeleted = true ALL ROWS', new List{ aggregateField, relationshipField, childObjectName })); + System.assertEquals(3, childrenToUndelete.size()); + undelete childrenToUndelete; + + // Assert nothing has changed on db + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(null, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(null, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeQueryRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // Call developer 'trigger like' API simulating a undelete + RollupService.rollup(null, new Map(childrenToUndelete), childType); + + // Assert no further limits have been used since the field to aggregate on the detail has not changed + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + // + One row for Rollup object + // + Six rows for LookupChild__c + System.assertEquals(beforeQueryRows + 7, Limits.getQueryRows()); + // + Three rows for LookupParent__c + System.assertEquals(beforeDMLRows + 3, Limits.getDMLRows()); + + // Assert parents are updated + assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(3, assertParents.size()); + System.assertEquals(expectedAmount, (Decimal) assertParents.get(parentA.id).get(aggregateResultField)); + System.assertEquals(expectedAmount, (Decimal) assertParents.get(parentB.id).get(aggregateResultField)); + System.assertEquals(expectedAmount, (Decimal) assertParents.get(parentC.id).get(aggregateResultField)); + } + /** * Create test user **/ @@ -441,11 +1264,11 @@ private with sharing class RollupServiceTest3 insert testUser; // Assign permission sets - Set psNames = new Set { 'LookupRollupSummariesFull', 'LookupRollupSummariesTest' }; + Set psNames = new Set { 'LookupRollupSummariesFull' }; List ps = [select Id from PermissionSet where Name in :psNames]; insert new List { - new PermissionSetAssignment(AssigneeId = testUser.Id, PermissionSetId = ps[0].Id), - new PermissionSetAssignment(AssigneeId = testUser.Id, PermissionSetId = ps[1].Id) }; + new PermissionSetAssignment(AssigneeId = testUser.Id, PermissionSetId = ps[0].Id) + }; } catch (Exception e) { return null; } diff --git a/rolluptool/src/classes/RollupServiceTest3.cls-meta.xml b/rolluptool/src/classes/RollupServiceTest3.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupServiceTest3.cls-meta.xml +++ b/rolluptool/src/classes/RollupServiceTest3.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupServiceTest4.cls b/rolluptool/src/classes/RollupServiceTest4.cls new file mode 100644 index 00000000..1f5e0c37 --- /dev/null +++ b/rolluptool/src/classes/RollupServiceTest4.cls @@ -0,0 +1,2002 @@ +/** + * Copyright (c) 2013, Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@IsTest +private class RollupServiceTest4 { + + private testmethod static void testDefaultUserSharingRollup() { + testSharingMode(10, 10, null); + } + + private testmethod static void testUserUserSharingRollup() { + testSharingMode(10, 10, 'User'); + } + + private testmethod static void testSystemUserSharingRollup() { + testSharingMode(10, 20, 'System'); + } + + private static void testSharingMode(Decimal expectedValue1, Decimal expectedValue2, String sharingMode) { + + // Create test user A + User testUserA = null; + System.runAs ( new User(Id = UserInfo.getUserId()) ) { + testUserA = createUser(1); + } + + // Create test user B + User testUserB = null; + System.runAs ( new User(Id = UserInfo.getUserId()) ) { + testUserB = createUser(2); + } + + // Rollup from child LookupChildAReallyReallyReallyBigBigName__c (set to private sharing) + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Total2__c.getDescribe().getName(); + + // Configure rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = parentObjectName; + rollupSummary.ChildObject__c = childObjectName; + rollupSummary.RelationShipField__c = relationshipField; + rollupSummary.FieldToAggregate__c = aggregateField; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummary.AggregateResultField__c = aggregateResultField; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + rollupSummary.CalculationSharingMode__c = sharingMode; + insert rollupSummary; + + // User A inserts parent and some children + Id parentId = null; + System.runAs(testUserA) + { + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + parentA.put(LookupParent__c.Total__c.getDescribe().getName(), 42); + insert parentA; + parentId = parentA.Id; + // Insert children + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parentId); + child1.put(aggregateField, 10); + insert child1; + // Assert rollup + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(expectedValue1, (Decimal) assertParents.get(parentId).get(aggregateResultField)); + } + + // User B inserts some children of its own + System.runAs(testUserB) + { + // Insert children + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parentId); + child1.put(aggregateField, 10); + insert child1; + // Assert rollup + Map assertParents = new Map(Database.query(String.format('select id, {0} from {1}', new List{ aggregateResultField, parentObjectName }))); + System.assertEquals(expectedValue2, (Decimal) assertParents.get(parentId).get(aggregateResultField)); + } + } + + /** + * Create test user + **/ + private static User createUser(Integer seed) + { + // Can only proceed with test if we have a suitable profile + List testProfiles = [Select Id From Profile where Name='Standard User' limit 1]; + if(testProfiles.size()!=1) + return null; + + // Can only proceed with test if we can successfully insert a test user + String testUsername = seed + '@testorg.com'; + User testUser = new User(Alias = 'test1', Email='testuser1@testorg.com', EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', LocaleSidKey='en_US', ProfileId = testProfiles[0].Id, TimeZoneSidKey='America/Los_Angeles', UserName=testUsername); + try { + insert testUser; + + // Assign permission sets + Set psNames = new Set { 'LookupRollupSummariesReadOnly' }; + List ps = [select Id from PermissionSet where Name in :psNames]; + insert new List { + new PermissionSetAssignment(AssigneeId = testUser.Id, PermissionSetId = ps[0].Id) + }; + } catch (Exception e) { + return null; + } + return testUser; + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/229 + * Two identical Aggregate (Sum) rollups + * - Effective values for all fields except for AggregateResultField__c are same + * - Field values differ by case only + * - Field value of RelationShipCriteria__c is identical including case + * only by case used for rollups summary field values except RelationShipCriteria__c which are identical including case + * Should result in a single context used, a single SOQL for the rollup itself and 3 DML rows (1 for each parent) + **/ + private testmethod static void testLimitsAndContextsUsedMultipleAggregateRollupsDifferByCaseOnlySameCriteriaSameCase() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Total__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Amount__c > 1'; + String relationshipCriteriaFields = 'Amount__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = LookupChild__c.Amount__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition; + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryA.FieldToAggregate__c = aggregateField.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField; + rollupSummaryB.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + Two rows for Rollup object + // + Nine rows for LookupChild__c + System.assertEquals(beforeRows + 11, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the update statement itself) + // + Three rows for LookupParent__c (from rollup processing) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/229 + * Two identical Aggregate (Sum) rollups + * - Effective values for all fields except AggregateResultField__c are same + * - Field values differ only by case + * - Field value of RelationShipCriteria__c differs by case + * Should result in Two (2) contexts used, two SOQL for the rollup itself and 3 DML rows (1 for each + * parent - DLRS combines updates to identical master record ids) + **/ + private testmethod static void testLimitsAndContextsUsedMultipleAggregateRollupsDifferByCaseOnlySameCriteriaDiffCase() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Total__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Amount__c > 1'; + String relationshipCriteriaFields = 'Amount__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = LookupChild__c.Amount__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition.toLowerCase(); + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields.toLowerCase(); + rollupSummaryA.FieldToAggregate__c = aggregateField.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField; + rollupSummaryB.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Sum.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 20); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 20); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 2); + children.add(child3); + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup A + // + One query on LookupChild__c for rollup B + System.assertEquals(beforeQueries + 3, Limits.getQueries()); + + // + Two rows for Rollup object + // + Nine rows for LookupChild__c for rollup A + // + Nine rows for LookupChild__c for rollup B + System.assertEquals(beforeRows + 20, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the update statement itself) + // + Three rows for LookupParent__c for rollup A & B (DLRS combined updates to identical master ids) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/229 + * Two identical Query (Last) rollups + * - Effective values for all fields except for AggregateResultField__c are same + * - Field values differ by case only + * - Field value of RelationShipCriteria__c is identical including case + * only by case used for rollups summary field values except RelationShipCriteria__c which are identical including case + * Should result in a single context used, a single SOQL for the rollup itself and 3 DML rows (1 for each parent) + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsDifferByCaseOnlySameCriteriaSameCase() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Total__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Amount__c > 1'; + String relationshipCriteriaFields = 'Amount__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = LookupChild__c.Amount__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition; + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryA.FieldToAggregate__c = aggregateField.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField; + rollupSummaryB.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 42); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 10); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 10); + children.add(child3); + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + Two rows for Rollup object + // + Nine rows for LookupChild__c + System.assertEquals(beforeRows + 11, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the update statement itself) + // + Three rows for LookupParent__c (from rollup processing) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/229 + * Two identical Query (Last) rollups + * - Effective values for all fields except AggregateResultField__c are same + * - Field values differ only by case + * - Field value of RelationShipCriteria__c differs by case + * Should result in Two (2) contexts used, two SOQL for the rollup itself and 3 DML rows (1 for each + * parent - DLRS combines updates to identical master record ids) + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsDifferByCaseOnlySameCriteriaDiffCase() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Total__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Amount__c > 1'; + String relationshipCriteriaFields = 'Amount__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = LookupChild__c.Amount__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition.toLowerCase(); + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields.toLowerCase(); + rollupSummaryA.FieldToAggregate__c = aggregateField.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField; + rollupSummaryB.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField, 42); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField, 10); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField, 10); + children.add(child3); + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup A + // + One query on LookupChild__c for rollup B + System.assertEquals(beforeQueries + 3, Limits.getQueries()); + + // + Two rows for Rollup object + // + Nine rows for LookupChild__c for rollup A + // + Nine rows for LookupChild__c for rollup B + System.assertEquals(beforeRows + 20, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the update statement itself) + // + Three rows for LookupParent__c for rollup A & B (DLRS combined updates to identical master ids) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/229 + * Two similar rollups + * - Different AggregateOperation__c (both use Query rollup - First/Last) + * - Different AggregateResultField__c + * - Different FieldToAggregate__c + * - Field value of RelationShipCriteria__c is identical including case + * - Effective values for all other fields same differing only by case used + * Should result in a single context used, a single SOQL for the rollup itself and 3 DML rows (1 for each parent) + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsDifferByOperationFieldAndCaseSameCriteriaSameCase() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField1 = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateField2 = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Colours__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Amount__c > 1'; + String relationshipCriteriaFields = 'Amount__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = LookupChild__c.Amount__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition; + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryA.FieldToAggregate__c = aggregateField1.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField2; + rollupSummaryB.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField1, 'Red'); + child1.put(aggregateField2, 42); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField1, 'Yellow'); + child2.put(aggregateField2, 15); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField1, 'Blue'); + child3.put(aggregateField2, 10); + children.add(child3); + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + Two rows for Rollup object + // + Nine rows for LookupChild__c + System.assertEquals(beforeRows + 11, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the update statement itself) + // + Three rows for LookupParent__c (from rollup processing) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals('Blue', (String) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals('Blue', (String) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals('Blue', (String) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/229 + * Two similar rollups + * - Different AggregateOperation__c (both use Query rollup - First/Last) + * - Different AggregateResultField__c + * - Different FieldToAggregate__c + * - Field value of RelationShipCriteria__c differs by case + * - Effective values for all other fields same differing only by case used + * Should result in Two (2) contexts used, two SOQL for the rollup itself and 3 DML rows (1 for each + * parent - DLRS combines updates to identical master record ids) + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsDifferByOperationFieldAndCaseSameCriteriaDiffCase() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField1 = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateField2 = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Colours__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Amount__c > 1'; + String relationshipCriteriaFields = 'Amount__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = LookupChild__c.Amount__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition.toLowerCase(); + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields.toLowerCase(); + rollupSummaryA.FieldToAggregate__c = aggregateField1.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField2; + rollupSummaryB.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField1, 'Red'); + child1.put(aggregateField2, 42); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField1, 'Yellow'); + child2.put(aggregateField2, 15); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField1, 'Blue'); + child3.put(aggregateField2, 10); + children.add(child3); + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup A + // + One query on LookupChild__c for rollup B + System.assertEquals(beforeQueries + 3, Limits.getQueries()); + + // + Two rows for Rollup object + // + Nine rows for LookupChild__c for rollup A + // + Nine rows for LookupChild__c for rollup B + System.assertEquals(beforeRows + 20, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the update statement itself) + // + Three rows for LookupParent__c for rollup A & B (DLRS combined updates to identical master ids) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals('Blue', (String) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals('Blue', (String) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals('Blue', (String) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/229 + * Two similar rollups differing by: + * - Different AggregateOperation__c (both use Query rollup - First/Last) + * - Different AggregateResultField__c + * - Different Order By + * - Effective values for all other fields same differing only by case used + * Should result in Two (2) contexts used, two SOQL for the rollup itself and 3 DML rows (1 for each + * parent - DLRS combines updates to identical master record ids) + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsDifferByOperationFieldCaseOrderBy() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField1 = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateField2 = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Colours__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Amount__c > 1'; + String relationshipCriteriaFields = 'Amount__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy1 = LookupChild__c.Amount__c.getDescribe().getName(); + String fieldToOrderBy2 = LookupChild__c.Name.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition; + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryA.FieldToAggregate__c = aggregateField1.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy1.toLowerCase(); + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField2; + rollupSummaryB.FieldToOrderBy__c = fieldToOrderBy2; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField1, 'Red'); + child1.put(aggregateField2, 42); + child1.put('Name', 'ChildZ'); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField1, 'Yellow'); + child2.put(aggregateField2, 15); + child1.put('Name', 'ChildY'); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField1, 'Blue'); + child3.put(aggregateField2, 10); + child1.put('Name', 'ChildX'); + children.add(child3); + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup A + // + One query on LookupChild__c for rollup B + System.assertEquals(beforeQueries + 3, Limits.getQueries()); + + // + Two rows for Rollup object + // + Nine rows for LookupChild__c for rollup A + // + Nine rows for LookupChild__c for rollup B + System.assertEquals(beforeRows + 20, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the update statement itself) + // + Three rows for LookupParent__c for rollup A & B (DLRS combined updates to identical master ids) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals('Blue', (String) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals('Blue', (String) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals('Blue', (String) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/239 + * Two similar rollups differing by: + * - Different AggregateOperation__c (both use Query rollup - First/Last) + * - Different AggregateResultField__c + * - Different FieldToAggregate__c + * - Different Order By one that has no order by specified + * - Effective values for all other fields same differing only by case used + * Should result in One (1) context used, one SOQL for the rollup itself and 3 DML rows (1 for each + * parent - DLRS combines updates to identical master record ids) + * + * The Context will be shared because the rollup that doesn't have an orderby (Rollup B) matches all other criteria + * on the other rollup (Rollup A) and therefore its added to Context for that rollup + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsDifferByOperationAggResultFieldAggFieldCaseOrderByOneOrderByIsNull() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField1 = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateField2 = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Colours__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Amount__c > 1'; + String relationshipCriteriaFields = 'Amount__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = LookupChild__c.Amount__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition; + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryA.FieldToAggregate__c = aggregateField1.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField2; + rollupSummaryB.FieldToOrderBy__c = null; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField1, 'Red'); + child1.put(aggregateField2, 42); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField1, 'Yellow'); + child2.put(aggregateField2, 15); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField1, 'Blue'); + child3.put(aggregateField2, 10); + children.add(child3); + } + + // Sample various limits prior to an insert + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // insert child records + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup A & B (single query because orderby matches even though one is not specified) + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + Two rows for Rollup object + // + Nine rows for LookupChild__c for rollup A + System.assertEquals(beforeRows + 11, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the insert statement itself) + // + Three rows for LookupParent__c for rollup A & B (DLRS combined updates to identical master ids) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + // Note that we are able to reliably assert rollup B even though it does not + // have orderby specified because it will end up using the same context as Rollup A because Rollup B's FieldToAggregate__c + // matches the first field in the orderby of Rollup A + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals('Blue', (String) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals('Blue', (String) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals('Blue', (String) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/239 + * Three similar rollups differing by: + * - Different AggregateOperation__c (both use Query rollup - First/Last) + * - Different AggregateResultField__c + * - Different FieldToAggregate__c + * - Different Order By two that have no order by specified + * - Effective values for all other fields same differing only by case used + * Should result in One (1) context used, one SOQL for the rollup itself and 3 DML rows (1 for each + * parent - DLRS combines updates to identical master record ids) + * + * The Context will be shared because the two rollups that do not have an orderby (Rollup B and C) matches all other criteria + * on the other rollup (Rollup A) and therefore are added to Context for that rollup + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsDifferByOperationAggResultFieldAggFieldCaseOrderByTwoOrderByIsNullSameFieldToAggregate() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField1 = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateField2 = LookupChild__c.Description__c.getDescribe().getName(); + String aggregateField3 = LookupChild__c.Description__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Colours__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Descriptions__c.getDescribe().getName(); + String aggregateResultField3 = LookupParent__c.Descriptions2__c.getDescribe().getName(); + String condition = 'Description__c != null'; + String relationshipCriteriaFields = 'Description__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = LookupChild__c.Name.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition; + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryA.FieldToAggregate__c = aggregateField1.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField2; + rollupSummaryB.FieldToOrderBy__c = null; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + LookupRollupSummary__c rollupSummaryC = new LookupRollupSummary__c(); + rollupSummaryC.Name = 'Test Rollup C'; + rollupSummaryC.ParentObject__c = parentObjectName; + rollupSummaryC.ChildObject__c = childObjectName; + rollupSummaryC.RelationShipField__c = relationshipField; + rollupSummaryC.RelationShipCriteria__c = condition; + rollupSummaryC.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryC.FieldToAggregate__c = aggregateField3; + rollupSummaryC.FieldToOrderBy__c = null; + rollupSummaryC.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryC.AggregateResultField__c = aggregateResultField3; + rollupSummaryC.Active__c = true; + rollupSummaryC.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryC.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB, rollupSummaryC }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put('Name', 'tom'); + child1.put(aggregateField1, 'Red'); + child1.put(aggregateField2, 'lemon'); + // aggregateField3 is same SObjectField as aggregateField2 + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put('Name', 'charlie'); + child2.put(aggregateField1, 'Yellow'); + child2.put(aggregateField2, 'pear'); + // aggregateField3 is same SObjectField as aggregateField2 + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put('Name', 'samantha'); + child3.put(aggregateField1, 'Blue'); + child3.put(aggregateField2, 'apple'); + // aggregateField3 is same SObjectField as aggregateField2 + children.add(child3); + } + + // Sample various limits prior to an insert + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // insert child records + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup A, B & C + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + Three rows for Rollup object + // + Nine rows for LookupChild__c for rollup A, B & C + System.assertEquals(beforeRows + 12, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the insert statement itself) + // + Three rows for LookupParent__c for rollup A & B & C (DLRS combined updates to identical master ids) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + // Note that we are able to reliably assert rollups B & C even though they do not have an order by specified + // because they same the same criteria as A and therefore will be added to the same context that was created for A + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1}, {2} from {3}', new List{ aggregateResultField1, aggregateResultField2, aggregateResultField3, parentObjectName }))); + System.assertEquals('Yellow', (String) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals('lemon', (String) assertParents.get(parentA.id).get(aggregateResultField2)); + System.assertEquals('pear', (String) assertParents.get(parentA.id).get(aggregateResultField3)); + + System.assertEquals('Yellow', (String) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals('lemon', (String) assertParents.get(parentB.id).get(aggregateResultField2)); + System.assertEquals('pear', (String) assertParents.get(parentB.id).get(aggregateResultField3)); + + System.assertEquals('Yellow', (String) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals('lemon', (String) assertParents.get(parentC.id).get(aggregateResultField2)); + System.assertEquals('pear', (String) assertParents.get(parentC.id).get(aggregateResultField3)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/239 + * Three similar rollups differing by: + * - Different AggregateOperation__c (both use Query rollup - First/Last) + * - Different AggregateResultField__c + * - Different Order By two that have no order by specified + * - Effective values for all other fields same differing only by case used + * Should result in One (1) context used, one SOQL for the rollup itself and 3 DML rows (1 for each + * parent - DLRS combines updates to identical master record ids) + * + * The Context will be shared because the two rollups that do not have an orderby (Rollup B and C) matches all other criteria + * on the other rollup (Rollup A) and therefore are added to Context for that rollup + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsDifferByOperationFieldCaseOrderByTwoOrderByIsNullDifferentFieldToAggregate() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField1 = LookupChild__c.Description__c.getDescribe().getName(); + String aggregateField2 = LookupChild__c.Description__c.getDescribe().getName(); + String aggregateField3 = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Descriptions__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Descriptions2__c.getDescribe().getName(); + String aggregateResultField3 = LookupParent__c.Colours__c.getDescribe().getName(); + String condition = 'Description__c != null'; + String relationshipCriteriaFields = 'Description__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = LookupChild__c.Description__c.getDescribe().getName(); + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition; + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryA.FieldToAggregate__c = aggregateField1.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField2; + rollupSummaryB.FieldToOrderBy__c = null; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + LookupRollupSummary__c rollupSummaryC = new LookupRollupSummary__c(); + rollupSummaryC.Name = 'Test Rollup C'; + rollupSummaryC.ParentObject__c = parentObjectName; + rollupSummaryC.ChildObject__c = childObjectName; + rollupSummaryC.RelationShipField__c = relationshipField; + rollupSummaryC.RelationShipCriteria__c = condition; + rollupSummaryC.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryC.FieldToAggregate__c = aggregateField3; + rollupSummaryC.FieldToOrderBy__c = null; + rollupSummaryC.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryC.AggregateResultField__c = aggregateResultField3; + rollupSummaryC.Active__c = true; + rollupSummaryC.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryC.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB, rollupSummaryC }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField1, 'lemon'); + // aggregateField2 is same SObjectField as aggregateField1 + child1.put(aggregateField3, 'Red'); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField1, 'pear'); + // aggregateField2 is same SObjectField as aggregateField1 + child2.put(aggregateField3, 'Yellow'); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField1, 'apple'); + // aggregateField2 is same SObjectField as aggregateField1 + child3.put(aggregateField3, 'Blue'); + children.add(child3); + } + + // Sample various limits prior to an insert + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // insert child records + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup A, B & C + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + Three rows for Rollup object + // + Nine rows for LookupChild__c for rollup A, B & C + System.assertEquals(beforeRows + 12, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the insert statement itself) + // + Three rows for LookupParent__c for rollup A & B & C (DLRS combined updates to identical master ids) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + // Note that we are able to reliably assert rollups B & C even though they do not have an order by specified + // because they same the same criteria as A and therefore will be added to the same context that was created for A + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1}, {2} from {3}', new List{ aggregateResultField1, aggregateResultField2, aggregateResultField3, parentObjectName }))); + System.assertEquals('apple', (String) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals('pear', (String) assertParents.get(parentA.id).get(aggregateResultField2)); + System.assertEquals('Blue', (String) assertParents.get(parentA.id).get(aggregateResultField3)); + + System.assertEquals('apple', (String) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals('pear', (String) assertParents.get(parentB.id).get(aggregateResultField2)); + System.assertEquals('Blue', (String) assertParents.get(parentB.id).get(aggregateResultField3)); + + System.assertEquals('apple', (String) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals('pear', (String) assertParents.get(parentC.id).get(aggregateResultField2)); + System.assertEquals('Blue', (String) assertParents.get(parentC.id).get(aggregateResultField3)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/239 + * Three similar rollups differing by: + * - Different AggregateOperation__c (both use Query rollup - First/Last) + * - Different AggregateResultField__c + * - Different Order By two that have no order by specified + * - Effective values for all other fields same differing only by case used + * Should result in a single context used, a single SOQL for all rollups and 3 DML rows (1 for each parent) + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsNoOrderByShareSingleContext() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField1 = LookupChild__c.Description__c.getDescribe().getName(); + String aggregateField2 = LookupChild__c.Description2__c.getDescribe().getName(); + String aggregateField3 = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateField4 = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateField5 = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Descriptions__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Descriptions2__c.getDescribe().getName(); + String aggregateResultField3 = LookupParent__c.Colours__c.getDescribe().getName(); + String aggregateResultField4 = LookupParent__c.Total__c.getDescribe().getName(); + String aggregateResultField5 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Description__c != null'; + String relationshipCriteriaFields = 'Description__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = null; + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition; + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryA.FieldToAggregate__c = aggregateField1.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField2; + rollupSummaryB.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + LookupRollupSummary__c rollupSummaryC = new LookupRollupSummary__c(); + rollupSummaryC.Name = 'Test Rollup C'; + rollupSummaryC.ParentObject__c = parentObjectName; + rollupSummaryC.ChildObject__c = childObjectName; + rollupSummaryC.RelationShipField__c = relationshipField; + rollupSummaryC.RelationShipCriteria__c = condition; + rollupSummaryC.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryC.FieldToAggregate__c = aggregateField3; + rollupSummaryC.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryC.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryC.AggregateResultField__c = aggregateResultField3; + rollupSummaryC.Active__c = true; + rollupSummaryC.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryC.CalculationSharingMode__c = sharingMode; + + LookupRollupSummary__c rollupSummaryD = new LookupRollupSummary__c(); + rollupSummaryD.Name = 'Test Rollup D'; + rollupSummaryD.ParentObject__c = parentObjectName; + rollupSummaryD.ChildObject__c = childObjectName; + rollupSummaryD.RelationShipField__c = relationshipField; + rollupSummaryD.RelationShipCriteria__c = condition; + rollupSummaryD.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryD.FieldToAggregate__c = aggregateField4; + rollupSummaryD.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryD.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryD.AggregateResultField__c = aggregateResultField4; + rollupSummaryD.Active__c = true; + rollupSummaryD.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryD.CalculationSharingMode__c = sharingMode; + + LookupRollupSummary__c rollupSummaryE = new LookupRollupSummary__c(); + rollupSummaryE.Name = 'Test Rollup E'; + rollupSummaryE.ParentObject__c = parentObjectName; + rollupSummaryE.ChildObject__c = childObjectName; + rollupSummaryE.RelationShipField__c = relationshipField; + rollupSummaryE.RelationShipCriteria__c = condition; + rollupSummaryE.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryE.FieldToAggregate__c = aggregateField5; + rollupSummaryE.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryE.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryE.AggregateResultField__c = aggregateResultField5; + rollupSummaryE.Active__c = true; + rollupSummaryE.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryE.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB, rollupSummaryC, rollupSummaryD, rollupSummaryE }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField1, 'lemon'); + child1.put(aggregateField2, 'tom'); + child1.put(aggregateField3, 'Red'); + child1.put(aggregateField4, 42); + // aggregateField5 is same SObjectField as aggregateField4 + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField1, 'pear'); + child2.put(aggregateField2, 'charlie'); + child2.put(aggregateField3, 'Yellow'); + child2.put(aggregateField4, 42); + // aggregateField5 is same SObjectField as aggregateField4 + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField1, 'apple'); + child3.put(aggregateField2, 'samantha'); + child3.put(aggregateField3, 'Blue'); + child3.put(aggregateField4, 42); + // aggregateField5 is same SObjectField as aggregateField4 + children.add(child3); + } + + // Sample various limits prior to an insert + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + // insert child records + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup A, B, C, D & E + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + Five rows for Rollup object + // + Nine rows for LookupChild__c for rollup A, B, C, D & E + System.assertEquals(beforeRows + 14, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the insert statement itself) + // + Three rows for LookupParent__c for rollup A & B & C & D & E (DLRS combined updates to identical master ids) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + // Note that we are not able to reliably assert rollups A, B, C, D & E because they do not have orderby specified + // and will share a context. Contexts generated for "no orderby specified" do not have an orderby + // and therefore we cannot assert values since order is non-deterministic + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals(parents.size(), assertParents.size()); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/216 + * Two similar rollups differing by: + * - Different AggregateOperation__c (both use Query rollup - First/Last) + * - Different AggregateResultField__c + * - Different Order By each containing multiple fields + * - Effective values for all other fields same differing only by case used + * Should result in Two (2) contexts used, two SOQL for the rollup itself and 3 DML rows (1 for each + * parent - DLRS combines updates to identical master record ids) + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsDifferByOperationFieldCaseMultipleFieldsOrderBy() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField1 = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateField2 = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Colours__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Amount__c > 1'; + String relationshipCriteriaFields = 'Amount__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String orderBy1 = 'Amount__c ASC NULLS FIRST, Color__c ASC NULLS FIRST'; + String orderBy2 = 'Amount__c ASC NULLS FIRST, Color__c DESC NULLS FIRST'; + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition; + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryA.FieldToAggregate__c = aggregateField1.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = orderBy1; + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField2; + rollupSummaryB.FieldToOrderBy__c = orderBy2; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField1, 'Red'); + child1.put(aggregateField2, 42); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField1, 'Yellow'); + child2.put(aggregateField2, 15); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField1, 'Blue'); + child3.put(aggregateField2, 10); + children.add(child3); + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup A + // + One query on LookupChild__c for rollup B + System.assertEquals(beforeQueries + 3, Limits.getQueries()); + + // + Two rows for Rollup object + // + Nine rows for LookupChild__c for rollup A + // + Nine rows for LookupChild__c for rollup B + System.assertEquals(beforeRows + 20, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the update statement itself) + // + Three rows for LookupParent__c for rollup A & B (DLRS combined updates to identical master ids) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Assert rollups + Map assertParents = new Map(Database.query(String.format('select id, {0}, {1} from {2}', new List{ aggregateResultField1, aggregateResultField2, parentObjectName }))); + System.assertEquals('Blue', (String) assertParents.get(parentA.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentA.id).get(aggregateResultField2)); + + System.assertEquals('Blue', (String) assertParents.get(parentB.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentB.id).get(aggregateResultField2)); + + System.assertEquals('Blue', (String) assertParents.get(parentC.id).get(aggregateResultField1)); + System.assertEquals(42, (Decimal) assertParents.get(parentC.id).get(aggregateResultField2)); + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/239 + * Two similar rollups differing by: + * - Different AggregateOperation__c (both use Query rollup - First/Last) + * - Different AggregateResultField__c + * - Neither rollup has any Order by specified (this will result in non-deterministic rolled up values) + * - Effective values for all other fields same differing only by case used + * Should result in a single context used, a single SOQL for the rollup itself and 3 DML rows (1 for each parent) + **/ + private testmethod static void testLimitsAndContextsUsedMultipleQueryRollupsDifferByOperationFieldAndCaseSameCriteriaSameCaseNoOrderBy() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField1 = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateField2 = LookupChild__c.Amount__c.getDescribe().getName(); + String aggregateResultField1 = LookupParent__c.Colours__c.getDescribe().getName(); + String aggregateResultField2 = LookupParent__c.Total2__c.getDescribe().getName(); + String condition = 'Amount__c > 1'; + String relationshipCriteriaFields = 'Amount__c'; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = null; + + // Configure rollups + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup A'; + rollupSummaryA.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummaryA.ChildObject__c = childObjectName.toLowerCase(); + rollupSummaryA.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummaryA.RelationShipCriteria__c = condition; + rollupSummaryA.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryA.FieldToAggregate__c = aggregateField1.toLowerCase(); + rollupSummaryA.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name(); + rollupSummaryA.AggregateResultField__c = aggregateResultField1.toLowerCase(); + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryA.CalculationSharingMode__c = sharingMode.toLowerCase(); + + LookupRollupSummary__c rollupSummaryB = new LookupRollupSummary__c(); + rollupSummaryB.Name = 'Test Rollup B'; + rollupSummaryB.ParentObject__c = parentObjectName; + rollupSummaryB.ChildObject__c = childObjectName; + rollupSummaryB.RelationShipField__c = relationshipField; + rollupSummaryB.RelationShipCriteria__c = condition; + rollupSummaryB.RelationShipCriteriaFields__c = relationshipCriteriaFields; + rollupSummaryB.FieldToAggregate__c = aggregateField2; + rollupSummaryB.FieldToOrderBy__c = fieldToOrderBy; + rollupSummaryB.AggregateOperation__c = RollupSummaries.AggregateOperation.Last.name(); + rollupSummaryB.AggregateResultField__c = aggregateResultField2; + rollupSummaryB.Active__c = true; + rollupSummaryB.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name(); + rollupSummaryB.CalculationSharingMode__c = sharingMode; + + List rollups = new List { rollupSummaryA, rollupSummaryB }; + insert rollups; + + // Insert parents + SObject parentA = parentType.newSObject(); + parentA.put('Name', 'ParentA'); + SObject parentB = parentType.newSObject(); + parentB.put('Name', 'ParentB'); + SObject parentC = parentType.newSObject(); + parentC.put('Name', 'ParentC'); + List parents = new List { parentA, parentB, parentC }; + insert parents; + + // Insert children + List children = new List(); + for(SObject parent : parents) + { + SObject child1 = childType.newSObject(); + child1.put(relationshipField, parent.Id); + child1.put(aggregateField1, 'orange'); + child1.put(aggregateField2, 42); + children.add(child1); + SObject child2 = childType.newSObject(); + child2.put(relationshipField, parent.Id); + child2.put(aggregateField1, 'purple'); + child2.put(aggregateField2, 15); + children.add(child2); + SObject child3 = childType.newSObject(); + child3.put(relationshipField, parent.Id); + child3.put(aggregateField1, 'cyan'); + child3.put(aggregateField2, 10); + children.add(child3); + } + + // Sample various limits prior to an update + Integer beforeQueries = Limits.getQueries(); + Integer beforeRows = Limits.getQueryRows(); + Integer beforeDMLRows = Limits.getDMLRows(); + + insert children; + + // Assert limits + // + One query on Rollup object + // + One query on LookupChild__c for rollup + System.assertEquals(beforeQueries + 2, Limits.getQueries()); + + // + Two rows for Rollup object + // + Nine rows for LookupChild__c + System.assertEquals(beforeRows + 11, Limits.getQueryRows()); + + // + Nine rows for LookupChild__c (from the update statement itself) + // + Three rows for LookupParent__c (from rollup processing) + System.assertEquals(beforeDMLRows + 12, Limits.getDMLRows()); + + // Unable to reliably assert rollups in this test because + // no order by was specified therefore result is non-deterministic + // this test is focused on limits and contexts to ensure a single context is used + } + + /** + * Test for issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/229 + * Ensure that any field on LookupRollupSummary__c that is describable is updated with describe info + **/ + private testmethod static void testLookupRollupSummaryFieldsMatchDescribeInfo() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + String rollupName = 'Test Rollup'; + Schema.SObjectType parentType = LookupParent__c.sObjectType; + Schema.SObjectType childType = LookupChild__c.sObjectType; + String parentObjectName = parentType.getDescribe().getName(); + String childObjectName = childType.getDescribe().getName(); + String relationshipField = LookupChild__c.LookupParent__c.getDescribe().getName(); + String aggregateField = LookupChild__c.Color__c.getDescribe().getName(); + String aggregateResultField = LookupParent__c.Colours__c.getDescribe().getName(); + String condition = LookupChild__c.Amount__c.getDescribe().getName() + ' > 1'; + List relationshipCriteriaFields = new List { LookupChild__c.Amount__c.getDescribe().getName(), 'Name', 'Id', 'IsDeleted' }; + String sharingMode = LREngine.SharingMode.User.name(); + String fieldToOrderBy = LookupChild__c.Amount__c.getDescribe().getName() + ',' + LookupChild__c.Color__c.getDescribe().getName() + ' ASC,Name NULLS LAST,Id DESC NULLS FIRST'; + + // Configure rollups + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = rollupName.toLowerCase(); + rollupSummary.ParentObject__c = parentObjectName.toLowerCase(); + rollupSummary.ChildObject__c = childObjectName.toLowerCase(); + rollupSummary.RelationShipField__c = relationshipField.toLowerCase(); + rollupSummary.RelationShipCriteria__c = condition.toLowerCase(); + rollupSummary.RelationShipCriteriaFields__c = String.join(relationshipCriteriaFields, '\r\n').toLowerCase(); + rollupSummary.FieldToAggregate__c = aggregateField.toLowerCase(); + rollupSummary.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name().toLowerCase(); + rollupSummary.AggregateResultField__c = aggregateResultField.toLowerCase(); + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name().toLowerCase(); + rollupSummary.CalculationSharingMode__c = sharingMode.toLowerCase(); + insert rollupSummary; + + // Assert field values were updated to describe info + LookupRollupSummary__c existingSummary = [SELECT Id, Name, ParentObject__c, ChildObject__c, RelationshipField__c, RelationShipCriteria__c, RelationShipCriteriaFields__c, + FieldToAggregate__c, FieldToOrderBy__c, AggregateOperation__c, AggregateResultField__c, CalculationMode__c, CalculationSharingMode__c FROM LookupRollupSummary__c WHERE Name = :rollupName]; + + + // name & condition are not updated with describe info + System.assertEquals(rollupName.toLowerCase(), existingSummary.Name); + System.assertEquals(condition.toLowerCase(), existingSummary.RelationShipCriteria__c); + // all remaining fields should match describe + System.assertEquals(parentObjectName, existingSummary.ParentObject__c); + System.assertEquals(childObjectName, existingSummary.ChildObject__c); + System.assertEquals(relationshipField, existingSummary.RelationShipField__c); + System.assertEquals(String.join(relationshipCriteriaFields, '\r\n'), existingSummary.RelationShipCriteriaFields__c); + System.assertEquals(aggregateField, existingSummary.FieldToAggregate__c); + System.assertEquals(fieldToOrderBy, existingSummary.FieldToOrderBy__c); + System.assertEquals(RollupSummaries.AggregateOperation.First.name(), existingSummary.AggregateOperation__c); + System.assertEquals(aggregateResultField, existingSummary.AggregateResultField__c); + System.assertEquals(RollupSummaries.CalculationMode.Realtime.name(), existingSummary.CalculationMode__c); + System.assertEquals(sharingMode, existingSummary.CalculationSharingMode__c); + + // Set summary values to lowered and update + existingSummary.Name = rollupName.toLowerCase(); + existingSummary.ParentObject__c = parentObjectName.toLowerCase(); + existingSummary.ChildObject__c = childObjectName.toLowerCase(); + existingSummary.RelationShipField__c = relationshipField.toLowerCase(); + existingSummary.RelationShipCriteria__c = condition.toLowerCase(); + existingSummary.RelationShipCriteriaFields__c = String.join(relationshipCriteriaFields, '\r\n').toLowerCase(); + existingSummary.FieldToAggregate__c = aggregateField.toLowerCase(); + existingSummary.FieldToOrderBy__c = fieldToOrderBy.toLowerCase(); + existingSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.First.name().toLowerCase(); + existingSummary.AggregateResultField__c = aggregateResultField.toLowerCase(); + existingSummary.Active__c = true; + existingSummary.CalculationMode__c = RollupSummaries.CalculationMode.Realtime.name().toLowerCase(); + existingSummary.CalculationSharingMode__c = sharingMode.toLowerCase(); + update rollupSummary; + + // Assert field values were updated to describe info + existingSummary = [SELECT Id, Name, ParentObject__c, ChildObject__c, RelationshipField__c, RelationShipCriteria__c, RelationShipCriteriaFields__c, + FieldToAggregate__c, FieldToOrderBy__c, AggregateOperation__c, AggregateResultField__c, CalculationMode__c, CalculationSharingMode__c FROM LookupRollupSummary__c WHERE Name = :rollupName]; + + + // name & condition are not updated with describe info + System.assertEquals(rollupName.toLowerCase(), existingSummary.Name); + System.assertEquals(condition.toLowerCase(), existingSummary.RelationShipCriteria__c); + // all remaining fields should match describe + System.assertEquals(parentObjectName, existingSummary.ParentObject__c); + System.assertEquals(childObjectName, existingSummary.ChildObject__c); + System.assertEquals(relationshipField, existingSummary.RelationShipField__c); + System.assertEquals(String.join(relationshipCriteriaFields, '\r\n'), existingSummary.RelationShipCriteriaFields__c); + System.assertEquals(aggregateField, existingSummary.FieldToAggregate__c); + System.assertEquals(fieldToOrderBy, existingSummary.FieldToOrderBy__c); + System.assertEquals(RollupSummaries.AggregateOperation.First.name(), existingSummary.AggregateOperation__c); + System.assertEquals(aggregateResultField, existingSummary.AggregateResultField__c); + System.assertEquals(RollupSummaries.CalculationMode.Realtime.name(), existingSummary.CalculationMode__c); + System.assertEquals(sharingMode, existingSummary.CalculationSharingMode__c); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupServiceTest4.cls-meta.xml b/rolluptool/src/classes/RollupServiceTest4.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/RollupServiceTest4.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/RollupServiceTest5.cls b/rolluptool/src/classes/RollupServiceTest5.cls new file mode 100644 index 00000000..dc21247e --- /dev/null +++ b/rolluptool/src/classes/RollupServiceTest5.cls @@ -0,0 +1,554 @@ +/** + * Copyright (c) 2013, Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@IsTest +private class RollupServiceTest5 { + + @IsTest + private static void testPolymorphicRelationshipsRealtime() { + + // Polymorphic lookup between Task and Account + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup'; + rollupSummaryA.ParentObject__c = 'Account'; + rollupSummaryA.ChildObject__c = 'Task'; + rollupSummaryA.RelationShipField__c = 'WhatId'; + rollupSummaryA.FieldToAggregate__c = 'Id'; + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryA.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = 'Realtime'; + insert rollupSummaryA; + + // Polymorphic lookup between Task and Opportunity + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Test Rollup'; + rollupSummary.ParentObject__c = 'Opportunity'; + rollupSummary.ChildObject__c = 'Task'; + rollupSummary.RelationShipField__c = 'WhatId'; + rollupSummary.FieldToAggregate__c = 'Id'; + rollupSummary.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummary.AggregateResultField__c = 'TotalOpportunityQuantity'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + insert rollupSummary; + + // Setup parent test records + Account accountParent = new Account(Name = 'Test Account'); + insert accountParent; + Opportunity opp = new Opportunity(); + opp.Name = 'Test Opportunity'; + opp.StageName = 'Open'; + opp.CloseDate = System.today(); + opp.AccountId = accountParent.Id; + insert opp; + + // Insert a Task for Account and assert + Task task1 = new Task(); + task1.Subject = 'Task A'; + task1.WhatId = accountParent.Id; + insert task1; + System.assertEquals(1, [select AnnualRevenue from Account where id = :accountParent.Id][0].AnnualRevenue); + System.assertEquals(null, [select TotalOpportunityQuantity from Opportunity where id = :opp.Id][0].TotalOpportunityQuantity); + + // Insert a Task for Oppoortunity and assert + Task task2 = new Task(); + task2.Subject = 'Task A'; + task2.WhatId = opp.Id; + insert task2; + System.assertEquals(1, [select AnnualRevenue from Account where id = :accountParent.Id][0].AnnualRevenue); + System.assertEquals(1, [select TotalOpportunityQuantity from Opportunity where id = :opp.Id][0].TotalOpportunityQuantity); + } + + @IsTest + private static void testPolymorphicRelationshipsScheduled() { + + // Polymorphic lookup between Task and Account + LookupRollupSummary__c rollupSummaryAccount = new LookupRollupSummary__c(); + rollupSummaryAccount.Name = 'Test Rollup'; + rollupSummaryAccount.ParentObject__c = 'Account'; + rollupSummaryAccount.ChildObject__c = 'Task'; + rollupSummaryAccount.RelationShipField__c = 'WhatId'; + rollupSummaryAccount.FieldToAggregate__c = 'Id'; + rollupSummaryAccount.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryAccount.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryAccount.Active__c = true; + rollupSummaryAccount.CalculationMode__c = 'Scheduled'; + insert rollupSummaryAccount; + + // Polymorphic lookup between Task and Opportunity + LookupRollupSummary__c rollupSummaryOpp = new LookupRollupSummary__c(); + rollupSummaryOpp.Name = 'Test Rollup'; + rollupSummaryOpp.ParentObject__c = 'Opportunity'; + rollupSummaryOpp.ChildObject__c = 'Task'; + rollupSummaryOpp.RelationShipField__c = 'WhatId'; + rollupSummaryOpp.FieldToAggregate__c = 'Id'; + rollupSummaryOpp.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryOpp.AggregateResultField__c = 'TotalOpportunityQuantity'; + rollupSummaryOpp.Active__c = true; + rollupSummaryOpp.CalculationMode__c = 'Scheduled'; + insert rollupSummaryOpp; + + // Setup parent test records + Account accountParent = new Account(Name = 'Test Account'); + insert accountParent; + Opportunity oppParent = new Opportunity(); + oppParent.Name = 'Test Opportunity'; + oppParent.StageName = 'Open'; + oppParent.CloseDate = System.today(); + oppParent.AccountId = accountParent.Id; + insert oppParent; + + // Insert Tasks to generated scheduled job work items + Task task1 = new Task(); + task1.Subject = 'Task A'; + task1.WhatId = accountParent.Id; + Task task2 = new Task(); + task2.Subject = 'Task A'; + task2.WhatId = oppParent.Id; + insert new List { task1, task2 }; + + // Should have two scheduled job work items + System.assertEquals(2, [select Id from LookupRollupSummaryScheduleItems__c].size()); // Assert a scheduled item has been created + System.assertEquals(rollupSummaryAccount.Id, [select LookupRollupSummary__c from LookupRollupSummaryScheduleItems__c where ParentId__c = :accountParent.Id][0].LookupRollupSummary__c); + System.assertEquals(rollupSummaryOpp.Id, [select LookupRollupSummary__c from LookupRollupSummaryScheduleItems__c where ParentId__c = :oppParent.Id][0].LookupRollupSummary__c); + + // Run rollup job + Test.startTest(); + RollupService.runJobToProcessScheduledItems(); + Test.stopTest(); + + // Assert scheduled rollup job did its thing! + System.assertEquals(1, [select AnnualRevenue from Account where id = :accountParent.Id][0].AnnualRevenue); + System.assertEquals(1, [select TotalOpportunityQuantity from Opportunity where id = :oppParent.Id][0].TotalOpportunityQuantity); + } + + @IsTest + private static void testPolymorphicRelationshipsScheduledIgnoreBadScheduleItems() { + + // Setup parent test records + Account accountParent = new Account(Name = 'Test Account'); + insert accountParent; + Opportunity oppParent = new Opportunity(); + oppParent.Name = 'Test Opportunity'; + oppParent.StageName = 'Open'; + oppParent.CloseDate = System.today(); + oppParent.AccountId = accountParent.Id; + insert oppParent; + + // Insert Tasks to generated scheduled job work items + Task task1 = new Task(); + task1.Subject = 'Task A'; + task1.WhatId = accountParent.Id; + Task task2 = new Task(); + task2.Subject = 'Task A'; + task2.WhatId = oppParent.Id; + insert new List { task1, task2 }; + + // Polymorphic lookup between Task and Account + LookupRollupSummary__c rollupSummaryAccount = new LookupRollupSummary__c(); + rollupSummaryAccount.Name = 'Test Rollup'; + rollupSummaryAccount.ParentObject__c = 'Account'; + rollupSummaryAccount.ChildObject__c = 'Task'; + rollupSummaryAccount.RelationShipField__c = 'WhatId'; + rollupSummaryAccount.FieldToAggregate__c = 'Id'; + rollupSummaryAccount.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryAccount.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryAccount.Active__c = true; + rollupSummaryAccount.CalculationMode__c = 'Scheduled'; + insert rollupSummaryAccount; + + // Polymorphic lookup between Task and Opportunity + LookupRollupSummary__c rollupSummaryOpp = new LookupRollupSummary__c(); + rollupSummaryOpp.Name = 'Test Rollup'; + rollupSummaryOpp.ParentObject__c = 'Opportunity'; + rollupSummaryOpp.ChildObject__c = 'Task'; + rollupSummaryOpp.RelationShipField__c = 'WhatId'; + rollupSummaryOpp.FieldToAggregate__c = 'Id'; + rollupSummaryOpp.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryOpp.AggregateResultField__c = 'TotalOpportunityQuantity'; + rollupSummaryOpp.Active__c = true; + rollupSummaryOpp.CalculationMode__c = 'Scheduled'; + insert rollupSummaryOpp; + + // Inject a valid schedule item record + LookupRollupSummaryScheduleItems__c lrssiAccount = new LookupRollupSummaryScheduleItems__c(); + lrssiAccount.LookupRollupSummary__c = rollupSummaryAccount.Id; + lrssiAccount.LookupRollupSummary2__c = rollupSummaryAccount.Id; + lrssiAccount.ParentId__c = accountParent.Id; + lrssiAccount.QualifiedParentID__c = lrssiAccount.ParentId__c + '#' + LookupRollupSummary__c.Id; + insert lrssiAccount; + + // Inject invalid schedule item reocrd, past bug would allow this to be written against + // the wrong lookup rule or user changing the lookup after schedule item written woudl cause an error + LookupRollupSummaryScheduleItems__c lrssiOpp = new LookupRollupSummaryScheduleItems__c(); + lrssiOpp.LookupRollupSummary__c = rollupSummaryAccount.Id; // Emulate invalid entry + lrssiOpp.LookupRollupSummary2__c = rollupSummaryAccount.Id; // Emulate invalid entry + lrssiOpp.ParentId__c = oppParent.Id; + lrssiOpp.QualifiedParentID__c = lrssiOpp.ParentId__c + '#' + LookupRollupSummary__c.Id; + insert lrssiOpp; + + // Run rollup job + Test.startTest(); + RollupService.runJobToProcessScheduledItems(); + Test.stopTest(); + + // Assert scheduled rollup for account worked, but the invalided schedule item was silently swallowed and deleted + System.assertEquals(0, [select Id from LookupRollupSummaryScheduleItems__c].size()); + System.assertEquals(1, [select AnnualRevenue from Account where id = :accountParent.Id][0].AnnualRevenue); + System.assertEquals(null, [select TotalOpportunityQuantity from Opportunity where id = :oppParent.Id][0].TotalOpportunityQuantity); + } + + private static void assertOrdering(List order, Integer numFields, List fields, List directions, List nullsLast) + { + System.assertNotEquals(null, order); + System.assertEquals(numFields, order.size()); + for (Integer i = 0; i < numFields; i++) + { + assertOrdering(order[i], fields[i], directions[i], nullsLast[i]); + } + } + + private static void assertOrdering(Utilities.Ordering o, String field, Utilities.SortOrder direction, Boolean nullsLast) + { + System.assertEquals(field, o.getField()); + System.assertEquals(direction, o.getDirection()); + System.assertEquals(nullsLast, o.getNullsLast()); + } + + @IsTest + private static void testParseOrderByFieldOnly() { + List order = Utilities.parseOrderByClause('Amount__c'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldOnlyLowered() { + List order = Utilities.parseOrderByClause('amount__c'); + assertOrdering( order, + 1, + new List { 'amount__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldOnlyMixedCase() { + List order = Utilities.parseOrderByClause('aMoUnT__c'); + assertOrdering( order, + 1, + new List { 'aMoUnT__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldAndASCDirection() { + List order = Utilities.parseOrderByClause('Amount__c ASC'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldAndASCDirectionLowered() { + List order = Utilities.parseOrderByClause('Amount__c asc'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldAndDESCDirection() { + List order = Utilities.parseOrderByClause('Amount__c DESC'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.DESCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldAndDESCDirectionLowered() { + List order = Utilities.parseOrderByClause('Amount__c desc'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.DESCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldAndNullsFirst() { + List order = Utilities.parseOrderByClause('Amount__c NULLS FIRST'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldAndNullsFirstLowered() { + List order = Utilities.parseOrderByClause('Amount__c nulls first'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldAndNullsLast() { + List order = Utilities.parseOrderByClause('Amount__c NULLS LAST'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { true }); + } + + @IsTest + private static void testParseOrderByFieldAndNullsLastLowered() { + List order = Utilities.parseOrderByClause('Amount__c nulls last'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { true }); + } + + @IsTest + private static void testParseOrderByFieldAndASCDirectionAndNullsFirst() { + List order = Utilities.parseOrderByClause('Amount__c ASC NULLS FIRST'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldAndASCDirectionAndNullsLast() { + List order = Utilities.parseOrderByClause('Amount__c ASC NULLS LAST'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { true }); + } + + @IsTest + private static void testParseOrderByFieldAndDESCDirectionAndNullsFirst() { + List order = Utilities.parseOrderByClause('Amount__c DESC NULLS FIRST'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.DESCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByFieldAndDESCDirectionAndNullsLast() { + List order = Utilities.parseOrderByClause('Amount__c DESC NULLS LAST'); + assertOrdering( order, + 1, + new List { 'Amount__c' }, + new List { Utilities.SortOrder.DESCENDING }, + new List { true }); + } + + @IsTest + private static void testParseOrderByMultipleFieldOnly() { + List order = Utilities.parseOrderByClause('Amount__c, Color__c, Name'); + assertOrdering( order, + 3, + new List { 'Amount__c', 'Color__c', 'Name' }, + new List { Utilities.SortOrder.ASCENDING, Utilities.SortOrder.ASCENDING, Utilities.SortOrder.ASCENDING }, + new List { false, false, false }); + } + + @IsTest + private static void testParseOrderByMultipleFieldAndMixedDirection() { + List order = Utilities.parseOrderByClause('Amount__c ASC, Color__c DESC, Name ASC'); + assertOrdering( order, + 3, + new List { 'Amount__c', 'Color__c', 'Name' }, + new List { Utilities.SortOrder.ASCENDING, Utilities.SortOrder.DESCENDING, Utilities.SortOrder.ASCENDING }, + new List { false, false, false }); + } + + @IsTest + private static void testParseOrderByMultipleFieldAndMixedDirectionAndNulls() { + List order = Utilities.parseOrderByClause('Amount__c ASC NULLS LAST, Color__c DESC NULLS FIRST, Name ASC NULLS LAST'); + assertOrdering( order, + 3, + new List { 'Amount__c', 'Color__c', 'Name' }, + new List { Utilities.SortOrder.ASCENDING, Utilities.SortOrder.DESCENDING, Utilities.SortOrder.ASCENDING }, + new List { true, false, true }); + } + + @IsTest + private static void testParseOrderByBadField() { + // parsing will succeed - validation of field name is done in RollupSummaries + List order = Utilities.parseOrderByClause('BadField__c'); + assertOrdering( order, + 1, + new List { 'BadField__c' }, + new List { Utilities.SortOrder.ASCENDING }, + new List { false }); + } + + @IsTest + private static void testParseOrderByBadDirection() { + try { + List order = Utilities.parseOrderByClause('Amount__c BAD'); + System.assert(false, 'Expected exception'); + } catch(Utilities.OrderByInvalidException e) { + System.assertEquals('Invalid order by clause.', e.getMessage()); + } + } + + @IsTest + private static void testParseOrderByBadNulls() { + try { + List order = Utilities.parseOrderByClause('Amount__c ASC BAD'); + System.assert(false, 'Expected exception'); + } catch(Utilities.OrderByInvalidException e) { + System.assertEquals('Invalid order by clause.', e.getMessage()); + } + } + + @IsTest + private static void testParseOrderByMissingNulls() { + try { + List order = Utilities.parseOrderByClause('Amount__c ASC LAST'); + System.assert(false, 'Expected exception'); + } catch(Utilities.OrderByInvalidException e) { + System.assertEquals('Invalid order by clause.', e.getMessage()); + } + } + + @IsTest + private static void testParseOrderByBadNullsType() { + try { + List order = Utilities.parseOrderByClause('Amount__c ASC NULLS BAD'); + System.assert(false, 'Expected exception'); + } catch(Utilities.OrderByInvalidException e) { + System.assertEquals('Invalid order by clause.', e.getMessage()); + } + } + + @IsTest + private static void testParseOrderByMissingNullsType() { + try { + List order = Utilities.parseOrderByClause('Amount__c ASC NULLS'); + System.assert(false, 'Expected exception'); + } catch(Utilities.OrderByInvalidException e) { + System.assertEquals('Invalid order by clause.', e.getMessage()); + } + } + + @IsTest + private static void testParseOrderByInvalidStart() { + try { + List order = Utilities.parseOrderByClause('BAD Amount__c ASC NULLS FIRST'); + System.assert(false, 'Expected exception'); + } catch(Utilities.OrderByInvalidException e) { + System.assertEquals('Invalid order by clause.', e.getMessage()); + } + } + + @IsTest + private static void testParseOrderByInvalidMiddle() { + try { + List order = Utilities.parseOrderByClause('Amount__c ASC BAD NULLS FIRST'); + System.assert(false, 'Expected exception'); + } catch(Utilities.OrderByInvalidException e) { + System.assertEquals('Invalid order by clause.', e.getMessage()); + } + } + + @IsTest + private static void testParseOrderByInvalidEnd() { + try { + List order = Utilities.parseOrderByClause('Amount__c ASC NULLS FIRST BAD'); + System.assert(false, 'Expected exception'); + } catch(Utilities.OrderByInvalidException e) { + System.assertEquals('Invalid order by clause.', e.getMessage()); + } + } + + @IsTest + private static void testParseOrderByMultipleSecondFieldInvalid() { + try { + List order = Utilities.parseOrderByClause('Amount__c ASC NULLS FIRST, Color__c ASC NULLS BAD, Name ASC NULLS FIRST'); + System.assert(false, 'Expected exception'); + } catch(Utilities.OrderByInvalidException e) { + System.assertEquals('Invalid order by clause.', e.getMessage()); + } + } + + @IsTest + private static void testParseOrderByMultipleThirdFieldInvalid() { + try { + List order = Utilities.parseOrderByClause('Amount__c ASC NULLS FIRST, Color__c ASC NULLS LAST, Name ASC FIRST'); + System.assert(false, 'Expected exception'); + } catch(Utilities.OrderByInvalidException e) { + System.assertEquals('Invalid order by clause.', e.getMessage()); + } + } + + @IsTest + private static void testParseOrderByMultipleFieldWhitespaceEverywhere() { + List order = Utilities.parseOrderByClause(' Amount__c ASC NULLS LAST , Color__c DESC NULLS FIRST '); + assertOrdering( order, + 2, + new List { 'Amount__c', 'Color__c'}, + new List { Utilities.SortOrder.ASCENDING, Utilities.SortOrder.DESCENDING }, + new List { true, false}); + } + + @IsTest + private static void testParseOrderByBlankClause() { + List order = Utilities.parseOrderByClause(null); + System.assertEquals(null, order); + + order = Utilities.parseOrderByClause(''); + System.assertEquals(null, order); + + order = Utilities.parseOrderByClause(' '); + System.assertEquals(null, order); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupServiceTest5.cls-meta.xml b/rolluptool/src/classes/RollupServiceTest5.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/RollupServiceTest5.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/RollupServiceTest6.cls b/rolluptool/src/classes/RollupServiceTest6.cls new file mode 100644 index 00000000..e8e0f16f --- /dev/null +++ b/rolluptool/src/classes/RollupServiceTest6.cls @@ -0,0 +1,419 @@ +/** + * Copyright (c) 2013, Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@IsTest +private class RollupServiceTest6 { + + /** + * https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/318 + **/ + @IsTest + private static void testHistoricBeforeV2ScheduleItemsAreTolerated() { + + // Setup parent test records + Account accountParent = new Account(Name = 'Test Account'); + insert accountParent; + Opportunity oppParent = new Opportunity(); + oppParent.Name = 'Test Opportunity'; + oppParent.StageName = 'Open'; + oppParent.CloseDate = System.today(); + oppParent.AccountId = accountParent.Id; + insert oppParent; + + // Insert Tasks to generated scheduled job work items + Task task1 = new Task(); + task1.Subject = 'Task A'; + task1.WhatId = accountParent.Id; + Task task2 = new Task(); + task2.Subject = 'Task A'; + task2.WhatId = oppParent.Id; + insert new List { task1, task2 }; + + // Between Task and Account + LookupRollupSummary__c rollupSummaryAccount = new LookupRollupSummary__c(); + rollupSummaryAccount.Name = 'Test Rollup'; + rollupSummaryAccount.ParentObject__c = 'Account'; + rollupSummaryAccount.ChildObject__c = 'Task'; + rollupSummaryAccount.RelationShipField__c = 'WhatId'; + rollupSummaryAccount.FieldToAggregate__c = 'Id'; + rollupSummaryAccount.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryAccount.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryAccount.Active__c = true; + rollupSummaryAccount.CalculationMode__c = 'Scheduled'; + insert rollupSummaryAccount; + + // Inject a valid schedule item record + LookupRollupSummaryScheduleItems__c lrssiAccount = new LookupRollupSummaryScheduleItems__c(); + lrssiAccount.LookupRollupSummary__c = rollupSummaryAccount.Id; + lrssiAccount.LookupRollupSummary2__c = rollupSummaryAccount.Id; + lrssiAccount.ParentId__c = accountParent.Id; + lrssiAccount.QualifiedParentID__c = lrssiAccount.ParentId__c + '#' + LookupRollupSummary__c.Id; + insert lrssiAccount; + + // Inject a valid schedule item record created before v2.0 + LookupRollupSummaryScheduleItems__c lrssiOpp = new LookupRollupSummaryScheduleItems__c(); + lrssiOpp.LookupRollupSummary__c = rollupSummaryAccount.Id; // Emulate invalid entry + lrssiOpp.LookupRollupSummary2__c = null; + lrssiOpp.ParentId__c = oppParent.Id; + lrssiOpp.QualifiedParentID__c = lrssiOpp.ParentId__c + '#' + LookupRollupSummary__c.Id; + insert lrssiOpp; + + // Run rollup job + Test.startTest(); + RollupService.runJobToProcessScheduledItems(); + Test.stopTest(); + + // Assert scheduled rollup for account worked, but the invalided schedule item was silently swallowed and deleted + System.assertEquals(0, [select Id from LookupRollupSummaryScheduleItems__c].size()); + System.assertEquals(1, [select AnnualRevenue from Account where id = :accountParent.Id][0].AnnualRevenue); + } + + /** + * https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/39 + **/ + @IsTest + private static void selfRollupInsert() { + + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup'; + rollupSummaryA.ParentObject__c = 'Opportunity'; + rollupSummaryA.ChildObject__c = 'Opportunity'; + rollupSummaryA.RelationShipField__c = 'Id'; + rollupSummaryA.FieldToAggregate__c = 'CreatedDate'; + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryA.AggregateResultField__c = 'Amount'; + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = 'Realtime'; + insert rollupSummaryA; + + // Setup parent test records + Opportunity opp = new Opportunity(); + opp.Name = 'Test Opportunity'; + opp.StageName = 'Open'; + opp.CloseDate = System.today(); + opp.Amount = 100; + insert opp; + + // Assert + System.assertEquals(1, [select Amount from Opportunity where id = :opp.Id][0].Amount); + } + + /** + * https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/39 + **/ + @IsTest + private static void selfRollupDelete() { + + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup'; + rollupSummaryA.ParentObject__c = 'Opportunity'; + rollupSummaryA.ChildObject__c = 'Opportunity'; + rollupSummaryA.RelationShipField__c = 'Id'; + rollupSummaryA.FieldToAggregate__c = 'CreatedDate'; + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryA.AggregateResultField__c = 'Amount'; + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = 'Realtime'; + insert rollupSummaryA; + + // Setup parent test records + Opportunity opp = new Opportunity(); + opp.Name = 'Test Opportunity'; + opp.StageName = 'Open'; + opp.CloseDate = System.today(); + opp.Amount = 100; + insert opp; + delete opp; + + // Assert this doesn't result in an exception, as it once did + // ENTITY_IS_DELETED, entity is deleted: []: Class.dlrs.RollupService.Updater.updateRecords: line 1159, column 1 + } + + private testmethod static void testSingleRollupWithInsertThenDelete() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + // Configure rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Total Opportunities greater than 200 into Annual Revenue on Account'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Opportunity'; + rollupSummary.RelationShipField__c = 'AccountId'; + rollupSummary.RelationShipCriteria__c = null; + rollupSummary.FieldToAggregate__c = 'Amount'; + rollupSummary.AggregateOperation__c = 'Sum'; + rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.AggregateAllRows__c = true; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + insert new List { rollupSummary }; + + // Test data + Account account = new Account(); + account.Name = 'Test Account'; + account.AnnualRevenue = 0; + insert account; + Opportunity opp = new Opportunity(); + opp.Name = 'Test Opportunity'; + opp.StageName = 'Open'; + opp.CloseDate = System.today(); + opp.AccountId = account.Id; + opp.Amount = 100; + insert opp; + + // Assert rollup + System.assertEquals(100, [select AnnualRevenue from Account where Id = :account.Id].AnnualRevenue); + + // Delete Opportunity + delete opp; + + // Assert rollup + System.assertEquals(100, [select AnnualRevenue from Account where Id = :account.Id].AnnualRevenue); + } + + + private testmethod static void testSingleRollupWithInsertThenDeleteThenUnDelete() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + // Configure rollup + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Total Opportunities greater than 200 into Annual Revenue on Account'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Opportunity'; + rollupSummary.RelationShipField__c = 'AccountId'; + rollupSummary.RelationShipCriteria__c = null; + rollupSummary.FieldToAggregate__c = 'Amount'; + rollupSummary.AggregateOperation__c = 'Sum'; + rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.AggregateAllRows__c = false; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + insert new List { rollupSummary }; + + // Test data + Account account = new Account(); + account.Name = 'Test Account'; + account.AnnualRevenue = 0; + insert account; + Opportunity opp = new Opportunity(); + opp.Name = 'Test Opportunity'; + opp.StageName = 'Open'; + opp.CloseDate = System.today(); + opp.AccountId = account.Id; + opp.Amount = 100; + insert opp; + + // Assert rollup + System.assertEquals(100, [select AnnualRevenue from Account where Id = :account.Id].AnnualRevenue); + + // Delete Opportunity + delete opp; + + // Assert rollup + System.assertEquals(0, [select AnnualRevenue from Account where Id = :account.Id].AnnualRevenue); + + // Undelete Opportunity + undelete opp; + + // Assert rollup + System.assertEquals(100, [select AnnualRevenue from Account where Id = :account.Id].AnnualRevenue); + } + + /** + * https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/303 + **/ + @IsTest + private static void testAccountMergeAsParent() { + + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup'; + rollupSummaryA.ParentObject__c = 'Account'; + rollupSummaryA.ChildObject__c = 'Task'; + rollupSummaryA.RelationShipField__c = 'WhatId'; + rollupSummaryA.FieldToAggregate__c = 'Id'; + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryA.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = 'Realtime'; + insert rollupSummaryA; + + // Setup parent test records + Account accountParentA = new Account(Name = 'Test Account A'); + insert accountParentA; + // Setup parent test records + Account accountParentB = new Account(Name = 'Test Account B'); + insert accountParentB; + + // Insert a Task for Account and assert + Task task1 = new Task(); + task1.Subject = 'Task A'; + task1.WhatId = accountParentA.Id; + insert task1; + + // Insert a Task for Account and assert + Task task2 = new Task(); + task2.Subject = 'Task B'; + task2.WhatId = accountParentB.Id; + insert task2; + + // Real time working? + System.assertEquals(1, [select AnnualRevenue from Account where id = :accountParentA.Id][0].AnnualRevenue); + System.assertEquals(1, [select AnnualRevenue from Account where id = :accountParentB.Id][0].AnnualRevenue); + + // Enable the Account (Parent) Trigger + TestContext.AccountTestTriggerEnabled = true; + + // Merge? + Database.merge(accountParentA, accountParentB.Id); + + // Assert Schedule items are added + System.assertEquals(accountParentA.Id, [select Id, ParentId__c from LookupRollupSummaryScheduleItems__c][0].ParentId__c); + + // Run rollup job + Test.startTest(); + RollupService.runJobToProcessScheduledItems(); + Test.stopTest(); + + // Schedule items triggered refresh of rollups? + System.assertEquals(2, [select AnnualRevenue from Account where id = :accountParentA.Id][0].AnnualRevenue); + } + + /** + * https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/303 + **/ + @IsTest + private static void testAccountMergeAsParentWithoutParentTriggerDeployed() { + + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Test Rollup'; + rollupSummaryA.ParentObject__c = 'Account'; + rollupSummaryA.ChildObject__c = 'Task'; + rollupSummaryA.RelationShipField__c = 'WhatId'; + rollupSummaryA.FieldToAggregate__c = 'Id'; + rollupSummaryA.AggregateOperation__c = RollupSummaries.AggregateOperation.Count.name(); + rollupSummaryA.AggregateResultField__c = 'AnnualRevenue'; + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = 'Realtime'; + insert rollupSummaryA; + + // Setup parent test records + Account accountParentA = new Account(Name = 'Test Account A'); + insert accountParentA; + // Setup parent test records + Account accountParentB = new Account(Name = 'Test Account B'); + insert accountParentB; + + // Insert a Task for Account and assert + Task task1 = new Task(); + task1.Subject = 'Task A'; + task1.WhatId = accountParentA.Id; + insert task1; + + // Insert a Task for Account and assert + Task task2 = new Task(); + task2.Subject = 'Task B'; + task2.WhatId = accountParentB.Id; + insert task2; + + // Real time working? + System.assertEquals(1, [select AnnualRevenue from Account where id = :accountParentA.Id][0].AnnualRevenue); + System.assertEquals(1, [select AnnualRevenue from Account where id = :accountParentB.Id][0].AnnualRevenue); + + // Disable the Account (Parent) Trigger, this prevents the rollups from being recalculated + TestContext.AccountTestTriggerEnabled = false; + + // Merge? + Database.merge(accountParentA, accountParentB.Id); + + // Assert no Schedule items are added + System.assertEquals(0, [select Id, ParentId__c from LookupRollupSummaryScheduleItems__c].size()); + + // Schedule items triggered refresh of rollups? No + System.assertEquals(1, [select AnnualRevenue from Account where id = :accountParentA.Id][0].AnnualRevenue); + + } + + /** + * https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/303 + **/ + @IsTest + private static void testContactMergeAsChild() { + + LookupRollupSummary__c rollupSummaryA = new LookupRollupSummary__c(); + rollupSummaryA.Name = 'Total Opportunities greater than 200 into Annual Revenue on Account'; + rollupSummaryA.ParentObject__c = 'Account'; + rollupSummaryA.ChildObject__c = 'Contact'; + rollupSummaryA.RelationShipField__c = 'AccountId'; + rollupSummaryA.RelationShipCriteria__c = null; + rollupSummaryA.FieldToAggregate__c = 'FirstName'; + rollupSummaryA.ConcatenateDelimiter__c = ','; + rollupSummaryA.AggregateOperation__c = 'Concatenate'; + rollupSummaryA.AggregateResultField__c = 'Description'; + rollupSummaryA.Active__c = true; + rollupSummaryA.CalculationMode__c = 'Realtime'; + insert rollupSummaryA; + + // Test data + Account accountA = new Account(); + accountA.Name = 'Test Account'; + accountA.AnnualRevenue = 0; + insert accountA; + Contact contactA = new Contact(); + contactA.FirstName = 'Fred'; + contactA.LastName = 'Smith'; + contactA.AccountId = accountA.Id; + insert contactA; + Contact contactB = new Contact(); + contactB.FirstName = 'Bob'; + contactB.LastName = 'Smith'; + contactB.AccountId = accountA.Id; + insert contactB; + + // Assert realtime rollup + System.assertEquals('Fred,Bob', [select Description from Account where Id = :accountA.Id][0].Description); + + // Disable the Account (Parent) Trigger (just to prove we don't need it as its a child merge) + TestContext.AccountTestTriggerEnabled = false; + + // Merge contacts + Database.merge(contactA, contactB.Id); + + // Assert Schedule items are added + System.assertEquals(accountA.Id, [select Id, ParentId__c from LookupRollupSummaryScheduleItems__c][0].ParentId__c); + + // Run rollup job + Test.startTest(); + RollupService.runJobToProcessScheduledItems(); + Test.stopTest(); + + System.assertEquals('Fred', [select Description from Account where Id = :accountA.Id][0].Description); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupServiceTest6.cls-meta.xml b/rolluptool/src/classes/RollupServiceTest6.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/RollupServiceTest6.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/RollupSummaries.cls b/rolluptool/src/classes/RollupSummaries.cls index 7391c736..060a3c88 100644 --- a/rolluptool/src/classes/RollupSummaries.cls +++ b/rolluptool/src/classes/RollupSummaries.cls @@ -25,9 +25,9 @@ **/ /** - * Validation and other behaviour for the Lookup Rollup Summary custom object + * Validation and other behaviour for the Lookup Rollup Summary custom object or custom metadata records **/ -public with sharing class RollupSummaries extends SObjectDomain +public class RollupSummaries extends fflib_SObjectDomain { private static final Integer APEXTRIGGER_NAME_LENGTH = 40; // ApexTrigger.Name.getDescribe().getLength(); gives 255? @@ -42,7 +42,12 @@ public with sharing class RollupSummaries extends SObjectDomain AggregateOperation.Max.name() => LREngine.RollupOperation.Max, AggregateOperation.Min.name() => LREngine.RollupOperation.Min, AggregateOperation.Avg.name() => LREngine.RollupOperation.Avg, - AggregateOperation.Count.name() => LREngine.RollupOperation.Count + AggregateOperation.Count.name() => LREngine.RollupOperation.Count, + AggregateOperation.Count_Distinct.name().replace('_', ' ') => LREngine.RollupOperation.Count_Distinct, + AggregateOperation.Concatenate.name() => LREngine.RollupOperation.Concatenate, + AggregateOperation.Concatenate_Distinct.name().replace('_', ' ') => LREngine.RollupOperation.Concatenate_Distinct, + AggregateOperation.First.name() => LREngine.RollupOperation.First, + AggregateOperation.Last.name() => LREngine.RollupOperation.Last }; /** @@ -52,7 +57,8 @@ public with sharing class RollupSummaries extends SObjectDomain { Realtime, Scheduled, - Developer + Developer, + Process_Builder } /** @@ -64,128 +70,301 @@ public with sharing class RollupSummaries extends SObjectDomain Max, Min, Avg, - Count + Count, + Count_Distinct, + Concatenate, + Concatenate_Distinct, + First, + Last } - public RollupSummaries(List records) + /** + * Intentially shadow the Records base class property with a list of wrapped records + **/ + public List Records; + + public RollupSummaries(List records) { super(records); + + // Disable CRUD security enforced in Trigger context + this.Configuration.disableTriggerCRUDSecurity(); + + // Wrap the records from the Custom Object or Custom Metadata + this.Records = RollupSummary.toList(records); } - + /** - * Validations for inserts and updates of records - **/ - public override void onValidate() + * Before Insert processing + **/ + public override void onBeforeInsert() { - // Query for any related Apex triggers - Set rollupTriggerNames = new Set(); - for(LookupRollupSummary__c lookupRollupSummary : (List) Records) - rollupTriggerNames.add(makeTriggerName(lookupRollupSummary)); - Map apexTriggers = new ApexTriggersSelector().selectByName(rollupTriggerNames); + updateDescribableFieldNames(); + } - // Cache Apex Describes + /** + * Before Update processing + **/ + public override void onBeforeUpdate(Map existingRecords) + { + updateDescribableFieldNames(); + } + + /** + * update field names using describe info + **/ + private void updateDescribableFieldNames() + { Map gd = Schema.getGlobalDescribe(); Map> gdFields = new Map>(); - for(LookupRollupSummary__c lookupRollupSummary : (List) Records) + for(RollupSummary lookupRollupSummary : Records) { - SObjectType parentObjectType = gd.get(lookupRollupSummary.ParentObject__c); - SObjectType childObjectType = gd.get(lookupRollupSummary.ChildObject__c); + SObjectType parentObjectType = gd.get(lookupRollupSummary.ParentObject); + SObjectType childObjectType = gd.get(lookupRollupSummary.ChildObject); if(parentObjectType!=null && !gdFields.containsKey(parentObjectType)) gdFields.put(parentObjectType, parentObjectType.getDescribe().fields.getMap()); if(childObjectType!=null && !gdFields.containsKey(childObjectType)) gdFields.put(childObjectType, childObjectType.getDescribe().fields.getMap()); } + + for(RollupSummary lookupRollupSummary : Records) + { + // Parent Object + fflib_SObjectDescribe parentObject = fflib_SObjectDescribe.getDescribe(lookupRollupSummary.ParentObject); + if(parentObject!=null) + lookupRollupSummary.ParentObject = parentObject.getDescribe().getName(); + + // Child Object + fflib_SObjectDescribe childObject = fflib_SObjectDescribe.getDescribe(lookupRollupSummary.ChildObject); + if(childObject!=null) + lookupRollupSummary.ChildObject = childObject.getDescribe().getName(); + + // Child Object fields + SObjectField relationshipField = null; + SObjectField fieldToAggregate = null; + if(childObject!=null) + { + // Relationship field + relationshipField = childObject.getField(lookupRollupSummary.RelationshipField); + if(relationshipField!=null) + lookupRollupSummary.RelationshipField = relationshipField.getDescribe().getName(); + // Field to Aggregate + fieldToAggregate = childObject.getField(lookupRollupSummary.FieldToAggregate); + if(fieldToAggregate!=null) + lookupRollupSummary.FieldToAggregate = fieldToAggregate.getDescribe().getName(); + // Field to Order By + if(lookupRollupSummary.FieldToOrderBy!=null) { + try { + lookupRollupSummary.FieldToOrderBy = parseOrderByClause(lookupRollupSummary.FieldToOrderBy, childObject); + } catch(Utilities.OrderByInvalidException e) { + // there is a problem with order by so we ignore it intentionally here since we're just trying + // to update field names with describe info. The error will be caught during validation phase. + } + } + } + // Parent Object fields + SObjectField aggregateResultField = null; + if(parentObject!=null) + { + // Aggregate Result field + aggregateResultField = parentObject.getField(lookupRollupSummary.AggregateResultField); + if(aggregateResultField!=null) + lookupRollupSummary.AggregateResultField = aggregateResultField.getDescribe().getName(); + } + // Check the list of fields expressed in the relationship critiera fields + if(childObject!=null && lookupRollupSummary.RelationshipCriteriaFields!=null) + { + List relationshipCriteriaFields = new List(); + String[] fieldList = lookupRollupSummary.RelationshipCriteriaFields.split('\r\n'); + for(String field : fieldList) { + SObjectField relationshipCriteriaField = childObject.getField(field); + relationshipCriteriaFields.add(relationshipCriteriaField !=null ? relationshipCriteriaField.getDescribe().getName() : field); + } + lookupRollupSummary.RelationshipCriteriaFields = String.join(relationshipCriteriaFields, '\r\n'); + } + } + } + + /** + * Validations for inserts and updates of records + **/ + private void validateCommon() + { + // Calculate child object tigger names + Set rollupTriggerNames = new Set(); + for(RollupSummary lookupRollupSummary : Records) + { + // Calculate trigger name child object reqquires in order to check existance + fflib_SObjectDescribe childObject = fflib_SObjectDescribe.getDescribe(lookupRollupSummary.ChildObject); + if(childObject!=null) + rollupTriggerNames.add(makeTriggerName(lookupRollupSummary)); + } + + // Query for any related Apex triggers + Map apexTriggers = new ApexTriggersSelector().selectByName(rollupTriggerNames); - for(LookupRollupSummary__c lookupRollupSummary : (List) Records) + for(RollupSummary lookupRollupSummary : Records) { + // Custom Metadata shadow record? + if(lookupRollupSummary.UniqueName!=null) { + if(lookupRollupSummary.UniqueName.startsWith('mdt:')) { + // Prevent this record from being activated + if(lookupRollupSummary.Active) { + lookupRollupSummary.Fields.Active.addError('This rollup is managed by the system and cannot be activated.'); + break; + } + // Skip rest of validation + break; + } + } // Parent Object valid? - SObjectType parentObjectType = gd.get(lookupRollupSummary.ParentObject__c); - if(parentObjectType==null) - lookupRollupSummary.ParentObject__c.addError(error('Object does not exist.', lookupRollupSummary, LookupRollupSummary__c.ParentObject__c)); + fflib_SObjectDescribe parentObject = fflib_SObjectDescribe.getDescribe(lookupRollupSummary.ParentObject); + if(parentObject==null) + lookupRollupSummary.Fields.ParentObject.addError(error('Object does not exist.', lookupRollupSummary.Record, LookupRollupSummary__c.ParentObject__c)); // Child Object valid? - SObjectType childObjectType = gd.get(lookupRollupSummary.ChildObject__c); - if(childObjectType==null) - lookupRollupSummary.ChildObject__c.addError(error('Object does not exist.', lookupRollupSummary, LookupRollupSummary__c.ChildObject__c)); + fflib_SObjectDescribe childObject = fflib_SObjectDescribe.getDescribe(lookupRollupSummary.ChildObject); + if(childObject==null) + lookupRollupSummary.Fields.ChildObject.addError(error('Object does not exist.', lookupRollupSummary.Record, LookupRollupSummary__c.ChildObject__c)); // Child Object fields valid? SObjectField relationshipField = null; SObjectField fieldToAggregate = null; - Map childObjectFields = gdFields.get(childObjectType); - if(childObjectFields!=null) + Boolean orderByIsValid = true; + if(childObject!=null) { // Relationship field valid? - relationshipField = childObjectFields.get(lookupRollupSummary.RelationshipField__c); + relationshipField = childObject.getField(lookupRollupSummary.RelationshipField); if(relationshipField==null) - lookupRollupSummary.RelationshipField__c.addError(error('Field does not exist.', lookupRollupSummary, LookupRollupSummary__c.RelationshipField__c)); + lookupRollupSummary.Fields.RelationshipField.addError(error('Field does not exist.', lookupRollupSummary.Record, LookupRollupSummary__c.RelationshipField__c)); // Field to Aggregate valid? - fieldToAggregate = childObjectFields.get(lookupRollupSummary.FieldToAggregate__c); + fieldToAggregate = childObject.getField(lookupRollupSummary.FieldToAggregate); if(fieldToAggregate==null) - lookupRollupSummary.FieldToAggregate__c.addError(error('Field does not exist.', lookupRollupSummary, LookupRollupSummary__c.FieldToAggregate__c)); + lookupRollupSummary.Fields.FieldToAggregate.addError(error('Field does not exist.', lookupRollupSummary.Record, LookupRollupSummary__c.FieldToAggregate__c)); + // Field to Order By valid? + if(!String.isBlank(lookupRollupSummary.FieldToOrderBy)) { + try { + String orderByClause = parseOrderByClause(lookupRollupSummary.FieldToOrderBy, childObject); + } catch(Utilities.OrderByInvalidException e) { + orderByIsValid = false; + lookupRollupSummary.Fields.FieldToOrderBy.addError(error(e.getMessage(), lookupRollupSummary.Record, LookupRollupSummary__c.FieldToOrderBy__c)); + } + } // TODO: Validate relationship field is a lookup to the parent // ... } // Parent Object fields valid? SObjectField aggregateResultField = null; - Map parentObjectFields = gdFields.get(parentObjectType); - if(parentObjectFields!=null) + if(parentObject!=null) { // Aggregate Result field valid? - aggregateResultField = parentObjectFields.get(lookupRollupSummary.AggregateResultField__c); + aggregateResultField = parentObject.getField(lookupRollupSummary.AggregateResultField); if(aggregateResultField==null) - lookupRollupSummary.AggregateResultField__c.addError(error('Field does not exist.', lookupRollupSummary, LookupRollupSummary__c.AggregateResultField__c)); + lookupRollupSummary.Fields.AggregateResultField.addError(error('Field does not exist.', lookupRollupSummary.Record, LookupRollupSummary__c.AggregateResultField__c)); } // Cannot activate Realtime or Scheduled rollup without the required trigger deployed - String triggerName = makeTriggerName(lookupRollupSummary); - if(lookupRollupSummary.Active__c && - (lookupRollupSummary.CalculationMode__c == CalculationMode.Realtime.name() || - lookupRollupSummary.CalculationMode__c == CalculationMode.Scheduled.name()) && - !apexTriggers.containsKey(triggerName)) - lookupRollupSummary.Active__c.addError(error('Apex Trigger ' + triggerName + ' has not been deployed. Click Manage Child Trigger and try again.', lookupRollupSummary, LookupRollupSummary__c.Active__c)); + if(childObject!=null) + { + String triggerName = makeTriggerName(lookupRollupSummary); + if(lookupRollupSummary.Active && + (lookupRollupSummary.CalculationMode == CalculationMode.Realtime.name() || + lookupRollupSummary.CalculationMode == CalculationMode.Scheduled.name()) && + !apexTriggers.containsKey(triggerName)) + lookupRollupSummary.Fields.Active.addError(error('Apex Trigger ' + triggerName + ' has not been deployed. Click Manage Child Trigger and try again.', lookupRollupSummary.Record, LookupRollupSummary__c.Active__c)); + } // Check the list of fields expressed in the relationship critiera fields - if(childObjectFields!=null && lookupRollupSummary.RelationshipCriteriaFields__c!=null) + if(childObject!=null && lookupRollupSummary.RelationshipCriteriaFields!=null) { - String[] fieldList = lookupRollupSummary.RelationshipCriteriaFields__c.split('\r\n'); + String[] fieldList = lookupRollupSummary.RelationshipCriteriaFields.split('[\r\n]+'); String[] fieldsInError = new List(); for(String field : fieldList) - if(childObjectFields.get(field)==null) - fieldsInError.add(field); + if(field.length()>0) + if(childObject.getField(field)==null) + fieldsInError.add(field); if(fieldsInError.size()==1) - lookupRollupSummary.RelationshipCriteriaFields__c.addError(error('Field ' + fieldsInError[0] + ' does not exist on the child object.', lookupRollupSummary, LookupRollupSummary__c.RelationshipCriteriaFields__c)); + lookupRollupSummary.Fields.RelationshipCriteriaFields.addError(error('Field ' + fieldsInError[0] + ' does not exist on the child object.', lookupRollupSummary.Record, LookupRollupSummary__c.RelationshipCriteriaFields__c)); else if(fieldsInError.size()>1) - lookupRollupSummary.RelationshipCriteriaFields__c.addError(error('Fields ' + String.join(fieldsInError, ',') + ' do not exist on the child object.', lookupRollupSummary, LookupRollupSummary__c.RelationshipCriteriaFields__c)); - } + lookupRollupSummary.Fields.RelationshipCriteriaFields.addError(error('Fields ' + String.join(fieldsInError, ',') + ' do not exist on the child object.', lookupRollupSummary.Record, LookupRollupSummary__c.RelationshipCriteriaFields__c)); + } + // Row limit is only supported for certain operations + LREngine.RollupOperation operation = + OPERATION_PICKLIST_TO_ENUMS.get(lookupRollupSummary.AggregateOperation); + if(operation!=null && lookupRollupSummary.RowLimit!=null && lookupRollupSummary.RowLimit>0) { + Set operationsSupportingRowLimit + = new Set{ + LREngine.RollupOperation.Last, + LREngine.RollupOperation.Concatenate, + LREngine.RollupOperation.Concatenate_Distinct }; + if(!operationsSupportingRowLimit.contains(operation)) { + lookupRollupSummary.Fields.RowLimit.addError(error('Row Limit is only supported on Last and Concatentate operators.', lookupRollupSummary.Record, LookupRollupSummary__c.RowLimit__c )); + } + } try { // If all objects and fields valid... - if(parentObjectType!=null && - childObjectType!=null && + if(parentObject!=null && + childObject!=null && relationshipField!=null && aggregateResultField!=null && - fieldToAggregate!=null) + fieldToAggregate!=null && + orderByIsValid) { // Validate via LREngine context LREngine.Context lreContext = new LREngine.Context( - parentObjectType, // parent object - childObjectType, // child object + parentObject.getSObjectType(), // parent object + childObject.getSObjectType(), // child object relationshipField.getDescribe(), // relationship field name - lookupRollupSummary.RelationShipCriteria__c); + lookupRollupSummary.RelationShipCriteria, + lookupRollupSummary.FieldToOrderBy); lreContext.add( new LREngine.RollupSummaryField( aggregateResultField.getDescribe(), fieldToAggregate.getDescribe(), - OPERATION_PICKLIST_TO_ENUMS.get(lookupRollupSummary.AggregateOperation__c))); + operation, + lookupRollupSummary.ConcatenateDelimiter)); + // Validate the SOQL + if(lookupRollupSummary.RelationShipCriteria!=null && + lookupRollupSummary.RelationShipCriteria.length()>0) + { + try { + // Validate only mode ensures no query is actually made should it be valid + LREngine.rollUp(lreContext, new Set(), true); + } catch (QueryException e) { + lookupRollupSummary.Fields.RelationShipCriteria.addError( + error(String.format(MSG_INVALID_CRITERIA, new String[] { lookupRollupSummary.RelationShipCriteria, e.getMessage() }), lookupRollupSummary.Record, LookupRollupSummary__c.RelationShipCriteria__c)); + } + } } } catch (LREngine.BadRollUpSummaryStateException e) { // Associate exception message with the lookup rollup summary error - lookupRollupSummary.addError(error(e.getMessage(), lookupRollupSummary)); + lookupRollupSummary.addError(error(e.getMessage(), lookupRollupSummary.Record)); } } } + + /** + * Validations for inserts of records + **/ + public override void onValidate() + { + // invoke validation that should occur for insert & update + validateCommon(); + } + + /** + * Validations for updates of records + **/ + public override void onValidate(Map existingRecords) + { + // invoke validation that should occur for insert & update + validateCommon(); + } + + private static final String MSG_INVALID_CRITERIA = 'Relationship Criteria \'\'{0}\'\' is not valid, see SOQL documentation http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_conditionexpression.htm, error is \'\'{1}\'\''; - public class Constructor implements SObjectDomain.IConstructable + public class Constructor implements fflib_SObjectDomain.IConstructable { - public SObjectDomain construct(List sObjectList) + public fflib_SObjectDomain construct(List sObjectList) { return new RollupSummaries(sObjectList); } @@ -194,46 +373,106 @@ public with sharing class RollupSummaries extends SObjectDomain /** * Trigger name for given lookup rollup summary **/ - public static String makeTriggerName(LookupRollupSummary__c lookupRollupSummary) + public static String makeTriggerName(RollupSummary lookupRollupSummary) { - if(Test.isRunningTest() && lookupRollupSummary.ChildObject__c == 'Opportunity') + if(Test.isRunningTest() && lookupRollupSummary.ChildObject == 'Opportunity') return 'RollupServiceTestTrigger'; - else if(Test.isRunningTest() && lookupRollupSummary.ChildObject__c == 'dlrs__LookupChild__c') + else if(Test.isRunningTest() && lookupRollupSummary.ChildObject == LookupChild__c.sObjectType.getDescribe().getName()) return 'RollupServiceTest2Trigger'; - else if(Test.isRunningTest() && lookupRollupSummary.ChildObject__c == 'Account') + else if(Test.isRunningTest() && lookupRollupSummary.ChildObject == 'Account') return 'RollupServiceTest3Trigger'; - return calculateComponentName(lookupRollupSummary.ChildObject__c, 'Trigger', APEXTRIGGER_NAME_LENGTH); + else if(Test.isRunningTest() && lookupRollupSummary.ChildObject == 'Task') + return 'RollupServiceTest4Trigger'; + else if(Test.isRunningTest() && lookupRollupSummary.ChildObject == 'Contact') + return 'RollupServiceTest5Trigger'; + return calculateComponentName(lookupRollupSummary.ChildObject, 'Trigger', APEXTRIGGER_NAME_LENGTH); } - + /** * Apex test name for given lookup rollup summary **/ - public static String makeTriggerTestName(LookupRollupSummary__c lookupRollupSummary) + public static String makeTriggerTestName(RollupSummary lookupRollupSummary) { - if(Test.isRunningTest() && lookupRollupSummary.ChildObject__c == 'Opportunity') + if(Test.isRunningTest() && lookupRollupSummary.ChildObject == 'Opportunity') return 'RollupSummariesTest'; - return calculateComponentName(lookupRollupSummary.ChildObject__c, 'Test', APEXCLASS_NAME_LENGTH); + return calculateComponentName(lookupRollupSummary.ChildObject, 'Test', APEXCLASS_NAME_LENGTH); } + /** + * Trigger name for Parent object for given lookup rollup summary + **/ + public static String makeParentTriggerName(RollupSummary lookupRollupSummary) + { + if(Test.isRunningTest() && lookupRollupSummary.ParentObject == 'Opportunity') + return 'RollupServiceTestTrigger'; + else if(Test.isRunningTest() && lookupRollupSummary.ParentObject == LookupParent__c.sObjectType.getDescribe().getName()) + return 'RollupServiceTest2Trigger'; + else if(Test.isRunningTest() && lookupRollupSummary.ParentObject == 'Account') + return 'RollupServiceTest3Trigger'; + else if(Test.isRunningTest() && lookupRollupSummary.ParentObject == 'Task') + return 'RollupServiceTest4Trigger'; + else if(Test.isRunningTest() && lookupRollupSummary.ParentObject == 'Contact') + return 'RollupServiceTest5Trigger'; + return calculateComponentName(lookupRollupSummary.ParentObject, 'Trigger', APEXTRIGGER_NAME_LENGTH); + } + + /** + * Apex test name for Parent object for given lookup rollup summary + **/ + public static String makeParentTriggerTestName(RollupSummary lookupRollupSummary) + { + if(Test.isRunningTest() && lookupRollupSummary.ParentObject == 'Opportunity') + return 'RollupSummariesTest'; + return calculateComponentName(lookupRollupSummary.ParentObject, 'Test', APEXCLASS_NAME_LENGTH); + } + /** * Ensures the component name never exceeds the given maximum length but yet still remains unique **/ + @TestVisible private static String calculateComponentName(String childObjectName, String suffix, Integer maxComponentNameLength) { String trimmedObjectName = childObjectName.replace('__c', '').replace('__', '_'); - String componentName = 'dlrs_' + trimmedObjectName + suffix; + String prefix = Utilities.componentPrefix(); + String componentName = prefix + trimmedObjectName + suffix; Integer componentNameLength = componentName.length(); if(componentNameLength > maxComponentNameLength) // Do we need to trim the trigger name? { Map gd = Schema.getGlobalDescribe(); - SObjectType childObjectType = gd.get(childObjectName); + SObjectType childObjectType = gd.get(childObjectName); String childObjectPrefix = childObjectType.getDescribe().getKeyPrefix(); // Key prefix will be used to make the trimmed name unique again Integer overflowChars = componentNameLength - maxComponentNameLength; // How much do we need to trim the name by? trimmedObjectName = trimmedObjectName.substring(0, trimmedObjectName.length() - overflowChars); // Trim the overflow characters from the name trimmedObjectName = trimmedObjectName.substring(0, trimmedObjectName.length() - childObjectPrefix.length()); // Trim space for the prefix on the end trimmedObjectName+= childObjectPrefix; // Add on the end the unique object prefix (to ensure the trimmed name is still unique) - componentName = 'dlrs_' + trimmedObjectName + suffix; + componentName = prefix + trimmedObjectName + suffix; } return componentName; } + + private static String parseOrderByClause(String orderByClause, fflib_SObjectDescribe fields) + { + List fieldsToOrderBy = Utilities.parseOrderByClause(orderByClause); + if (fieldsToOrderBy == null || fieldsToOrderBy.isEmpty()) { + return null; + } + + String parsedOrderByClause = ''; + for (Utilities.Ordering orderByField :fieldsToOrderBy) { + SObjectField sObjectField = fields.getField(orderByField.getField()); + if (sObjectField == null) { + throw new Utilities.OrderByInvalidException('Field does not exist.'); + } + // update name with describe info + orderByField.setField(sObjectField.getDescribe().getName()); + + // using toAsSpecifiedString so that we update the field name to proper describe info + // but leave the rest of what was input unchanged. If we called toString() we would + // add fully qualified Order By Clause and we don't want to add in portions of the clause + // that the user didn't provide in the first place. + parsedOrderByClause += (String.isBlank(parsedOrderByClause) ? '' : ',') + orderByField.toAsSpecifiedString(); + } + + return parsedOrderByClause; + } } \ No newline at end of file diff --git a/rolluptool/src/classes/RollupSummaries.cls-meta.xml b/rolluptool/src/classes/RollupSummaries.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupSummaries.cls-meta.xml +++ b/rolluptool/src/classes/RollupSummaries.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupSummariesSelector.cls b/rolluptool/src/classes/RollupSummariesSelector.cls index c7844932..3e515995 100644 --- a/rolluptool/src/classes/RollupSummariesSelector.cls +++ b/rolluptool/src/classes/RollupSummariesSelector.cls @@ -25,58 +25,284 @@ **/ /** - * Various queries for the Lookup Rollup Summary custom object + * Various queries for the Lookup Rollup Summary custom object and cusotm metadata object **/ -public with sharing class RollupSummariesSelector extends SObjectSelector +public class RollupSummariesSelector { - public List getSObjectFieldList() - { - return new List { - LookupRollupSummary__c.Name, - LookupRollupSummary__c.Active__c, - LookupRollupSummary__c.AggregateOperation__c, - LookupRollupSummary__c.AggregateResultField__c, - LookupRollupSummary__c.CalculationMode__c, - LookupRollupSummary__c.ChildObject__c, - LookupRollupSummary__c.FieldToAggregate__c, - LookupRollupSummary__c.ParentObject__c, - LookupRollupSummary__c.RelationshipCriteria__c, - LookupRollupSummary__c.RelationshipCriteriaFields__c, - LookupRollupSummary__c.RelationshipField__c, - LookupRollupSummary__c.CalculateJobId__c - }; + private CustomObjectSelector m_customObjectSelector; + + private CustomMetadataSelector m_customMetadataSelector; + + public RollupSummariesSelector() { + this(false); } - public Schema.SObjectType getSObjectType() - { - return LookupRollupSummary__c.sObjectType; + public RollupSummariesSelector(boolean enforceSecurity) { + + // Dual selectors for querying custom object and custom metadata stores + m_customObjectSelector = new CustomObjectSelector(enforceSecurity); + m_customMetadataSelector = new CustomMetadataSelector(enforceSecurity); } - public List selectById(Set idSet) + /** + * Returns all rollups for the given Id set (can contain either Custom Metadata Id' or DeveloperName's) + **/ + public List selectById(Set idSet) { - return (List) selectSObjectsById(idSet); + List records = new List(); + records = m_customObjectSelector.selectById(idSet); + records.addAll(m_customMetadataSelector.selectById(idSet)); + records.addAll(m_customMetadataSelector.selectByDeveloperName(idSet)); + return records; } + /** * Returns active lookup rollup summary definitions for thr given calculation mode and child object **/ - public List selectActiveByChildObject(RollupSummaries.CalculationMode calculationMode, Set childObjectNames) + public List selectActiveByChildObject(RollupSummaries.CalculationMode calculationMode, Set childObjectNames) { - return selectActiveByChildObject(new List { calculationMode }, childObjectNames); + List records = new List(); + records = m_customObjectSelector.selectActiveByChildObject(calculationMode, childObjectNames); + records.addAll(m_customMetadataSelector.selectActiveByChildObject(calculationMode, childObjectNames)); + return records; } /** * Returns active lookup rollup summary definitions for thr given calculation modes and child object **/ - public List selectActiveByChildObject(List calculationModes, Set childObjectNames) + public List selectActiveByChildObject(List calculationModes, Set childObjectNames) { - assertIsAccessible(); - List calculationModeNames = new List(); - for(RollupSummaries.CalculationMode calculationMode : calculationModes) - calculationModeNames.add(calculationMode.name()); - return Database.query(String.format( - 'select {0} from {1} where CalculationMode__c in :calculationModeNames and ChildObject__c in :childObjectNames and Active__c = true order by ParentObject__c, RelationshipField__c', - new List{getFieldListString(), - getSObjectName(), - getOrderBy()})); + List records = new List(); + records = m_customObjectSelector.selectActiveByChildObject(calculationModes, childObjectNames); + records.addAll(m_customMetadataSelector.selectActiveByChildObject(calculationModes, childObjectNames)); + return records; } + + /** + * Returns active lookup rollup summary definitions for the given rollup unique names + **/ + public List selectActiveByUniqueName(Set uniqueNames) + { + List records = new List(); + records = m_customObjectSelector.selectActiveByUniqueName(uniqueNames); + records.addAll(m_customMetadataSelector.selectActiveByUniqueName(uniqueNames)); + return records; + } + + /** + * Queries Custom Object store for rollups + **/ + public class CustomObjectSelector extends fflib_SObjectSelector { + + public CustomObjectSelector() { + super(); + } + + public CustomObjectSelector(boolean enforceSecurity) { + super(false, enforceSecurity, enforceSecurity); + } + + public List getSObjectFieldList() + { + return new List { + LookupRollupSummary__c.Name, + LookupRollupSummary__c.Active__c, + LookupRollupSummary__c.AggregateOperation__c, + LookupRollupSummary__c.AggregateResultField__c, + LookupRollupSummary__c.CalculationMode__c, + LookupRollupSummary__c.ChildObject__c, + LookupRollupSummary__c.ConcatenateDelimiter__c, + LookupRollupSummary__c.FieldToAggregate__c, + LookupRollupSummary__c.FieldToOrderBy__c, + LookupRollupSummary__c.ParentObject__c, + LookupRollupSummary__c.RelationshipCriteria__c, + LookupRollupSummary__c.RelationshipCriteriaFields__c, + LookupRollupSummary__c.RelationshipField__c, + LookupRollupSummary__c.UniqueName__c, + LookupRollupSummary__c.CalculationSharingMode__c, + LookupRollupSummary__c.TestCode__c, + LookupRollupSummary__c.TestCodeSeeAllData__c, + LookupRollupSummary__c.AggregateAllRows__c, + LookupRollupSummary__c.RowLimit__c + }; + } + + public Schema.SObjectType getSObjectType() + { + return LookupRollupSummary__c.sObjectType; + } + + public List selectById(Set idSet) + { + Set recordIds = new Set(); + for(String idAsString : idSet) + recordIds.add((Id)idAsString); + return RollupSummary.toList(selectSObjectsById(recordIds)); + } + + /** + * Returns active lookup rollup summary definitions for thr given calculation mode and child object + **/ + public List selectActiveByChildObject(RollupSummaries.CalculationMode calculationMode, Set childObjectNames) + { + return selectActiveByChildObject(new List { calculationMode }, childObjectNames); + } + + /** + * Returns active lookup rollup summary definitions for thr given calculation modes and child object + **/ + public List selectActiveByChildObject(List calculationModes, Set childObjectNames) + { + List calculationModeNames = new List(); + for(RollupSummaries.CalculationMode calculationMode : calculationModes) + calculationModeNames.add(calculationMode.name()); + return RollupSummary.toList( + Database.query( + newQueryFactory(). + setCondition('CalculationMode__c in :calculationModeNames and ChildObject__c in :childObjectNames and Active__c = true'). + addOrdering(LookupRollupSummary__c.ParentObject__c, fflib_QueryFactory.SortOrder.ASCENDING). + addOrdering(LookupRollupSummary__c.RelationshipField__c, fflib_QueryFactory.SortOrder.ASCENDING). + toSOQL())); + } + + /** + * Returns active lookup rollup summary definitions for the given rollup unique names + **/ + public List selectActiveByUniqueName(Set uniqueNames) + { + return RollupSummary.toList( + Database.query( + newQueryFactory(). + setCondition('UniqueName__c in :uniqueNames and Active__c = true'). + addOrdering(LookupRollupSummary__c.ParentObject__c, fflib_QueryFactory.SortOrder.ASCENDING). + addOrdering(LookupRollupSummary__c.RelationshipField__c, fflib_QueryFactory.SortOrder.ASCENDING). + toSOQL())); + } + + /** + * Returns lookup rollup summary definitions for the given rollup unique names + **/ + public List selectByUniqueName(Set uniqueNames) + { + return RollupSummary.toList( + Database.query( + newQueryFactory(). + setCondition('UniqueName__c in :uniqueNames'). + addOrdering(LookupRollupSummary__c.ParentObject__c, fflib_QueryFactory.SortOrder.ASCENDING). + addOrdering(LookupRollupSummary__c.RelationshipField__c, fflib_QueryFactory.SortOrder.ASCENDING). + toSOQL())); + } + } + + /** + * Queries Custom Metadata store for rollups + **/ + public class CustomMetadataSelector extends fflib_SObjectSelector { + + public CustomMetadataSelector() { + super(); + } + + public CustomMetadataSelector(boolean enforceSecurity) { + super(false, enforceSecurity, enforceSecurity); + } + + public List getSObjectFieldList() + { + return new List { + LookupRollupSummary2__mdt.Id, + LookupRollupSummary2__mdt.Label, + LookupRollupSummary2__mdt.DeveloperName, + LookupRollupSummary2__mdt.Active__c, + LookupRollupSummary2__mdt.AggregateOperation__c, + LookupRollupSummary2__mdt.AggregateResultField__c, + LookupRollupSummary2__mdt.CalculationMode__c, + LookupRollupSummary2__mdt.ChildObject__c, + LookupRollupSummary2__mdt.ConcatenateDelimiter__c, + LookupRollupSummary2__mdt.FieldToAggregate__c, + LookupRollupSummary2__mdt.FieldToOrderBy__c, + LookupRollupSummary2__mdt.ParentObject__c, + LookupRollupSummary2__mdt.RelationshipCriteria__c, + LookupRollupSummary2__mdt.RelationshipCriteriaFields__c, + LookupRollupSummary2__mdt.RelationshipField__c, + LookupRollupSummary2__mdt.CalculationSharingMode__c, + LookupRollupSummary2__mdt.TestCode__c, + LookupRollupSummary2__mdt.TestCodeSeeAllData__c, + LookupRollupSummary2__mdt.Description__c, + LookupRollupSummary2__mdt.AggregateAllRows__c, + LookupRollupSummary2__mdt.RowLimit__c + }; + } + + public Schema.SObjectType getSObjectType() + { + return LookupRollupSummary2__mdt.sObjectType; + } + + public List selectById(Set idSet) + { + return RollupSummary.toList( + Database.query( + newQueryFactory().setCondition('id in :idSet').toSOQL())); + } + + public List selectByDeveloperName(Set idSet) + { + String developerName = new List(idSet)[0]; + return RollupSummary.toList( + Database.query( + newQueryFactory().setCondition('DeveloperName = :developerName').toSOQL())); + } + + /** + * Returns active lookup rollup summary definitions for thr given calculation mode and child object + **/ + public List selectActiveByChildObject(RollupSummaries.CalculationMode calculationMode, Set childObjectNames) + { + return selectActiveByChildObject(new List { calculationMode }, childObjectNames); + } + + /** + * Returns active lookup rollup summary definitions for thr given calculation modes and child object + **/ + public List selectActiveByChildObject(List calculationModes, Set childObjectNames) + { + List calculationModeNames = new List(); + for(RollupSummaries.CalculationMode calculationMode : calculationModes) + calculationModeNames.add(calculationMode.name()); + return RollupSummary.toList( + Database.query( + newQueryFactory(). + setCondition('CalculationMode__c in :calculationModeNames and ChildObject__c in :childObjectNames and Active__c = true'). + addOrdering(LookupRollupSummary2__mdt.ParentObject__c, fflib_QueryFactory.SortOrder.ASCENDING). + addOrdering(LookupRollupSummary2__mdt.RelationshipField__c, fflib_QueryFactory.SortOrder.ASCENDING). + toSOQL())); + } + + /** + * Returns active lookup rollup summary definitions for the given rollup unique names + **/ + public List selectActiveByUniqueName(Set uniqueNames) + { + return RollupSummary.toList( + Database.query( + newQueryFactory(). + setCondition('DeveloperName in :uniqueNames and Active__c = true'). + addOrdering(LookupRollupSummary2__mdt.ParentObject__c, fflib_QueryFactory.SortOrder.ASCENDING). + addOrdering(LookupRollupSummary2__mdt.RelationshipField__c, fflib_QueryFactory.SortOrder.ASCENDING). + toSOQL())); + } + + /** + * Select all + **/ + public List selectAll() + { + return RollupSummary.toList( + Database.query( + newQueryFactory(). + addOrdering(LookupRollupSummary2__mdt.Label, fflib_QueryFactory.SortOrder.ASCENDING). + toSOQL())); + } + } } \ No newline at end of file diff --git a/rolluptool/src/classes/RollupSummariesSelector.cls-meta.xml b/rolluptool/src/classes/RollupSummariesSelector.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupSummariesSelector.cls-meta.xml +++ b/rolluptool/src/classes/RollupSummariesSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupSummariesTest.cls b/rolluptool/src/classes/RollupSummariesTest.cls index 962b498a..2a96497d 100644 --- a/rolluptool/src/classes/RollupSummariesTest.cls +++ b/rolluptool/src/classes/RollupSummariesTest.cls @@ -25,7 +25,7 @@ **/ @IsTest -private with sharing class RollupSummariesTest +private class RollupSummariesTest { // TODO: Write a test to validate the criteria fields validation // ... @@ -33,11 +33,39 @@ private with sharing class RollupSummariesTest // TODO: Write a test to validate the criteria fields are specified when criteria is specified // ... - + /** - * Issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/97 + * Issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/108 **/ - private testmethod static void testInsertBadChildBadCriteria() + private testmethod static void testBadCriteria() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Total Opportunities into Annual Revenue on Account'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Opportunity'; + rollupSummary.RelationShipField__c = 'AccountId'; + rollupSummary.RelationShipCriteria__c = 'StageName Equals Won'; + rollupSummary.RelationShipCriteriaFields__c = 'StageName'; + rollupSummary.FieldToAggregate__c = 'Amount'; + rollupSummary.AggregateOperation__c = 'Sum'; + rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Relationship Criteria \'StageName Equals Won\' is not valid, see SOQL documentation http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_conditionexpression.htm, error is \'unexpected token: \'Equals\'\'', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.RelationShipCriteria__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + } + + /** + * Issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/115 + **/ + private testmethod static void testInsertBadChildBigName() { // Test supported? if(!TestContext.isSupported()) @@ -46,7 +74,7 @@ private with sharing class RollupSummariesTest LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); rollupSummary.Name = 'Max Birthday for Contacts related to an Account'; rollupSummary.ParentObject__c = 'Account'; - rollupSummary.ChildObject__c = 'Bad'; + rollupSummary.ChildObject__c = 'BadBadBadBadBadBadBadBadBadBad'; rollupSummary.RelationShipField__c = 'AccountId'; rollupSummary.RelationShipCriteria__c = null; rollupSummary.FieldToAggregate__c = 'LastCURequestDate'; @@ -55,14 +83,50 @@ private with sharing class RollupSummariesTest rollupSummary.RelationshipCriteriaFields__c = 'Bad'; rollupSummary.Active__c = false; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Object does not exist.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(LookupRollupSummary__c.ChildObject__c, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[0]).field); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Object does not exist.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.ChildObject__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); } - private testmethod static void testInsertActiveValidation() + /** + * Issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/212 + **/ + private testmethod static void testUpdateBadChildBigName() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + String rsId = fflib_IDGenerator.generate(LookupRollupSummary__c.SObjectType); + + LookupRollupSummary__c oldRollupSummary = new LookupRollupSummary__c(Id=rsId); + oldRollupSummary.Name = 'Max Birthday for Contacts related to an Account'; + oldRollupSummary.ParentObject__c = 'Account'; + oldRollupSummary.ChildObject__c = 'Contact'; + oldRollupSummary.RelationShipField__c = 'AccountId'; + oldRollupSummary.RelationShipCriteria__c = null; + oldRollupSummary.FieldToAggregate__c = 'LastCURequestDate'; + oldRollupSummary.AggregateOperation__c = 'Count'; + oldRollupSummary.AggregateResultField__c = 'AnnualRevenue'; + oldRollupSummary.Active__c = false; + oldRollupSummary.CalculationMode__c = 'Realtime'; + + LookupRollupSummary__c newRollupSummary = oldRollupSummary.clone(true, true, true, true); + newRollupSummary.ChildObject__c = 'BadBadBadBadBadBadBadBadBadBad'; + fflib_SObjectDomain.Test.Database.onUpdate(new LookupRollupSummary__c[] { newRollupSummary }, new Map { oldRollupSummary.Id => oldRollupSummary } ); + + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Object does not exist.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.ChildObject__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + } + + /** + * Issue https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/97 + **/ + private testmethod static void testInsertBadChildBadCriteria() { // Test supported? if(!TestContext.isSupported()) @@ -71,19 +135,44 @@ private with sharing class RollupSummariesTest LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); rollupSummary.Name = 'Max Birthday for Contacts related to an Account'; rollupSummary.ParentObject__c = 'Account'; - rollupSummary.ChildObject__c = 'Contact'; + rollupSummary.ChildObject__c = 'Bad'; rollupSummary.RelationShipField__c = 'AccountId'; rollupSummary.RelationShipCriteria__c = null; rollupSummary.FieldToAggregate__c = 'LastCURequestDate'; rollupSummary.AggregateOperation__c = 'Count'; rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.RelationshipCriteriaFields__c = 'Bad'; + rollupSummary.Active__c = false; + rollupSummary.CalculationMode__c = 'Realtime'; + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Object does not exist.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.ChildObject__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + } + + private testmethod static void testInsertActiveValidation() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Last Lead raised for this Account'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Lead'; + rollupSummary.RelationShipField__c = 'OwnerId'; + rollupSummary.RelationShipCriteria__c = null; + rollupSummary.FieldToAggregate__c = 'Name'; + rollupSummary.AggregateOperation__c = 'Last'; + rollupSummary.AggregateResultField__c = 'Description'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Apex Trigger ' + RollupSummaries.makeTriggerName(rollupSummary) + ' has not been deployed. Click Manage Child Trigger and try again.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(LookupRollupSummary__c.Active__c, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[0]).field); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Apex Trigger ' + RollupSummaries.makeTriggerName(new RollupSummary(rollupSummary)) + ' has not been deployed. Click Manage Child Trigger and try again.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.Active__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); } private testmethod static void testInsertParentObjectValidation() @@ -103,11 +192,11 @@ private with sharing class RollupSummariesTest rollupSummary.AggregateResultField__c = 'AnnualRevenue'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Object does not exist.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(LookupRollupSummary__c.ParentObject__c, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[0]).field); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Object does not exist.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.ParentObject__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); } private testmethod static void testInsertChildObjectValidation() @@ -127,13 +216,11 @@ private with sharing class RollupSummariesTest rollupSummary.AggregateResultField__c = 'AnnualRevenue'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(2, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Object does not exist.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(LookupRollupSummary__c.ChildObject__c, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[0]).field); - System.assertEquals('Apex Trigger ' + RollupSummaries.makeTriggerName(rollupSummary) + ' has not been deployed. Click Manage Child Trigger and try again.', SObjectDomain.Errors.getAll()[1].message); - System.assertEquals(LookupRollupSummary__c.Active__c, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[1]).field); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Object does not exist.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.ChildObject__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); } private testmethod static void testInsertRelationshipFieldValidation() @@ -153,11 +240,11 @@ private with sharing class RollupSummariesTest rollupSummary.AggregateResultField__c = 'AnnualRevenue'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Field does not exist.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(LookupRollupSummary__c.RelationShipField__c, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[0]).field); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Field does not exist.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.RelationShipField__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); } private testmethod static void testInsertFieldToAggregateValidation() @@ -177,12 +264,62 @@ private with sharing class RollupSummariesTest rollupSummary.AggregateResultField__c = 'AnnualRevenue'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Field does not exist.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(LookupRollupSummary__c.FieldToAggregate__c, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[0]).field); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Field does not exist.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.FieldToAggregate__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); } + + private testmethod static void testInsertFieldToOrderByValidation() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Total Opportunities into Annual Revenue on Account'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Opportunity'; + rollupSummary.RelationShipField__c = 'AccountId'; + rollupSummary.RelationShipCriteria__c = null; + rollupSummary.FieldToAggregate__c = 'Amount'; + rollupSummary.FieldToOrderBy__c = 'AmountX'; + rollupSummary.AggregateOperation__c = 'Sum'; + rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Field does not exist.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.FieldToOrderBy__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + } + + private testmethod static void testInsertFieldToOrderByInvalidClauseValidation() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Total Opportunities into Annual Revenue on Account'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Opportunity'; + rollupSummary.RelationShipField__c = 'AccountId'; + rollupSummary.RelationShipCriteria__c = null; + rollupSummary.FieldToAggregate__c = 'Amount'; + rollupSummary.FieldToOrderBy__c = 'Amount ASC NULLS BAD'; + rollupSummary.AggregateOperation__c = 'Sum'; + rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Invalid order by clause.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.FieldToOrderBy__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + } private testmethod static void testInsertAggregateResultFieldValidation() { @@ -201,11 +338,11 @@ private with sharing class RollupSummariesTest rollupSummary.AggregateResultField__c = 'AnnualRevenueX'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Field does not exist.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(LookupRollupSummary__c.AggregateResultField__c, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[0]).field); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Field does not exist.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.AggregateResultField__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); } private testmethod static void testInsertBadFieldTypesStringNotValid() @@ -225,11 +362,11 @@ private with sharing class RollupSummariesTest rollupSummary.AggregateResultField__c = 'AnnualRevenue'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Only Date/DateTime/Time/Numeric fields are allowed for Sum, Max, Min and Avg', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(rollupSummary, ((SObjectDomain.ObjectError)SObjectDomain.Errors.getAll()[0]).record); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Only Date/DateTime/Time/Numeric fields are allowed for Sum, Max, Min and Avg', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(rollupSummary, ((fflib_SObjectDomain.ObjectError)fflib_SObjectDomain.Errors.getAll()[0]).record); } private testmethod static void testInsertBadFieldTypeSumNotValid() @@ -249,11 +386,11 @@ private with sharing class RollupSummariesTest rollupSummary.AggregateResultField__c = 'SLAExpirationDate__c'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Sum/Avg doesnt looks like valid for dates ! Still want, then implement the IRollerCoaster yourself and change this class as required.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(rollupSummary, ((SObjectDomain.ObjectError)SObjectDomain.Errors.getAll()[0]).record); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Sum/Avg doesnt looks like valid for dates ! Still want, then implement the IRollerCoaster yourself and change this class as required.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(rollupSummary, ((fflib_SObjectDomain.ObjectError)fflib_SObjectDomain.Errors.getAll()[0]).record); } private testmethod static void testTriggerAndTestClassNaming() @@ -262,14 +399,19 @@ private with sharing class RollupSummariesTest if(!TestContext.isSupported()) return; - System.assertEquals('dlrs_ContactTrigger', RollupSummaries.makeTriggerName(new LookupRollupSummary__c(ChildObject__c = 'Contact'))); - System.assertEquals('dlrs_ContactTest', RollupSummaries.makeTriggerTestName(new LookupRollupSummary__c(ChildObject__c = 'Contact'))); - System.assertEquals('dlrs_pse_AssignmentTrigger', RollupSummaries.makeTriggerName(new LookupRollupSummary__c(ChildObject__c = 'pse__Assignment__c'))); - System.assertEquals('dlrs_pse_AssignmentTest', RollupSummaries.makeTriggerTestName(new LookupRollupSummary__c(ChildObject__c = 'pse__Assignment__c'))); - System.assertEquals('dlrs_MyCustomObjectTrigger', RollupSummaries.makeTriggerName(new LookupRollupSummary__c(ChildObject__c = 'MyCustomObject__c'))); - System.assertEquals('dlrs_MyCustomObjectTest', RollupSummaries.makeTriggerTestName(new LookupRollupSummary__c(ChildObject__c = 'MyCustomObject__c'))); - System.assertEquals('dlrs_dlrs_LookupChildAReallyRea06Trigger', RollupSummaries.makeTriggerName(new LookupRollupSummary__c(ChildObject__c = 'dlrs__LookupChildAReallyReallyReallyBigBigName__c'))); - System.assertEquals('dlrs_dlrs_LookupChildAReallyRealla06Test', RollupSummaries.makeTriggerTestName(new LookupRollupSummary__c(ChildObject__c = 'dlrs__LookupChildAReallyReallyReallyBigBigName__c'))); + String componentPrefix = Utilities.componentPrefix(); + String objectPrefix = Utilities.objectPrefix(); + System.assertEquals(componentPrefix + 'LeadTrigger', RollupSummaries.makeTriggerName(new RollupSummary(new LookupRollupSummary__c(ChildObject__c = 'Lead')))); + System.assertEquals(componentPrefix + 'LeadTest', RollupSummaries.makeTriggerTestName(new RollupSummary(new LookupRollupSummary__c(ChildObject__c = 'Lead')))); + System.assertEquals(componentPrefix + 'pse_AssignmentTrigger', RollupSummaries.makeTriggerName(new RollupSummary(new LookupRollupSummary__c(ChildObject__c = 'pse__Assignment__c')))); + System.assertEquals(componentPrefix + 'pse_AssignmentTest', RollupSummaries.makeTriggerTestName(new RollupSummary(new LookupRollupSummary__c(ChildObject__c = 'pse__Assignment__c')))); + System.assertEquals(componentPrefix + 'MyCustomObjectTrigger', RollupSummaries.makeTriggerName(new RollupSummary(new LookupRollupSummary__c(ChildObject__c = 'MyCustomObject__c')))); + System.assertEquals(componentPrefix + 'MyCustomObjectTest', RollupSummaries.makeTriggerTestName(new RollupSummary(new LookupRollupSummary__c(ChildObject__c = 'MyCustomObject__c')))); + + String dlrsKeyPrefix = DeclarativeLookupRollupSummaries__c.sObjectType.getDescribe().getKeyPrefix(); + // Test RollupSummaries.calculateComponentName directly so we can override the maxComponentNameLength + System.assertEquals(componentPrefix + componentPrefix + 'DeclarativeLookupRollupSu' + dlrsKeyPrefix + 'Trigger', RollupSummaries.calculateComponentName(objectPrefix + 'DeclarativeLookupRollupSummaries__c', 'Trigger', 35 + 2 * componentPrefix.length())); + System.assertEquals(componentPrefix + componentPrefix + 'DeclarativeLookupRollupSumma' + dlrsKeyPrefix + 'Test', RollupSummaries.calculateComponentName(objectPrefix + 'DeclarativeLookupRollupSummaries__c', 'Test', 35 + 2 * componentPrefix.length())); } private testmethod static void testRelationshipCriteriaFieldsValidationSingle() @@ -290,10 +432,13 @@ private with sharing class RollupSummariesTest rollupSummary.AggregateResultField__c = 'AnnualRevenue'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Field Stage does not exist on the child object.', SObjectDomain.Errors.getAll()[0].message); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(2, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Field Stage does not exist on the child object.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.RelationShipCriteriaFields__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + System.assertEquals('Relationship Criteria \'Stage = \'Won\'\' is not valid, see SOQL documentation http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_conditionexpression.htm, error is \'No such column \'Stage\' on entity \'Opportunity\'. If you are attempting to use a custom field, be sure to append the \'__c\' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.\'', fflib_SObjectDomain.Errors.getAll()[1].message); + System.assertEquals(LookupRollupSummary__c.RelationShipCriteria__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[1]).field); } private testmethod static void testRelationshipCriteriaFieldsValidationMulti() @@ -314,10 +459,40 @@ private with sharing class RollupSummariesTest rollupSummary.AggregateResultField__c = 'AnnualRevenue'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Fields Stage,Another do not exist on the child object.', SObjectDomain.Errors.getAll()[0].message); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(2, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Fields Stage,Another do not exist on the child object.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.RelationShipCriteriaFields__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + System.assertEquals('Relationship Criteria \'Stage = \'Won\'\' is not valid, see SOQL documentation http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_conditionexpression.htm, error is \'No such column \'Stage\' on entity \'Opportunity\'. If you are attempting to use a custom field, be sure to append the \'__c\' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.\'', fflib_SObjectDomain.Errors.getAll()[1].message); + System.assertEquals(LookupRollupSummary__c.RelationShipCriteria__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[1]).field); + } + + private testmethod static void testRelationshipCriteriaFieldsValidationMultiViaMDT() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Total Opportunities into Annual Revenue on Account'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Opportunity'; + rollupSummary.RelationShipField__c = 'AccountId'; + rollupSummary.RelationShipCriteria__c = 'Stage = \'Won\''; + rollupSummary.RelationShipCriteriaFields__c = 'Stage\nAnother'; + rollupSummary.FieldToAggregate__c = 'Amount'; + rollupSummary.AggregateOperation__c = 'Sum'; + rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(2, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Fields Stage,Another do not exist on the child object.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.RelationShipCriteriaFields__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + System.assertEquals('Relationship Criteria \'Stage = \'Won\'\' is not valid, see SOQL documentation http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_conditionexpression.htm, error is \'No such column \'Stage\' on entity \'Opportunity\'. If you are attempting to use a custom field, be sure to append the \'__c\' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.\'', fflib_SObjectDomain.Errors.getAll()[1].message); + System.assertEquals(LookupRollupSummary__c.RelationShipCriteria__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[1]).field); } private testmethod static void testInsertCountByCloseDateNoErrors() @@ -337,9 +512,34 @@ private with sharing class RollupSummariesTest rollupSummary.AggregateResultField__c = 'SLAExpirationDate__c'; rollupSummary.Active__c = true; rollupSummary.CalculationMode__c = 'Realtime'; - SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); - SObjectDomain.triggerHandler(RollupSummaries.class); - System.assertEquals(0, SObjectDomain.Errors.getAll().size()); + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(0, fflib_SObjectDomain.Errors.getAll().size()); } + + private testmethod static void testUseOfRowLimitOnSum() + { + // Test supported? + if(!TestContext.isSupported()) + return; + + LookupRollupSummary__c rollupSummary = new LookupRollupSummary__c(); + rollupSummary.Name = 'Total Opportunities into Annual Revenue on Account'; + rollupSummary.ParentObject__c = 'Account'; + rollupSummary.ChildObject__c = 'Opportunity'; + rollupSummary.RelationShipField__c = 'AccountId'; + rollupSummary.RelationShipCriteria__c = null; + rollupSummary.FieldToAggregate__c = 'Amount'; + rollupSummary.AggregateOperation__c = 'Sum'; + rollupSummary.AggregateResultField__c = 'AnnualRevenue'; + rollupSummary.RowLimit__c = 10; + rollupSummary.Active__c = true; + rollupSummary.CalculationMode__c = 'Realtime'; + fflib_SObjectDomain.Test.Database.onInsert(new LookupRollupSummary__c[] { rollupSummary } ); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Row Limit is only supported on Last and Concatentate operators.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(LookupRollupSummary__c.RowLimit__c, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + } } \ No newline at end of file diff --git a/rolluptool/src/classes/RollupSummariesTest.cls-meta.xml b/rolluptool/src/classes/RollupSummariesTest.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupSummariesTest.cls-meta.xml +++ b/rolluptool/src/classes/RollupSummariesTest.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupSummary.cls b/rolluptool/src/classes/RollupSummary.cls new file mode 100644 index 00000000..34806662 --- /dev/null +++ b/rolluptool/src/classes/RollupSummary.cls @@ -0,0 +1,341 @@ +/** + * Copyright (c), Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * Wrapper class abstracts away from the underlying storage approached used for the rollup, this allows + * for the tools domain and service layer logic to work regardless of how the rollup summary is stored + * + * TODO: I may implement this in due course differently, to use a small factory pattern and + * leverage explicit references to the Custom Object or Custom Metadata fields, likely + * faster and also ensures the compiler is aware of the references + **/ +public class RollupSummary { + + /** + * Provides access to the wrapped SObject + **/ + public SObject Record {get; private set;} + + /** + * Provides a means to log field level errors against the wrapped record + **/ + public RecordMetadata Fields {get; private set;} + + /** + * Record level error message + **/ + public String Error {get; private set;} + + /** + * Wraps the given LookupRollupSummary__c or LookupRollupSummary2__c + **/ + public RollupSummary(SObject record) { + this.Record = record; + this.Fields = new RecordMetadata(this); + } + + public String Id { + get { return (String) Record.get('Id'); } + } + + public String Name { + get { return (String) Record.get(Record instanceof LookupRollupSummary__c ? 'Name' : 'Label'); } + set { Record.put('Name', value); } + } + + public Boolean Active { + get { return (Boolean) Record.get('Active__c'); } + set { Record.put('Active__c', value); } + } + + public String AggregateOperation { + get { return (String) Record.get('AggregateOperation__c'); } + set { Record.put('AggregateOperation__c', value); } + } + + public String AggregateResultField { + get { return (String) Record.get('AggregateResultField__c'); } + set { Record.put('AggregateResultField__c', value); } + } + + public String CalculationMode { + get { return (String) Record.get('CalculationMode__c'); } + set { Record.put('CalculationMode__c', value); } + } + + public String CalculationSharingMode { + get { return (String) Record.get('CalculationSharingMode__c'); } + set { Record.put('CalculationSharingMode__c', value); } + } + + public String ChildObject { + get { return (String) Record.get('ChildObject__c'); } + set { Record.put('ChildObject__c', value); } + } + + public String ConcatenateDelimiter { + get { return (String) Record.get('ConcatenateDelimiter__c'); } + set { Record.put('ConcatenateDelimiter__c', value); } + } + + public String Description { + get { return (String) Record.get('Description__c'); } + set { Record.put('Description__c', value); } + } + + public String FieldToAggregate { + get { return (String) Record.get('FieldToAggregate__c'); } + set { Record.put('FieldToAggregate__c', value); } + } + + public String FieldToOrderBy { + get { return (String) Record.get('FieldToOrderBy__c'); } + set { Record.put('FieldToOrderBy__c', value); } + } + + public String UniqueName { + get { return (String) Record.get(Record instanceof LookupRollupSummary__c ? 'UniqueName__c' : 'DeveloperName'); } + set { Record.put(Record instanceof LookupRollupSummary__c ? 'UniqueName__c' : 'DeveloperName', value); } + } + + public String ParentObject { + get { return (String) Record.get('ParentObject__c'); } + set { Record.put('ParentObject__c', value); } + } + + public String RelationshipCriteria { + get { return (String) Record.get('RelationshipCriteria__c'); } + set { Record.put('RelationshipCriteria__c', value); } + } + + public String RelationshipCriteriaFields { + get { return (String) Record.get('RelationshipCriteriaFields__c'); } + set { Record.put('RelationshipCriteriaFields__c', value); } + } + + public String RelationshipField { + get { return (String) Record.get('RelationshipField__c'); } + set { Record.put('RelationshipField__c', value); } + } + + public String TestCode { + get { return (String) Record.get('TestCode__c'); } + set { Record.put('TestCode__c', value); } + } + + public Boolean TestCodeSeeAllData { + get { return (Boolean) Record.get('TestCodeSeeAllData__c'); } + set { Record.put('TestCodeSeeAllData__c', value); } + } + + public Boolean AggregateAllRows { + get { return (Boolean) Record.get('AggregateAllRows__c'); } + set { Record.put('AggregateAllRows__c', value); } + } + + public Decimal RowLimit { + get { return (Decimal) Record.get('RowLimit__c'); } + set { Record.put('RowLimit__c', value); } + } + + public void addError(String errorMessage) { + + // Store the error message + Error = errorMessage; + + // For Custom Object backed Rollup Summaries utilise SObject.addError + if(Record instanceof LookupRollupSummary__c) { + LookupRollupSummary__c rollupSummaryRecord = (LookupRollupSummary__c) Record; + rollupSummaryRecord.addError(errorMessage); + } + } + + public Boolean equals(Object obj) { + return Record == obj; + } + + public Integer hashCode() { + return System.hashCode(Record); + } + + /** + * Class exposes type safe instances of FieldData to capture errors + **/ + public class RecordMetadata { + + public RollupSummary RollupSummary {get; private set;} + + public List Errors {get; private set;} + + private RecordMetadata(RollupSummary rollupSummary) { + this.RollupSummary = rollupSummary; + this.Errors = new List(); + } + + public final FieldData Active = new FieldData(this); + public final FieldData AggregateOperation = new FieldData(this); + public final FieldData AggregateResultField = new FieldData(this); + public final FieldData CalculationMode = new FieldData(this); + public final FieldData CalculationSharingMode = new FieldData(this); + public final FieldData ChildObject = new FieldData(this); + public final FieldData ConcatenateDelimiter = new FieldData(this); + public final FieldData Description = new FieldData(this); + public final FieldData FieldToAggregate = new FieldData(this); + public final FieldData FieldToOrderBy = new FieldData(this); + public final FieldData UniqueName = new FieldData(this); + public final FieldData ParentObject = new FieldData(this); + public final FieldData RelationshipCriteria = new FieldData(this); + public final FieldData RelationshipCriteriaFields = new FieldData(this); + public final FieldData RelationshipField = new FieldData(this); + public final FieldData TestCode = new FieldData(this); + public final FieldData TestCodeSeeAllData = new FieldData(this); + public final FieldData AggregateAllRows = new FieldData(this); + public final FieldData RowLimit = new FieldData(this); + } + + /** + * Class provides a wrapper around a given record field data, error messages + **/ + public class FieldData { + + public RecordMetadata RecordMetadata {get; private set;} + + public FieldData(RecordMetadata recordMetadata) { + this.RecordMetadata = recordMetadata; + } + + public void addError(String errorMessage) { + + // Field in error? + String fieldLabelInError; + if(this === RecordMetadata.Active) { + fieldLabelInError = LookupRollupSummary__c.Active__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.AggregateOperation) { + fieldLabelInError = LookupRollupSummary__c.AggregateOperation__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.AggregateResultField) { + fieldLabelInError = LookupRollupSummary__c.AggregateResultField__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.CalculationMode) { + fieldLabelInError = LookupRollupSummary__c.CalculationMode__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.CalculationSharingMode) { + fieldLabelInError = LookupRollupSummary__c.CalculationSharingMode__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.ChildObject) { + fieldLabelInError = LookupRollupSummary__c.ChildObject__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.ConcatenateDelimiter) { + fieldLabelInError = LookupRollupSummary__c.ConcatenateDelimiter__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.Description) { + fieldLabelInError = LookupRollupSummary__c.Description__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.FieldToAggregate) { + fieldLabelInError = LookupRollupSummary__c.FieldToAggregate__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.FieldToOrderBy) { + fieldLabelInError = LookupRollupSummary__c.FieldToOrderBy__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.UniqueName) { + fieldLabelInError = LookupRollupSummary__c.UniqueName__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.ParentObject) { + fieldLabelInError = LookupRollupSummary__c.ParentObject__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.RelationshipCriteria) { + fieldLabelInError = LookupRollupSummary__c.RelationshipCriteria__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.RelationshipCriteriaFields) { + fieldLabelInError = LookupRollupSummary__c.RelationshipCriteriaFields__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.RelationshipField) { + fieldLabelInError = LookupRollupSummary__c.RelationshipField__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.TestCode) { + fieldLabelInError = LookupRollupSummary__c.TestCode__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.TestCodeSeeAllData) { + fieldLabelInError = LookupRollupSummary__c.TestCodeSeeAllData__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.AggregateAllRows) { + fieldLabelInError = LookupRollupSummary__c.AggregateAllRows__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.RowLimit) { + fieldLabelInError = LookupRollupSummary__c.RowLimit__c.getDescribe().getLabel(); + } + + // Store error + RecordMetadata.Errors.add(fieldLabelInError + ': ' + errorMessage); + + // For Custom Object backed Rollup Summaries utilise SObject.addError + if(RecordMetadata.RollupSummary.Record instanceof LookupRollupSummary__c) { + LookupRollupSummary__c customObjectRecord = + (LookupRollupSummary__c) RecordMetadata.RollupSummary.Record; + // Route the error accordingly + if(this === RecordMetadata.Active) { + customObjectRecord.Active__c.addError(errorMessage); + fieldLabelInError = LookupRollupSummary__c.Active__c.getDescribe().getLabel(); + } else if(this === RecordMetadata.AggregateOperation) { + customObjectRecord.AggregateOperation__c.addError(errorMessage); + } else if(this === RecordMetadata.AggregateResultField) { + customObjectRecord.AggregateResultField__c.addError(errorMessage); + } else if(this === RecordMetadata.CalculationMode) { + customObjectRecord.CalculationMode__c.addError(errorMessage); + } else if(this === RecordMetadata.CalculationSharingMode) { + customObjectRecord.CalculationSharingMode__c.addError(errorMessage); + } else if(this === RecordMetadata.ChildObject) { + customObjectRecord.ChildObject__c.addError(errorMessage); + } else if(this === RecordMetadata.ConcatenateDelimiter) { + customObjectRecord.ConcatenateDelimiter__c.addError(errorMessage); + } else if(this === RecordMetadata.Description) { + customObjectRecord.Description__c.addError(errorMessage); + } else if(this === RecordMetadata.FieldToAggregate) { + customObjectRecord.FieldToAggregate__c.addError(errorMessage); + } else if(this === RecordMetadata.FieldToOrderBy) { + customObjectRecord.FieldToOrderBy__c.addError(errorMessage); + } else if(this === RecordMetadata.UniqueName) { + customObjectRecord.UniqueName__c.addError(errorMessage); + } else if(this === RecordMetadata.ParentObject) { + customObjectRecord.ParentObject__c.addError(errorMessage); + } else if(this === RecordMetadata.RelationshipCriteria) { + customObjectRecord.RelationshipCriteria__c.addError(errorMessage); + } else if(this === RecordMetadata.RelationshipCriteriaFields) { + customObjectRecord.RelationshipCriteriaFields__c.addError(errorMessage); + } else if(this === RecordMetadata.RelationshipField) { + customObjectRecord.RelationshipField__c.addError(errorMessage); + } else if(this === RecordMetadata.TestCode) { + customObjectRecord.TestCode__c.addError(errorMessage); + } else if(this === RecordMetadata.TestCodeSeeAllData) { + customObjectRecord.TestCodeSeeAllData__c.addError(errorMessage); + } else if(this === RecordMetadata.AggregateAllRows) { + customObjectRecord.AggregateAllRows__c.addError(errorMessage); + } else if(this === RecordMetadata.RowLimit) { + customObjectRecord.RowLimit__c.addError(errorMessage); + } + } + } + } + + public static List toList(List records) { + List summaries = new List(); + for(SObject record : records) { + summaries.add(new RollupSummary(record)); + } + return summaries; + } + + public static Map toMap(List records) { + Map summariesById = new Map(); + for(RollupSummary record : records) { + summariesById.put(record.Id, record); + } + return summariesById; + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupSummary.cls-meta.xml b/rolluptool/src/classes/RollupSummary.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/RollupSummary.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/RollupSummaryEnhancedController.cls b/rolluptool/src/classes/RollupSummaryEnhancedController.cls index 149cb354..c2dc2122 100644 --- a/rolluptool/src/classes/RollupSummaryEnhancedController.cls +++ b/rolluptool/src/classes/RollupSummaryEnhancedController.cls @@ -29,7 +29,7 @@ * * https://github.com/afawcett/declarative-lookup-rollup-summaries/pull/15 **/ -public class RollupSummaryEnhancedController { +public with sharing class RollupSummaryEnhancedController { private ApexPages.StandardController controller {get; set;} private LookupRollupSummary__c rus; private Set numeric; @@ -155,7 +155,7 @@ public class RollupSummaryEnhancedController { Set childTrigger = new Set(); childTrigger.add(rus.ChildObject__c); Map apexTriggers = new ApexTriggersSelector().selectByName(childTrigger); - String triggerName = RollupSummaries.makeTriggerName(rus); + String triggerName = RollupSummaries.makeTriggerName(new RollupSummary(rus)); foundTrigger = apexTriggers.containsKey(triggerName); } @@ -171,19 +171,27 @@ public class RollupSummaryEnhancedController { if(triggerWasDeployedSuccessfully) { //rus.Active__c = true; //Uncomment once the trigger deploying works. - if(rus.Id!=null) - sr = Database.update(rus, false); - else - sr = Database.insert(rus, false); + if(rus.Id!=null) { + fflib_SecurityUtils.checkObjectIsUpdateable(LookupRollupSummary__c.SObjectType); + sr = Database.update(rus, false); + } + else { + fflib_SecurityUtils.checkObjectIsInsertable(LookupRollupSummary__c.SObjectType); + sr = Database.insert(rus, false); + } } } else { //rus.Active__c = true; //Uncomment once the trigger deploying works. - if(rus.Id!=null) - sr = Database.update(rus, false); - else - sr = Database.insert(rus, false); + if(rus.Id!=null) { + fflib_SecurityUtils.checkObjectIsUpdateable(LookupRollupSummary__c.SObjectType); + sr = Database.update(rus, false); + } + else { + fflib_SecurityUtils.checkObjectIsInsertable(LookupRollupSummary__c.SObjectType); + sr = Database.insert(rus, false); + } } PageReference pageRef; if(sr.isSuccess()) @@ -211,4 +219,4 @@ public class RollupSummaryEnhancedController { if(childObjectType!=null && !gdFields.containsKey(childObjectType)) gdFields.put(childObjectType, childObjectType.getDescribe().fields.getMap()); } -} +} \ No newline at end of file diff --git a/rolluptool/src/classes/RollupSummaryEnhancedController.cls-meta.xml b/rolluptool/src/classes/RollupSummaryEnhancedController.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupSummaryEnhancedController.cls-meta.xml +++ b/rolluptool/src/classes/RollupSummaryEnhancedController.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupSummaryEnhancedControllerTest.cls-meta.xml b/rolluptool/src/classes/RollupSummaryEnhancedControllerTest.cls-meta.xml index 1124945f..49358969 100644 --- a/rolluptool/src/classes/RollupSummaryEnhancedControllerTest.cls-meta.xml +++ b/rolluptool/src/classes/RollupSummaryEnhancedControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 24.0 + 37.0 Active diff --git a/rolluptool/src/classes/RollupSummaryScheduleItemsSelector.cls b/rolluptool/src/classes/RollupSummaryScheduleItemsSelector.cls index 16fa844b..cc35d170 100644 --- a/rolluptool/src/classes/RollupSummaryScheduleItemsSelector.cls +++ b/rolluptool/src/classes/RollupSummaryScheduleItemsSelector.cls @@ -24,14 +24,15 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **/ -public with sharing class RollupSummaryScheduleItemsSelector extends SObjectSelector +public class RollupSummaryScheduleItemsSelector extends fflib_SObjectSelector { public List getSObjectFieldList() { return new List { LookupRollupSummaryScheduleItems__c.Name, LookupRollupSummaryScheduleItems__c.ParentId__c, - LookupRollupSummaryScheduleItems__c.LookupRollupSummary__c + LookupRollupSummaryScheduleItems__c.LookupRollupSummary__c, + LookupRollupSummaryScheduleItems__c.LookupRollupSummary2__c }; } @@ -47,9 +48,7 @@ public with sharing class RollupSummaryScheduleItemsSelector extends SObjectSele public Database.Querylocator selectAllQueryLocator() { - assertIsAccessible(); - return Database.getQueryLocator(String.format('SELECT {0} FROM {1} ORDER BY {2}', - new List{getFieldListString(),getSObjectName(),getOrderBy()})); + return Database.getQueryLocator(newQueryFactory().toSOQL()); } public List selectById(Set idSet) diff --git a/rolluptool/src/classes/RollupSummaryScheduleItemsSelector.cls-meta.xml b/rolluptool/src/classes/RollupSummaryScheduleItemsSelector.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/RollupSummaryScheduleItemsSelector.cls-meta.xml +++ b/rolluptool/src/classes/RollupSummaryScheduleItemsSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/SObjectDomain.cls b/rolluptool/src/classes/SObjectDomain.cls deleted file mode 100644 index dcdfd811..00000000 --- a/rolluptool/src/classes/SObjectDomain.cls +++ /dev/null @@ -1,385 +0,0 @@ -/** - * Copyright (c), Andrew Fawcett, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of the Andrew Fawcett, nor the names of its contributors - * may be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**/ - -/** - * Base class aiding in the implemetnation of a Domain Model around SObject collections - * - * Domain (software engineering). “a set of common requirements, terminology, and functionality - * for any software program constructed to solve a problem in that field”, - * http://en.wikipedia.org/wiki/Domain_(software_engineering) - * - * Domain Model, “An object model of the domain that incorporates both behavior and data.”, - * “At its worst business logic can be very complex. Rules and logic describe many different " - * "cases and slants of behavior, and it's this complexity that objects were designed to work with...” - * Martin Fowler, EAA Patterns - * http://martinfowler.com/eaaCatalog/domainModel.html - * - **/ -public virtual with sharing class SObjectDomain -{ - public List Records { get; private set;} - - public Schema.DescribeSObjectResult SObjectDescribe {get; private set;} - - public static ErrorFactory Errors {get; private set;} - - public static TestFactory Test {get; private set;} - - static - { - Errors = new ErrorFactory(); - - Test = new TestFactory(); - } - - public SObjectDomain(List sObjectList) - { - Records = sObjectList; - - SObjectDescribe = Records.getSObjectType().getDescribe(); - } - - /** - * Override this to apply defaults to the records, this is called by the handleBeforeInsert method - **/ - public virtual void onApplyDefaults() { } - - /** - * Override this to apply general validation to be performed during insert or update, called by the handleAfterInsert and handleAfterUpdate methods - **/ - public virtual void onValidate() { } - - /** - * Override this to apply validation to be performed during insert, called by the handleAfterUpdate method - **/ - public virtual void onValidate(Map existingRecords) { } - - /** - * Override this to perform processing during the before insert phase, this is called by the handleBeforeInsert method - **/ - public virtual void onBeforeInsert() { } - - /** - * Override this to perform processing during the before update phase, this is called by the handleBeforeUpdate method - **/ - public virtual void onBeforeUpdate(Map existingRecords) { } - - /** - * Override this to perform processing during the before delete phase, this is called by the handleBeforeDelete method - **/ - public virtual void onBeforeDelete() { } - - /** - * Override this to perform processing during the after insert phase, this is called by the handleAfterInsert method - **/ - public virtual void onAfterInsert() { } - - /** - * Override this to perform processing during the after update phase, this is called by the handleAfterUpdate method - **/ - public virtual void onAfterUpdate(Map existingRecords) { } - - /** - * Override this to perform processing during the after delete phase, this is called by the handleAfterDelete method - **/ - public virtual void onAfterDelete() { } - - /** - * Base handler for the Apex Trigger event Before Insert, calls the onApplyDefaults method, followed by onBeforeInsert - **/ - public virtual void handleBeforeInsert() - { - onApplyDefaults(); - onBeforeInsert(); - } - - /** - * Base handler for the Apex Trigger event Before Update, calls the onBeforeUpdate method - **/ - public void handleBeforeUpdate(Map existingRecords) - { - onBeforeUpdate(existingRecords); - } - - /** - * Base handler for the Apex Trigger event Before Delete, calls the onBeforeDelete method - **/ - public void handleBeforeDelete() - { - onBeforeDelete(); - } - - /** - * Base handler for the Apex Trigger event After Insert, checks object security and calls the onValidate and onAfterInsert methods - * - * @throws DomainException if the current user context is not able to create records - **/ - public void handleAfterInsert() - { - if(!SObjectDescribe.isCreateable()) - throw new DomainException('Permission to create an ' + SObjectDescribe.getName() + ' denied.'); - - onValidate(); - onAfterInsert(); - } - - /** - * Base handler for the Apex Trigger event After Update, checks object security and calls the onValidate, onValidate(Map) and onAfterUpdate methods - * - * @throws DomainException if the current user context is not able to update records - **/ - public void handleAfterUpdate(Map existingRecords) - { - if(!SObjectDescribe.isUpdateable()) - throw new DomainException('Permission to udpate an ' + SObjectDescribe.getName() + ' denied.'); - - onValidate(); - onValidate(existingRecords); - onAfterUpdate(existingRecords); - } - - /** - * Base handler for the Apex Trigger event After Delete, checks object security and calls the onAfterDelete method - * - * @throws DomainException if the current user context is not able to delete records - **/ - public void handleAfterDelete() - { - if(!SObjectDescribe.isDeletable()) - throw new DomainException('Permission to delete an ' + SObjectDescribe.getName() + ' denied.'); - - onAfterDelete(); - } - - public interface IConstructable - { - SObjectDomain construct(List sObjectList); - } - - /** - * Method constructs the given Domain class with the current Trigger context - * before calling the applicable override methods such as beforeInsert, beforeUpdate etc. - **/ - public static void triggerHandler(Type domainClass) - { - // Construct the domain class constructor class - String domainClassName = domainClass.getName(); - Type constructableClass = domainClassName.endsWith('Constructor') ? Type.forName(domainClassName) : Type.forName(domainClassName+'.Constructor'); - IConstructable constructor = (IConstructable) constructableClass.newInstance(); - - // Process the trigger context - if(System.Test.isRunningTest() & Test.Database.hasRecords()) - { - // If in test context and records in the mock database delegate initially to the mock database trigger handler - Test.Database.testTriggerHandler(constructor); - } - else - { - // Process the runtime Apex Trigger context - triggerHandler(constructor, - Trigger.isBefore, - Trigger.isAfter, - Trigger.isInsert, - Trigger.isUpdate, - Trigger.isDelete, - Trigger.new, - Trigger.oldMap); - } - } - - /** - * Calls the applicable override methods such as beforeInsert, beforeUpdate etc. based on a Trigger context - **/ - private static void triggerHandler(IConstructable domainConstructor, Boolean isBefore, Boolean isAfter, Boolean isInsert, Boolean isUpdate, Boolean isDelete, List newRecords, Map oldRecordsMap) - { - if(isBefore) - { - if(isInsert) domainConstructor.construct(newRecords).handleBeforeInsert(); - else if(isUpdate) domainConstructor.construct(newRecords).handleBeforeUpdate(oldRecordsMap); - else if(isDelete) domainConstructor.construct(oldRecordsMap.values()).handleBeforeDelete(); - } - else - { - if(isInsert) domainConstructor.construct(newRecords).handleAfterInsert(); - else if(isUpdate) domainConstructor.construct(newRecords).handleAfterUpdate(oldRecordsMap); - else if(isDelete) domainConstructor.construct(oldRecordsMap.values()).handleAfterDelete(); - } - } - - public class DomainException extends Exception - { - } - - public String error(String message, SObject record) - { - return Errors.error(this, message, record); - } - - public String error(String message, SObject record, SObjectField field) - { - return Errors.error(this, message, record, field); - } - - public class ErrorFactory - { - private List errorList = new List(); - - private ErrorFactory() - { - - } - - public String error(String message, SObject record) - { - return error(null, message, record); - } - - private String error(SObjectDomain domain, String message, SObject record) - { - ObjectError objectError = new ObjectError(); - objectError.domain = domain; - objectError.message = message; - objectError.record = record; - errorList.add(objectError); - return message; - } - - public String error(String message, SObject record, SObjectField field) - { - return error(null, message, record, field); - } - - private String error(SObjectDomain domain, String message, SObject record, SObjectField field) - { - FieldError fieldError = new FieldError(); - fieldError.domain = domain; - fieldError.message = message; - fieldError.record = record; - fieldError.field = field; - errorList.add(fieldError); - return message; - } - - public List getAll() - { - return errorList.clone(); - } - - public void clearAll() - { - errorList.clear(); - } - } - - public class FieldError extends ObjectError - { - public SObjectField field; - - private FieldError() - { - - } - } - - public virtual class ObjectError extends Error - { - public SObject record; - - private ObjectError() - { - - } - } - - public abstract class Error - { - public String message; - public SObjectDomain domain; - } - - public class TestFactory - { - public MockDatabase Database = new MockDatabase(); - - private TestFactory() - { - - } - } - - public class MockDatabase - { - private Boolean isInsert = false; - private Boolean isUpdate = false; - private Boolean isDelete = false; - private List records = new List(); - private Map oldRecords = new Map(); - - private MockDatabase() - { - - } - - private void testTriggerHandler(IConstructable domainConstructor) - { - // Mock Before - triggerHandler(domainConstructor, true, false, isInsert, isUpdate, isDelete, records, oldRecords); - - // Mock After - triggerHandler(domainConstructor, false, true, isInsert, isUpdate, isDelete, records, oldRecords); - } - - public void onInsert(List records) - { - this.isInsert = true; - this.isUpdate = false; - this.isDelete = false; - this.records = records; - } - - public void onUpdate(List records, Map oldRecords) - { - this.isInsert = false; - this.isUpdate = true; - this.isDelete = false; - this.records = records; - this.oldRecords = oldRecords; - } - - public void onDelete(Map records) - { - this.isInsert = false; - this.isUpdate = false; - this.isDelete = true; - this.oldRecords = records; - } - - public Boolean hasRecords() - { - return records!=null && records.size()>0 || oldRecords!=null && oldRecords.size()>0; - } - } -} \ No newline at end of file diff --git a/rolluptool/src/classes/SObjectDomainTest.cls b/rolluptool/src/classes/SObjectDomainTest.cls deleted file mode 100644 index 14ad5428..00000000 --- a/rolluptool/src/classes/SObjectDomainTest.cls +++ /dev/null @@ -1,238 +0,0 @@ -/** - * Copyright (c), Andrew Fawcett, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of the Andrew Fawcett, nor the names of its contributors - * may be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**/ - -@IsTest -private with sharing class SObjectDomainTest -{ - - @IsTest - private static void testValidationWithoutDML() - { - TestSObjectDomain opps = new TestSObjectDomain(new Opportunity[] { new Opportunity ( Name = 'Test', Type = 'Existing Account' ) } ); - opps.onValidate(); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('You must provide an Account for Opportunities for existing Customers.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(Opportunity.AccountId, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[0]).field); - } - - @IsTest - private static void testInsertValidationFailedWithoutDML() - { - Opportunity opp = new Opportunity ( Name = 'Test', Type = 'Existing Account' ); - System.assertEquals(false, SObjectDomain.Test.Database.hasRecords()); - SObjectDomain.Test.Database.onInsert(new Opportunity[] { opp } ); - System.assertEquals(true, SObjectDomain.Test.Database.hasRecords()); - SObjectDomain.triggerHandler(TestSObjectDomainConstructor.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('You must provide an Account for Opportunities for existing Customers.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(Opportunity.AccountId, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[0]).field); - } - - @IsTest - private static void testUpdateValidationFailedWithoutDML() - { - Opportunity oldOpp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); - oldOpp.Name = 'Test'; - oldOpp.Type = 'Existing Account'; - Opportunity newOpp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); - newOpp.Name = 'Test'; - newOpp.Type = 'New Account'; - System.assertEquals(false, SObjectDomain.Test.Database.hasRecords()); - SObjectDomain.Test.Database.onUpdate(new Opportunity[] { newOpp }, new Map { newOpp.Id => oldOpp } ); - System.assertEquals(true, SObjectDomain.Test.Database.hasRecords()); - SObjectDomain.triggerHandler(TestSObjectDomainConstructor.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('You cannot change the Opportunity type once it has been created.', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals(Opportunity.Type, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[0]).field); - } - - @IsTest - private static void testOnBeforeDeleteWithoutDML() - { - Opportunity opp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); - opp.Name = 'Test'; - opp.Type = 'Existing Account'; - System.assertEquals(false, SObjectDomain.Test.Database.hasRecords()); - SObjectDomain.Test.Database.onDelete(new Map { opp.Id => opp } ); - System.assertEquals(true, SObjectDomain.Test.Database.hasRecords()); - SObjectDomain.triggerHandler(TestSObjectDomainConstructor.class); - System.assertEquals(1, SObjectDomain.Errors.getAll().size()); - System.assertEquals('You cannot delete this Opportunity.', SObjectDomain.Errors.getAll()[0].message); - } - - @IsTest - private static void testObjectSecurity() - { - // Create a user which will not have access to the test object type - User testUser = createChatterExternalUser(); - if(testUser==null) - return; // Abort the test if unable to create a user with low enough acess - System.runAs(testUser) - { - // Test Create object security - Opportunity opp = new Opportunity ( Name = 'Test', Type = 'Existing Account' ); - SObjectDomain.Test.Database.onInsert(new Opportunity[] { opp } ); - try { - SObjectDomain.triggerHandler(TestSObjectDomainConstructor.class); - System.assert(false, 'Expected access denied exception'); - } catch (Exception e) { - System.assertEquals('Permission to create an Opportunity denied.', e.getMessage()); - } - - // Test Update object security - Opportunity existingOpp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); - existingOpp.Name = 'Test'; - existingOpp.Type = 'Existing Account'; - SObjectDomain.Test.Database.onUpdate(new List { opp }, new Map { opp.Id => opp } ); - try { - SObjectDomain.triggerHandler(TestSObjectDomainConstructor.class); - System.assert(false, 'Expected access denied exception'); - } catch (Exception e) { - System.assertEquals('Permission to udpate an Opportunity denied.', e.getMessage()); - } - - // Test Delete object security - SObjectDomain.Test.Database.onDelete(new Map { opp.Id => opp }); - try { - SObjectDomain.triggerHandler(TestSObjectDomainConstructor.class); - System.assert(false, 'Expected access denied exception'); - } catch (Exception e) { - System.assertEquals('Permission to delete an Opportunity denied.', e.getMessage()); - } - } - } - - @IsTest - public static void testErrorLogging() - { - // Test static helpers for raise none domain object instance errors - Opportunity opp = new Opportunity ( Name = 'Test', Type = 'Existing Account' ); - SObjectDomain.Errors.error('Error', opp); - SObjectDomain.Errors.error('Error', opp, Opportunity.Type); - System.assertEquals(2, SObjectDomain.Errors.getAll().size()); - System.assertEquals('Error', SObjectDomain.Errors.getAll()[0].message); - System.assertEquals('Error', SObjectDomain.Errors.getAll()[1].message); - System.assertEquals(Opportunity.Type, ((SObjectDomain.FieldError)SObjectDomain.Errors.getAll()[1]).field); - SObjectDomain.Errors.clearAll(); - System.assertEquals(0, SObjectDomain.Errors.getAll().size()); - } - - private static User createChatterExternalUser() - { - // Can only proceed with test if we have a suitable profile - Chatter External license has no access to Opportunity - List testProfiles = [Select Id From Profile where UserLicense.Name='Chatter External' limit 1]; - if(testProfiles.size()!=1) - return null; - - // Can only proceed with test if we can successfully insert a test user - String testUsername = System.now().format('yyyyMMddhhmmss') + '@testorg.com'; - User testUser = new User(Alias = 'test1', Email='testuser1@testorg.com', EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', LocaleSidKey='en_US', ProfileId = testProfiles[0].Id, TimeZoneSidKey='America/Los_Angeles', UserName=testUsername); - try { - insert testUser; - } catch (Exception e) { - return null; - } - return testUser; - } - - /** - * Test domain class - **/ - public with sharing class TestSObjectDomain extends SObjectDomain - { - public TestSObjectDomain(List sObjectList) - { - // Domain classes are initialised with lists to enforce bulkification throughout - super(sObjectList); - } - - public override void onApplyDefaults() - { - // Not required in production code - super.onApplyDefaults(); - - // Apply defaults to TestSObjectDomain - for(Opportunity opportunity : (List) Records) - { - opportunity.CloseDate = System.today().addDays(30); - } - } - - public override void onValidate() - { - // Not required in production code - super.onValidate(); - - // Validate TestSObjectDomain - for(Opportunity opp : (List) Records) - { - if(opp.Type!=null && opp.Type.startsWith('Existing') && opp.AccountId == null) - { - opp.AccountId.addError( error('You must provide an Account for Opportunities for existing Customers.', opp, Opportunity.AccountId) ); - } - } - } - - public override void onValidate(Map existingRecords) - { - // Not required in production code - super.onValidate(existingRecords); - - // Validate changes to TestSObjectDomain - for(Opportunity opp : (List) Records) - { - Opportunity existingOpp = (Opportunity) existingRecords.get(opp.Id); - if(opp.Type != existingOpp.Type) - { - opp.Type.addError( error('You cannot change the Opportunity type once it has been created.', opp, Opportunity.Type) ); - } - } - } - - public override void onBeforeDelete() - { - // Not required in production code - super.onBeforeDelete(); - - // Validate changes to TestSObjectDomain - for(Opportunity opp : (List) Records) - { - opp.addError( error('You cannot delete this Opportunity.', opp) ); - } - } - } - - /** - * Typically an inner class to the domain class, supported here for test purposes - **/ - public class TestSObjectDomainConstructor implements SObjectDomain.IConstructable - { - public SObjectDomain construct(List sObjectList) - { - return new TestSObjectDomain(sObjectList); - } - } -} \ No newline at end of file diff --git a/rolluptool/src/classes/SObjectSelector.cls b/rolluptool/src/classes/SObjectSelector.cls deleted file mode 100644 index 51f8b3a0..00000000 --- a/rolluptool/src/classes/SObjectSelector.cls +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c), Andrew Fawcett, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of the Andrew Fawcett, nor the names of its contributors - * may be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**/ - -public abstract with sharing class SObjectSelector -{ - private StringBuilder.FieldListBuilder m_fieldListBuilder; - - private static Set whiteListStandardWithoutCurrencyIso = - new Set { 'AsyncApexJob', 'ApexClass', 'ApexTrigger' }; - - public SObjectSelector() - { - } - - abstract List getSObjectFieldList(); - - abstract Schema.SObjectType getSObjectType(); - - public StringBuilder.FieldListBuilder getFieldListBuilder() - { - if(m_fieldListBuilder == null) - m_fieldListBuilder = whiteListStandardWithoutCurrencyIso.contains(getSObjectType().getDescribe().getName()) ? - new StringBuilder.FieldListBuilder( getSObjectFieldList() ) : - new StringBuilder.MultiCurrencyFieldListBuilder( getSObjectFieldList()); - return m_fieldListBuilder; - } - - public void setFieldListBuilder(StringBuilder.FieldListBuilder fieldListBuilder) - { - m_fieldListBuilder = fieldListBuilder; - } - - public String getFieldListString() - { - return getFieldListBuilder().getStringValue(); - } - - public String getRelatedFieldListString(String relation) - { - return getFieldListBuilder().getStringValue(relation + '.'); - } - - public String getSObjectName() - { - return getSObjectType().getDescribe().getName(); - } - - public virtual String getOrderBy() - { - return 'Name'; - } - - public List selectSObjectsById(Set idSet) - { - assertIsAccessible(); - return Database.query(String.format('SELECT {0} FROM {1} WHERE id in :idSet ORDER BY {2}', new List{getFieldListString(),getSObjectName(),getOrderBy()})); - } - - public void assertIsAccessible() - { - if(!getSObjectType().getDescribe().isAccessible()) - throw new SObjectDomain.DomainException('Permission to access an ' + getSObjectType().getDescribe().getName() + ' dennied.'); - } -} \ No newline at end of file diff --git a/rolluptool/src/classes/SObjectSelectorTest.cls b/rolluptool/src/classes/SObjectSelectorTest.cls deleted file mode 100644 index b6bddec9..00000000 --- a/rolluptool/src/classes/SObjectSelectorTest.cls +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Copyright (c), Andrew Fawcett, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of the Andrew Fawcett, nor the names of its contributors - * may be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**/ - -@IsTest -private with sharing class SObjectSelectorTest -{ - static testMethod void testGetFieldListString() - { - TestSObjectSelector selector = new TestSObjectSelector(); - if(UserInfo.isMultiCurrencyOrganization()) - system.assertEquals('Name,Id,AccountNumber,AnnualRevenue,CurrencyIsoCode',selector.getFieldListString()); - else - system.assertEquals('Name,Id,AccountNumber,AnnualRevenue',selector.getFieldListString()); - } - - static testMethod void testGetSObjectName() - { - TestSObjectSelector selector = new TestSObjectSelector(); - system.assertEquals('Account',selector.getSObjectName()); - } - - static testMethod void testSelectSObjectsById() - { - // Inserting in reverse order so that we can test the order by of select - List accountList = new List { - new Account(Name='TestAccount2',AccountNumber='A2',AnnualRevenue=12345.67), - new Account(Name='TestAccount1',AccountNumber='A1',AnnualRevenue=76543.21) }; - insert accountList; - Set idSet = new Set(); - for(Account item : accountList) - idSet.add(item.Id); - - Test.startTest(); - TestSObjectSelector selector = new TestSObjectSelector(); - List result = (List) selector.selectSObjectsById(idSet); - Test.stopTest(); - - system.assertEquals(2,result.size()); - system.assertEquals('TestAccount1',result[0].Name); - system.assertEquals('A1',result[0].AccountNumber); - system.assertEquals(76543.21,result[0].AnnualRevenue); - system.assertEquals('TestAccount2',result[1].Name); - system.assertEquals('A2',result[1].AccountNumber); - system.assertEquals(12345.67,result[1].AnnualRevenue); - } - - static testMethod void testAssertIsAccessible() - { - List accountList = new List { - new Account(Name='TestAccount2',AccountNumber='A2',AnnualRevenue=12345.67), - new Account(Name='TestAccount1',AccountNumber='A1',AnnualRevenue=76543.21) }; - insert accountList; - Set idSet = new Set(); - for(Account item : accountList) - idSet.add(item.Id); - - // Create a user which will not have access to the test object type - User testUser = createChatterExternalUser(); - if(testUser==null) - return; // Abort the test if unable to create a user with low enough acess - System.runAs(testUser) - { - TestSObjectSelector selector = new TestSObjectSelector(); - try - { - List result = (List) selector.selectSObjectsById(idSet); - System.assert(false,'Expected exception was not thrown'); - } - catch(SObjectDomain.DomainException e) - { - System.assertEquals('Permission to access an Account dennied.',e.getMessage()); - } - } - } - - private class TestSObjectSelector extends SObjectSelector - { - public List getSObjectFieldList() - { - return new List { - Account.Name, - Account.Id, - Account.AccountNumber, - Account.AnnualRevenue - }; - } - - public Schema.SObjectType getSObjectType() - { - return Account.sObjectType; - } - } - - private static User createChatterExternalUser() - { - // Can only proceed with test if we have a suitable profile - Chatter External license has no access to Opportunity - List testProfiles = [Select Id From Profile where UserLicense.Name='Chatter External' limit 1]; - if(testProfiles.size()!=1) - return null; - - // Can only proceed with test if we can successfully insert a test user - String testUsername = System.now().format('yyyyMMddhhmmss') + '@testorg.com'; - User testUser = new User(Alias = 'test1', Email='testuser1@testorg.com', EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', LocaleSidKey='en_US', ProfileId = testProfiles[0].Id, TimeZoneSidKey='America/Los_Angeles', UserName=testUsername); - try { - insert testUser; - } catch (Exception e) { - return null; - } - return testUser; - } -} \ No newline at end of file diff --git a/rolluptool/src/classes/StringBuilder.cls-meta.xml b/rolluptool/src/classes/StringBuilder.cls-meta.xml deleted file mode 100644 index b211a092..00000000 --- a/rolluptool/src/classes/StringBuilder.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 28.0 - Active - diff --git a/rolluptool/src/classes/TestContext.cls b/rolluptool/src/classes/TestContext.cls index b181c47f..a98c3252 100644 --- a/rolluptool/src/classes/TestContext.cls +++ b/rolluptool/src/classes/TestContext.cls @@ -24,7 +24,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **/ -public with sharing class TestContext +public class TestContext { private TestContext() { } diff --git a/rolluptool/src/classes/TestContext.cls-meta.xml b/rolluptool/src/classes/TestContext.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/TestContext.cls-meta.xml +++ b/rolluptool/src/classes/TestContext.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/TestLREngine.cls b/rolluptool/src/classes/TestLREngine.cls index dac0e0d8..f2b0d16d 100644 --- a/rolluptool/src/classes/TestLREngine.cls +++ b/rolluptool/src/classes/TestLREngine.cls @@ -33,10 +33,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @isTest private class TestLREngine { // common master records for the test case - static Account acc1, acc2; + static Account acc1, acc2, acc3, acc4; // common bunch of detail records for the test case static Opportunity[] detailRecords; + static Opportunity[] detailRecords2; static Opportunity[] detailRecordsAcc1; + static Opportunity[] detailRecordsAcc3; // dynamic reference to this field to avoid it being included in the package static Schema.SObjectField ACCOUNT_SLA_EXPIRATION_DATE; static Schema.SObjectField ACCOUNT_NUMBER_OF_EMPLOYEES; @@ -107,7 +109,7 @@ private class TestLREngine { AccountId = acc2.Id, Amount = 200.00, CloseDate = System.today().addMonths(2), - StageName = 'test' + StageName = 'Won' ); Opportunity o2Acc2 = new Opportunity( @@ -115,7 +117,7 @@ private class TestLREngine { AccountId = acc2.Id, Amount = 400.00, CloseDate = System.today().addMonths(3), - StageName = 'test' + StageName = 'Lost' ); Opportunity o3Acc2 = new Opportunity( @@ -123,7 +125,7 @@ private class TestLREngine { AccountId = acc2.Id, Amount = 300.00, CloseDate = System.today().addMonths(4), - StageName = 'test' + StageName = 'Won' ); detailRecords = new Opportunity[] {o1Acc1, o2Acc1, o3Acc1, o1Acc2, o2Acc2, o3Acc2}; if(ANNUALIZED_RECCURING_REVENUE!=null) @@ -131,7 +133,76 @@ private class TestLREngine { detailRecord.put(ANNUALIZED_RECCURING_REVENUE, 1000); detailRecordsAcc1 = new Opportunity[] {o1Acc1, o2Acc1, o3Acc1}; insert detailRecords; - } + } + + /* + creates the common seed data using Opportunity and Account objects. + */ + static void prepareData2() { + acc3 = new Account(Name = 'Acc3'); + acc4 = new Account(Name = 'Acc4'); + insert new Account[] {acc3, acc4}; + + Date today = System.today(); + Opportunity o1Acc3 = new Opportunity( + Name = 'o1Acc3', + AccountId = acc3.Id, + Amount = 100.00, + CloseDate = today, + Type = 'New Customer', + StageName = 'red' + ); + Opportunity o2Acc3 = new Opportunity( + Name = 'o2Acc3', + AccountId = acc3.Id, + Amount = 100.00, + CloseDate = today, + Type = 'New Customer', + StageName = 'yellow' + ); + + Opportunity o3Acc3 = new Opportunity( + Name = 'o3Acc3', + AccountId = acc3.Id, + Amount = null, + CloseDate = today, + Type = 'New Customer', + StageName = 'blue' + ); + + Opportunity o1Acc4 = new Opportunity( + Name = 'o1Acc4', + AccountId = acc4.Id, + Amount = 100.00, + CloseDate = today, + Type = 'New Customer', + StageName = 'orange' + ); + + Opportunity o2Acc4 = new Opportunity( + Name = 'o2Acc4', + AccountId = acc4.Id, + Amount = 100.00, + CloseDate = today, + Type = 'New Customer', + StageName = 'green' + ); + + Opportunity o3Acc4 = new Opportunity( + Name = 'o3Acc4', + AccountId = acc4.Id, + Amount = 100.00, + CloseDate = today, + Type = 'New Customer', + StageName = 'purple' + ); + detailRecords2 = new Opportunity[] {o1Acc3, o2Acc3, o3Acc3, o1Acc4, o2Acc4, o3Acc4}; + if(ANNUALIZED_RECCURING_REVENUE!=null) + for(Opportunity detailRecord : detailRecords2) + detailRecord.put(ANNUALIZED_RECCURING_REVENUE, 1000); + detailRecordsAcc3 = new Opportunity[] {o1Acc3, o2Acc3, o3Acc3}; + insert detailRecords2; + } /* @@ -282,6 +353,42 @@ private class TestLREngine { System.assertEquals(3, reloadedAcc1.get(ACCOUNT_NUMBER_OF_EMPLOYEES)); System.assertEquals(3, reloadedAcc2.get(ACCOUNT_NUMBER_OF_EMPLOYEES)); } + + /* + Tests count distinct + */ + static testMethod void testCountDistinctOperations() { + + // Required custom field/s present? + if(ACCOUNT_NUMBER_OF_EMPLOYEES==null) + return; + + // create seed data + prepareData(); + + LREngine.Context ctx = new LREngine.Context(Account.SobjectType, + Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId); + ctx.add( + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.AnnualRevenue, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Count_Distinct + )); + + Sobject[] masters = LREngine.rollUp(ctx, detailRecords); + // 2 masters should be back + System.assertEquals(2, masters.size()); + + Account reloadedAcc1, reloadedAcc2; + for (Sobject so : masters) { + if (so.Id == acc1.id) reloadedAcc1 = (Account)so; + if (so.Id == acc2.id) reloadedAcc2 = (Account)so; + } + + System.assertEquals(1, reloadedAcc1.AnnualRevenue); // Only one set of distinct StageName's on Account 1 + System.assertEquals(2, reloadedAcc2.AnnualRevenue); // Two sets of distinct StageName's on Account 2 + } /* @@ -371,6 +478,43 @@ private class TestLREngine { System.assertEquals(0, ((Account)mastersById.get(acc1.id)).AnnualRevenue); System.assertEquals(0, ((Account)mastersById.get(acc2.id)).AnnualRevenue); } + + + /** + * Test enhancement where AllRows is used, which includes deleted rows + **/ + static testMethod void testDeletingChildRecordsWithAllRowsSet() + { + // create seed data + prepareData(); + + LREngine.Context ctx = new LREngine.Context( + Account.SobjectType, + Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId, + 'Amount > 200', // filter out any opps with amount less than 200 + null, null, true); // Include child rows including deleted + ctx.add( + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.AnnualRevenue, + Schema.SObjectType.Opportunity.fields.Amount, + LREngine.RollupOperation.Avg)); + + Sobject[] masters = LREngine.rollUp(ctx, detailRecords); + Map mastersById = new Map(masters); + System.assertEquals(2, masters.size()); + System.assertEquals(300, ((Account)mastersById.get(acc1.id)).AnnualRevenue); + System.assertEquals(350.00, ((Account)mastersById.get(acc2.id)).AnnualRevenue); + + // Delete all children + delete [select Id from Opportunity]; + + // Recacluate rollups again + masters = LREngine.rollUp(ctx, detailRecords); + mastersById = new Map(masters); + System.assertEquals(300, ((Account)mastersById.get(acc1.id)).AnnualRevenue); + System.assertEquals(350.00, ((Account)mastersById.get(acc2.id)).AnnualRevenue); + } /** * Test enhancement to ensure the SOQL Aggregate only applies to child records @@ -533,5 +677,514 @@ private class TestLREngine { catch (Exception e) { System.assertEquals('Only Date/DateTime/Time/Numeric fields are allowed for Sum, Max, Min and Avg', e.getMessage()); } + } + + static testMethod void testRollupContextsValidRollupFieldCombosOnly() { + + // Cannot mix (Sum, Max, Min, Avg, Count, Count_Distinct) with (Concatenate, Concatenate_Distinct, First, Last) + try { + LREngine.Context ctx = + new LREngine.Context( + Account.SobjectType, Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId); + ctx.add(new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate)); + ctx.add(new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.AnnualRevenue, + Schema.SObjectType.Opportunity.fields.Amount, + LREngine.RollupOperation.Sum)); + System.assert(false, 'Expecting an exception'); + } catch (Exception e) { + System.assertEquals('Cannot mix Sum, Max, Min, Avg, Count, Count_Distinct operations with Concatenate, Concatenate_Distinct, First, Last operations', e.getMessage()); + } + try { + LREngine.Context ctx = + new LREngine.Context( + Account.SobjectType, Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId); + ctx.add(new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.AnnualRevenue, + Schema.SObjectType.Opportunity.fields.Amount, + LREngine.RollupOperation.Sum)); + ctx.add(new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate)); + System.assert(false, 'Expecting an exception'); + } catch (Exception e) { + System.assertEquals('Cannot mix Sum, Max, Min, Avg, Count, Count_Distinct operations with Concatenate, Concatenate_Distinct, First, Last operations', e.getMessage()); + } + } + + static testMethod void testRollupSummaryFieldValidationConcatenate() { + // Master must be text type + try { + LREngine.Context ctx = + new LREngine.Context( + Account.SobjectType, Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId); + ctx.add(new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.AnnualRevenue, + Schema.SObjectType.Opportunity.fields.Id, + LREngine.RollupOperation.Concatenate)); + System.assert(false, 'Expecting an exception'); + } catch (Exception e) { + System.assertEquals('Only Text/Text Area fields are allowed for Concatenate and Concatenate Distinct', e.getMessage()); + } + } + + static testMethod void testRollupSummaryFieldValidationFirstAndLast() { + // Master and detail field type must match + try { + LREngine.Context ctx = + new LREngine.Context( + Account.SobjectType, Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId); + ctx.add(new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.AnnualRevenue, + Schema.SObjectType.Opportunity.fields.Id, + LREngine.RollupOperation.Last)); + System.assert(false, 'Expecting an exception'); + } catch (Exception e) { + System.assertEquals('Master and detail fields must be the same field type (or text/Id based) for First or Last operations', e.getMessage()); + } + try { + LREngine.Context ctx = + new LREngine.Context( + Account.SobjectType, Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId); + ctx.add(new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.AnnualRevenue, + Schema.SObjectType.Opportunity.fields.Id, + LREngine.RollupOperation.First)); + System.assert(false, 'Expecting an exception'); + } catch (Exception e) { + System.assertEquals('Master and detail fields must be the same field type (or text/Id based) for First or Last operations', e.getMessage()); + } + // Master and detail field type match + try { + LREngine.Context ctx = + new LREngine.Context( + Account.SobjectType, Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId); + ctx.add(new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.AnnualRevenue, + Schema.SObjectType.Opportunity.fields.Amount, + LREngine.RollupOperation.First)); + } catch (Exception e) { + System.assert(false, 'Not expecting an exception ' + e.getMessage()); + } + } + + static testMethod void testRollupConcatenateTruncate() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.AccountNumber, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, '01234567890123456789,'), + 'test01234567890123456789,test01234567...', + 'Lost01234567890123456789,Won012345678...'); } + + static testMethod void testRollupConcatenate() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ','), + 'test,test,test', + 'Lost,Won,Won'); + } + + static testMethod void testRollupConcatenateLimited() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ',', 2), + 'test,test', + 'Lost,Won'); + } + + static testMethod void testRollupConcatenateDeletedChildRows() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ','), + 'test,test,test', + 'Lost,Won,Won', + true); + } + + static testMethod void testRollupConcatenateBR() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, 'BR()'), + 'test\ntest\ntest', + 'Lost\nWon\nWon'); + } + + static testMethod void testRollupConcatenateMultipleBR() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, 'BR()BR()BR()'), + 'test\n\n\ntest\n\n\ntest', + 'Lost\n\n\nWon\n\n\nWon'); + } + + static testMethod void testRollupConcatenateCommaBR() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ',BR()'), + 'test,\ntest,\ntest', + 'Lost,\nWon,\nWon'); + } + + static testMethod void testRollupConcatenateSP() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, 'SP()'), + 'test test test', + 'Lost Won Won'); + } + + static testMethod void testRollupConcatenateMultipleSP() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, 'SP()SP()SP()'), + 'test test test', + 'Lost Won Won'); + } + + static testMethod void testRollupConcatenateCommaSP() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ',SP()'), + 'test, test, test', + 'Lost, Won, Won'); + } + + static testMethod void testRollupConcatenateTB() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, 'TB()'), + 'test\ttest\ttest', + 'Lost\tWon\tWon'); + } + + static testMethod void testRollupConcatenateMultipleTB() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, 'TB()TB()TB()'), + 'test\t\t\ttest\t\t\ttest', + 'Lost\t\t\tWon\t\t\tWon'); + } + + static testMethod void testRollupConcatenateCommaTB() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ',TB()'), + 'test,\ttest,\ttest', + 'Lost,\tWon,\tWon'); + } + + static testMethod void testRollupConcatenateAllTokens() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, 'TB()BR()SP()'), + 'test\t\n test\t\n test', + 'Lost\t\n Won\t\n Won'); + } + + static testMethod void testRollupConcatenateCommaAllTokens() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ',TB()BR()SP()'), + 'test,\t\n test,\t\n test', + 'Lost,\t\n Won,\t\n Won'); + } + + static testMethod void testRollupConcatenateOrderBy() { + testRollup( + Schema.SObjectType.Opportunity.fields.Amount.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ','), + 'test,test,test', + 'Won,Won,Lost'); + } + + static testMethod void testRollupConcatenateOrderByMultipleAscendingNullsFirst() { + testRollup2( + 'CloseDate, Type, Amount, Name', + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ','), + 'blue,red,yellow', + 'orange,green,purple'); + } + + static testMethod void testRollupConcatenateOrderByMultipleAscendingNullsLast() { + testRollup2( + 'CloseDate NULLS LAST, Type NULLS LAST, Amount NULLS LAST, Name NULLS LAST', + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ','), + 'red,yellow,blue', + 'orange,green,purple'); + } + + static testMethod void testRollupConcatenateOrderByMultipleDescendingNullsFirst() { + testRollup2( + 'CloseDate DESC, Type DESC, Amount DESC, Name DESC', + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ','), + 'blue,yellow,red', + 'purple,green,orange'); + } + + static testMethod void testRollupConcatenateOrderByMultipleDescendingNullsLast() { + testRollup2( + 'CloseDate DESC NULLS LAST, Type DESC NULLS LAST, Amount DESC NULLS LAST, Name DESC NULLS LAST', + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, ','), + 'yellow,red,blue', + 'purple,green,orange'); + } + + static testMethod void testRollupConcatenateNoDelimiter() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate, null), + 'testtesttest', + 'LostWonWon'); + } + + static testMethod void testRollupConcatenateDistinct() { + testRollup( + Schema.SObjectType.Opportunity.fields.StageName.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate_Distinct, ','), + 'test', + 'Lost,Won'); + } + + static testMethod void testRollupConcatenateDistinctWithOrderBy() { + testRollup( + Schema.SObjectType.Opportunity.fields.Amount.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate_Distinct, ','), + 'test', + 'Won,Lost'); + } + + static testMethod void testRollupConcatenateDistinctWithMultipleFieldsOrderBy() { + testRollup( + 'Amount DESC, CloseDate DESC, Type DESC, Name DESC', + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Concatenate_Distinct, ','), + 'test', + 'Lost,Won'); + } + + static testMethod void testRollupFirst() { + testRollup( + Schema.SObjectType.Opportunity.fields.Amount.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.First, null), + 'test', + 'Won'); + } + + static testMethod void testRollupLast() { + testRollup( + Schema.SObjectType.Opportunity.fields.Amount.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Last, null), + 'test', + 'Lost'); + } + + static testMethod void testRollupLastLimit() { + testRollup( + Schema.SObjectType.Opportunity.fields.Amount.getName(), + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Last, null, 2), + 'test', + 'Won'); + } + + static testMethod void testMultipleRollupsSameResultField() { + prepareData(); + + LREngine.Context ctx = new LREngine.Context( + Account.SobjectType, + Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId, + null, + Schema.SObjectType.Opportunity.fields.Amount.getName()); + + LREngine.RollupSummaryField rollupField1 = + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Description, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.Last, null); + ctx.add(rollupField1); + LREngine.RollupSummaryField rollupField2 = + new LREngine.RollupSummaryField( + Schema.SObjectType.Account.fields.Sic, + Schema.SObjectType.Opportunity.fields.StageName, + LREngine.RollupOperation.First, null); + ctx.add(rollupField2); + + SObject[] masters = LREngine.rollUp(ctx, detailRecords); + + Map mastersById = new Map(masters); + Account reloadedAcc1 = (Account)mastersById.get(acc1.Id); + Account reloadedAcc2 = (Account)mastersById.get(acc2.Id); + System.assertEquals(2, masters.size()); + System.assertEquals('test', reloadedAcc1.get(rollupField1.master.getName())); + System.assertEquals('test', reloadedAcc1.get(rollupField2.master.getName())); + System.assertEquals('Lost', reloadedAcc2.get(rollupField1.master.getName())); + System.assertEquals('Won', reloadedAcc2.get(rollupField2.master.getName())); + } + + static testMethod void testIsAggregateOrQueryBasedRollup() + { + // map of operations with flag indicating if it is an aggregate operation + Map operations = new Map { + LREngine.RollupOperation.Sum => true, + LREngine.RollupOperation.Min => true, + LREngine.RollupOperation.Max => true, + LREngine.RollupOperation.Avg => true, + LREngine.RollupOperation.Count => true, + LREngine.RollupOperation.Count_Distinct => true, + LREngine.RollupOperation.Concatenate => false, + LREngine.RollupOperation.Concatenate_Distinct => false, + LREngine.RollupOperation.First => false, + LREngine.RollupOperation.Last => false + }; + for (LREngine.RollupOperation op :operations.keySet()) { + Boolean isAggregate = operations.get(op); + System.assertEquals(isAggregate, LREngine.isAggregateBasedRollup(op)); + System.assertEquals(!isAggregate, LREngine.isQueryBasedRollup(op)); + } + } + + static private void testRollup(String detailOrderByClause, LREngine.RollupSummaryField rollupField, String expected1, String expected2) { + testRollup(detailOrderByClause, rollupField, expected1, expected2, false); + } + + static private void testRollup(String detailOrderByClause, LREngine.RollupSummaryField rollupField, String expected1, String expected2, boolean allRows) { + + prepareData(); + + if(allRows) + delete detailRecordsAcc1; + + LREngine.Context ctx = new LREngine.Context( + Account.SobjectType, + Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId, + null, // detailWhereClause + null, + detailOrderByClause, + allRows); + + ctx.add(rollupField); + + SObject[] masters = LREngine.rollUp(ctx, detailRecords); + + Map mastersById = new Map(masters); + Account reloadedAcc1 = (Account)mastersById.get(acc1.Id); + Account reloadedAcc2 = (Account)mastersById.get(acc2.Id); + System.assertEquals(2, masters.size()); + System.assertEquals(expected1, reloadedAcc1.get(rollupField.master.getName())); + System.assertEquals(expected2, reloadedAcc2.get(rollupField.master.getName())); + } + + static private void testRollup2(String detailOrderByClause, LREngine.RollupSummaryField rollupField, String expected1, String expected2) { + + prepareData2(); + + LREngine.Context ctx = new LREngine.Context( + Account.SobjectType, + Opportunity.SobjectType, + Schema.SObjectType.Opportunity.fields.AccountId, + null, // detailWhereClause + detailOrderByClause); + + ctx.add(rollupField); + + SObject[] masters = LREngine.rollUp(ctx, detailRecords2); + + Map mastersById = new Map(masters); + Account reloadedAcc3 = (Account)mastersById.get(acc3.Id); + Account reloadedAcc4 = (Account)mastersById.get(acc4.Id); + System.assertEquals(2, masters.size()); + System.assertEquals(expected1, reloadedAcc3.get(rollupField.master.getName())); + System.assertEquals(expected2, reloadedAcc4.get(rollupField.master.getName())); + } } \ No newline at end of file diff --git a/rolluptool/src/classes/TestLREngine.cls-meta.xml b/rolluptool/src/classes/TestLREngine.cls-meta.xml index b211a092..49358969 100644 --- a/rolluptool/src/classes/TestLREngine.cls-meta.xml +++ b/rolluptool/src/classes/TestLREngine.cls-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 37.0 Active diff --git a/rolluptool/src/classes/Utilities.cls b/rolluptool/src/classes/Utilities.cls new file mode 100644 index 00000000..ad6d4859 --- /dev/null +++ b/rolluptool/src/classes/Utilities.cls @@ -0,0 +1,189 @@ +/** + * Copyright (c) 2013, Andrew Fawcett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the Andrew Fawcett, nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +public class Utilities { + /** + * Get the namespace of this package + **/ + public static String namespace() + { + Schema.DescribeSObjectResult describe = LookupRollupSummary__c.sObjectType.getDescribe(); + String name = describe.getName(); + String localName = describe.getLocalName(); + String namespace = name.removeEnd(localName).removeEnd('__'); + return namespace; + } + + /** + * Get the component prefix based on the current namespace + **/ + public static String componentPrefix() + { + String namespace = namespace(); + return String.isEmpty(namespace) ? '' : (namespace + '_'); + } + + /** + * Get the class prefix based on the current namespace + **/ + public static String classPrefix() + { + String namespace = namespace(); + return String.isEmpty(namespace) ? '' : (namespace + '.'); + } + + /** + * Get the object prefix based on the current namespace + **/ + public static String objectPrefix() + { + String namespace = namespace(); + return String.isEmpty(namespace) ? '' : (namespace + '__'); + } + + /** + * Parse a string that follows the SOQL Order By standard + * + * @param orderByClause - order by clause (not including ORDER BY keywords) following standard at https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_orderby.htm + * + * @return list containing one LREngine.Ordering element for each field in the order by clause + * + * @throw OrderByInvalidException when order by is not in proper format + **/ + public static List parseOrderByClause(String orderByClause) + { + if (String.isBlank(orderByClause)) { + return null; + } + + List orderByFields = new List(); + List orderByClauseFields = orderByClause.split(','); + for(String field :orderByClauseFields) { + orderByFields.add(parseOrderByField(field)); + } + + return orderByFields; + } + + // Regular expression for Order By Clause + // Case-Insensitive pattern + // Group 1 - Field Name (required) + // Group 2 - ASC/DESC (optional) + // Group 3 - NULLS FIRST (optional) + // Group 4 - NULLS (required if Group 3 != null) + // Group 5 - FIRST (required if Group 3 != null) + private static Pattern orderByPattern = Pattern.compile('^(?i)[\\s]*([\\w]+)[\\s]*(ASC|DESC)?[\\s]*((NULLS)[\\s]*(FIRST|LAST))?[\\s]*$'); + private static Utilities.Ordering parseOrderByField(String orderByField) + { + Matcher matcher = orderByPattern.matcher(orderByField); + if (!matcher.matches() || matcher.groupCount() != 5) { + throw new Utilities.OrderByInvalidException('Invalid order by clause.'); + } + + // regex enforces that fieldname cannot be blank + String fieldName = matcher.group(1); + + // regex enforces that ordering be null, ASC or DESC + // == operator is case-insensitive + String ordering = matcher.group(2); + Utilities.SortOrder sortOrder = (ordering == null) ? null : (ordering == 'DESC' ? Utilities.SortOrder.DESCENDING : Utilities.SortOrder.ASCENDING); + + // regex enforces that firstLast be null, FIRST or LAST + // == operator is case-insensitive + String firstLast = matcher.group(5); + Boolean nullsLast = (firstLast == null) ? null : (firstLast == 'LAST'); + + return new Utilities.Ordering(fieldName, sortOrder, nullsLast); + } + + /** + Sort Order + */ + public enum SortOrder {ASCENDING, DESCENDING} + + /** + Represents a single portion of the Order By clause for SOQL statement + */ + public class Ordering{ + private SortOrder direction; + private Boolean nullsLast; + private String field; + private Boolean directionSpecified; // if direction was specified during construction + private Boolean nullsLastSpecified; // if nullsLast was specified during construction + + /** + * Construct a new ordering instance + **/ + public Ordering(String field) { + this(field, null); + } + public Ordering(String field, SortOrder direction) { + this(field, direction, null); + } + public Ordering(String field, SortOrder direction, Boolean nullsLast) { + setField(field); + this.directionSpecified = direction != null; + this.nullsLastSpecified = nullsLast != null; + this.direction = this.directionSpecified ? direction : SortOrder.ASCENDING; //SOQL docs ASC is default behavior + this.nullsLast = this.nullsLastSpecified ? nullsLast : false; //SOQL docs state NULLS FIRST is default behavior + } + public String getField() { + return field; + } + public void setField(String field) { + if (String.isBlank(field)) { + throw new Utilities.BadOrderingStateException('field cannot be blank.'); + } + this.field = field; + } + public SortOrder getDirection() { + return direction; + } + public Boolean getNullsLast() { + return nullsLast; + } + public override String toString() { + return field + ' ' + (direction == Utilities.SortOrder.ASCENDING ? 'ASC' : 'DESC') + ' ' + (nullsLast ? 'NULLS LAST' : 'NULLS FIRST'); + } + public String toAsSpecifiedString() { + // emit order by using describe info with the direction and nullsLast + // that was provided during construction. This allows to regurgitate + // the proper SOQL order by using exactly what was passed in + return field + (directionSpecified ? (direction == Utilities.SortOrder.ASCENDING ? ' ASC' : ' DESC') : '') + (nullsLastSpecified ? (nullsLast ? ' NULLS LAST' : ' NULLS FIRST') : ''); + } + } + + + /** + Exception thrown if Order by clause is invalid + */ + public class OrderByInvalidException extends Exception {} + + /** + Exception thrown if Ordering is in bad state + */ + public class BadOrderingStateException extends Exception {} +} \ No newline at end of file diff --git a/rolluptool/src/classes/Utilities.cls-meta.xml b/rolluptool/src/classes/Utilities.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/Utilities.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/WelcomeController.cls b/rolluptool/src/classes/WelcomeController.cls index 748eced5..02ca6306 100644 --- a/rolluptool/src/classes/WelcomeController.cls +++ b/rolluptool/src/classes/WelcomeController.cls @@ -30,10 +30,14 @@ public with sharing class WelcomeController { public String Host {get;set;} - + + public String RemoteSiteName { get { return Utilities.componentPrefix() + 'mdapi'; } } + public String MetadataResponse {get;set;} public Boolean MetadataConnectionWarning {get;set;} + + public String MetadataApiException {get;set;} public PageReference checkMetadataAPIConnection() { @@ -48,6 +52,9 @@ public with sharing class WelcomeController { ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error, 'A Remote Site Setting must be created in your org before you can use this tool.')); ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error, 'Press the Create Remote Site Setting button to perform this step or refer to the post install step below to perform this manually.')); MetadataConnectionWarning = true; + MetadataApiException = ''; + if(RollupService.LastMetadataAPIConnectionException!=null) + MetadataApiException = RollupService.LastMetadataAPIConnectionException.getMessage(); } return null; @@ -58,7 +65,7 @@ public with sharing class WelcomeController { // Display the response from the client side Metadata API callout if(metadataResponse.length()==0) { - ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Remote Site Setting dlrs_mdapi has been created.' )); + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Remote Site Setting ' + RemoteSiteName + ' has been created.' )); MetadataConnectionWarning = false; } else diff --git a/rolluptool/src/classes/WelcomeController.cls-meta.xml b/rolluptool/src/classes/WelcomeController.cls-meta.xml index 1124945f..49358969 100644 --- a/rolluptool/src/classes/WelcomeController.cls-meta.xml +++ b/rolluptool/src/classes/WelcomeController.cls-meta.xml @@ -1,5 +1,5 @@ - 24.0 + 37.0 Active diff --git a/rolluptool/src/classes/WelcomeControllerTest.cls-meta.xml b/rolluptool/src/classes/WelcomeControllerTest.cls-meta.xml index 1124945f..49358969 100644 --- a/rolluptool/src/classes/WelcomeControllerTest.cls-meta.xml +++ b/rolluptool/src/classes/WelcomeControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 24.0 + 37.0 Active diff --git a/rolluptool/src/classes/fflib_ApexMocks.cls b/rolluptool/src/classes/fflib_ApexMocks.cls new file mode 100644 index 00000000..ee38f1f8 --- /dev/null +++ b/rolluptool/src/classes/fflib_ApexMocks.cls @@ -0,0 +1,255 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +public with sharing class fflib_ApexMocks +{ + public static final Integer NEVER = 0; + + private final fflib_MethodCountRecorder methodCountRecorder; + private final fflib_MethodReturnValueRecorder methodReturnValueRecorder; + + public Boolean Verifying + { + get + { + return methodCountRecorder.Verifying; + } + + private set; + } + + public Boolean Stubbing + { + get + { + return methodReturnValueRecorder.Stubbing; + } + + private set; + } + + public Exception DoThrowWhenException + { + get + { + return methodReturnValueRecorder.DoThrowWhenException; + } + + set + { + methodReturnValueRecorder.DoThrowWhenException = value; + } + } + + /** + * Construct an ApexMocks instance. + */ + public fflib_ApexMocks() + { + methodCountRecorder = new fflib_MethodCountRecorder(); + methodReturnValueRecorder = new fflib_MethodReturnValueRecorder(); + + methodCountRecorder.Verifying = false; + methodReturnValueRecorder.Stubbing = false; + } + + public static String extractTypeName(Object mockInstance) + { + return String.valueOf(mockInstance).split(':').get(0); + } + + /** + * Verify a method was called on a mock object. + * @param mockInstance The mock object instance. + * @return The mock object instance. + */ + public Object verify(Object mockInstance) + { + return verify(mockInstance, 1); + } + + /** + * Verify a method was called on a mock object. + * @param mockInstance The mock object instance. + * @param times The number of times you expect the method to have been called. + * @return The mock object instance. + */ + public Object verify(Object mockInstance, Integer times) + { + methodCountRecorder.Verifying = true; + methodCountRecorder.VerifyCount = times; + return mockInstance; + } + + /** + * Verfiy a method was called on a mock object. + * @param mockInstance The mock object instance. + * @param methodName The method you expect to have been called. + * @param methodArg The argument you expect to have been passed to the method being verified. + */ + public void verifyMethodCall(Object mockInstance, String methodName, Object methodArg) + { + methodCountRecorder.verifyMethodCall(mockInstance, methodName, methodArg); + } + + /** + * Tell ApexMocks framework you are about to start stubbing using when() calls. + */ + public void startStubbing() + { + methodReturnValueRecorder.Stubbing = true; + } + + /** + * Tell ApexMocks framework you are about to stop stubbing using when() calls. + */ + public void stopStubbing() + { + methodReturnValueRecorder.Stubbing = false; + } + + /** + * Setup when stubbing for a mock object instance. + * @param This is the return value from the method called on the mockInstance, and is ignored here since we are about to setup + * the stubbed return value using thenReturn() (see MethodReturnValue class below). + */ + public fflib_MethodReturnValue when(Object ignoredRetVal) + { + return methodReturnValueRecorder.MethodReturnValue; + } + + /** + * Record a method was called on a mock object. + * @param mockInstance The mock object instance. + * @param methodName The method to be recorded. + * @param methodArg The method argument to be recorded. + */ + public void recordMethod(Object mockInstance, String methodName, Object methodArg) + { + methodCountRecorder.recordMethod(mockInstance, methodName, methodArg); + } + + /** + * Prepare a stubbed method return value. + * @param mockInstance The mock object instance. + * @param methodName The method for which to prepare a return value. + * @param methodArg The method argument for which to prepare a return value. + */ + public fflib_MethodReturnValue prepareMethodReturnValue(Object mockInstance, String methodName, Object methodArg) + { + return methodReturnValueRecorder.prepareMethodReturnValue(mockInstance, methodName, methodArg); + } + + /** + * Get the method return value for the given method call. + * @param mockInstance The mock object instance. + * @param methodName The method for which to prepare a return value. + * @param methodArg The method argument for which to prepare a return value. + * @return The MethodReturnValue instance. + */ + public fflib_MethodReturnValue getMethodReturnValue(Object mockInstance, String methodName, Object methodArg) + { + return methodReturnValueRecorder.getMethodReturnValue(mockInstance, methodName, methodArg); + } + + /** + * Setup exception stubbing for a void method. + * @param e The exception to throw. + * @param mockInstance The mock object instance. + */ + public Object doThrowWhen(Exception e, Object mockInstance) + { + methodReturnValueRecorder.prepareDoThrowWhenException(e); + return mockInstance; + } + + /** + * Mock a void method. Called by generated mock instance classes, not directly by a developers + * code. + * @param mockInstance The mock object instance. + * @param methodName The method for which to prepare a return value. + * @param methodArg The method argument for which to prepare a return value. + */ + public void mockVoidMethod(Object mockInstance, String methodName, Object methodArg) + { + if (Verifying) + { + verifyMethodCall(mockInstance, methodName, methodArg); + } + else if (Stubbing) + { + prepareMethodReturnValue(mockInstance, methodName, methodArg).thenThrow(DoThrowWhenException); + } + else + { + fflib_MethodReturnValue methodReturnValue = getMethodReturnValue(mockInstance, methodName, methodArg); + + if (methodReturnValue != null && methodReturnValue.ReturnValue instanceof Exception) + { + throw ((Exception) methodReturnValue.ReturnValue); + } + + recordMethod(mockInstance, methodName, methodArg); + } + } + + /** + * Mock a non-void method. Called by generated mock instance classes, not directly by a developers + * code. + * @param mockInstance The mock object instance. + * @param methodName The method for which to prepare a return value. + * @param methodArg The method argument for which to prepare a return value. + */ + public Object mockNonVoidMethod(Object mockInstance, String methodName, Object methodArg) + { + if (Verifying) + { + verifyMethodCall(mockInstance, methodName, methodArg); + } + else if (Stubbing) + { + prepareMethodReturnValue(mockInstance, methodName, methodArg); + return null; + } + else + { + recordMethod(mockInstance, methodName, methodArg); + + fflib_MethodReturnValue methodReturnValue = getMethodReturnValue(mockInstance, methodName, methodArg); + + if (methodReturnValue != null) + { + if (methodReturnValue.ReturnValue instanceof Exception) + { + throw ((Exception) methodReturnValue.ReturnValue); + } + + return methodReturnValue.ReturnValue; + } + } + + return null; + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_ApexMocks.cls-meta.xml b/rolluptool/src/classes/fflib_ApexMocks.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_ApexMocks.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_ApexMocksTest.cls b/rolluptool/src/classes/fflib_ApexMocksTest.cls new file mode 100644 index 00000000..58f33efe --- /dev/null +++ b/rolluptool/src/classes/fflib_ApexMocksTest.cls @@ -0,0 +1,387 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +@isTest +private class fflib_ApexMocksTest +{ + @isTest + static void whenStubSingleCallWithSingleArgumentShouldReturnStubbedValue() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + mocks.startStubbing(); + mocks.when(mockList.get(0)).thenReturn('bob'); + mocks.stopStubbing(); + + // When + String actualValue = mockList.get(0); + + // Then + System.assertEquals('bob', actualValue); + } + + @isTest + static void whenStubMultipleCallsWithSingleArgumentShouldReturnStubbedValues() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + mocks.startStubbing(); + mocks.when(mockList.get(0)).thenReturn('bob'); + mocks.when(mockList.get(1)).thenReturn('fred'); + mocks.stopStubbing(); + + // When + String actualValueArg0 = mockList.get(0); + String actualValueArg1 = mockList.get(1); + String actualValueArg2 = mockList.get(2); + + // Then + System.assertEquals('bob', actualValueArg0); + System.assertEquals('fred', actualValueArg1); + System.assertEquals(null, actualValueArg2); + } + + @isTest + static void whenStubSameCallWithDifferentArgumentValueShouldReturnLastStubbedValue() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + mocks.startStubbing(); + mocks.when(mockList.get(0)).thenReturn('bob1'); + mocks.when(mockList.get(0)).thenReturn('bob2'); + mocks.stopStubbing(); + + // When + String actualValue = mockList.get(0); + + // Then + System.assertEquals('bob2', actualValue); + } + + @isTest + static void whenStubCallWithNoArgumentsShouldReturnStubbedValue() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + mocks.startStubbing(); + mocks.when(mockList.isEmpty()).thenReturn(false); + mocks.stopStubbing(); + + // When + Boolean actualValue = mockList.isEmpty(); + + // Then + System.assertEquals(false, actualValue); + } + + @isTest + static void verifySingleMethodCallWithNoArguments() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + // When + mockList.isEmpty(); + + // Then + ((fflib_MyList.IList) mocks.verify(mockList)).isEmpty(); + } + + @isTest + static void verifySingleMethodCallWithSingleArgument() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + // When + mockList.add('bob'); + + // Then + ((fflib_MyList.IList) mocks.verify(mockList)).add('bob'); + } + + @isTest + static void verifyMultipleMethodCallsWithSameSingleArgument() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + // When + mockList.add('bob'); + mockList.add('bob'); + + // Then + ((fflib_MyList.IList) mocks.verify(mockList, 2)).add('bob'); + } + + @isTest + static void verifyMultipleMethodCallsWithDifferentSingleArgument() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + // When + mockList.add('bob'); + mockList.add('fred'); + + // Then + ((fflib_MyList.IList) mocks.verify(mockList)).add('bob'); + ((fflib_MyList.IList) mocks.verify(mockList)).add('fred'); + } + + @isTest + static void verifyMethodNotCalled() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + // When + mockList.get(0); + + // Then + ((fflib_MyList.IList) mocks.verify(mockList, fflib_ApexMocks.NEVER)).add('bob'); + ((fflib_MyList.IList) mocks.verify(mockList)).get(0); + } + + @isTest + static void stubAndVerifyMethodCallsWithNoArguments() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + mocks.startStubbing(); + mocks.when(mockList.isEmpty()).thenReturn(false); + mocks.stopStubbing(); + + mockList.clear(); + + // When + Boolean actualValue = mockList.isEmpty(); + + // Then + System.assertEquals(false, actualValue); + ((fflib_MyList.IList) mocks.verify(mockList)).clear(); + } + + @isTest + static void whenStubExceptionTheExceptionShouldBeThrown() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + mocks.startStubbing(); + mocks.when(mockList.get(0)).thenThrow(new MyException('Stubbed exception.')); + mocks.stopStubbing(); + + // When + try + { + mockList.get(0); + System.assert(false, 'Stubbed exception should have been thrown.'); + } + catch(Exception e) + { + // Then + System.assert(e instanceof MyException); + System.assertEquals('Stubbed exception.', e.getMessage()); + } + } + + @isTest + static void whenStubVoidMethodWithExceptionThenExceptionShouldBeThrown() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + mocks.startStubbing(); + ((fflib_MyList.IList) mocks.doThrowWhen(new MyException('Stubbed exception.'), mockList)).clear(); + mocks.stopStubbing(); + + // When + try + { + mockList.clear(); + System.assert(false, 'Stubbed exception should have been thrown.'); + } + catch(Exception e) + { + // Then + System.assert(e instanceof MyException); + System.assertEquals('Stubbed exception.', e.getMessage()); + } + } + + @isTest + static void whenStubMultipleVoidMethodsWithExceptionsThenExceptionsShouldBeThrown() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + mocks.startStubbing(); + ((fflib_MyList.IList) mocks.doThrowWhen(new MyException('clear stubbed exception.'), mockList)).clear(); + ((fflib_MyList.IList) mocks.doThrowWhen(new MyException('add stubbed exception.'), mockList)).add('bob'); + mocks.stopStubbing(); + + // When + try + { + mockList.clear(); + System.assert(false, 'Stubbed exception should have been thrown.'); + } + catch(Exception e) + { + // Then + System.assert(e instanceof MyException); + System.assertEquals('clear stubbed exception.', e.getMessage()); + } + + // When + try + { + mockList.add('bob'); + System.assert(false, 'Stubbed exception should have been thrown.'); + } + catch(Exception e) + { + // Then + System.assert(e instanceof MyException); + System.assertEquals('add stubbed exception.', e.getMessage()); + } + } + + @isTest + static void whenStubVoidMethodWithExceptionAndCallMethodTwiceThenExceptionShouldBeThrownTwice() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + mocks.startStubbing(); + ((fflib_MyList.IList) mocks.doThrowWhen(new MyException('clear stubbed exception.'), mockList)).clear(); + mocks.stopStubbing(); + + // When + try + { + mockList.clear(); + System.assert(false, 'Stubbed exception should have been thrown.'); + } + catch(Exception e) + { + // Then + System.assert(e instanceof MyException); + System.assertEquals('clear stubbed exception.', e.getMessage()); + } + + // When + try + { + mockList.clear(); + System.assert(false, 'Stubbed exception should have been thrown.'); + } + catch(Exception e) + { + // Then + System.assert(e instanceof MyException); + System.assertEquals('clear stubbed exception.', e.getMessage()); + } + } + + @isTest + static void verifyMethodCallWhenNoCallsBeenMadeForType() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + // Then + ((fflib_MyList.IList) mocks.verify(mockList, fflib_ApexMocks.NEVER)).add('bob'); + } + + @isTest + static void verifySingleMethodCallWithMultipleArguments() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + // When + mockList.set(0, 'bob'); + + // Then + ((fflib_MyList.IList) mocks.verify(mockList)).set(0, 'bob'); + ((fflib_MyList.IList) mocks.verify(mockList, fflib_ApexMocks.NEVER)).set(0, 'fred'); + } + + @isTest + static void whenStubMultipleCallsWithMultipleArgumentShouldReturnStubbedValues() + { + // Given + fflib_ApexMocks mocks = new fflib_ApexMocks(); + fflib_MyList.IList mockList = new fflib_Mocks.Mockfflib_MyList(mocks); + + mocks.startStubbing(); + mocks.when(mockList.get2(0, 'zero')).thenReturn('bob'); + mocks.when(mockList.get2(1, 'one')).thenReturn('fred'); + mocks.when(mockList.get2(0, 'two')).thenReturn('bob'); + mocks.when(mockList.get2(1, 'three')).thenReturn('bub'); + mocks.stopStubbing(); + + // When + String actualValueArg0 = mockList.get2(0, 'zero'); + String actualValueArg1 = mockList.get2(1, 'one'); + String actualValueArg2 = mockList.get2(0, 'two'); + String actualValueArg3 = mockList.get2(1, 'three'); + String actualValueArg4 = mockList.get2(0, 'three'); + + // Then + System.assertEquals('bob', actualValueArg0); + System.assertEquals('fred', actualValueArg1); + System.assertEquals('bob', actualValueArg2); + System.assertEquals('bub', actualValueArg3); + System.assertEquals(null, actualValueArg4); + } + + private class MyException extends Exception + { + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_ApexMocksTest.cls-meta.xml b/rolluptool/src/classes/fflib_ApexMocksTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_ApexMocksTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_Application.cls b/rolluptool/src/classes/fflib_Application.cls new file mode 100644 index 00000000..701e25a3 --- /dev/null +++ b/rolluptool/src/classes/fflib_Application.cls @@ -0,0 +1,304 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * Class provides inner classes implementing factories for the main components + * of the Apex Enterprise Patterns, Service, Unit Of Work, Selector and Domain. + * See the sample applications Application.cls file for an example + **/ +public class fflib_Application +{ + /** + * Class implements a Unit of Work factory + **/ + public class UnitOfWorkFactory + { + private List m_objectTypes; + private fflib_ISObjectUnitOfWork m_mockUow; + + /** + * Constructs a Unit Of Work factory + * + * @param objectTypes List of SObjectTypes in dependency order + **/ + public UnitOfWorkFactory(List objectTypes) + { + m_objectTypes = objectTypes.clone(); + } + + /** + * Returns a new fflib_SObjectUnitOfWork configured with the + * SObjectType list provided in the constructor, returns a Mock implementation + * if set via the setMock method + **/ + public fflib_ISObjectUnitOfWork newInstance() + { + // Mock? + if(m_mockUow!=null) + return m_mockUow; + return new fflib_SObjectUnitOfWork(m_objectTypes); + } + + @TestVisible + private void setMock(fflib_ISObjectUnitOfWork mockUow) + { + m_mockUow = mockUow; + } + } + + /** + * Simple Service Factory implementaiton + **/ + public class ServiceFactory + { + private Map m_serviceInterfaceTypeByServiceImplType; + + private Map m_serviceInterfaceTypeByMockService; + + /** + * Constructs a simple Service Factory, + * using a Map of Apex Interfaces to Apex Classes implementing the interface + * Note that this will not check the Apex Classes given actually implement the interfaces + * as this information is not presently available via the Apex runtime + * + * @param serviceInterfaceTypeByServiceImplType Map ofi interfaces to classes + **/ + public ServiceFactory(Map serviceInterfaceTypeByServiceImplType) + { + m_serviceInterfaceTypeByServiceImplType = serviceInterfaceTypeByServiceImplType; + m_serviceInterfaceTypeByMockService = new Map(); + } + + /** + * Returns a new instance of the Apex class associated with the given Apex interface + * Will return any mock implementation of the interface provided via setMock + * Note that this method will not check the configured Apex class actually implements the interface + * + * @param serviceInterfaceType Apex interface type + * @exception Is thrown if there is no registered Apex class for the interface type + **/ + public Object newInstance(Type serviceInterfaceType) + { + // Mock implementation? + if(m_serviceInterfaceTypeByMockService.containsKey(serviceInterfaceType)) + return m_serviceInterfaceTypeByMockService.get(serviceInterfaceType); + + // Create an instance of the type impleneting the given interface + Type serviceImpl = m_serviceInterfaceTypeByServiceImplType.get(serviceInterfaceType); + if(serviceImpl==null) + throw new DeveloperException('No implementation registered for service interface ' + serviceInterfaceType.getName()); + return serviceImpl.newInstance(); + } + + @TestVisible + private void setMock(Type serviceInterfaceType, Object serviceImpl) + { + m_serviceInterfaceTypeByMockService.put(serviceInterfaceType, serviceImpl); + } + } + + /** + * Class implements a Selector class factory + **/ + public class SelectorFactory + { + private Map m_sObjectBySelectorType; + private Map m_sObjectByMockSelector; + + /** + * Consturcts a Selector Factory linking SObjectType's with Apex Classes implement the fflib_ISObjectSelector interface + * Note that the factory does not chekc the given Apex Classes implement the interface + * currently this is not possible in Apex. + * + * @Param sObjectBySelectorType Map of SObjectType's to Selector Apex Classes + **/ + public SelectorFactory(Map sObjectBySelectorType) + { + m_sObjectBySelectorType = sObjectBySelectorType; + m_sObjectByMockSelector = new Map(); + } + + /** + * Creates a new instance of the associated Apex Class implementing fflib_ISObjectSelector + * for the given SObjectType, or if provided via setMock returns the Mock implementaton + * + * @param sObjectType An SObjectType token, e.g. Account.SObjectType + **/ + public fflib_ISObjectSelector newInstance(SObjectType sObjectType) + { + // Mock implementation? + if(m_sObjectByMockSelector.containsKey(sObjectType)) + return m_sObjectByMockSelector.get(sObjectType); + + // Determine Apex class for Selector class + Type selectorClass = m_sObjectBySelectorType.get(sObjectType); + if(selectorClass==null) + throw new DeveloperException('Selector class not found for SObjectType ' + sObjectType); + + // Construct Selector class and query by Id for the records + return (fflib_ISObjectSelector) selectorClass.newInstance(); + } + + /** + * Helper method to query the given SObject records + * Internally creates an instance of the registered Selector and calls its + * selectSObjectById method + * + * @param recordIds The SObject record Ids, must be all the same SObjectType + * @exception Is thrown if the record Ids are not all the same or the SObjectType is not registered + **/ + public List selectById(Set recordIds) + { + // No point creating an empty Domain class, nor can we determine the SObjectType anyway + if(recordIds==null || recordIds.size()==0) + throw new DeveloperException('Invalid record Id\'s set'); + + // Determine SObjectType + SObjectType domainSObjectType = new List(recordIds)[0].getSObjectType(); + for(Id recordId : recordIds) + if(recordId.getSobjectType()!=domainSObjectType) + throw new DeveloperException('Unable to determine SObjectType, Set contains Id\'s from different SObject types'); + + // Construct Selector class and query by Id for the records + return newInstance(domainSObjectType).selectSObjectsById(recordIds); + } + + /** + * Helper method to query related records to those provided, for example + * if passed a list of Opportunity records and the Account Id field will + * construct internally a list of Account Ids and call the registered + * Account selector to query the related Account records, e.g. + * + * List accounts = + * (List) Applicaiton.Selector.selectByRelationship(myOpps, Opportunity.AccountId); + * + * @param relatedRecords used to extract the related record Ids, e.g. Opportunty records + * @param relationshipField field in the passed records that contains the relationship records to query, e.g. Opportunity.AccountId + **/ + public List selectByRelationship(List relatedRecords, SObjectField relationshipField) + { + Set relatedIds = new Set(); + for(SObject relatedRecord : relatedRecords) + { + Id relatedId = (Id) relatedRecord.get(relationshipField); + if(relatedId!=null) + relatedIds.add(relatedId); + } + return selectById(relatedIds); + } + + @TestVisible + private void setMock(fflib_ISObjectSelector selectorInstance) + { + m_sObjectByMockSelector.put(selectorInstance.sObjectType(), selectorInstance); + } + } + + /** + * Class implements a Domain class factory + **/ + public class DomainFactory + { + private fflib_Application.SelectorFactory m_selectorFactory; + + private Map m_sObjectByDomainConstructorType; + + private Map m_sObjectByMockDomain; + + /** + * Consturcts a Domain factory, using an instance of the Selector Factory + * and a map of Apex classes implementing fflib_ISObjectDomain by SObjectType + * Note this will not check the Apex classes provided actually implement the interfaces + * since this is not possible in the Apex runtime at present + * + * @param selectorFactory, e.g. Application.Selector + * @param sObjectByDomainConstructorType Map of Apex classes by SObjectType + **/ + public DomainFactory(fflib_Application.SelectorFactory selectorFactory, + Map sObjectByDomainConstructorType) + { + m_selectorFactory = selectorFactory; + m_sObjectByDomainConstructorType = sObjectByDomainConstructorType; + m_sObjectByMockDomain = new Map(); + } + + /** + * Dynamically constructs an instance of a Domain class for the given record Ids + * Internally uses the Selector Factory to query the records before passing to a + * dynamically constructed instance of the application Apex Domain class + * + * @param recordIds A list of Id's of the same type + * @exception Throws an exception via the Selector Factory if the Ids are not all of the same SObjectType + **/ + public fflib_ISObjectDomain newInstance(Set recordIds) + { + return newInstance(m_selectorFactory.selectById(recordIds)); + + } + + /** + * Dynamically constructs an instace of the Domain class for the given records + * Will return a Mock implementation if one has been provided via setMock + * + * @param records A concreate list (e.g. List vs List) of records + * @exception Throws an exception if the SObjectType cannot be determined from the list + * or the constructor for Domain class was not registered for the SOBjectType + **/ + public fflib_ISObjectDomain newInstance(List records) + { + SObjectType domainSObjectType = records.getSObjectType(); + if(domainSObjectType==null) + throw new DeveloperException('Unable to determine SObjectType'); + + // Mock implementation? + if(m_sObjectByMockDomain.containsKey(domainSObjectType)) + return m_sObjectByMockDomain.get(domainSObjectType); + + // Determine SObjectType and Apex classes for Domain class + Type domainConstructorClass = m_sObjectByDomainConstructorType.get(domainSObjectType); + if(domainConstructorClass==null) + throw new DeveloperException('Domain constructor class not found for SObjectType ' + domainSObjectType); + + // Construct Domain class passing in the queried records + fflib_SObjectDomain.IConstructable domainConstructor = + (fflib_SObjectDomain.IConstructable) domainConstructorClass.newInstance(); + return (fflib_ISObjectDomain) domainConstructor.construct(records); + } + + @TestVisible + private void setMock(fflib_ISObjectDomain mockDomain) + { + m_sObjectByMockDomain.put(mockDomain.sObjectType(), mockDomain); + } + } + + public class ApplicationException extends Exception { } + + /** + * Exception representing a developer coding error, not intended for end user eyes + **/ + public class DeveloperException extends Exception { } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_Application.cls-meta.xml b/rolluptool/src/classes/fflib_Application.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_Application.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_IDGenerator.cls b/rolluptool/src/classes/fflib_IDGenerator.cls new file mode 100644 index 00000000..48f99f75 --- /dev/null +++ b/rolluptool/src/classes/fflib_IDGenerator.cls @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +public with sharing class fflib_IDGenerator +{ + private static Integer fakeIdCount = 0; + private static final String ID_PATTERN = '000000000000'; + + /** + * Generate a fake Salesforce Id for the given SObjectType + */ + public static Id generate(Schema.SObjectType sobjectType) + { + String keyPrefix = sobjectType.getDescribe().getKeyPrefix(); + fakeIdCount++; + + String fakeIdPrefix = ID_PATTERN.substring(0, 12 - fakeIdCount.format().length()); + + return Id.valueOf(keyPrefix + fakeIdPrefix + fakeIdCount); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_IDGenerator.cls-meta.xml b/rolluptool/src/classes/fflib_IDGenerator.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_IDGenerator.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_IDGeneratorTest.cls b/rolluptool/src/classes/fflib_IDGeneratorTest.cls new file mode 100644 index 00000000..e9c893ef --- /dev/null +++ b/rolluptool/src/classes/fflib_IDGeneratorTest.cls @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +@isTest +private class fflib_IDGeneratorTest +{ + @isTest + static void itShouldGenerateValidIDs() + { + String id1 = fflib_IDGenerator.generate(Account.SObjectType); + String id2 = fflib_IDGenerator.generate(Account.SObjectType); + String id3 = fflib_IDGenerator.generate(Account.SObjectType); + String id4 = fflib_IDGenerator.generate(Account.SObjectType); + String id5 = fflib_IDGenerator.generate(Account.SObjectType); + String id6 = fflib_IDGenerator.generate(Account.SObjectType); + String id7 = fflib_IDGenerator.generate(Account.SObjectType); + String id8 = fflib_IDGenerator.generate(Account.SObjectType); + String id9 = fflib_IDGenerator.generate(Account.SObjectType); + String id10 = fflib_IDGenerator.generate(Account.SObjectType); + String id11 = fflib_IDGenerator.generate(Account.SObjectType); + + System.assertEquals('001000000000001AAA', id1); + System.assertEquals('001000000000002AAA', id2); + System.assertEquals('001000000000003AAA', id3); + System.assertEquals('001000000000004AAA', id4); + System.assertEquals('001000000000005AAA', id5); + System.assertEquals('001000000000006AAA', id6); + System.assertEquals('001000000000007AAA', id7); + System.assertEquals('001000000000008AAA', id8); + System.assertEquals('001000000000009AAA', id9); + System.assertEquals('001000000000010AAA', id10); + System.assertEquals('001000000000011AAA', id11); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_IDGeneratorTest.cls-meta.xml b/rolluptool/src/classes/fflib_IDGeneratorTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_IDGeneratorTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_ISObjectDomain.cls b/rolluptool/src/classes/fflib_ISObjectDomain.cls new file mode 100644 index 00000000..71c0f1fe --- /dev/null +++ b/rolluptool/src/classes/fflib_ISObjectDomain.cls @@ -0,0 +1,23 @@ +/* +* FinancialForce.com, inc. claims copyright in this software, its screen +* display designs and supporting documentation. FinancialForce and +* FinancialForce.com are trademarks of FinancialForce.com, inc. Any +* unauthorized use, copying or sale of the above may constitute an +* infringement of copyright and may result in criminal or other legal +* proceedings. +* +* Copyright (c) 2013 FinancialForce.com, inc. All rights reserved. +*/ + +public interface fflib_ISObjectDomain +{ + /** + * Returns the SObjectType this Domain class represents + **/ + Schema.SObjectType sObjectType(); + + /** + * Alternative to the Records property, provided to support mocking of Domain classes + **/ + List getRecords(); +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_ISObjectDomain.cls-meta.xml b/rolluptool/src/classes/fflib_ISObjectDomain.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_ISObjectDomain.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_ISObjectSelector.cls b/rolluptool/src/classes/fflib_ISObjectSelector.cls new file mode 100644 index 00000000..d4fee01a --- /dev/null +++ b/rolluptool/src/classes/fflib_ISObjectSelector.cls @@ -0,0 +1,23 @@ +/* +* FinancialForce.com, inc. claims copyright in this software, its screen +* display designs and supporting documentation. FinancialForce and +* FinancialForce.com are trademarks of FinancialForce.com, inc. Any +* unauthorized use, copying or sale of the above may constitute an +* infringement of copyright and may result in criminal or other legal +* proceedings. +* +* Copyright (c) 2013 FinancialForce.com, inc. All rights reserved. +*/ + +public interface fflib_ISObjectSelector +{ + /** + * Provides the SObjectType for the object the given Selector is providing query logic for + **/ + Schema.SObjectType sObjectType(); + + /** + * Selects by Id records using the fields defined by the Selector configuration + **/ + List selectSObjectsById(Set idSet); +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_ISObjectSelector.cls-meta.xml b/rolluptool/src/classes/fflib_ISObjectSelector.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_ISObjectSelector.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_ISObjectUnitOfWork.cls b/rolluptool/src/classes/fflib_ISObjectUnitOfWork.cls new file mode 100644 index 00000000..484915a5 --- /dev/null +++ b/rolluptool/src/classes/fflib_ISObjectUnitOfWork.cls @@ -0,0 +1,75 @@ +/* +* FinancialForce.com, inc. claims copyright in this software, its screen +* display designs and supporting documentation. FinancialForce and +* FinancialForce.com are trademarks of FinancialForce.com, inc. Any +* unauthorized use, copying or sale of the above may constitute an +* infringement of copyright and may result in criminal or other legal +* proceedings. +* +* Copyright (c) 2013 FinancialForce.com, inc. All rights reserved. +*/ + +/** + * @see fflib_SObjectUnitOfWork + **/ +public interface fflib_ISObjectUnitOfWork +{ + /** + * Register a newly created SObject instance to be inserted when commitWork is called + * + * @param record A newly created SObject instance to be inserted during commitWork + **/ + void registerNew(SObject record); + /** + * Register a list of newly created SObject instances to be inserted when commitWork is called + * + * @param records A list of newly created SObject instances to be inserted during commitWork + **/ + void registerNew(List records); + /** + * Register a newly created SObject instance to be inserted when commitWork is called, + * you may also provide a reference to the parent record instance (should also be registered as new separatly) + * + * @param record A newly created SObject instance to be inserted during commitWork + * @param relatedToParentField A SObjectField reference to the child field that associates the child record with its parent + * @param relatedToParentRecord A SObject instance of the parent record (should also be registered as new separatly) + **/ + void registerNew(SObject record, Schema.sObjectField relatedToParentField, SObject relatedToParentRecord); + /** + * Register a relationship between two records that have yet to be inserted to the database. This information will be + * used during the commitWork phase to make the references only when related records have been inserted to the database. + * + * @param record An existing or newly created record + * @param relatedToField A SObjectField referene to the lookup field that relates the two records together + * @param relatedTo A SOBject instance (yet to be commited to the database) + */ + void registerRelationship(SObject record, Schema.sObjectField relatedToField, SObject relatedTo); + /** + * Register an existing record to be updated during the commitWork method + * + * @param record An existing record + **/ + void registerDirty(SObject record); + /** + * Register a list of existing records to be updated during the commitWork method + * + * @param records A list of existing records + **/ + void registerDirty(List records); + /** + * Register an existing record to be deleted during the commitWork method + * + * @param record An existing record + **/ + void registerDeleted(SObject record); + /** + * Register a list of existing records to be deleted during the commitWork method + * + * @param records A list of existing records + **/ + void registerDeleted(List records); + /** + * Takes all the work that has been registered with the UnitOfWork and commits it to the database + **/ + void commitWork(); +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_ISObjectUnitOfWork.cls-meta.xml b/rolluptool/src/classes/fflib_ISObjectUnitOfWork.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_ISObjectUnitOfWork.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_MethodCountRecorder.cls b/rolluptool/src/classes/fflib_MethodCountRecorder.cls new file mode 100644 index 00000000..1d3f6343 --- /dev/null +++ b/rolluptool/src/classes/fflib_MethodCountRecorder.cls @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +public with sharing class fflib_MethodCountRecorder +{ + public Boolean Verifying { get; set; } + public Integer VerifyCount { get; set; } + + /** + * Map of method counts by type name. + * + * Key: typeName + * Object: map of method calls by methodName. + * + * Key: methodName + * Object: map of count by method call argument. + */ + private Map>> methodCountsByTypeName; + + public fflib_MethodCountRecorder() + { + methodCountsByTypeName = new Map>>(); + } + + /** + * Verfiy a method was called on a mock object. + * @param mockInstance The mock object instance. + * @param methodName The method you expect to have been called. + * @param methodArg The argument you expect to have been passed to the method being verified. + */ + public void verifyMethodCall(Object mockInstance, String methodName, Object methodArg) + { + String typeName = fflib_ApexMocks.extractTypeName(mockInstance); + System.assertEquals(VerifyCount, getMethodCount(mockInstance, methodName, methodArg), 'Wanted but not invoked: ' + typeName + '.' + methodName + '.'); + Verifying = false; + } + + /** + * Record a method was called on a mock object. + * @param mockInstance The mock object instance. + * @param methodName The method to be recorded. + * @param methodArg The method argument to be recorded. + */ + public void recordMethod(Object mockInstance, String methodName, Object methodArg) + { + String typeName = fflib_ApexMocks.extractTypeName(mockInstance); + Map> methodCountsForType = methodCountsByTypeName.get(typeName); + + if (methodCountsForType == null) + { + recordInitialMethodCall(typeName, methodName, methodArg); + } + else + { + Map methodCountsForArg = methodCountsForType.get(methodName); + Integer count; + + if (methodCountsForArg == null) + { + count = null; + } + else + { + count = methodCountsForArg.get(methodArg); + } + + if (count == null) + { + if (methodCountsForType.get(methodName) == null) + { + methodCountsForType.put(methodName, new Map()); + } + + methodCountsByTypeName.get(typeName).get(methodName).put(methodArg, 1); + } + else + { + methodCountsForType.get(methodName).put(methodArg, count + 1); + } + } + } + + private void recordInitialMethodCall(String typeName, String methodName, Object methodArg) + { + methodCountsByTypeName.put(typeName, new Map>()); + methodCountsByTypeName.get(typeName).put(methodName, new Map()); + methodCountsByTypeName.get(typeName).get(methodName).put(methodArg, 1); + } + + private Integer getMethodCount(Object mockInstance, String methodName, Object methodArg) + { + String typeName = fflib_ApexMocks.extractTypeName(mockInstance); + Map> methodCountsForType = methodCountsByTypeName.get(typeName); + + if (methodCountsForType == null) + { + return 0; + } + else + { + Map methodCountsForArg = methodCountsForType.get(methodName); + + if (methodCountsForArg == null) + { + return 0; + } + + Integer methodCounts = methodCountsForArg.get(methodArg); + return methodCounts == null ? 0 : methodCounts; + } + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_MethodCountRecorder.cls-meta.xml b/rolluptool/src/classes/fflib_MethodCountRecorder.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_MethodCountRecorder.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_MethodReturnValue.cls b/rolluptool/src/classes/fflib_MethodReturnValue.cls new file mode 100644 index 00000000..e6350b71 --- /dev/null +++ b/rolluptool/src/classes/fflib_MethodReturnValue.cls @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +@isTest +public with sharing class fflib_MethodReturnValue +{ + /** + * Class defining a method return value. + */ + public Object ReturnValue { get; private set; } + + /** + * Setup a stubbed return value. + * @param value The value to return from the stubbed method call. + */ + public void thenReturn(Object value) + { + returnValue = value; + } + + /** + * Setup a stubbed exception. + * @param e The exception to throw from the stubbed method call. + */ + public void thenThrow(Exception e) + { + returnValue = e; + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_MethodReturnValue.cls-meta.xml b/rolluptool/src/classes/fflib_MethodReturnValue.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_MethodReturnValue.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_MethodReturnValueRecorder.cls b/rolluptool/src/classes/fflib_MethodReturnValueRecorder.cls new file mode 100644 index 00000000..5e54a774 --- /dev/null +++ b/rolluptool/src/classes/fflib_MethodReturnValueRecorder.cls @@ -0,0 +1,107 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +public with sharing class fflib_MethodReturnValueRecorder +{ + public Boolean Stubbing { get; set; } + + public Exception DoThrowWhenException { get; set; } + + /** + * Map of method return values by type name. + * + * Key: typeName + * Object: map of method return values by methodName. + * + * Key: methodName + * Object: map of MethodReturnVakue by method call argument. + */ + private Map>> methodReturnValuesByTypeName; + + public fflib_MethodReturnValue MethodReturnValue { get; private set; } + + public fflib_MethodReturnValueRecorder() + { + methodReturnValuesByTypeName = new Map>>(); + MethodReturnValue = null; + } + + /** + * Prepare a stubbed method return value. + * @param mockInstance The mock object instance. + * @param methodName The method for which to prepare a return value. + * @param methodArg The method argument for which to prepare a return value. + */ + public fflib_MethodReturnValue prepareMethodReturnValue(Object mockInstance, String methodName, Object methodArg) + { + String typeName = fflib_ApexMocks.extractTypeName(mockInstance); + + if (methodReturnValuesByTypeName.get(typeName) == null) + { + methodReturnValuesByTypeName.put(typeName, new Map>()); + } + + Map> methodReturnValues = methodReturnValuesByTypeName.get(typeName); + + MethodReturnValue = new fflib_MethodReturnValue(); + + if (methodReturnValues.get(methodName) == null) + { + methodReturnValues.put(methodName, new Map()); + } + + methodReturnValues.get(methodName).put(methodArg, MethodReturnValue); + + return MethodReturnValue; + } + + /** + * Get the method return value for the given method call. + * @param mockInstance The mock object instance. + * @param methodName The method for which to prepare a return value. + * @param methodArg The method argument for which to prepare a return value. + * @return The MethodReturnValue instance. + */ + public fflib_MethodReturnValue getMethodReturnValue(Object mockInstance, String methodName, Object methodArg) + { + String typeName = fflib_ApexMocks.extractTypeName(mockInstance); + + if (methodReturnValuesByTypeName.get(typeName) != null && methodReturnValuesByTypeName.get(typeName).get(methodName) != null) + { + return methodReturnValuesByTypeName.get(typeName).get(methodName).get(methodArg); + } + + return null; + } + + /** + * Prepare a stubbed exception for a void method. + * @param e The exception to throw. + */ + public void prepareDoThrowWhenException(Exception e) + { + DoThrowWhenException = e; + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_MethodReturnValueRecorder.cls-meta.xml b/rolluptool/src/classes/fflib_MethodReturnValueRecorder.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_MethodReturnValueRecorder.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_Mocks.cls b/rolluptool/src/classes/fflib_Mocks.cls new file mode 100644 index 00000000..a580bf7f --- /dev/null +++ b/rolluptool/src/classes/fflib_Mocks.cls @@ -0,0 +1,44 @@ +@isTest +public class fflib_Mocks +{ + + public class Mockfflib_MyList implements fflib_MyList.IList + { + private fflib_ApexMocks mocks; + + public Mockfflib_MyList(fflib_ApexMocks mocks) + { + this.mocks = mocks; + } + + public void add(String value) + { + mocks.mockVoidMethod(this, 'add', new List {value}); + } + + public String get(Integer index) + { + return (String) mocks.mockNonVoidMethod(this, 'get', new List {index}); + } + + public String get2(Integer index, String value) + { + return (String) mocks.mockNonVoidMethod(this, 'get2', new List {index, value}); + } + + public void clear() + { + mocks.mockVoidMethod(this, 'clear', new List {}); + } + + public Boolean isEmpty() + { + return (Boolean) mocks.mockNonVoidMethod(this, 'isEmpty', new List {}); + } + + public void set(Integer index, Object value) + { + mocks.mockVoidMethod(this, 'set', new List {index, value}); + } + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_Mocks.cls-meta.xml b/rolluptool/src/classes/fflib_Mocks.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_Mocks.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_MyList.cls b/rolluptool/src/classes/fflib_MyList.cls new file mode 100644 index 00000000..2b2f949d --- /dev/null +++ b/rolluptool/src/classes/fflib_MyList.cls @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +public with sharing class fflib_MyList implements IList +{ + public interface IList + { + void add(String value); + String get(Integer index); + String get2(Integer index, String value); // This is just a method signature to allow me to test stubbing a method with multiple arguments + void clear(); + Boolean isEmpty(); + void set(Integer index, Object value); + } + + public void add(String value) + { + } + + public String get(Integer index) + { + return 'fred'; + } + + public void clear() + { + } + + public Boolean isEmpty() + { + return true; + } + + public void set(Integer index, Object value) + { + } + + public String get2(Integer index, String value) + { + return 'mary'; + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_MyList.cls-meta.xml b/rolluptool/src/classes/fflib_MyList.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_MyList.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_QueryFactory.cls b/rolluptool/src/classes/fflib_QueryFactory.cls new file mode 100644 index 00000000..06381d4f --- /dev/null +++ b/rolluptool/src/classes/fflib_QueryFactory.cls @@ -0,0 +1,657 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * QueryFactor provides an object-oriented way of building SOQL queries without resorting to string manipulation. + * This class is not meant to be used as a replacement for all SOQL queries, and due to the relativley high overhead in both CPU and describe calls + * should be used in places where highly dynamic queries, such as those that include field sets or are mutated heavilly + * in multiple locations are a good fit for use with fflib_QueryFactory. + * + * To use call construct a new instance for each query you intend to make. + * To add additional fields to the query make use of the selectField(s) methods. + * + * Currently the WHERE clause of the query is manipulated as a single string, and is decidedly less OO-styled than other methods. + * This is expected to be expanded upon in the future. + * + * To include one or more sort expression(s), use one of the addOrdering methods. If not specified, the "NULLS FIRST" keywords + * will be included by default. + * + * Subselect Queries are supported with the subselectQuery method. + * More than one sub-query can be added to a single query, but sub-queries can only be 1 level deep. + * An exception will thrown from the subselectQuery method when there is an attempt to add a subquery to a sub-query + * or to add a subquery to a query with an invalid relationship. + * + * Current limitations: + * - Aggregate functions are not currently supported. + * - Cross-object references currently require using String argument(s) to selectField(s). + * - The behavior of serializing and deserializing an fflib_QueryFactory instance is currently untested and undefined. + * + * There is a google doc providing additional guideance on the use of this class with field sets at + * https://docs.google.com/a/financialforce.com/document/d/1I4cxN4xHT4UJj_3Oi0YBL_MJ5chm-KG8kMN1D1un8-g/edit?usp=sharing +**/ +public class fflib_QueryFactory { //No explicit sharing declaration - inherit from caller + public enum SortOrder {ASCENDING, DESCENDING} + + /** + * This property is read-only and may not be set after instantiation. + * The {@link Schema.SObjectType} token of the SObject that will be used in the FROM clause of the resultant query. + **/ + public Schema.SObjectType table {get; private set;} + @testVisible + private Set fields; + private String conditionExpression; + private Integer limitCount; + private Integer offset; + private List order; + /** + * each item in sortExpressions contains the field and the direction (ascending or descending) + * use the addOrdering method to add fields to sort by. the sort fields + * appear in the SOQL query in the order they are added to the query. + **/ + /** + /* Integrate checking for READ Field Level Security within the selectField(s) methods + /* This can optionally be enforced (or not) by calling the setEnforceFLS method prior to calling + /* one of the selectField or selectFieldset methods. + **/ + private Boolean enforceFLS; + + /** + * The relationship and subselectQueryMap variables are used to support subselect queries. Subselects can be added to + * a query, as long as it isn't a subselect query itself. You may have many subselects inside + * a query, but they may only be 1 level deep (no subselect inside a subselect) + * to add a subselect, call the subselectQuery method, passing in the ChildRelationship. + **/ + private Schema.ChildRelationship relationship; + private Map subselectQueryMap; + + private QueryField getFieldToken(String fieldName){ + QueryField result; + if(!fieldName.contains('.')){ //single field + Schema.SObjectField token = fflib_SObjectDescribe.getDescribe(table).getField(fieldName.toLowerCase()); + if(token == null) + throw new InvalidFieldException(fieldName,this.table); + if (enforceFLS) + fflib_SecurityUtils.checkFieldIsReadable(this.table, token); + result = new QueryField(token); + }else{ //traversing FK relationship(s) + List fieldPath = new List(); + Schema.sObjectType lastSObjectType = table; + Iterator i = fieldName.split('\\.').iterator(); + while(i.hasNext()){ + String field = i.next(); + Schema.SObjectField token = fflib_SObjectDescribe.getDescribe(lastSObjectType).getField(field.toLowerCase()); + if (token != null && enforceFLS) + fflib_SecurityUtils.checkFieldIsReadable(lastSObjectType, token); + if(token != null && i.hasNext() && token.getDescribe().getSOAPType() == Schema.SOAPType.ID){ + lastSObjectType = token.getDescribe().getReferenceTo()[0]; //if it's polymorphic doesn't matter which one we get + fieldPath.add(token); + }else if(token != null && !i.hasNext()){ + fieldPath.add(token); + }else{ + if(token == null) + throw new InvalidFieldException(field,lastSObjectType); + else + throw new NonReferenceFieldException(lastSObjectType+'.'+field+' is not a lookup or master-detail field but is used in a cross-object query field.'); + } + } + result = new QueryField(fieldPath); + } + return result; + } + + /** + * fflib_QueryFactory instances will be considered equal if they produce the same SOQL query. + * A faster comparison will first be attempted to check if they apply to the same table, and contain the same number of fields selected. + * This method will never return true if the provided object is not an instance of fflib_QueryFactory. + * @param obj the object to check equality of. + **/ + public boolean equals(Object obj){ + if( !(obj instanceof fflib_QueryFactory) || ((fflib_QueryFactory)obj).table != this.table || ((fflib_QueryFactory)obj).fields.size() != this.fields.size() ) + return false; + return ((fflib_QueryFactory)obj).toSOQL() == this.toSOQL(); + } + + /** + * Construct a new fflib_QueryFactory instance with no options other than the FROM caluse. + * You *must* call selectField(s) before {@link #toSOQL} will return a valid, runnable query. + * @param table the SObject to be used in the FROM clause of the resultant query. This sets the value of {@link #table}. + **/ + public fflib_QueryFactory(Schema.SObjectType table){ + this.table = table; + fields = new Set(); + order = new List(); + enforceFLS = false; + } + + /** + * Construct a new fflib_QueryFactory instance with no options other than the FROM clause and the relationship. + * This should be used when constructing a subquery query for addition to a parent query. + * Objects created with this constructor cannot be added to another object using the subselectQuery method. + * You *must* call selectField(s) before {@link #toSOQL} will return a valid, runnable query. + * @param relationship the ChildRelationship to be used in the FROM Clause of the resultant Query (when set overrides value of table). This sets the value of {@link #relationship} and {@link #table}. + **/ + private fflib_QueryFactory(Schema.ChildRelationship relationship){ + this(relationship.getChildSObject()); + this.relationship = relationship; + } + + /** + * This method checks to see if the User has Read Access on {@link #table}. + * Asserts true if User has access. + **/ + public fflib_QueryFactory assertIsAccessible(){ + fflib_SecurityUtils.checkObjectIsReadable(table); + return this; + } + + /** + * This method sets a flag to indicate that this query should have FLS Read + * permission enforced. If this method is not called, the default behavior + * is that FLS read permission will not be checked. + * @param enforce whether to enforce field level security (read) + **/ + public fflib_QueryFactory setEnforceFLS(Boolean enforce){ + this.enforceFLS = enforce; + return this; + } + + /** + * Selects a single field from the SObject specified in {@link #table}. + * Selecting fields is idempotent, if this field is already selected calling this method will have no additional impact. + * @param fieldName the API name of the field to add to the query's SELECT clause. + **/ + public fflib_QueryFactory selectField(String fieldName){ + fields.add( getFieldToken(fieldName) ); + return this; + } + /** + * Selects a field, avoiding the possible ambiguitiy of String API names. + * @see #selectField(String) + * @param field the {@link Schema.SObjectField} to select with this query. + * @exception InvalidFieldException If the field is null {@code field}. + **/ + public fflib_QueryFactory selectField(Schema.SObjectField field){ + if(field == null) + throw new InvalidFieldException(null,this.table); + if (enforceFLS) + fflib_SecurityUtils.checkFieldIsReadable(table, field); + fields.add( new QueryField(field) ); + return this; + } + /** + * Selects multiple fields. This acts the same as calling {@link #selectField(String)} multiple times. + * @param fieldNames the Set of field API names to select. + **/ + public fflib_QueryFactory selectFields(Set fieldNames){ + List fieldList = new List(); + Set toAdd = new Set(); + for(String fieldName:fieldNames){ + toAdd.add( getFieldToken(fieldName) ); + } + fields.addAll(toAdd); + return this; + } + /** + * Selects multiple fields. This acts the same as calling {@link #selectField(String)} multiple times. + * @param fieldNames the List of field API names to select. + **/ + public fflib_QueryFactory selectFields(List fieldNames){ + Set toAdd = new Set(); + for(String fieldName:fieldNames) + toAdd.add( getFieldToken(fieldName) ); + fields.addAll(toAdd); + return this; + } + /** + * Selects multiple fields. This acts the same as calling {@link #selectField(Schema.SObjectField)} multiple times. + * @param fieldNames the set of {@link Schema.SObjectField}s to select. + * @exception InvalidFieldException if the fields are null {@code fields}. + **/ + public fflib_QueryFactory selectFields(Set fields){ + for(Schema.SObjectField token:fields){ + if(token == null) + throw new InvalidFieldException(); + if (enforceFLS) + fflib_SecurityUtils.checkFieldIsReadable(table, token); + this.fields.add( new QueryField(token) ); + } + return this; + } + /** + * Selects multiple fields. This acts the same as calling {@link #selectField(Schema.SObjectField)} multiple times. + * @param fieldNames the set of {@link Schema.SObjectField}s to select. + * @exception InvalidFieldException if the fields are null {@code fields}. + **/ + public fflib_QueryFactory selectFields(List fields){ + for(Schema.SObjectField token:fields){ + if(token == null) + throw new InvalidFieldException(); + if (enforceFLS) + fflib_SecurityUtils.checkFieldIsReadable(table, token); + this.fields.add( new QueryField(token) ); + } + return this; + } + /** + * @see #selectFieldSet(Schema.FieldSet,Boolean) + **/ + public fflib_QueryFactory selectFieldSet(Schema.FieldSet fieldSet){ + return selectFieldSet(fieldSet,true); + } + /** + * This is equivielent to iterating the fields in the field set and calling {@link #selectField(String)} on each. + * @param fieldSet Select all fields included in the field set. + * @param allowCrossObject if false this method will throw an exception if any fields in the field set reference fields on a related record. + * @exception InvalidFieldSetException if the fieldset is invalid for table {@code fields}. + **/ + public fflib_QueryFactory selectFieldSet(Schema.FieldSet fieldSet, Boolean allowCrossObject){ + if(fieldSet.getSObjectType() != table) + throw new InvalidFieldSetException('Field set "'+fieldSet.getName()+'" is not for SObject type "'+table+'"'); + for(Schema.FieldSetMember field: fieldSet.getFields()){ + if(!allowCrossObject && field.getFieldPath().contains('.')) + throw new InvalidFieldSetException('Cross-object fields not allowed and field "'+field.getFieldPath()+'"" is a cross-object field.'); + fields.add( getFieldToken(field.getFieldPath()) ); + } + return this; + } + /** + * @param conditionExpression Sets the WHERE clause to the string provided. Do not include the "WHERE". + **/ + public fflib_QueryFactory setCondition(String conditionExpression){ + this.conditionExpression = conditionExpression; + return this; + } + /** + * @returns the current value of the WHERE clause, if any, as set by {@link #setCondition} + **/ + public String getCondition(){ + return this.conditionExpression; + } + /** + * @param limitCount if not null causes a LIMIT caluse to be added to the resulting query. + **/ + public fflib_QueryFactory setLimit(Integer limitCount){ + this.limitCount = limitCount; + return this; + } + /** + * @returns the current value of the LIMIT clause, if any. + **/ + public Integer getLimit(){ + return this.limitCount; + } + /** + * @param o an instance of {@link fflib_QueryFactory.Ordering} to be added to the query's ORDER BY clause. + **/ + public fflib_QueryFactory addOrdering(Ordering o){ + this.order.add(o); + return this; + } + /** + * @returns the list of orderings that will be used as the query's ORDER BY clause. You may remove elements from the returned list, or otherwise mutate it, to remove previously added orderings. + **/ + public List getOrderings(){ + return this.order; + } + + /** + * @returns the selected fields + **/ + public Set getSelectedFields() { + return this.fields; + } + + /** + * Add a subquery query to this query. If a subquery for this relationship already exists, it will be returned. + * If not, a new one will be created and returned. + * @exception InvalidSubqueryRelationshipException If this method is called on a subselectQuery or with an invalid relationship + * @param related The related object type + **/ + public fflib_QueryFactory subselectQuery(SObjectType related){ + return setSubselectQuery(getChildRelationship(related), false); + } + + /** + * Add a subquery query to this query. If a subquery for this relationship already exists, it will be returned. + * If not, a new one will be created and returned. + * @exception InvalidSubqueryRelationshipException If this method is called on a subselectQuery or with an invalid relationship + * @param related The related object type + * @param assertIsAccessible indicates whether to check if the user has access to the subquery object + **/ + public fflib_QueryFactory subselectQuery(SObjectType related, Boolean assertIsAccessible){ + return setSubselectQuery(getChildRelationship(related), assertIsAccessible); + } + + /** + * Add a subquery query to this query. If a subquery for this relationship already exists, it will be returned. + * If not, a new one will be created and returned. + * @exception InvalidSubqueryRelationshipException If this method is called on a subselectQuery or with an invalid relationship + * @param relationship The ChildRelationship to be added as a subquery + **/ + private fflib_QueryFactory setSubselectQuery(ChildRelationship relationship, Boolean assertIsAccessible){ + if (this.relationship != null){ + throw new InvalidSubqueryRelationshipException('Invalid call to subselectQuery. You may not add a subselect query to a subselect query.'); + } + if (this.subselectQueryMap == null){ + this.subselectQueryMap = new Map(); + } + if (this.subselectQueryMap.containsKey(relationship)){ + return subselectQueryMap.get(relationship); + } + + fflib_QueryFactory subselectQuery = new fflib_QueryFactory(relationship); + subSelectQuery.assertIsAccessible(); + subselectQueryMap.put(relationship, subSelectQuery); + return subSelectQuery; + } + + /** + * @returns the list of subquery instances of fflib_QueryFactory which will be added to the SOQL as relationship/child/sub-queries. + **/ + public List getSubselectQueries(){ + if (subselectQueryMap != null) { + return subselectQueryMap.values(); + } + return null; + } + + /** + * Get the ChildRelationship from the Table for the object type passed in. + * @param objType The object type of the child relationship to get + **/ + private Schema.ChildRelationship getChildRelationship(sObjectType objType){ + for (Schema.ChildRelationship childRow : table.getDescribe().getChildRelationships()){ + //occasionally on some standard objects (Like Contact child of Contact) do not have a relationship name. + //if there is no relationship name, we cannot query on it, so throw an exception. + if (childRow.getChildSObject() == objType && childRow.getRelationshipName() != null){ + return childRow; + } + } + throw new InvalidSubqueryRelationshipException('Invalid call to subselectQuery. Invalid relationship for table '+table + ' and objtype='+objType); + } + + /** + * Add a field to be sorted on. This may be a direct field or a field + * related through an object lookup or master-detail relationship. + * Use the set to store unique field names, since we only want to sort + * by the same field one time. The sort expressions are stored in a list + * so that they are applied to the SOQL in the same order that they + * were added in. + * @param fieldName The string value of the field to be sorted on + * @param SortOrder the direction to be sorted on (ASCENDING or DESCENDING) + * @param nullsLast whether to sort null values last (NULLS LAST keyword included). + **/ + public fflib_QueryFactory addOrdering(String fieldName, SortOrder direction, Boolean nullsLast){ + order.add( + new Ordering(getFieldToken(fieldName), direction, nullsLast) + ); + return this; + } + + /** + * Add a field to be sorted on. This may be a direct field or a field + * related through an object lookup or master-detail relationship. + * Use the set to store unique field names, since we only want to sort + * by the same field one time. The sort expressions are stored in a list + * so that they are applied to the SOQL in the same order that they + * were added in. + * @param field The SObjectfield to sort. This can only be a direct reference. + * @param SortOrder the direction to be sorted on (ASCENDING or DESCENDING) + * @param nullsLast whether to sort null values last (NULLS LAST keyword included). + **/ + public fflib_QueryFactory addOrdering(SObjectField field, SortOrder direction, Boolean nullsLast){ + order.add( + new Ordering(new QueryField(field), direction, nullsLast) + ); + return this; + } + + /** + * Add a field to be sorted on. This may be a direct field or a field + * related through an object lookup or master-detail relationship. + * Use the set to store unique field names, since we only want to sort + * by the same field one time. The sort expressions are stored in a list + * so that they are applied to the SOQL in the same order that they + * were added in. + * The "NULLS FIRST" keywords will be included by default. If "NULLS LAST" + * is required, use one of the overloaded addOrdering methods which include this parameter. + * @param fieldName The string value of the field to be sorted on + * @param SortOrder the direction to be sorted on (ASCENDING or DESCENDING) + **/ + public fflib_QueryFactory addOrdering(String fieldName, SortOrder direction){ + order.add( + new Ordering(getFieldToken(fieldName), direction) + ); + return this; + } + + /** + * Add a field to be sorted on. This may be a direct field or a field + * related through an object lookup or master-detail relationship. + * Use the set to store unique field names, since we only want to sort + * by the same field one time. The sort expressions are stored in a list + * so that they are applied to the SOQL in the same order that they + * were added in. + * The "NULLS FIRST" keywords will be included by default. If "NULLS LAST" + * is required, use one of the overloaded addOrdering methods which include this parameter. + * @param field The SObjectfield to sort. This can only be a direct reference. + * @param SortOrder the direction to be sorted on (ASCENDING or DESCENDING) + **/ + public fflib_QueryFactory addOrdering(SObjectField field, SortOrder direction){ + order.add( + new Ordering(new QueryField(field), direction) + ); + return this; + } + + /** + * Convert the values provided to this instance into a full SOQL string for use with Database.query + * Check to see if subqueries queries need to be added after the field list. + **/ + public String toSOQL(){ + String result = 'SELECT '; + //if no fields have been added, just add the Id field so that the query or subquery will not just fail + if (fields.size() == 0){ + if (enforceFLS) fflib_SecurityUtils.checkFieldIsReadable(table, 'Id'); + result += 'Id '; + }else{ + List fieldsToQuery = new List(fields); + fieldsToQuery.sort(); //delegates to QueryFilter's comparable implementation + for(QueryField field:fieldsToQuery){ + result += field + ', '; + } + } + if(subselectQueryMap != null && !subselectQueryMap.isEmpty()){ + for (fflib_QueryFactory childRow : subselectQueryMap.values()){ + result += ' (' + childRow.toSOQL() + '), '; + } + } + result = result.substring(0,result.length()-2) + ' FROM ' + (relationship != null ? relationship.getRelationshipName() : table.getDescribe().getName()); + if(conditionExpression != null) + result += ' WHERE '+conditionExpression; + + if(order.size() > 0){ + result += ' ORDER BY '; + for(Ordering o:order) + result += o.toSOQL() +', '; + result = result.substring(0,result.length()-2); + } + + if(limitCount != null) + result += ' LIMIT '+limitCount; + return result; + } + + public class Ordering{ + private SortOrder direction; + private boolean nullsLast; + private QueryField field; + + public Ordering(String sobjType, String fieldName, SortOrder direction){ + this( + fflib_SObjectDescribe.getDescribe(sobjType).getField(fieldName), + direction + ); + } + /** + * Construct a new ordering instance for use with {@link fflib_QueryFactory#addOrdering} + * Once constructed it's properties may not be modified. + **/ + public Ordering(Schema.SObjectField field, SortOrder direction){ + this(field, direction, false); //SOQL docs state NULLS FIRST is default behavior + } + public Ordering(Schema.SObjectField field, SortOrder direction, Boolean nullsLast){ + this(new QueryField(field), direction, nullsLast); + } + @testVisible + private Ordering(QueryField field, SortOrder direction){ + this(field, direction, false); + } + @testVisible + private Ordering(QueryField field, SortOrder direction, Boolean nullsLast){ + this.direction = direction; + this.field = field; + this.nullsLast = nullsLast; + } + /** + * @deprecated + * Use of this method is discouraged. Only the first field of any cross-object fields is returned. + * Use getFields() instead. + **/ + public Schema.SObjectField getField(){ + System.debug(LoggingLevel.WARN, 'fflib_QueryFactory.Ordering.getField is deprecated and should not be used.'); + return field.getBaseField(); + } + public List getFields(){ + return this.field.getFieldPath(); + } + public SortOrder getDirection(){ + return direction; + } + public String toSOQL(){ + return field + ' ' + (direction == SortOrder.ASCENDING ? 'ASC' : 'DESC') + (nullsLast ? ' NULLS LAST ' : ' NULLS FIRST '); + } + } + + + public class QueryField implements Comparable{ + List fields; + + /** + * The first field in the path to to field being queried + **/ + public SObjectField getBaseField(){ + return fields[0]; + } + + /** + * The full list of fields representing the path to the field being queried + **/ + public List getFieldPath(){ + return fields.clone(); + } + + @testVisible + private QueryField(List fields){ + if(fields == null || fields.size() == 0) + throw new InvalidFieldException('Invalid field: null'); + this.fields = fields.clone(); //don't let clients mutate after setting! + } + @testVisible + private QueryField(Schema.SObjectField field){ + if(field == null) + throw new InvalidFieldException('Invalid field: null'); + fields = new List{ field }; + } + public override String toString(){ + String result = ''; + Iterator i = fields.iterator(); + while(i.hasNext()){ + String fieldName = i.next().getDescribe().getName(); + if(fieldName.endsWithIgnoreCase('Id') && i.hasNext()) + fieldName = fieldName.removeEndIgnoreCase('Id'); + if(fieldName.endsWithIgnoreCase('__c') && i.hasNext()) + fieldName = fieldName.removeEndIgnoreCase('__c')+'__r'; + result += fieldName + (i.hasNext() ? '.' :''); + } + return result; + } + public integer hashCode(){ + return String.valueOf(this.fields).hashCode(); + } + public boolean equals(Object obj){ + if(!(obj instanceof QueryField)) + return false; + if( String.valueOf(((QueryField) obj).fields) != String.valueOf(this.fields)) + return false; + Set objFields = new Set(); + objFields.addAll( ((QueryField)obj).fields ); + objFields.retainAll(this.fields); + objFields.removeAll(this.fields); + return objFields.size() == 0; + } + /** + * Allows sorting QueryField instances, which means we'll get deterministic field ordering by just sorting the parent + * QueryFactory's array when toSOQL'ing. + * + * Returns: + * - Objects that are not QueryField instances as -2, which functions as -1 but with more flair + * - QueryField instances with less joins in their path as -1 + * - QueryField instances with an equal number of joins and alphabetically first as an undefined negative integer + * - equals as 0 + * - anything else an undefined positive integer (usually, but not always 1) + **/ + public Integer compareTo(Object o){ + if(!(o instanceof QueryField)) + return -2; //We can't possibly do a sane comparison against an unknwon type, go athead and let it "win" + QueryField that = (QueryField) o; + if(this.fields.size() < that.fields.size()){ + return -1; + }else if( this.fields.size() == that.fields.size() ){ + if(this.equals(that)){ + return 0; + }else{ + return this.toString().compareTo(that.toString()); + } + }else{ + return 1; + } + } + } + + public class InvalidFieldException extends Exception{ + private String fieldName; + private Schema.SObjectType objectType; + public InvalidFieldException(String fieldname, Schema.SObjectType objectType){ + this.objectType = objectType; + this.fieldName = fieldName; + this.setMessage( 'Invalid field \''+fieldName+'\' for object \''+objectType+'\'' ); + } + } + public class InvalidFieldSetException extends Exception{} + public class NonReferenceFieldException extends Exception{} + public class InvalidSubqueryRelationshipException extends Exception{} +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_QueryFactory.cls-meta.xml b/rolluptool/src/classes/fflib_QueryFactory.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_QueryFactory.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_QueryFactoryTest.cls b/rolluptool/src/classes/fflib_QueryFactoryTest.cls new file mode 100644 index 00000000..545eeba5 --- /dev/null +++ b/rolluptool/src/classes/fflib_QueryFactoryTest.cls @@ -0,0 +1,545 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@isTest +private class fflib_QueryFactoryTest { + @isTest + static void simpleFieldSelection() { + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('NAMe').selectFields( new Set{'naMe', 'email'}); + String query = qf.toSOQL(); + System.assert( Pattern.matches('SELECT.*Name.*FROM.*',query), 'Expected Name field in query, got '+query); + System.assert( Pattern.matches('SELECT.*Email.*FROM.*',query), 'Expected Name field in query, got '+query); + qf.setLimit(100); + System.assertEquals(100,qf.getLimit()); + System.assert( qf.toSOQL().endsWithIgnoreCase('LIMIT '+qf.getLimit()), 'Failed to respect limit clause:'+qf.toSOQL() ); + } + + @isTest + static void fieldSelections(){ + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('firstName'); + qf.selectField(Schema.Contact.SObjectType.fields.lastName); + qf.selectFields( new Set{'acCounTId', 'account.name'} ); + qf.selectFields( new List{'homePhonE','fAX'} ); + qf.selectFields( new List{ Contact.Email, Contact.Title } ); + } + + @isTest + static void simpleFieldCondition(){ + String whereClause = 'name = \'test\''; + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('name'); + qf.selectField('email'); + qf.setCondition( whereClause ); + System.assertEquals(whereClause,qf.getCondition()); + String query = qf.toSOQL(); + System.assert(query.endsWith('WHERE name = \'test\''),'Query should have ended with a filter on name, got: '+query); + } + + @isTest + static void duplicateFieldSelection() { + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('NAMe').selectFields( new Set{'naMe', 'email'}); + String query = qf.toSOQL(); + System.assertEquals(1, query.countMatches('Name'), 'Expected one name field in query: '+query ); + } + + @isTest + static void equalityCheck(){ + fflib_QueryFactory qf1 = new fflib_QueryFactory(Contact.SObjectType); + fflib_QueryFactory qf2 = new fflib_QueryFactory(Contact.SObjectType); + System.assertEquals(qf1,qf2); + qf1.selectField('name'); + System.assertNotEquals(qf1,qf2); + qf2.selectField('NAmE'); + System.assertEquals(qf1,qf2); + qf1.selectField('name').selectFields( new Set{ 'NAME', 'name' }).selectFields( new Set{ Contact.Name, Contact.Name} ); + System.assertEquals(qf1,qf2); + } + + @isTest + static void nonReferenceField(){ + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + fflib_QueryFactory.NonReferenceFieldException e; + try{ + qf.selectField('name.title'); + }catch(fflib_QueryFactory.NonReferenceFieldException ex){ + e = ex; + } + System.assertNotEquals(null,e,'Cross-object notation on a non-reference field should throw NonReferenceFieldException.'); + } + + @isTest + static void invalidCrossObjectField(){ + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + fflib_QueryFactory.InvalidFieldException e; + try{ + qf.selectField('account.NOT_A_REAL_FIELD'); + }catch(fflib_QueryFactory.InvalidFieldException ex){ + e = ex; + } + System.assertNotEquals(null,e,'Cross-object notation on a non-reference field should throw NonReferenceFieldException.'); + } + + @isTest + static void invalidFieldTests(){ + List exceptions = new List(); + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + try{ + qf.selectField('Not_a_field'); + }catch(fflib_QueryFactory.InvalidFieldException e){ + exceptions.add(e); + } + try{ + qf.selectFields( new Set{ 'Not_a_field','alsoNotreal'}); + }catch(fflib_QueryFactory.InvalidFieldException e){ + exceptions.add(e); + } + try{ + qf.selectFields( new Set{ null }); + }catch(fflib_QueryFactory.InvalidFieldException e){ + exceptions.add(e); + } + try{ + qf.selectFields( new List{ null, Contact.title }); + }catch(fflib_QueryFactory.InvalidFieldException e){ + exceptions.add(e); + } + System.assertEquals(4,exceptions.size()); + } + + @isTest + static void ordering(){ + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('name'); + qf.selectField('email'); + qf.setCondition( 'name = \'test\'' ); + qf.addOrdering( new fflib_QueryFactory.Ordering('Contact','name',fflib_QueryFactory.SortOrder.ASCENDING) ).addOrdering( new fflib_QueryFactory.Ordering('Contact','CreatedDATE',fflib_QueryFactory.SortOrder.DESCENDING) ); + String query = qf.toSOQL(); + + System.assertEquals(2,qf.getOrderings().size()); + System.assertEquals(Contact.name,qf.getOrderings()[0].getField() ); + System.assertEquals(fflib_QueryFactory.SortOrder.DESCENDING,qf.getOrderings()[1].getDirection() ); + + + System.assert( Pattern.matches('SELECT.*Name.*FROM.*',query), 'Expected Name field in query, got '+query); + System.assert( Pattern.matches('SELECT.*Email.*FROM.*',query), 'Expected Name field in query, got '+query); + } + + @isTest + static void invalidField_string(){ + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('name'); + Exception e; + try{ + qf.selectField('not_a__field'); + }catch(fflib_QueryFactory.InvalidFieldException ex){ + e = ex; + } + System.assertNotEquals(null,e); + } + + @isTest + static void invalidFields_string(){ + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('name'); + Exception e; + try{ + qf.selectFields( new List{'not_a__field'} ); + }catch(fflib_QueryFactory.InvalidFieldException ex){ + e = ex; + } + System.assertNotEquals(null,e); + } + + @isTest + static void invalidField_nullToken(){ + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('name'); + Exception e; + Schema.SObjectField token = null; + try{ + qf.selectField( token ); + }catch(fflib_QueryFactory.InvalidFieldException ex){ + e = ex; + } + System.assertNotEquals(null,e); + } + + @isTest + static void invalidFields_nullToken(){ + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('name'); + Exception e; + List token = new List{ + null + }; + try{ + qf.selectFields( token ); + }catch(fflib_QueryFactory.InvalidFieldException ex){ + e = ex; + } + System.assertNotEquals(null,e); + } + + @isTest + static void invalidFields_noQueryFields(){ + Exception e; + List sObjectFields = new List(); + try { + fflib_QueryFactory.QueryField qfld = new fflib_QueryFactory.QueryField(sObjectFields); + } catch (Exception ex) { + e = ex; + } + System.assertNotEquals(null,e); + } + + @isTest + static void invalidFields_noQueryField(){ + Exception e; + Schema.SObjectField sObjectField; + try { + fflib_QueryFactory.QueryField qfld = new fflib_QueryFactory.QueryField(sObjectField); + } catch (Exception ex) { + e = ex; + } + System.assertNotEquals(null,e); + } + + @isTest + static void invalidFields_queryFieldsNotEquals(){ + Exception e; + Schema.SObjectField sObjectField; + fflib_QueryFactory.QueryField qfld = new fflib_QueryFactory.QueryField(Contact.Name); + fflib_QueryFactory.QueryField qfld2 = new fflib_QueryFactory.QueryField(Contact.LastName); + System.assert(!qfld.equals(qfld2)); + } + + @isTest + static void queryIdFieldNotEquals(){ + //this is the equivalent of calling setField('account.name'), where table = Contact + fflib_QueryFactory.QueryField qfld = new fflib_QueryFactory.QueryField(new List{ + Schema.Contact.SObjectType.fields.AccountId, + Schema.Account.SObjectType.fields.name + }); + String fldString = qfld.toString(); + } + + @isTest + static void queryIdFieldNotEqualsWrongObjType(){ + fflib_QueryFactory.QueryField qfld = new fflib_QueryFactory.QueryField(new List{ + Schema.Contact.SObjectType.fields.AccountId}); + System.assert(!qfld.equals(new Contact())); + } + + @isTest + static void addChildQueries_success(){ + Account acct = new Account(); + acct.Name = 'testchildqueriesacct'; + insert acct; + Contact cont = new Contact(); + cont.FirstName = 'test'; + cont.LastName = 'test'; + cont.AccountId = acct.Id; + insert cont; + Task tsk = new Task(); + tsk.WhoId = cont.Id; + tsk.Subject = 'test'; + tsk.ActivityDate = System.today(); + insert tsk; + + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('name').selectField('Id').setCondition( 'name like \'%test%\'' ).addOrdering('CreatedDate',fflib_QueryFactory.SortOrder.DESCENDING, true); + Schema.DescribeSObjectResult descResult = Contact.SObjectType.getDescribe(); + //explicitly assert object accessibility when creating the subselect + qf.subselectQuery(Task.SObjectType, true).selectField('Id').selectField('Subject').setCondition(' IsDeleted = false '); + List queries = qf.getSubselectQueries(); + System.assert(queries != null); + List contacts = Database.query(qf.toSOQL()); + System.assert(contacts != null && contacts.size() == 1); + System.assert(contacts[0].Tasks.size() == 1); + System.assert(contacts[0].Tasks[0].Subject == 'test'); + } + + @isTest + static void addChildQuerySameRelationshipAgain_success(){ + Account acct = new Account(); + acct.Name = 'testchildqueriesacct'; + insert acct; + Contact cont = new Contact(); + cont.FirstName = 'test'; + cont.LastName = 'test'; + cont.AccountId = acct.Id; + insert cont; + Task tsk = new Task(); + tsk.WhoId = cont.Id; + tsk.Subject = 'test'; + tsk.ActivityDate = System.today(); + insert tsk; + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('name'); + qf.selectField('Id'); + qf.setCondition( 'name like \'%test%\'' ); + qf.addOrdering( new fflib_QueryFactory.Ordering('Contact','name',fflib_QueryFactory.SortOrder.ASCENDING) ).addOrdering('CreatedBy.Name',fflib_QueryFactory.SortOrder.DESCENDING); + Schema.DescribeSObjectResult descResult = Contact.SObjectType.getDescribe(); + ChildRelationship relationship; + for (Schema.ChildRelationship childRow : descResult.getChildRelationships()) { + if (childRow.getRelationshipName() == 'Tasks') { + relationship = childRow; + } + } + System.assert(qf.getSubselectQueries() == null); + fflib_QueryFactory childQf = qf.subselectQuery(Task.SObjectType); + childQf.assertIsAccessible(); + childQf.setEnforceFLS(true); + childQf.selectField('Id'); + fflib_QueryFactory childQf2 = qf.subselectQuery(Task.SObjectType); + List queries = qf.getSubselectQueries(); + System.assert(queries != null); + System.assert(queries.size() == 1); + } + + @isTest + static void addChildQueries_invalidChildRelationship(){ + Account acct = new Account(); + acct.Name = 'testchildqueriesacct'; + insert acct; + Contact cont = new Contact(); + cont.FirstName = 'test'; + cont.LastName = 'test'; + cont.AccountId = acct.Id; + insert cont; + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('name'); + qf.selectField('email'); + qf.setCondition( 'name like \'%test%\'' ); + qf.addOrdering( new fflib_QueryFactory.Ordering('Contact','name',fflib_QueryFactory.SortOrder.ASCENDING) ).addOrdering( 'CreatedDATE',fflib_QueryFactory.SortOrder.DESCENDING); + Schema.DescribeSObjectResult descResult = Account.SObjectType.getDescribe(); + Exception e; + try { + fflib_QueryFactory childQf = qf.subselectQuery(Contact.SObjectType); + childQf.selectField('Id'); + } catch (fflib_QueryFactory.InvalidSubqueryRelationshipException ex) { + e = ex; + } + System.assertNotEquals(e, null); + } + + @isTest + static void addChildQueries_invalidChildRelationshipTooDeep(){ + Account acct = new Account(); + acct.Name = 'testchildqueriesacct'; + insert acct; + Contact cont = new Contact(); + cont.FirstName = 'test'; + cont.LastName = 'test'; + cont.AccountId = acct.Id; + insert cont; + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.selectField('name'); + qf.selectField('email'); + qf.setCondition( 'name like \'%test%\'' ); + qf.addOrdering( new fflib_QueryFactory.Ordering('Contact','name',fflib_QueryFactory.SortOrder.ASCENDING) ).addOrdering('CreatedDATE',fflib_QueryFactory.SortOrder.DESCENDING); + Schema.DescribeSObjectResult descResult = Contact.SObjectType.getDescribe(); + + fflib_QueryFactory childQf = qf.subselectQuery(Task.SObjectType); + childQf.selectField('Id'); + childQf.selectField('Subject'); + Exception e; + try { + fflib_QueryFactory subChildQf = childQf.subselectQuery(Task.SObjectType); + } catch (fflib_QueryFactory.InvalidSubqueryRelationshipException ex) { + e = ex; + } + System.assertNotEquals(e, null); + } + + @isTest + static void checkFieldObjectReadSort_success(){ + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.assertIsAccessible() + .setEnforceFLS(true) + .selectField('createdby.name') + .selectField(Contact.LastModifiedById) + .selectFields(new List{Contact.LastModifiedDate}) + .setEnforceFLS(false) + .selectField(Contact.LastName) + .selectFields(new List{Contact.Id}) + .setCondition( 'name like \'%test%\'' ) + .setEnforceFLS(true) + .selectFields(new Set{Contact.FirstName}) + .addOrdering(new fflib_QueryFactory.Ordering('Contact','name',fflib_QueryFactory.SortOrder.ASCENDING) ) + .addOrdering(Contact.LastModifiedDate,fflib_QueryFactory.SortOrder.DESCENDING) + .addOrdering(Contact.CreatedDate,fflib_QueryFactory.SortOrder.DESCENDING, true); + Set fields = qf.getSelectedFields(); + fflib_QueryFactory.Ordering ordering = new fflib_QueryFactory.Ordering('Contact','name',fflib_QueryFactory.SortOrder.ASCENDING); + ordering.getFields(); + for (fflib_QueryFactory.QueryField qfRow : fields) { + SObjectField fld = qfRow.getBaseField(); + List flds = qfRow.getFieldPath(); + break; + } + System.assert(qf.toSOQL().containsIgnoreCase('NULLS LAST')); + } + + @isTest + static void checkObjectRead_fail(){ + User usr = createTestUser_noAccess(); + if (usr != null){ + System.runAs(usr){ + //create a query factory object for Account. + fflib_QueryFactory qf = new fflib_QueryFactory(Account.SObjectType); + Boolean excThrown = false; + try { + //check to see if this record is accessible, it isn't. + qf.assertIsAccessible(); + } catch (fflib_SecurityUtils.CrudException e) { + excThrown = true; + } + System.assert(excThrown); + } + } + } + + @isTest + static void checkFieldRead_fail(){ + User usr = createTestUser_noAccess(); + if (usr != null){ + System.runAs(usr){ + //create a query factory object for Account. + fflib_QueryFactory qf = new fflib_QueryFactory(Account.SObjectType); + Boolean excThrown = false; + try { + //set field to enforce FLS, then try to add a field. + qf.setEnforceFLS(true); + qf.selectField('Name'); + } catch (fflib_SecurityUtils.FlsException e) { + excThrown = true; + } + System.assert(excThrown); + } + } + } + + @isTest + static void queryWith_noFields(){ + fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType); + qf.assertIsAccessible().setEnforceFLS(true).setCondition( 'name like \'%test%\'' ).addOrdering('CreatedDate',fflib_QueryFactory.SortOrder.DESCENDING); + String query = qf.toSOQL(); + System.assert(query.containsIgnoreCase('Id FROM')); + } + + @isTest + static void queryField_compareTo(){ + String otherType = 'bob'; + fflib_QueryFactory.QueryField qf = new fflib_QueryFactory.QueryField(Contact.SObjectType.fields.Name); + fflib_QueryFactory.QueryField joinQf = new fflib_QueryFactory.QueryField(new List{ + Contact.SObjectType.fields.LastModifiedById, + Account.SObjectType.fields.OwnerId, + User.SObjectType.fields.Name + }); + fflib_QueryFactory.QueryField otherJoinQf = new fflib_QueryFactory.QueryField(new List{ + Contact.SObjectType.fields.AccountId, + Account.SObjectType.fields.CreatedById, + User.SObjectType.fields.Name + }); + System.assertEquals(-2, qf.compareTo(otherType)); + System.assertEquals(0, qf.compareTo(qf)); + System.assertEquals( + 0, + qf.compareTo(new fflib_QueryFactory.QueryField(Contact.SObjectType.fields.Name)), + 'An equal but non-identical instance should return 0' + ); + System.assertEquals(-1 , qf.compareTo(joinQf)); + System.assertEquals(1, joinQf.compareTo(qf)); + System.assert(joinQf.compareTo(otherJoinQf) > 0); + System.assert(otherJoinQf.compareTo(joinQf) < 0); + } + + @isTest + static void deterministic_toSOQL(){ + fflib_QueryFactory qf1 = new fflib_QueryFactory(User.SObjectType); + fflib_QueryFactory qf2 = new fflib_QueryFactory(User.SObjectType); + for(fflib_QueryFactory qf:new Set{qf1,qf2}){ + qf.selectFields(new List{ + 'Id', + 'FirstName', + 'LastName', + 'CreatedBy.Name', + 'CreatedBy.Manager', + 'LastModifiedBy.Email' + }); + } + String expectedQuery = + 'SELECT ' + +'FirstName, Id, LastName, ' //less joins come first, alphabetically + +'CreatedBy.ManagerId, CreatedBy.Name, LastModifiedBy.Email ' //alphabetical on the same number of joinrs' + +'FROM User'; + System.assertEquals(qf1.toSOQL(), qf2.toSOQL()); + System.assertEquals(expectedQuery, qf1.toSOQL()); + System.assertEquals(expectedQuery, qf2.toSOQL()); + } + + public static User createTestUser_noAccess(){ + User usr; + try { + //look for a profile that does not have access to the Account object + PermissionSet ps = + [SELECT Profile.Id, profile.name + FROM PermissionSet + WHERE IsOwnedByProfile = true + AND Profile.UserType = 'Standard' + AND Id NOT IN (SELECT ParentId + FROM ObjectPermissions + WHERE SObjectType = 'Account' + AND PermissionsRead = true) + LIMIT 1]; + + if (ps != null){ + //create a user with the profile found that doesn't have access to the Account object + usr = new User( + firstName = 'testUsrF', + LastName = 'testUsrL', + Alias = 'tstUsr', + Email = 'testy.test@test.com', + UserName='test'+ Math.random().format()+'user99@test.com', + EmailEncodingKey = 'ISO-8859-1', + LanguageLocaleKey = 'en_US', + TimeZoneSidKey = 'America/Los_Angeles', + LocaleSidKey = 'en_US', + ProfileId = ps.Profile.Id, + IsActive=true + ); + insert usr; + } + } catch (Exception e) { + //do nothing, just return null User because this test case won't work in this org. + return null; + } + return usr; + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_QueryFactoryTest.cls-meta.xml b/rolluptool/src/classes/fflib_QueryFactoryTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_QueryFactoryTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SObjectDescribe.cls b/rolluptool/src/classes/fflib_SObjectDescribe.cls new file mode 100644 index 00000000..8d4774d3 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectDescribe.cls @@ -0,0 +1,330 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * fflib_SObjectDescribe is a semi-intelligent wrapper for standard apex Schema methods. + * It provides an internal caching layer, to avoid hitting describe limits from repeated use, + * as well as wrapper classes and methods to make common tasks like working with relationship field name oddities + * as well namespace handling. + * + * Of particular note for use in contexts that may be released as managed packages are the #getFields and get #getGlobalDescribe methods + * These return special immutable wrapper objects that automatically imply the current namespace (detected as the one this class is contained in) + * and allow an older API style of omitting the namespace when working with fields or global describe maps. + * This allows both upgrading old code to APIv29 by making use of these as a nearly drop in replacement, as well as keeping + * namespace detection logic encapsulated. +**/ +public class fflib_SObjectDescribe { + //internal implementation details + private Schema.SObjectType token; + private Schema.SObjectField nameField; + private Schema.DescribeSObjectResult describe { //lazy load - keep this leightweight until we need more data + get{ + if(describe == null) + describe = token.getDescribe(); + return describe; + } + set; + } + private Map fields { + get{ + if(fields == null) + fields = describe.fields.getMap(); + return fields; + } + set; + } + private Map fieldSets { + get{ + if(fieldSets == null) + fieldSets = describe.fieldSets.getMap(); + return fieldSets; + } + set; + } + private FieldsMap wrappedFields { + get{ + if(wrappedFields == null){ + wrappedFields = new FieldsMap(this.fields); + } + return wrappedFields; + } + set; + } + + private fflib_SObjectDescribe(Schema.SObjectType token){ + if(token == null) + throw new InvalidDescribeException('Invalid SObject type: null'); + if(instanceCache.containsKey( String.valueOf(token) )) + throw new DuplicateDescribeException(token + ' is already in the describe cache'); + this.token = token; + instanceCache.put( String.valueOf(token).toLowerCase() , this); + } + + //public instace methods + /** + * Returns the Schema.SObjectType this fflib_SObjectDescribe instance is based on. + **/ + public Schema.SObjectType getSObjectType(){ + return token; + } + /** + * This method is a convenient shorthand for calling getField(name, true) + **/ + public Schema.SObjectField getField(String name){ + return this.getField(name, true); + } + /** + * This method provides a simplified shorthand for calling #getFields and getting the provided field. + * Additionally it handles finding the correct SObjectField for relationship notation, + * e.g. getting the Account field on Contact would fail without being referenced as AccountId - both work here. + **/ + public Schema.SObjectField getField(String fieldName, boolean implyNamespace){ + Schema.SObjectField result = wrappedFields.get( + (fieldName.endsWithIgnoreCase('__r') ? //resolve custom field cross-object (__r) syntax + (fieldName.removeEndIgnoreCase('__r')+'__c') : + fieldName), + implyNamespace + ); + if(result == null){ + result = wrappedFields.get(fieldName+'Id', implyNamespace); //in case it's a standard lookup in cross-object format + } + return result; + } + + /** + * Returns the field where isNameField() is true (if any); otherwise returns null + **/ + public Schema.SObjectField getNameField() + { + if(nameField == null) { + for(Schema.SObjectField field : wrappedFields.values()) { + if(field.getDescribe().isNameField()) { + nameField = field; + break; + } + } + } + return nameField; + } + + /** + * Returns the raw Schema.DescribeSObjectResult an fflib_SObjectDescribe instance wraps. + **/ + public Schema.DescribeSObjectResult getDescribe(){ + return describe; + } + /** + * This method returns the raw data and provides no namespace handling. + * Due to this, __use of this method is discouraged__ in favor of getFields(). + **/ + public Map getFieldsMap(){ + return fields; + } + public FieldsMap getFields(){ + return wrappedFields; + } + public Map getFieldSetsMap(){ + return fieldSets; + } + + + + private static Map rawGlobalDescribe { + get{ + if(rawGlobalDescribe == null) + rawGlobalDescribe = Schema.getGlobalDescribe(); + return rawGlobalDescribe; + } + set; + } + private static GlobalDescribeMap wrappedGlobalDescribe{ + get{ + if(wrappedGlobalDescribe == null){ + wrappedGlobalDescribe = new GlobalDescribeMap(rawGlobalDescribe); + } + return wrappedGlobalDescribe; + } + set; + } + /** + * This is used to cache fflib_SObjectDescribe instances as they're consutrcted + * to prevent repeatedly re-constructing the same type. + * These instances are not guaranteed to be, but typically will be, unique per sObject type due to the presence of flushCache. + **/ + private static Map instanceCache {get{ + if(instanceCache == null) + instanceCache = new Map(); + return instanceCache; + } + set; + } + public static fflib_SObjectDescribe getDescribe(String sObjectName){ + fflib_SObjectDescribe result = instanceCache.get(sObjectName.toLowerCase()); + if(result == null){ + Schema.SObjectType token = wrappedGlobalDescribe.get(sObjectName.toLowerCase()); + if(token == null) + result = null; + else + result = new fflib_SObjectDescribe(token); + } + return result; + } + public static fflib_SObjectDescribe getDescribe(Schema.SObjectType token){ + fflib_SObjectDescribe result = instanceCache.get(String.valueOf(token).toLowerCase()); + if(result == null) + result = new fflib_SObjectDescribe(token); + return result; + } + public static fflib_SObjectDescribe getDescribe(Schema.DescribeSObjectResult nativeDescribe){ + fflib_SObjectDescribe result = instanceCache.get(nativeDescribe.getName().toLowerCase()); + if(result == null) + result = new fflib_SObjectDescribe(nativeDescribe.getSobjectType()); + return result; + } + public static fflib_SObjectDescribe getDescribe(SObject instance){ + return getDescribe(instance.getSobjectType()); + } + + //returns the same results as the native method, just with caching built in to avoid limits + public static Map getRawGlobalDescribe(){ + return rawGlobalDescribe; + } + public static GlobalDescribeMap getGlobalDescribe(){ + return wrappedGlobalDescribe; + } + //Useful when working in heap space constrained environments. + //Existing references to SObjectDescribe instances will continue to work. + public static void flushCache(){ + rawGlobalDescribe = null; + instanceCache = null; + } + + + /** + * This class handles emulating a Map's non-mutating instance methods and helps navigate the complex topic of + * handling implicit namespace behavior like pre-APIv29 did, while also allowing fully qualified references. + * Note that this requires the API version of fflib_SObjectDescribe to be 29 or higher to function properly. + * + * Due to the lack of language support for covariant return types sublasses are responsible for implementing the get methods. + * A minimal implementation of these would be a cast and returning getObject's result. + **/ + private abstract class NamespacedAttributeMap{ + @testVisible + protected String currentNamespace; + protected Map values; + + protected NamespacedAttributeMap(Map values){ + //namespace detection courtesey http://salesforce.stackexchange.com/a/28977/60 + currentNamespace = fflib_SObjectDescribe.class.getName().substringBefore('fflib_SObjectDescribe').removeEnd('.').toLowerCase(); + this.values = values; + } + //A no-args constructor to allow subclasses with different contructor signatures + protected NamespacedAttributeMap(){ + this(new Map()); + } + /** + * A convenient shortcut for invoking #getObject(name, true) + **/ + protected virtual Object getObject(String name){ + return this.getObject(name, true); + } + /** + * + **/ + protected virtual Object getObject(String name, Boolean implyNamespace){ + String preferredValue = ((implyNamespace ? currentNamespace+'__' : '') + name).toLowerCase(); + if(values.containsKey(preferredValue)){ + return values.get(preferredValue); + }else if(implyNamespace){ + return values.get(name); + }else{ + return null; + } + } + public virtual Boolean containsKey(String name){ + return this.containsKey(name, true); + } + public virtual Boolean containsKey(String name, Boolean implyNamespace){ + String preferredValue = ((implyNamespace ? currentNamespace+'__' : '') + name).toLowerCase(); + return ( + values.containsKey(preferredValue) || + implyNamespace && values.containsKey(name) + ); + } + public virtual Integer size(){ + return values.size(); + } + public virtual Set keySet(){ + return values.keySet(); + } + } + + /** + * A subclass of NamespacedAttributeMap for handling the data returned by #Schema.DescribeSObjectResult.fields.getMap + **/ + public class FieldsMap extends NamespacedAttributeMap{ + + @testVisible + private FieldsMap(Map values){ + super(values); + } + + public Schema.SObjectField get(String name){ + return this.get(name, true); + } + public Schema.SObjectField get(String name, Boolean implyNamespace){ + return (Schema.SObjectField) this.getObject(name, implyNamespace); + } + public List values(){ + return (List) values.values(); + } + + } + /** + * A subclass of NamespacedAttributeMap for handling the data returned by #Schema.getGlobalDescribe + **/ + public class GlobalDescribeMap extends NamespacedAttributeMap{ + @testVisible + private GlobalDescribeMap(Map values){ + super(values); + } + + public Schema.SObjectType get(String name){ + return this.get(name, true); + } + public Schema.SObjectType get(String name, Boolean implyNamespace){ + return (Schema.SObjectType) this.getObject(name, implyNamespace); + } + public List values(){ + return (List) values.values(); + } + } + + + public abstract class DescribeException extends Exception{} + public class DuplicateDescribeException extends DescribeException{} //Test coverage for this requires APIv28's @testVisbile annotation to force exception cases. + public class InvalidDescribeException extends DescribeException{} +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SObjectDescribe.cls-meta.xml b/rolluptool/src/classes/fflib_SObjectDescribe.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectDescribe.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SObjectDescribeTest.cls b/rolluptool/src/classes/fflib_SObjectDescribeTest.cls new file mode 100644 index 00000000..4cda2c7b --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectDescribeTest.cls @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + This class adapted from https://github.com/capeterson/Apex-Util + Used under a BSD license: https://github.com/capeterson/Apex-Util/blob/master/LICENSE +**/ +@isTest +private class fflib_SObjectDescribeTest { + + @isTest + static void NamespacedAttributeMap_implementations(){ + fflib_SObjectDescribe.GlobalDescribeMap gdm = fflib_SObjectDescribe.getGlobalDescribe(); + Schema.SObjectType accountObjType = gdm.get('AccOunT'); + System.assertEquals(accountObjType, Account.SobjectType); + System.assertEquals(Schema.getGlobalDescribe().size(), gdm.size()); + + fflib_SObjectDescribe acccountDescribe = fflib_SObjectDescribe.getDescribe(accountObjType); + fflib_SObjectDescribe.FieldsMap fields = acccountDescribe.getFields(); + System.assert( fields.keySet().containsAll(acccountDescribe.getFieldsMap().keySet()) ); + + System.assertEquals(fields.get('name'), Account.SObjectType.fields.name); //behavior of FieldsMap is tested in another method + System.assertEquals(Schema.SObjectType.Account.fields.getMap().size(), fields.size()); + } + + @isTest + static void FieldsMap(){ + String fakeNamespace = 'fflib_test'; + Map fakeFieldData = new Map{ + 'name__c' => Contact.SObjectType.fields.name, //re-use stndard field types since we can't mock them + fakeNamespace+'__name__c' => Account.SObjectType.fields.name, + 'createddate' => Contact.SObjectType.fields.CreatedDate + }; + fflib_SObjectDescribe.FieldsMap fields = new fflib_SObjectDescribe.FieldsMap(fakeFieldData); + fields.currentNamespace = fakeNamespace; + System.assertEquals(true, fields.containsKey('name__c') ); + System.assertEquals(true, fields.containsKey(fakeNamespace+'__name__c') ); + System.assert(fields.get('name__c') === fields.get(fakeNamespace+'__name__c')); + + fields.currentNamespace = 'someOtherNamespace'; + System.assertNotEquals(fields.get('name__c'), fields.get(fakeNamespace+'__name__c')); + } + + @isTest + static void GlobalDescribeMap(){ + String fakeNamespace = 'fflib_test'; + Map fakeFieldData = new Map{ + 'name__c' => Contact.SObjectType, //re-use stndard object types since we can't mock them + fakeNamespace+'__name__c' => Account.SObjectType, + 'createddate' => Lead.SObjectType + }; + fflib_SObjectDescribe.GlobalDescribeMap gdm = new fflib_SObjectDescribe.GlobalDescribeMap(fakeFieldData); + gdm.currentNamespace = fakeNamespace; + System.assertEquals(true, gdm.containsKey('name__c') ); + System.assertEquals(true, gdm.containsKey(fakeNamespace+'__name__c') ); + System.assert(gdm.get('name__c') === gdm.get(fakeNamespace+'__name__c')); + + gdm.currentNamespace = 'someOtherNamespace'; + System.assertNotEquals(gdm.get('name__c'), gdm.get(fakeNamespace+'__name__c')); + } + + @isTest //Tests all forms of the getDescribe static + static void getAccountDescribes(){ + fflib_SObjectDescribe d = fflib_SObjectDescribe.getDescribe('Account'); + fflib_SObjectDescribe d2 = fflib_SObjectDescribe.getDescribe(Account.SObjectType); + fflib_SObjectDescribe d3 = fflib_SObjectDescribe.getDescribe(Schema.SObjectType.Account); + System.assertEquals('Account', d.getDescribe().getName()); + System.assert( (d === d2 && d2 === d3) ,'All three getDescribe calls should return the same cached instance.'); + } + + @isTest + static void simpleAccountFieldDescribe(){ + fflib_SObjectDescribe d = fflib_SObjectDescribe.getDescribe(Account.SObjectType); + Map fields; + for(integer i = 0; i < 10; i++){ + fields = d.getFieldsMap(); + } + System.assertEquals(false,fields.isEmpty()); + } + + @isTest + static void simpleAccountFieldSetDescribe(){ + fflib_SObjectDescribe d = fflib_SObjectDescribe.getDescribe(Account.SObjectType); + Map fields; + for(integer i = 0; i < 10; i++){ + fields = d.getFieldSetsMap(); + } + + // We need to assert something here... but what? + //no asserts on result size to avoid a requirement on field sets existing + } + + @isTest + static void simpleAccountGetNameField(){ + fflib_SObjectDescribe d = fflib_SObjectDescribe.getDescribe(Account.SObjectType); + Schema.SObjectField nameField = d.getNameField(); + System.assertEquals('Name', nameField.getDescribe().getName()); + } + + @isTest + static void flushCache(){ + fflib_SObjectDescribe d = fflib_SObjectDescribe.getDescribe('Account'); + fflib_SObjectDescribe.flushCache(); + fflib_SObjectDescribe d2 = fflib_SObjectDescribe.getDescribe('Account'); + System.assert(d !== d2, 'Second object should be a fresh instance after a cache flush.' ); + } + + @isTest + static void rawGlobalDescribeCheck(){ + Map systemGd = Schema.getGlobalDescribe(); + Map cachedGd = fflib_SObjectDescribe.getRawGlobalDescribe(); + System.assertEquals(systemGd.size(),cachedGd.size()); + } + +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SObjectDescribeTest.cls-meta.xml b/rolluptool/src/classes/fflib_SObjectDescribeTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectDescribeTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SObjectDomain.cls b/rolluptool/src/classes/fflib_SObjectDomain.cls new file mode 100644 index 00000000..5c3c73f9 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectDomain.cls @@ -0,0 +1,797 @@ +/** + * Copyright (c) 2012, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * Base class aiding in the implemetnation of a Domain Model around SObject collections + * + * Domain (software engineering). “a set of common requirements, terminology, and functionality + * for any software program constructed to solve a problem in that field”, + * http://en.wikipedia.org/wiki/Domain_(software_engineering) + * + * Domain Model, “An object model of the domain that incorporates both behavior and data.”, + * “At its worst business logic can be very complex. Rules and logic describe many different " + * "cases and slants of behavior, and it's this complexity that objects were designed to work with...” + * Martin Fowler, EAA Patterns + * http://martinfowler.com/eaaCatalog/domainModel.html + * + **/ +public virtual with sharing class fflib_SObjectDomain + implements fflib_ISObjectDomain +{ + /** + * Provides access to the data represented by this domain class + **/ + public List Records { get; private set;} + + /** + * Derived from the records provided during construction, provides the native describe for the standard or custom object + **/ + public Schema.DescribeSObjectResult SObjectDescribe {get; private set;} + + /** + * Exposes the configuration for this domain class instance + **/ + public Configuration Configuration {get; private set;} + + /** + * Useful during unit testign to assert at a more granular and robust level for errors raised during the various trigger events + **/ + public static ErrorFactory Errors {get; private set;} + + /** + * Useful during unit testing to access mock support for database inserts and udpates (testing without DML) + **/ + public static TestFactory Test {get; private set;} + + /** + * Retains instances of domain classes implementing trigger stateful + **/ + private static Map> TriggerStateByClass; + + static + { + Errors = new ErrorFactory(); + + Test = new TestFactory(); + + TriggerStateByClass = new Map>(); + } + + /** + * Constructs the domain class with the data on which to apply the behaviour implemented within + **/ + public fflib_SObjectDomain(List sObjectList) + { + // Ensure the domain class has its own copy of the data + Records = sObjectList.clone(); + // Capture SObjectType describe for this domain class + SObjectDescribe = Records.getSObjectType().getDescribe(); + // Configure the Domain object instance + Configuration = new Configuration(); + } + + /** + * Override this to apply defaults to the records, this is called by the handleBeforeInsert method + **/ + public virtual void onApplyDefaults() { } + + /** + * Override this to apply general validation to be performed during insert or update, called by the handleAfterInsert and handleAfterUpdate methods + **/ + public virtual void onValidate() { } + + /** + * Override this to apply validation to be performed during insert, called by the handleAfterUpdate method + **/ + public virtual void onValidate(Map existingRecords) { } + + /** + * Override this to perform processing during the before insert phase, this is called by the handleBeforeInsert method + **/ + public virtual void onBeforeInsert() { } + + /** + * Override this to perform processing during the before update phase, this is called by the handleBeforeUpdate method + **/ + public virtual void onBeforeUpdate(Map existingRecords) { } + + /** + * Override this to perform processing during the before delete phase, this is called by the handleBeforeDelete method + **/ + public virtual void onBeforeDelete() { } + + /** + * Override this to perform processing during the after insert phase, this is called by the handleAfterInsert method + **/ + public virtual void onAfterInsert() { } + + /** + * Override this to perform processing during the after update phase, this is called by the handleAfterUpdate method + **/ + public virtual void onAfterUpdate(Map existingRecords) { } + + /** + * Override this to perform processing during the after delete phase, this is called by the handleAfterDelete method + **/ + public virtual void onAfterDelete() { } + + /** + * Base handler for the Apex Trigger event Before Insert, calls the onApplyDefaults method, followed by onBeforeInsert + **/ + public virtual void handleBeforeInsert() + { + onApplyDefaults(); + onBeforeInsert(); + } + + /** + * Base handler for the Apex Trigger event Before Update, calls the onBeforeUpdate method + **/ + public void handleBeforeUpdate(Map existingRecords) + { + onBeforeUpdate(existingRecords); + } + + /** + * Base handler for the Apex Trigger event Before Delete, calls the onBeforeDelete method + **/ + public void handleBeforeDelete() + { + onBeforeDelete(); + } + + /** + * Base handler for the Apex Trigger event After Insert, checks object security and calls the onValidate and onAfterInsert methods + * + * @throws DomainException if the current user context is not able to create records + **/ + public void handleAfterInsert() + { + if(Configuration.EnforcingTriggerCRUDSecurity && !SObjectDescribe.isCreateable()) + throw new DomainException('Permission to create an ' + SObjectDescribe.getName() + ' denied.'); + + onValidate(); + onAfterInsert(); + } + + /** + * Base handler for the Apex Trigger event After Update, checks object security and calls the onValidate, onValidate(Map) and onAfterUpdate methods + * + * @throws DomainException if the current user context is not able to update records + **/ + public void handleAfterUpdate(Map existingRecords) + { + if(Configuration.EnforcingTriggerCRUDSecurity && !SObjectDescribe.isUpdateable()) + throw new DomainException('Permission to udpate an ' + SObjectDescribe.getName() + ' denied.'); + + if(Configuration.OldOnUpdateValidateBehaviour) + onValidate(); + onValidate(existingRecords); + onAfterUpdate(existingRecords); + } + + /** + * Base handler for the Apex Trigger event After Delete, checks object security and calls the onAfterDelete method + * + * @throws DomainException if the current user context is not able to delete records + **/ + public void handleAfterDelete() + { + if(Configuration.EnforcingTriggerCRUDSecurity && !SObjectDescribe.isDeletable()) + throw new DomainException('Permission to delete an ' + SObjectDescribe.getName() + ' denied.'); + + onAfterDelete(); + } + + /** + * Returns the SObjectType this Domain class represents + **/ + public SObjectType getSObjectType() + { + return SObjectDescribe.getSObjectType(); + } + + /** + * Returns the SObjectType this Domain class represents + **/ + public SObjectType sObjectType() + { + return getSObjectType(); + } + + /** + * Alternative to the Records property, provided to support mocking of Domain classes + **/ + public List getRecords() + { + return Records; + } + + /** + * Interface used to aid the triggerHandler in constructing instances of Domain classes + **/ + public interface IConstructable + { + fflib_SObjectDomain construct(List sObjectList); + } + + /** + * For Domain classes implementing the ITriggerStateful interface returns the instance + * of the domain class being shared between trigger invocations, returns null if + * the Domain class trigger has not yet fired or the given domain class does not implement + * the ITriggerStateful interface. Note this method is sensitive to recursion, meaning + * it will return the applicable domain instance for the level of recursion + **/ + public static fflib_SObjectDomain getTriggerInstance(Type domainClass) + { + List domains = TriggerStateByClass.get(domainClass); + if(domains==null || domains.size()==0) + return null; + return domains[domains.size()-1]; + } + + /** + * Method constructs the given Domain class with the current Trigger context + * before calling the applicable override methods such as beforeInsert, beforeUpdate etc. + **/ + public static void triggerHandler(Type domainClass) + { + // Process the trigger context + if(System.Test.isRunningTest() & Test.Database.hasRecords()) + { + // If in test context and records in the mock database delegate initially to the mock database trigger handler + Test.Database.testTriggerHandler(domainClass); + } + else + { + // Process the runtime Apex Trigger context + triggerHandler(domainClass, + Trigger.isBefore, + Trigger.isAfter, + Trigger.isInsert, + Trigger.isUpdate, + Trigger.isDelete, + Trigger.new, + Trigger.oldMap); + } + } + + /** + * Calls the applicable override methods such as beforeInsert, beforeUpdate etc. based on a Trigger context + **/ + private static void triggerHandler(Type domainClass, Boolean isBefore, Boolean isAfter, Boolean isInsert, Boolean isUpdate, Boolean isDelete, List newRecords, Map oldRecordsMap) + { + // After phase of trigger will reuse prior instance of domain class if ITriggerStateful implemented + fflib_SObjectDomain domainObject = isBefore ? null : popTriggerInstance(domainClass, isDelete ? oldRecordsMap.values() : newRecords); + if(domainObject==null) + { + // Construct the domain class constructor class + String domainClassName = domainClass.getName(); + Type constructableClass = domainClassName.endsWith('Constructor') ? Type.forName(domainClassName) : Type.forName(domainClassName+'.Constructor'); + IConstructable domainConstructor = (IConstructable) constructableClass.newInstance(); + + // Construct the domain class with the approprite record set + if(isInsert) domainObject = domainConstructor.construct(newRecords); + else if(isUpdate) domainObject = domainConstructor.construct(newRecords); + else if(isDelete) domainObject = domainConstructor.construct(oldRecordsMap.values()); + + // Should this instance be reused on the next trigger invocation? + if(domainObject.Configuration.TriggerStateEnabled) + // Push this instance onto the stack to be popped during the after phase + pushTriggerInstance(domainClass, domainObject); + } + + // Invoke the applicable handler + if(isBefore) + { + if(isInsert) domainObject.handleBeforeInsert(); + else if(isUpdate) domainObject.handleBeforeUpdate(oldRecordsMap); + else if(isDelete) domainObject.handleBeforeDelete(); + } + else + { + if(isInsert) domainObject.handleAfterInsert(); + else if(isUpdate) domainObject.handleAfterUpdate(oldRecordsMap); + else if(isDelete) domainObject.handleAfterDelete(); + } + } + + /** + * Pushes to the stack of domain classes per type a domain object instance + **/ + private static void pushTriggerInstance(Type domainClass, fflib_SObjectDomain domain) + { + List domains = TriggerStateByClass.get(domainClass); + if(domains==null) + TriggerStateByClass.put(domainClass, domains = new List()); + domains.add(domain); + } + + /** + * Pops from the stack of domain classes per type a domain object instance and updates the record set + **/ + private static fflib_SObjectDomain popTriggerInstance(Type domainClass, List records) + { + List domains = TriggerStateByClass.get(domainClass); + if(domains==null || domains.size()==0) + return null; + fflib_SObjectDomain domain = domains.remove(domains.size()-1); + domain.Records = records; + return domain; + } + + /** + * Fluent style Configuration system for Domain class creation + **/ + public class Configuration + { + /** + * Backwards compatability mode for handleAfterUpdate routing to onValidate() + **/ + public Boolean OldOnUpdateValidateBehaviour {get; private set;} + /** + * True if the base class is checking the users CRUD requirements before invoking trigger methods + **/ + public Boolean EnforcingTriggerCRUDSecurity {get; private set;} + + /** + * Enables reuse of the same Domain instance between before and after trigger phases (subject to recursive scenarios) + **/ + public Boolean TriggerStateEnabled {get; private set;} + + /** + * Default configuration + **/ + public Configuration() + { + EnforcingTriggerCRUDSecurity = true; // Default is true for backwards compatability + TriggerStateEnabled = false; + OldOnUpdateValidateBehaviour = false; // Breaking change, but felt to better practice + } + + /** + * See associated property + **/ + public Configuration enableTriggerState() + { + TriggerStateEnabled = true; + return this; + } + + /** + * See associated property + **/ + public Configuration disableTriggerState() + { + TriggerStateEnabled = false; + return this; + } + + /** + * See associated property + **/ + public Configuration enforceTriggerCRUDSecurity() + { + EnforcingTriggerCRUDSecurity = true; + return this; + } + + /** + * See associated property + **/ + public Configuration disableTriggerCRUDSecurity() + { + EnforcingTriggerCRUDSecurity = false; + return this; + } + + /** + * See associated property + **/ + public Configuration enableOldOnUpdateValidateBehaviour() + { + OldOnUpdateValidateBehaviour = true; + return this; + } + + /** + * See associated property + **/ + public Configuration disableOldOnUpdateValidateBehaviour() + { + OldOnUpdateValidateBehaviour = false; + return this; + } + } + + /** + * General exception class for the domain layer + **/ + public class DomainException extends Exception + { + } + + /** + * Ensures logging of errors in the Domain context for later assertions in tests + **/ + public String error(String message, SObject record) + { + return Errors.error(this, message, record); + } + + /** + * Ensures logging of errors in the Domain context for later assertions in tests + **/ + public String error(String message, SObject record, SObjectField field) + { + return Errors.error(this, message, record, field); + } + + /** + * Ensures logging of errors in the Domain context for later assertions in tests + **/ + public class ErrorFactory + { + private List errorList = new List(); + + private ErrorFactory() + { + + } + + public String error(String message, SObject record) + { + return error(null, message, record); + } + + private String error(fflib_SObjectDomain domain, String message, SObject record) + { + ObjectError objectError = new ObjectError(); + objectError.domain = domain; + objectError.message = message; + objectError.record = record; + errorList.add(objectError); + return message; + } + + public String error(String message, SObject record, SObjectField field) + { + return error(null, message, record, field); + } + + private String error(fflib_SObjectDomain domain, String message, SObject record, SObjectField field) + { + FieldError fieldError = new FieldError(); + fieldError.domain = domain; + fieldError.message = message; + fieldError.record = record; + fieldError.field = field; + errorList.add(fieldError); + return message; + } + + public List getAll() + { + return errorList.clone(); + } + + public void clearAll() + { + errorList.clear(); + } + } + + /** + * Ensures logging of errors in the Domain context for later assertions in tests + **/ + public class FieldError extends ObjectError + { + public SObjectField field; + + private FieldError() + { + + } + } + + /** + * Ensures logging of errors in the Domain context for later assertions in tests + **/ + public virtual class ObjectError extends Error + { + public SObject record; + + private ObjectError() + { + + } + } + + /** + * Ensures logging of errors in the Domain context for later assertions in tests + **/ + public abstract class Error + { + public String message; + public fflib_SObjectDomain domain; + } + + /** + * Provides test context mocking facilities to unit tests testing domain classes + **/ + public class TestFactory + { + public MockDatabase Database = new MockDatabase(); + + private TestFactory() + { + + } + } + + /** + * Class used during Unit testing of Domain classes, can be used (not exclusively) to speed up test execution and focus testing + **/ + public class MockDatabase + { + private Boolean isInsert = false; + private Boolean isUpdate = false; + private Boolean isDelete = false; + private List records = new List(); + private Map oldRecords = new Map(); + + private MockDatabase() + { + + } + + private void testTriggerHandler(Type domainClass) + { + // Mock Before + triggerHandler(domainClass, true, false, isInsert, isUpdate, isDelete, records, oldRecords); + + // Mock After + triggerHandler(domainClass, false, true, isInsert, isUpdate, isDelete, records, oldRecords); + } + + public void onInsert(List records) + { + this.isInsert = true; + this.isUpdate = false; + this.isDelete = false; + this.records = records; + } + + public void onUpdate(List records, Map oldRecords) + { + this.isInsert = false; + this.isUpdate = true; + this.isDelete = false; + this.records = records; + this.oldRecords = oldRecords; + } + + public void onDelete(Map records) + { + this.isInsert = false; + this.isUpdate = false; + this.isDelete = true; + this.oldRecords = records; + } + + public Boolean hasRecords() + { + return records!=null && records.size()>0 || oldRecords!=null && oldRecords.size()>0; + } + } + + /** + * Test domain class (ideally this would be in the test class, however Type.newInstance does not see such classes) + **/ + public with sharing class TestSObjectDomain extends fflib_SObjectDomain + { + private String someState; + + public TestSObjectDomain(List sObjectList) + { + // Domain classes are initialised with lists to enforce bulkification throughout + super(sObjectList); + } + + public override void onApplyDefaults() + { + // Not required in production code + super.onApplyDefaults(); + + // Apply defaults to Testfflib_SObjectDomain + for(Opportunity opportunity : (List) Records) + { + opportunity.CloseDate = System.today().addDays(30); + } + } + + public override void onValidate() + { + // Not required in production code + super.onValidate(); + + // Validate Testfflib_SObjectDomain + for(Opportunity opp : (List) Records) + { + if(opp.Type!=null && opp.Type.startsWith('Existing') && opp.AccountId == null) + { + opp.AccountId.addError( error('You must provide an Account for Opportunities for existing Customers.', opp, Opportunity.AccountId) ); + } + } + } + + public override void onValidate(Map existingRecords) + { + // Not required in production code + super.onValidate(existingRecords); + + // Validate changes to Testfflib_SObjectDomain + for(Opportunity opp : (List) Records) + { + Opportunity existingOpp = (Opportunity) existingRecords.get(opp.Id); + if(opp.Type != existingOpp.Type) + { + opp.Type.addError( error('You cannot change the Opportunity type once it has been created.', opp, Opportunity.Type) ); + } + } + } + + public override void onBeforeDelete() + { + // Not required in production code + super.onBeforeDelete(); + + // Validate changes to Testfflib_SObjectDomain + for(Opportunity opp : (List) Records) + { + opp.addError( error('You cannot delete this Opportunity.', opp) ); + } + } + + public override void onBeforeInsert() + { + // Assert this variable is null in the after insert (since this domain class is stateless) + someState = 'This should not survice the trigger after phase'; + } + + public override void onAfterInsert() + { + // This is a stateless domain class, so should not retain anything betweet before and after + System.assertEquals(null, someState); + } + } + + /** + * Typically an inner class to the domain class, supported here for test purposes + **/ + public class TestSObjectDomainConstructor implements fflib_SObjectDomain.IConstructable + { + public fflib_SObjectDomain construct(List sObjectList) + { + return new TestSObjectDomain(sObjectList); + } + } + + /** + * Test domain class (ideally this would be in the test class, however Type.newInstance does not see such classes) + **/ + public with sharing class TestSObjectStatefulDomain + extends fflib_SObjectDomain + { + public String someState; + + public TestSObjectStatefulDomain(List sObjectList) + { + super(sObjectList); + + // Ensure this instance is re-used in the after trigger phase (subject to recursive scenarios) + Configuration.enableTriggerState(); + } + + public override void onBeforeInsert() + { + // This must always be null, as we do not reuse domain instances within recursive scenarios (different record sets) + System.assertEquals(null, someState); + + // Process records + List newOpps = new List(); + for(Opportunity opp : (List) Records) + { + // Set some state sensitive to the incoming records + someState = 'Error on Record ' + opp.Name; + + // Create a new Opportunity record to trigger recursive code path? + if(opp.Name.equals('Test Recursive 1')) + newOpps.add(new Opportunity ( Name = 'Test Recursive 2', Type = 'Existing Account' )); + } + + // If testing recursiving emulate an insert + if(newOpps.size()>0) + { + // This will force recursion and thus validate via the above assert results in a new domain instance + fflib_SObjectDomain.Test.Database.onInsert(newOpps); + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectStatefulDomainConstructor.class); + } + } + + public override void onAfterInsert() + { + // Use the state set in the before insert (since this is a stateful domain class) + if(someState!=null) + for(Opportunity opp : (List) Records) + opp.addError(error(someState, opp)); + } + } + + /** + * Typically an inner class to the domain class, supported here for test purposes + **/ + public class TestSObjectStatefulDomainConstructor implements fflib_SObjectDomain.IConstructable + { + public fflib_SObjectDomain construct(List sObjectList) + { + return new TestSObjectStatefulDomain(sObjectList); + } + } + + /** + * Test domain class (ideally this would be in the test class, however Type.newInstance does not see such classes) + **/ + public with sharing class TestSObjectOnValidateBehaviour + extends fflib_SObjectDomain + { + public TestSObjectOnValidateBehaviour(List sObjectList) + { + super(sObjectList); + + // Enable old behaviour based on the test Opportunity name passed in + if(sObjectList[0].Name == 'Test Enable Old Behaviour') + Configuration.enableOldOnUpdateValidateBehaviour(); + } + + public override void onValidate() + { + // Throw exception to give the test somethign to assert on + throw new DomainException('onValidate called'); + } + } + + /** + * Typically an inner class to the domain class, supported here for test purposes + **/ + public class TestSObjectOnValidateBehaviourConstructor implements fflib_SObjectDomain.IConstructable + { + public fflib_SObjectDomain construct(List sObjectList) + { + return new TestSObjectOnValidateBehaviour(sObjectList); + } + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SObjectDomain.cls-meta.xml b/rolluptool/src/classes/fflib_SObjectDomain.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectDomain.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SObjectDomainTest.cls b/rolluptool/src/classes/fflib_SObjectDomainTest.cls new file mode 100644 index 00000000..df3125ae --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectDomainTest.cls @@ -0,0 +1,214 @@ +/** + * Copyright (c), FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@IsTest +private with sharing class fflib_SObjectDomainTest +{ + @IsTest + private static void testValidationWithoutDML() + { + fflib_SObjectDomain.TestSObjectDomain opps = new fflib_SObjectDomain.TestSObjectDomain(new Opportunity[] { new Opportunity ( Name = 'Test', Type = 'Existing Account' ) } ); + opps.onValidate(); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('You must provide an Account for Opportunities for existing Customers.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(Opportunity.AccountId, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + } + + @IsTest + private static void testInsertValidationFailedWithoutDML() + { + Opportunity opp = new Opportunity ( Name = 'Test', Type = 'Existing Account' ); + System.assertEquals(false, fflib_SObjectDomain.Test.Database.hasRecords()); + fflib_SObjectDomain.Test.Database.onInsert(new Opportunity[] { opp } ); + System.assertEquals(true, fflib_SObjectDomain.Test.Database.hasRecords()); + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectDomainConstructor.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('You must provide an Account for Opportunities for existing Customers.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(Opportunity.AccountId, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + } + + @IsTest + private static void testUpdateValidationFailedWithoutDML() + { + Opportunity oldOpp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); + oldOpp.Name = 'Test'; + oldOpp.Type = 'Existing Account'; + Opportunity newOpp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); + newOpp.Name = 'Test'; + newOpp.Type = 'New Account'; + System.assertEquals(false, fflib_SObjectDomain.Test.Database.hasRecords()); + fflib_SObjectDomain.Test.Database.onUpdate(new Opportunity[] { newOpp }, new Map { newOpp.Id => oldOpp } ); + System.assertEquals(true, fflib_SObjectDomain.Test.Database.hasRecords()); + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectDomainConstructor.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('You cannot change the Opportunity type once it has been created.', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals(Opportunity.Type, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[0]).field); + } + + @IsTest + private static void testOnBeforeDeleteWithoutDML() + { + Opportunity opp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); + opp.Name = 'Test'; + opp.Type = 'Existing Account'; + System.assertEquals(false, fflib_SObjectDomain.Test.Database.hasRecords()); + fflib_SObjectDomain.Test.Database.onDelete(new Map { opp.Id => opp } ); + System.assertEquals(true, fflib_SObjectDomain.Test.Database.hasRecords()); + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectDomainConstructor.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('You cannot delete this Opportunity.', fflib_SObjectDomain.Errors.getAll()[0].message); + } + + @IsTest + private static void testObjectSecurity() + { + // Create a user which will not have access to the test object type + User testUser = createChatterExternalUser(); + if(testUser==null) + return; // Abort the test if unable to create a user with low enough acess + System.runAs(testUser) + { + // Test Create object security + Opportunity opp = new Opportunity ( Name = 'Test', Type = 'Existing Account' ); + fflib_SObjectDomain.Test.Database.onInsert(new Opportunity[] { opp } ); + try { + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectDomainConstructor.class); + System.assert(false, 'Expected access denied exception'); + } catch (Exception e) { + System.assertEquals('Permission to create an Opportunity denied.', e.getMessage()); + } + + // Test Update object security + Opportunity existingOpp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); + existingOpp.Name = 'Test'; + existingOpp.Type = 'Existing Account'; + fflib_SObjectDomain.Test.Database.onUpdate(new List { opp }, new Map { opp.Id => opp } ); + try { + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectDomainConstructor.class); + System.assert(false, 'Expected access denied exception'); + } catch (Exception e) { + System.assertEquals('Permission to udpate an Opportunity denied.', e.getMessage()); + } + + // Test Delete object security + fflib_SObjectDomain.Test.Database.onDelete(new Map { opp.Id => opp }); + try { + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectDomainConstructor.class); + System.assert(false, 'Expected access denied exception'); + } catch (Exception e) { + System.assertEquals('Permission to delete an Opportunity denied.', e.getMessage()); + } + } + } + + @IsTest + private static void testErrorLogging() + { + // Test static helpers for raise none domain object instance errors + Opportunity opp = new Opportunity ( Name = 'Test', Type = 'Existing Account' ); + fflib_SObjectDomain.Errors.error('Error', opp); + fflib_SObjectDomain.Errors.error('Error', opp, Opportunity.Type); + System.assertEquals(2, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Error', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals('Error', fflib_SObjectDomain.Errors.getAll()[1].message); + System.assertEquals(Opportunity.Type, ((fflib_SObjectDomain.FieldError)fflib_SObjectDomain.Errors.getAll()[1]).field); + fflib_SObjectDomain.Errors.clearAll(); + System.assertEquals(0, fflib_SObjectDomain.Errors.getAll().size()); + } + + @IsTest + private static void testTriggerState() + { + Opportunity opp = new Opportunity ( Name = 'Test', Type = 'Existing Account' ); + fflib_SObjectDomain.Test.Database.onInsert(new Opportunity[] { opp } ); + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectStatefulDomainConstructor.class); + System.assertEquals(1, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Error on Record Test', fflib_SObjectDomain.Errors.getAll()[0].message); + } + + @IsTest + private static void testRecursiveTriggerState() + { + Opportunity opp = new Opportunity ( Name = 'Test Recursive 1', Type = 'Existing Account' ); + fflib_SObjectDomain.Test.Database.onInsert(new Opportunity[] { opp } ); + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectStatefulDomainConstructor.class); + System.assertEquals(2, fflib_SObjectDomain.Errors.getAll().size()); + System.assertEquals('Error on Record Test Recursive 2', fflib_SObjectDomain.Errors.getAll()[0].message); + System.assertEquals('Error on Record Test Recursive 1', fflib_SObjectDomain.Errors.getAll()[1].message); + } + + @IsTest + private static void testOnValidateBehaviorDefault() + { + Opportunity oldOpp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); + oldOpp.Name = 'Test Default Behaviour'; + oldOpp.Type = 'Existing Account'; + Opportunity newOpp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); + newOpp.Name = 'Test Default Behaviour'; + newOpp.Type = 'New Account'; + fflib_SObjectDomain.Test.Database.onUpdate(new Opportunity[] { newOpp }, new Map { newOpp.Id => oldOpp } ); + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectOnValidateBehaviourConstructor.class); + } + + @IsTest + private static void testOnValidateBehaviorOld() + { + Opportunity oldOpp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); + oldOpp.Name = 'Test Enable Old Behaviour'; + oldOpp.Type = 'Existing Account'; + Opportunity newOpp = (Opportunity) Opportunity.sObjectType.newSObject('006E0000006mkRQ'); + newOpp.Name = 'Test Enable Old Behaviour'; + newOpp.Type = 'New Account'; + fflib_SObjectDomain.Test.Database.onUpdate(new Opportunity[] { newOpp }, new Map { newOpp.Id => oldOpp } ); + try { + fflib_SObjectDomain.triggerHandler(fflib_SObjectDomain.TestSObjectOnValidateBehaviourConstructor.class); + System.assert(false, 'Expected exception'); + } catch (Exception e) { + System.assertEquals('onValidate called', e.getMessage()); + } + } + + /** + * Create test user + **/ + private static User createChatterExternalUser() + { + // Can only proceed with test if we have a suitable profile - Chatter External license has no access to Opportunity + List testProfiles = [Select Id From Profile where UserLicense.Name='Chatter External' limit 1]; + if(testProfiles.size()!=1) + return null; + + // Can only proceed with test if we can successfully insert a test user + String testUsername = System.now().format('yyyyMMddhhmmss') + '@testorg.com'; + User testUser = new User(Alias = 'test1', Email='testuser1@testorg.com', EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', LocaleSidKey='en_US', ProfileId = testProfiles[0].Id, TimeZoneSidKey='America/Los_Angeles', UserName=testUsername); + try { + insert testUser; + } catch (Exception e) { + return null; + } + return testUser; + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SObjectDomainTest.cls-meta.xml b/rolluptool/src/classes/fflib_SObjectDomainTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectDomainTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SObjectMocks.cls b/rolluptool/src/classes/fflib_SObjectMocks.cls new file mode 100644 index 00000000..f1b312a6 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectMocks.cls @@ -0,0 +1,232 @@ +/** + * Copyright (c), FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * This is a generated class with some manual modifications + * Use the Apex Mocks Generator, then re-apply the 'virtual' modifier + **/ +@IsTest +public class fflib_SObjectMocks +{ + public virtual class SObjectDomain implements fflib_ISObjectDomain + { + private fflib_ApexMocks mocks; + + public SObjectDomain(fflib_ApexMocks mocks) + { + this.mocks = mocks; + } + + public SObjectType sObjectType() + { + if (mocks.Verifying) + { + mocks.verifyMethodCall(this, 'sObjectType', new List {}); + } + else if (mocks.Stubbing) + { + mocks.prepareMethodReturnValue(this, 'sObjectType', new List {}); + return null; + } + else + { + mocks.recordMethod(this, 'sObjectType', new List {}); + + fflib_MethodReturnValue methodReturnValue = mocks.getMethodReturnValue(this, 'sObjectType', new List {}); + + if (methodReturnValue != null) + { + if (methodReturnValue.ReturnValue instanceof Exception) + { + throw ((Exception) methodReturnValue.ReturnValue); + } + + return (SObjectType) methodReturnValue.ReturnValue; + } + } + + return null; + } + + public List getRecords() + { + if (mocks.Verifying) + { + mocks.verifyMethodCall(this, 'getRecords', new List {}); + } + else if (mocks.Stubbing) + { + mocks.prepareMethodReturnValue(this, 'getRecords', new List {}); + return null; + } + else + { + mocks.recordMethod(this, 'getRecords', new List {}); + + fflib_MethodReturnValue methodReturnValue = mocks.getMethodReturnValue(this, 'getRecords', new List {}); + + if (methodReturnValue != null) + { + if (methodReturnValue.ReturnValue instanceof Exception) + { + throw ((Exception) methodReturnValue.ReturnValue); + } + + return (List) methodReturnValue.ReturnValue; + } + } + + return null; + } + } + + public virtual class SObjectSelector implements fflib_ISObjectSelector + { + private fflib_ApexMocks mocks; + + public SObjectSelector(fflib_ApexMocks mocks) + { + this.mocks = mocks; + } + + public Schema.SObjectType sObjectType() + { + if (mocks.Verifying) + { + mocks.verifyMethodCall(this, 'sObjectType', new List {}); + } + else if (mocks.Stubbing) + { + mocks.prepareMethodReturnValue(this, 'sObjectType', new List {}); + return null; + } + else + { + mocks.recordMethod(this, 'sObjectType', new List {}); + + fflib_MethodReturnValue methodReturnValue = mocks.getMethodReturnValue(this, 'sObjectType', new List {}); + + if (methodReturnValue != null) + { + if (methodReturnValue.ReturnValue instanceof Exception) + { + throw ((Exception) methodReturnValue.ReturnValue); + } + + return (Schema.SObjectType) methodReturnValue.ReturnValue; + } + } + + return null; + } + + public List selectSObjectsById(Set idSet) + { + if (mocks.Verifying) + { + mocks.verifyMethodCall(this, 'selectSObjectsById', new List {idSet}); + } + else if (mocks.Stubbing) + { + mocks.prepareMethodReturnValue(this, 'selectSObjectsById', new List {idSet}); + return null; + } + else + { + mocks.recordMethod(this, 'selectSObjectsById', new List {idSet}); + + fflib_MethodReturnValue methodReturnValue = mocks.getMethodReturnValue(this, 'selectSObjectsById', new List {idSet}); + + if (methodReturnValue != null) + { + if (methodReturnValue.ReturnValue instanceof Exception) + { + throw ((Exception) methodReturnValue.ReturnValue); + } + + return (List) methodReturnValue.ReturnValue; + } + } + + return null; + } + } + + public virtual class SObjectUnitOfWork implements fflib_ISObjectUnitOfWork + { + private fflib_ApexMocks mocks; + + public SObjectUnitOfWork(fflib_ApexMocks mocks) + { + this.mocks = mocks; + } + + public void registerNew(SObject record) + { + mocks.mockVoidMethod(this, 'registerNew', new List {record}); + } + + public void registerNew(List records) + { + mocks.mockVoidMethod(this, 'registerNew', new List {records}); + } + + public void registerNew(SObject record, Schema.sObjectField relatedToParentField, SObject relatedToParentRecord) + { + mocks.mockVoidMethod(this, 'registerNew', new List {record, relatedToParentField, relatedToParentRecord}); + } + + public void registerRelationship(SObject record, Schema.sObjectField relatedToField, SObject relatedTo) + { + mocks.mockVoidMethod(this, 'registerRelationship', new List {record, relatedToField, relatedTo}); + } + + public void registerDirty(SObject record) + { + mocks.mockVoidMethod(this, 'registerDirty', new List {record}); + } + + public void registerDirty(List records) + { + mocks.mockVoidMethod(this, 'registerDirty', new List {records}); + } + + public void registerDeleted(SObject record) + { + mocks.mockVoidMethod(this, 'registerDeleted', new List {record}); + } + + public void registerDeleted(List records) + { + mocks.mockVoidMethod(this, 'registerDeleted', new List {records}); + } + + public void commitWork() + { + mocks.mockVoidMethod(this, 'commitWork', new List {}); + } + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SObjectMocks.cls-meta.xml b/rolluptool/src/classes/fflib_SObjectMocks.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectMocks.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SObjectSelector.cls b/rolluptool/src/classes/fflib_SObjectSelector.cls new file mode 100644 index 00000000..a259d985 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectSelector.cls @@ -0,0 +1,409 @@ +/** + * Copyright (c), FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * Class providing common database query support for abstracting and encapsulating query logic + **/ +public abstract with sharing class fflib_SObjectSelector + implements fflib_ISObjectSelector +{ + /** + * This overrides the Multi Currency handling, preventing it from injecting the CurrencyIsoCode fie ld for certain System objects that don't ever support it + **/ + private static Set STANDARD_WITHOUT_CURRENCYISO = new Set { AsyncApexJob.SObjectType.getDescribe().getName() + , ApexTrigger.SObjectType.getDescribe().getName() + , ApexClass.SObjectType.getDescribe().getName() + , Attachment.SObjectType.getDescribe().getName() + , RecordType.SObjectType.getDescribe().getName() }; + + /** + * Should this selector automatically include the FieldSet fields when building queries? + **/ + private Boolean m_includeFieldSetFields; + + /** + * Enforce FLS Security + **/ + private Boolean m_enforceFLS; + + /** + * Enforce CRUD Security + **/ + private Boolean m_enforceCRUD; + + /** + * Order by field + **/ + private String m_orderBy; + + /** + * Describe helper + **/ + private fflib_SObjectDescribe describeWrapper { + get { + if(describeWrapper == null) + describeWrapper = fflib_SObjectDescribe.getDescribe(getSObjectType()); + return describeWrapper; + } + set; + } + + /** + * Implement this method to inform the base class of the SObject (custom or standard) to be queried + **/ + abstract Schema.SObjectType getSObjectType(); + + /** + * Implement this method to inform the base class of the common fields to be queried or listed by the base class methods + **/ + abstract List getSObjectFieldList(); + + /** + * Constructs the Selector, defaults to not including any FieldSet fields automatically + **/ + public fflib_SObjectSelector() + { + this(false); + } + + /** + * Constructs the Selector + * + * @param includeFieldSetFields Set to true if the Selector queries are to include Fieldset fields as well + **/ + public fflib_SObjectSelector(Boolean includeFieldSetFields) + { + this(includeFieldSetFields, true, false); + } + + /** + * Constructs the Selector + * + * @param includeFieldSetFields Set to true if the Selector queries are to include Fieldset fields as well + **/ + public fflib_SObjectSelector(Boolean includeFieldSetFields, Boolean enforceCRUD, Boolean enforceFLS) + { + m_includeFieldSetFields = includeFieldSetFields; + m_enforceCRUD = enforceCRUD; + m_enforceFLS = enforceFLS; + } + + /** + * Override this method to provide a list of Fieldsets that can optionally drive inclusion of additional fields in the base queries + **/ + public virtual List getSObjectFieldSetList() + { + return null; + } + + /** + * Override this method to control the default ordering of records returned by the base queries, + * defaults to the name field of the object or CreatedDate if there is none + **/ + public virtual String getOrderBy() + { + if(m_orderBy == null) { + m_orderBy = 'CreatedDate'; + if(describeWrapper.getNameField() != null) { + m_orderBy = describeWrapper.getNameField().getDescribe().getName(); + } + } + return m_orderBy; + } + + /** + * Returns True if this Selector instance has been instructed by the caller to include Field Set fields + **/ + public Boolean isIncludeFieldSetFields() + { + return m_includeFieldSetFields; + } + + /** + * Returns True if this Selector is enforcing FLS + **/ + public Boolean isEnforcingFLS() + { + return m_enforceFLS; + } + + /** + * Returns True if this Selector is enforcing CRUD Security + **/ + public Boolean isEnforcingCRUD() + { + return m_enforceCRUD; + } + + /** + * Provides access to the builder containing the list of fields base queries are using, this is demand + * created if one has not already been defined via setFieldListBuilder + * + * @depricated See newQueryFactory + **/ + public fflib_StringBuilder.FieldListBuilder getFieldListBuilder() + { + List sObjectFields = new List(); + for(fflib_QueryFactory.QueryField queryField : newQueryFactory().getSelectedFields()) + sObjectFields.add(queryField.getBaseField()); + return new fflib_StringBuilder.FieldListBuilder(sObjectFields); + } + + /** + * Use this method to override the default FieldListBuilder (created on demand via getFieldListBuilder) with a custom one, + * warning, this will bypass anything getSObjectFieldList or getSObjectFieldSetList returns + * + * @depricated See newQueryFactory + **/ + public void setFieldListBuilder(fflib_StringBuilder.FieldListBuilder fieldListBuilder) + { + // TODO: Consider if given the known use cases for this (dynamic selector optomisation) if it's OK to leave this as a null operation + } + + /** + * Returns in string form a comma delimted list of fields as defined via getSObjectFieldList and optionally getSObjectFieldSetList + * + * @depricated See newQueryFactory + **/ + public String getFieldListString() + { + return getFieldListBuilder().getStringValue(); + } + + /** + * Returns in string form a comma delimted list of fields as defined via getSObjectFieldList and optionally getSObjectFieldSetList + * @param relation Will prefix fields with the given relation, e.g. MyLookupField__r + * + * @depricated See newQueryFactory + **/ + public String getRelatedFieldListString(String relation) + { + return getFieldListBuilder().getStringValue(relation + '.'); + } + + /** + * Returns the string representaiton of the SObject this selector represents + **/ + public String getSObjectName() + { + return describeWrapper.getDescribe().getName(); + } + + /** + * Performs a SOQL query, + * - Selecting the fields described via getSObjectFieldsList and getSObjectFieldSetList (if included) + * - From the SObject described by getSObjectType + * - Where the Id's match those provided in the set + * - Ordered by the fields returned via getOrderBy + * @returns A list of SObject's + **/ + public List selectSObjectsById(Set idSet) + { + return Database.query(buildQuerySObjectById()); + } + + /** + * Performs a SOQL query, + * - Selecting the fields described via getSObjectFieldsList and getSObjectFieldSetList (if included) + * - From the SObject described by getSObjectType + * - Where the Id's match those provided in the set + * - Ordered by the fields returned via getOrderBy + * @returns A QueryLocator (typically for use in a Batch Apex job) + **/ + public Database.QueryLocator queryLocatorById(Set idSet) + { + return Database.getQueryLocator(buildQuerySObjectById()); + } + + /** + * Throws an exception if the SObject indicated by getSObjectType is not accessible to the current user (read access) + * + * @depricated If you utilise the newQueryFactory method this is automatically done for you (unless disabled by the selector) + **/ + public void assertIsAccessible() + { + if(!getSObjectType().getDescribe().isAccessible()) + throw new fflib_SObjectDomain.DomainException( + 'Permission to access an ' + getSObjectType().getDescribe().getName() + ' denied.'); + } + + /** + * Public acccess for the getSObjectType during Mock registration + * (adding public to the existing method broken base class API backwards compatability) + **/ + public SObjectType getSObjectType2() + { + return getSObjectType(); + } + + /** + * Public acccess for the getSObjectType during Mock registration + * (adding public to the existing method broken base class API backwards compatability) + **/ + public SObjectType sObjectType() + { + return getSObjectType(); + } + + /** + * Returns a QueryFactory configured with the Selectors object, fields, fieldsets and default order by + **/ + public fflib_QueryFactory newQueryFactory() + { + return newQueryFactory(m_enforceCRUD, m_enforceFLS, true); + } + + /** + * Returns a QueryFactory configured with the Selectors object, fields, fieldsets and default order by + **/ + public fflib_QueryFactory newQueryFactory(Boolean includeSelectorFields) + { + return newQueryFactory(m_enforceCRUD, m_enforceFLS, includeSelectorFields); + } + + /** + * Returns a QueryFactory configured with the Selectors object, fields, fieldsets and default order by + * CRUD and FLS read security will be checked if the corresponding inputs are true (overrides that defined in the selector). + **/ + public fflib_QueryFactory newQueryFactory(Boolean assertCRUD, Boolean enforceFLS, Boolean includeSelectorFields) + { + // Construct QueryFactory around the given SObject + return configureQueryFactory( + new fflib_QueryFactory(getSObjectType2()), + assertCRUD, enforceFLS, includeSelectorFields); + } + + /** + * Adds the selectors fields to the given QueryFactory using the given relationship path as a prefix + * + * // TODO: This should be consistant (ideally) with configureQueryFactory below + **/ + public void configureQueryFactoryFields(fflib_QueryFactory queryFactory, String relationshipFieldPath) + { + // Add fields from selector prefixing the relationship path + for(SObjectField field : getSObjectFieldList()) + queryFactory.selectField(relationshipFieldPath + '.' + field.getDescribe().getName()); + // Automatically select the CurrencyIsoCode for MC orgs (unless the object is a known exception to the rule) + if(addCurrencyIsoCode()) + queryFactory.selectField(relationshipFieldPath+'.CurrencyIsoCode'); + } + + /** + * Adds a subselect QueryFactory based on this selector to the given QueryFactor, returns the parentQueryFactory + **/ + public fflib_QueryFactory addQueryFactorySubselect(fflib_QueryFactory parentQueryFactory) + { + return addQueryFactorySubselect(parentQueryFactory, true); + } + + /** + * Adds a subselect QueryFactory based on this selector to the given QueryFactor + **/ + public fflib_QueryFactory addQueryFactorySubselect(fflib_QueryFactory parentQueryFactory, Boolean includeSelectorFields) + { + fflib_QueryFactory subSelectQueryFactory = + parentQueryFactory.subselectQuery(getSObjectType2()); + return configureQueryFactory( + subSelectQueryFactory, + m_enforceCRUD, + m_enforceFLS, + includeSelectorFields); + } + + /** + * Constructs the default SOQL query for this selector, see selectSObjectsById and queryLocatorById + **/ + private String buildQuerySObjectById() + { + return newQueryFactory().setCondition('id in :idSet').toSOQL(); + } + + /** + * Configures a QueryFactory instance according to the configuration of this selector + **/ + private fflib_QueryFactory configureQueryFactory(fflib_QueryFactory queryFactory, Boolean assertCRUD, Boolean enforceFLS, Boolean includeSelectorFields) + { + // CRUD and FLS security required? + if (assertCRUD) + { + try { + // Leverage QueryFactory for CRUD checking + queryFactory.assertIsAccessible(); + } catch (fflib_SecurityUtils.CrudException e) { + // Marshal exception into DomainException for backwards compatability + throw new fflib_SObjectDomain.DomainException( + 'Permission to access an ' + getSObjectType().getDescribe().getName() + ' denied.'); + } + } + queryFactory.setEnforceFLS(enforceFLS); + + // Configure the QueryFactory with the Selector fields? + if(includeSelectorFields) + { + // select the Selector fields and Fieldsets and set order + queryFactory.selectFields(new Set(getSObjectFieldList())); + List fieldSetList = getSObjectFieldSetList(); + if(m_includeFieldSetFields && fieldSetList != null) + for(Schema.FieldSet fieldSet : fieldSetList) + queryFactory.selectFieldSet(fieldSet); + + // Automatically select the CurrencyIsoCode for MC orgs (unless the object is a known exception to the rule) + if(addCurrencyIsoCode()) + queryFactory.selectField('CurrencyIsoCode'); + } + + // Parse the getOrderBy() + for(String orderBy : getOrderBy().split(',')) + { + // TODO: Handle NULLS FIRST and NULLS LAST, http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_orderby.htm + List orderByParts = orderBy.trim().split(' '); + String fieldNamePart = orderByParts[0]; + String fieldSortOrderPart = orderByParts.size() > 1 ? orderByParts[1] : null; + fflib_QueryFactory.SortOrder fieldSortOrder = fflib_QueryFactory.SortOrder.ASCENDING; + if(fieldSortOrderPart==null) + fieldSortOrder = fflib_QueryFactory.SortOrder.ASCENDING; + else if(fieldSortOrderPart.equalsIgnoreCase('DESC')) + fieldSortOrder = fflib_QueryFactory.SortOrder.DESCENDING; + else if(fieldSortOrderPart.equalsIgnoreCase('ASC')) + fieldSortOrder = fflib_QueryFactory.SortOrder.ASCENDING; + queryFactory.addOrdering(fieldNamePart, fieldSortOrder); + } + + return queryFactory; + } + + /** + * Determines if CurrencyIsoCode should be automatically added. + **/ + public virtual Boolean addCurrencyIsoCode() { + // Custom Metadata objects don't have CurrencyIsoCode fields + if(getSObjectType().getDescribe().getName().endsWith('__mdt')) + return false; + // Ohter object types are fine so long as its not in the list + return Userinfo.isMultiCurrencyOrganization() && + !STANDARD_WITHOUT_CURRENCYISO.contains(getSObjectType().getDescribe().getName()); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SObjectSelector.cls-meta.xml b/rolluptool/src/classes/fflib_SObjectSelector.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectSelector.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SObjectSelectorTest.cls b/rolluptool/src/classes/fflib_SObjectSelectorTest.cls new file mode 100644 index 00000000..251dc8f7 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectSelectorTest.cls @@ -0,0 +1,261 @@ +/** + * Copyright (c), FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@IsTest +private with sharing class fflib_SObjectSelectorTest +{ + + static testMethod void testGetFieldListString() + { + Testfflib_SObjectSelector selector = new Testfflib_SObjectSelector(); + String fieldListString = selector.getFieldListString(); + assertFieldListString(fieldListString, null); + String relatedFieldListString = selector.getRelatedFieldListString('myprefix'); + assertFieldListString(relatedFieldListString, 'myprefix'); + } + + static testMethod void testGetSObjectName() + { + Testfflib_SObjectSelector selector = new Testfflib_SObjectSelector(); + system.assertEquals(null, selector.getSObjectFieldSetList()); + system.assertEquals('Account',selector.getSObjectName()); + } + + static testMethod void testSelectSObjectsById() + { + // Inserting in reverse order so that we can test the order by of select + List accountList = new List { + new Account(Name='TestAccount2',AccountNumber='A2',AnnualRevenue=12345.67), + new Account(Name='TestAccount1',AccountNumber='A1',AnnualRevenue=76543.21) }; + insert accountList; + Set idSet = new Set(); + for(Account item : accountList) + idSet.add(item.Id); + + Test.startTest(); + Testfflib_SObjectSelector selector = new Testfflib_SObjectSelector(); + List result = (List) selector.selectSObjectsById(idSet); + Test.stopTest(); + + system.assertEquals(2,result.size()); + system.assertEquals('TestAccount2',result[0].Name); + system.assertEquals('A2',result[0].AccountNumber); + system.assertEquals(12345.67,result[0].AnnualRevenue); + system.assertEquals('TestAccount1',result[1].Name); + system.assertEquals('A1',result[1].AccountNumber); + system.assertEquals(76543.21,result[1].AnnualRevenue); + } + + static testMethod void testQueryLocatorById() + { + // Inserting in reverse order so that we can test the order by of select + List accountList = new List { + new Account(Name='TestAccount2',AccountNumber='A2',AnnualRevenue=12345.67), + new Account(Name='TestAccount1',AccountNumber='A1',AnnualRevenue=76543.21) }; + insert accountList; + Set idSet = new Set(); + for(Account item : accountList) + idSet.add(item.Id); + + Test.startTest(); + Testfflib_SObjectSelector selector = new Testfflib_SObjectSelector(); + Database.QueryLocator result = selector.queryLocatorById(idSet); + System.Iterator iteratorResult = result.iterator(); + Test.stopTest(); + + System.assert(true, iteratorResult.hasNext()); + Account account = (Account) iteratorResult.next(); + system.assertEquals('TestAccount2',account.Name); + system.assertEquals('A2',account.AccountNumber); + system.assertEquals(12345.67,account.AnnualRevenue); + System.assert(true, iteratorResult.hasNext()); + account = (Account) iteratorResult.next(); + system.assertEquals('TestAccount1',account.Name); + system.assertEquals('A1',account.AccountNumber); + system.assertEquals(76543.21,account.AnnualRevenue); + System.assertEquals(false, iteratorResult.hasNext()); + } + + static testMethod void testAssertIsAccessible() + { + List accountList = new List { + new Account(Name='TestAccount2',AccountNumber='A2',AnnualRevenue=12345.67), + new Account(Name='TestAccount1',AccountNumber='A1',AnnualRevenue=76543.21) }; + insert accountList; + Set idSet = new Set(); + for(Account item : accountList) + idSet.add(item.Id); + + // Create a user which will not have access to the test object type + User testUser = createChatterExternalUser(); + if(testUser==null) + return; // Abort the test if unable to create a user with low enough acess + System.runAs(testUser) + { + Testfflib_SObjectSelector selector = new Testfflib_SObjectSelector(); + try + { + List result = (List) selector.selectSObjectsById(idSet); + System.assert(false,'Expected exception was not thrown'); + } + catch(fflib_SObjectDomain.DomainException e) + { + System.assertEquals('Permission to access an Account denied.',e.getMessage()); + } + } + } + + static testMethod void testCRUDOff() + { + List accountList = new List { + new Account(Name='TestAccount2',AccountNumber='A2',AnnualRevenue=12345.67), + new Account(Name='TestAccount1',AccountNumber='A1',AnnualRevenue=76543.21) }; + insert accountList; + Set idSet = new Set(); + for(Account item : accountList) + idSet.add(item.Id); + + // Create a user which will not have access to the test object type + User testUser = createChatterExternalUser(); + if(testUser==null) + return; // Abort the test if unable to create a user with low enough acess + System.runAs(testUser) + { + Testfflib_SObjectSelector selector = new Testfflib_SObjectSelector(false, false, false); + try + { + List result = (List) selector.selectSObjectsById(idSet); + } + catch(fflib_SObjectDomain.DomainException e) + { + System.assert(false,'Did not expect an exception to be thrown'); + } + } + } + + static testMethod void testSOQL() + { + Testfflib_SObjectSelector selector = new Testfflib_SObjectSelector(); + String soql = selector.newQueryFactory().toSOQL(); + Pattern p = Pattern.compile('SELECT (.*) FROM Account ORDER BY Name DESC NULLS FIRST , AnnualRevenue ASC NULLS FIRST '); + Matcher m = p.matcher(soql); + System.assert(m.matches(), 'Generated SOQL does not match expected pattern. Here is the generated SOQL: ' + soql); + System.assertEquals(1, m.groupCount(), 'Unexpected number of groups captured.'); + String fieldListString = m.group(1); + assertFieldListString(fieldListString, null); + } + + static testMethod void testDefaultConfig() + { + Testfflib_SObjectSelector selector = new Testfflib_SObjectSelector(); + System.assertEquals(false, selector.isEnforcingFLS()); + System.assertEquals(true, selector.isEnforcingCRUD()); + System.assertEquals(false, selector.isIncludeFieldSetFields()); + + String fieldListString = selector.getFieldListString(); + assertFieldListString(fieldListString, null); + + String relatedFieldListString = selector.getRelatedFieldListString('LookupField__r'); + assertFieldListString(relatedFieldListString, 'LookupField__r'); + + System.assertEquals('Account', selector.getSObjectName()); + System.assertEquals(Account.SObjectType, selector.getSObjectType2()); + } + + private static void assertFieldListString(String fieldListString, String prefix) { + String prefixString = (!String.isBlank(prefix)) ? prefix + '.' : ''; + List fieldList = fieldListString.split(',{1}\\s?'); + System.assertEquals(UserInfo.isMultiCurrencyOrganization() ? 5 : 4, fieldList.size()); + Set fieldSet = new Set(); + fieldSet.addAll(fieldList); + String expected = prefixString + 'AccountNumber'; + System.assert(fieldSet.contains(expected), expected + ' missing from field list string: ' + fieldListString); + expected = prefixString + 'AnnualRevenue'; + System.assert(fieldSet.contains(expected), expected + ' missing from field list string: ' + fieldListString); + expected = prefixString + 'Id'; + System.assert(fieldSet.contains(expected), expected + ' missing from field list string: ' + fieldListString); + expected = prefixString + 'Name'; + System.assert(fieldSet.contains(expected), expected + ' missing from field list string: ' + fieldListString); + if (UserInfo.isMultiCurrencyOrganization()) { + expected = prefixString + 'CurrencyIsoCode'; + System.assert(fieldSet.contains(expected), expected + ' missing from field list string: ' + fieldListString); + } + } + + private class Testfflib_SObjectSelector extends fflib_SObjectSelector + { + public Testfflib_SObjectSelector() + { + super(); + } + + public Testfflib_SObjectSelector(Boolean includeFieldSetFields, Boolean enforceCRUD, Boolean enforceFLS) + { + super(includeFieldSetFields, enforceCRUD, enforceFLS); + } + + public List getSObjectFieldList() + { + return new List { + Account.Name, + Account.Id, + Account.AccountNumber, + Account.AnnualRevenue + }; + } + + public Schema.SObjectType getSObjectType() + { + return Account.sObjectType; + } + + public override String getOrderBy() + { + return 'Name DESC, AnnualRevenue ASC'; + } + } + + /** + * Create test user + **/ + private static User createChatterExternalUser() + { + // Can only proceed with test if we have a suitable profile - Chatter External license has no access to Opportunity + List testProfiles = [Select Id From Profile where UserLicense.Name='Chatter External' limit 1]; + if(testProfiles.size()!=1) + return null; + + // Can only proceed with test if we can successfully insert a test user + String testUsername = System.now().format('yyyyMMddhhmmss') + '@testorg.com'; + User testUser = new User(Alias = 'test1', Email='testuser1@testorg.com', EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', LocaleSidKey='en_US', ProfileId = testProfiles[0].Id, TimeZoneSidKey='America/Los_Angeles', UserName=testUsername); + try { + insert testUser; + } catch (Exception e) { + return null; + } + return testUser; + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SObjectSelectorTest.cls-meta.xml b/rolluptool/src/classes/fflib_SObjectSelectorTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectSelectorTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SObjectUnitOfWork.cls b/rolluptool/src/classes/fflib_SObjectUnitOfWork.cls new file mode 100644 index 00000000..058bef9a --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectUnitOfWork.cls @@ -0,0 +1,350 @@ +/** + * Copyright (c), FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * Provides an implementation of the Enterprise Application Architecture Unit Of Work, as defined by Martin Fowler + * http://martinfowler.com/eaaCatalog/unitOfWork.html + * + * "When you're pulling data in and out of a database, it's important to keep track of what you've changed; otherwise, + * that data won't be written back into the database. Similarly you have to insert new objects you create and + * remove any objects you delete." + * + * "You can change the database with each change to your object model, but this can lead to lots of very small database calls, + * which ends up being very slow. Furthermore it requires you to have a transaction open for the whole interaction, which is + * impractical if you have a business transaction that spans multiple requests. The situation is even worse if you need to + * keep track of the objects you've read so you can avoid inconsistent reads." + * + * "A Unit of Work keeps track of everything you do during a business transaction that can affect the database. When you're done, + * it figures out everything that needs to be done to alter the database as a result of your work." + * + * In an Apex context this pattern provides the following specific benifits + * - Applies bulkfication to DML operations, insert, update and delete + * - Manages a business transaction around the work and ensures a rollback occurs (even when exceptions are later handled by the caller) + * - Honours dependency rules between records and updates dependent relationships automatically during the commit + * + * Please refer to the testMethod's in this class for example usage + * + * TODO: Need to complete the 100% coverage by covering parameter exceptions in tests + * TODO: Need to add some more test methods for more complex use cases and some unexpected (e.g. registerDirty and then registerDeleted) + * + **/ +public virtual class fflib_SObjectUnitOfWork + implements fflib_ISObjectUnitOfWork +{ + private List m_sObjectTypes = new List(); + + private Map> m_newListByType = new Map>(); + + private Map> m_dirtyMapByType = new Map>(); + + private Map> m_deletedMapByType = new Map>(); + + private Map m_relationships = new Map(); + + private List m_workList = new List(); + + private SendEmailWork m_emailWork = new SendEmailWork(); + + private IDML m_dml; + + /** + * Interface describes work to be performed during the commitWork method + **/ + public interface IDoWork + { + void doWork(); + } + + public interface IDML + { + void dmlInsert(List objList); + void dmlUpdate(List objList); + void dmlDelete(List objList); + } + + public class SimpleDML implements IDML + { + public void dmlInsert(List objList){ + insert objList; + } + public void dmlUpdate(List objList){ + update objList; + } + public void dmlDelete(List objList){ + delete objList; + } + } + /** + * Constructs a new UnitOfWork to support work against the given object list + * + * @param sObjectList A list of objects given in dependency order (least dependent first) + */ + public fflib_SObjectUnitOfWork(List sObjectTypes) + { + this(sObjectTypes,new SimpleDML()); + } + + + public fflib_SObjectUnitOfWork(List sObjectTypes, IDML dml) + { + m_sObjectTypes = sObjectTypes.clone(); + + for(Schema.SObjectType sObjectType : m_sObjectTypes) + { + m_newListByType.put(sObjectType.getDescribe().getName(), new List()); + m_dirtyMapByType.put(sObjectType.getDescribe().getName(), new Map()); + m_deletedMapByType.put(sObjectType.getDescribe().getName(), new Map()); + m_relationships.put(sObjectType.getDescribe().getName(), new Relationships()); + } + + m_workList.add(m_emailWork); + + m_dml = dml; + } + + /** + * Register a generic peace of work to be invoked during the commitWork phase + **/ + public void registerWork(IDoWork work) + { + m_workList.add(work); + } + + /** + * Registers the given email to be sent during the commitWork + **/ + public void registerEmail(Messaging.Email email) + { + m_emailWork.registerEmail(email); + } + + /** + * Register a newly created SObject instance to be inserted when commitWork is called + * + * @param record A newly created SObject instance to be inserted during commitWork + **/ + public void registerNew(SObject record) + { + registerNew(record, null, null); + } + + /** + * Register a list of newly created SObject instances to be inserted when commitWork is called + * + * @param records A list of newly created SObject instances to be inserted during commitWork + **/ + public void registerNew(List records) + { + for(SObject record : records) + { + registerNew(record, null, null); + } + } + + /** + * Register a newly created SObject instance to be inserted when commitWork is called, + * you may also provide a reference to the parent record instance (should also be registered as new separatly) + * + * @param record A newly created SObject instance to be inserted during commitWork + * @param relatedToParentField A SObjectField reference to the child field that associates the child record with its parent + * @param relatedToParentRecord A SObject instance of the parent record (should also be registered as new separatly) + **/ + public void registerNew(SObject record, Schema.sObjectField relatedToParentField, SObject relatedToParentRecord) + { + if(record.Id != null) + throw new UnitOfWorkException('Only new records can be registered as new'); + String sObjectType = record.getSObjectType().getDescribe().getName(); + if(!m_newListByType.containsKey(sObjectType)) + throw new UnitOfWorkException(String.format('SObject type {0} is not supported by this unit of work', new String[] { sObjectType })); + m_newListByType.get(sObjectType).add(record); + if(relatedToParentRecord!=null && relatedToParentField!=null) + registerRelationship(record, relatedToParentField, relatedToParentRecord); + } + + /** + * Register a relationship between two records that have yet to be inserted to the database. This information will be + * used during the commitWork phase to make the references only when related records have been inserted to the database. + * + * @param record An existing or newly created record + * @param relatedToField A SObjectField referene to the lookup field that relates the two records together + * @param relatedTo A SOBject instance (yet to be commited to the database) + */ + public void registerRelationship(SObject record, Schema.sObjectField relatedToField, SObject relatedTo) + { + String sObjectType = record.getSObjectType().getDescribe().getName(); + if(!m_newListByType.containsKey(sObjectType)) + throw new UnitOfWorkException(String.format('SObject type {0} is not supported by this unit of work', new String[] { sObjectType })); + m_relationships.get(sObjectType).add(record, relatedToField, relatedTo); + } + + /** + * Register an existing record to be updated during the commitWork method + * + * @param record An existing record + **/ + public void registerDirty(SObject record) + { + if(record.Id == null) + throw new UnitOfWorkException('New records cannot be registered as dirty'); + String sObjectType = record.getSObjectType().getDescribe().getName(); + if(!m_dirtyMapByType.containsKey(sObjectType)) + throw new UnitOfWorkException(String.format('SObject type {0} is not supported by this unit of work', new String[] { sObjectType })); + m_dirtyMapByType.get(sObjectType).put(record.Id, record); + } + + /** + * Register a list of existing records to be updated during the commitWork method + * + * @param records A list of existing records + **/ + public void registerDirty(List records) + { + for(SObject record : records) + { + this.registerDirty(record); + } + } + + /** + * Register an existing record to be deleted during the commitWork method + * + * @param record An existing record + **/ + public void registerDeleted(SObject record) + { + if(record.Id == null) + throw new UnitOfWorkException('New records cannot be registered for deletion'); + String sObjectType = record.getSObjectType().getDescribe().getName(); + if(!m_deletedMapByType.containsKey(sObjectType)) + throw new UnitOfWorkException(String.format('SObject type {0} is not supported by this unit of work', new String[] { sObjectType })); + m_deletedMapByType.get(sObjectType).put(record.Id, record); + } + + /** + * Register a list of existing records to be deleted during the commitWork method + * + * @param records A list of existing records + **/ + public void registerDeleted(List records) + { + for(SObject record : records) + { + this.registerDeleted(record); + } + } + + /** + * Takes all the work that has been registered with the UnitOfWork and commits it to the database + **/ + public void commitWork() + { + // Wrap the work in its own transaction + Savepoint sp = Database.setSavePoint(); + try + { + // Insert by type + for(Schema.SObjectType sObjectType : m_sObjectTypes) + { + m_relationships.get(sObjectType.getDescribe().getName()).resolve(); + m_dml.dmlInsert(m_newListByType.get(sObjectType.getDescribe().getName())); + } + // Update by type + for(Schema.SObjectType sObjectType : m_sObjectTypes) + m_dml.dmlUpdate(m_dirtyMapByType.get(sObjectType.getDescribe().getName()).values()); + // Delete by type (in reverse dependency order) + Integer objectIdx = m_sObjectTypes.size() - 1; + while(objectIdx>=0) + m_dml.dmlDelete(m_deletedMapByType.get(m_sObjectTypes[objectIdx--].getDescribe().getName()).values()); + // Generic work + for(IDoWork work : m_workList) + work.doWork(); + } + catch (Exception e) + { + // Rollback + Database.rollback(sp); + // Throw exception on to caller + throw e; + } + } + + private class Relationships + { + private List m_relationships = new List(); + + public void resolve() + { + // Resolve relationships + for(Relationship relationship : m_relationships) + relationship.Record.put(relationship.RelatedToField, relationship.RelatedTo.Id); + } + + public void add(SObject record, Schema.sObjectField relatedToField, SObject relatedTo) + { + // Relationship to resolve + Relationship relationship = new Relationship(); + relationship.Record = record; + relationship.RelatedToField = relatedToField; + relationship.RelatedTo = relatedTo; + m_relationships.add(relationship); + } + } + + private class Relationship + { + public SObject Record; + public Schema.sObjectField RelatedToField; + public SObject RelatedTo; + } + + /** + * UnitOfWork Exception + **/ + public class UnitOfWorkException extends Exception {} + + /** + * Internal implementation of Messaging.sendEmail, see outer class registerEmail method + **/ + private class SendEmailWork implements IDoWork + { + private List emails; + + public SendEmailWork() + { + this.emails = new List(); + } + + public void registerEmail(Messaging.Email email) + { + this.emails.add(email); + } + + public void doWork() + { + if(emails.size() > 0) Messaging.sendEmail(emails); + } + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SObjectUnitOfWork.cls-meta.xml b/rolluptool/src/classes/fflib_SObjectUnitOfWork.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectUnitOfWork.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SObjectUnitOfWorkTest.cls b/rolluptool/src/classes/fflib_SObjectUnitOfWorkTest.cls new file mode 100644 index 00000000..1f569797 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectUnitOfWorkTest.cls @@ -0,0 +1,167 @@ +/** + * Copyright (c), FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@IsTest +private with sharing class fflib_SObjectUnitOfWorkTest +{ + // SObjects (in order of dependency) used by UnitOfWork in tests bellow + private static List MY_SOBJECTS = + new Schema.SObjectType[] { + Product2.SObjectType, + PricebookEntry.SObjectType, + Opportunity.SObjectType, + OpportunityLineItem.SObjectType }; + + @isTest + private static void testUnitOfWorkNewDirtyDelete() + { + // Insert Opporunities with UnitOfWork + { + fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork(MY_SOBJECTS); + for(Integer o=0; o<10; o++) + { + Opportunity opp = new Opportunity(); + opp.Name = 'UoW Test Name ' + o; + opp.StageName = 'Open'; + opp.CloseDate = System.today(); + uow.registerNew(new List{opp}); + for(Integer i=0; i{product}); + PricebookEntry pbe = new PricebookEntry(); + pbe.UnitPrice = 10; + pbe.IsActive = true; + pbe.UseStandardPrice = false; + pbe.Pricebook2Id = Test.getStandardPricebookId(); + uow.registerNew(pbe, PricebookEntry.Product2Id, product); + OpportunityLineItem oppLineItem = new OpportunityLineItem(); + oppLineItem.Quantity = 1; + oppLineItem.TotalPrice = 10; + uow.registerRelationship(oppLineItem, OpportunityLineItem.PricebookEntryId, pbe); + uow.registerNew(oppLineItem, OpportunityLineItem.OpportunityId, opp); + } + } + uow.commitWork(); + } + + // Assert Results + assertResults('UoW'); + // TODO: Need to re-instate this check with a better approach, as it is not possible when + // product triggers contribute to DML (e.g. in sample app Opportunity trigger) + // System.assertEquals(5 /* Oddly a setSavePoint consumes a DML */, Limits.getDmlStatements()); + + // Records to update + List opps = [select Id, Name, (Select Id from OpportunityLineItems) from Opportunity where Name like 'UoW Test Name %' order by Name]; + + // Update some records with UnitOfWork + { + fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork(MY_SOBJECTS); + Opportunity opp = opps[0]; + opp.Name = opp.Name + ' Changed'; + uow.registerDirty(new List{opp}); + Product2 product = new Product2(); + product.Name = opp.Name + ' : New Product'; + uow.registerNew(new List{product}); + PricebookEntry pbe = new PricebookEntry(); + pbe.UnitPrice = 10; + pbe.IsActive = true; + pbe.UseStandardPrice = false; + pbe.Pricebook2Id = Test.getStandardPricebookId(); + uow.registerNew(pbe, PricebookEntry.Product2Id, product); + OpportunityLineItem newOppLineItem = new OpportunityLineItem(); + newOppLineItem.Quantity = 1; + newOppLineItem.TotalPrice = 10; + uow.registerRelationship(newOppLineItem, OpportunityLineItem.PricebookEntryId, pbe); + uow.registerNew(newOppLineItem, OpportunityLineItem.OpportunityId, opp); + OpportunityLineItem existingOppLine = opp.OpportunityLineItems[0]; + // Test that operations on the same object can be daisy chained, and the same object registered as dirty more than once + // This verifies that using a Map to back the dirty records collection prevents duplicate registration. + existingOppLine.Quantity = 2; + uow.registerDirty(new List{existingOppLine}); + existingOppLine.TotalPrice = 20; + uow.registerDirty(new List{existingOppLine}); + uow.commitWork(); + } + + // Assert Results + // TODO: Need to re-instate this check with a better approach, as it is not possible when + // product triggers contribute to DML (e.g. in sample app Opportunity trigger) + // System.assertEquals(11, Limits.getDmlStatements()); + opps = [select Id, Name, (Select Id, PricebookEntry.Product2.Name, Quantity, TotalPrice from OpportunityLineItems Order By PricebookEntry.Product2.Name) from Opportunity where Name like 'UoW Test Name %' order by Name]; + System.assertEquals(10, opps.size()); + System.assertEquals('UoW Test Name 0 Changed', opps[0].Name); + System.assertEquals(2, opps[0].OpportunityLineItems.size()); + // Verify that both fields were updated properly + System.assertEquals(2, opps[0].OpportunityLineItems[0].Quantity); + System.assertEquals(20, opps[0].OpportunityLineItems[0].TotalPrice); + System.assertEquals('UoW Test Name 0 Changed : New Product', opps[0].OpportunityLineItems[1].PricebookEntry.Product2.Name); + + // Delete some records with the UnitOfWork + { + fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork(MY_SOBJECTS); + uow.registerDeleted(new List{opps[0].OpportunityLineItems[1].PricebookEntry.Product2}); // Delete PricebookEntry Product + uow.registerDeleted(new List{opps[0].OpportunityLineItems[1].PricebookEntry}); // Delete PricebookEntry + uow.registerDeleted(new List{opps[0].OpportunityLineItems[1]}); // Delete OpportunityLine Item + // Register the same deletions more than once. + // This verifies that using a Map to back the deleted records collection prevents duplicate registration. + uow.registerDeleted(new List{opps[0].OpportunityLineItems[1].PricebookEntry.Product2}); // Delete PricebookEntry Product + uow.registerDeleted(new List{opps[0].OpportunityLineItems[1].PricebookEntry}); // Delete PricebookEntry + uow.registerDeleted(new List{opps[0].OpportunityLineItems[1]}); // Delete OpportunityLine Item + uow.commitWork(); + } + + // Assert Results + // TODO: Need to re-instate this check with a better approach, as it is not possible when + // product triggers contribute to DML (e.g. in sample app Opportunity trigger) + // System.assertEquals(15, Limits.getDmlStatements()); + opps = [select Id, Name, (Select Id, PricebookEntry.Product2.Name, Quantity from OpportunityLineItems Order By PricebookEntry.Product2.Name) from Opportunity where Name like 'UoW Test Name %' order by Name]; + List prods = [Select Id from Product2 where Name = 'UoW Test Name 0 Changed : New Product']; + System.assertEquals(10, opps.size()); + System.assertEquals('UoW Test Name 0 Changed', opps[0].Name); + System.assertEquals(1, opps[0].OpportunityLineItems.size()); // Should have deleted OpportunityLineItem added above + System.assertEquals(0, prods.size()); // Should have deleted Product added above + } + + private static void assertResults(String prefix) + { + // Standard Assertions on tests data inserted by tests + String filter = prefix + ' Test Name %'; + List opps = [select Id, Name, (Select Id from OpportunityLineItems) from Opportunity where Name like :filter order by Name]; + System.assertEquals(10, opps.size()); + System.assertEquals(1, opps[0].OpportunityLineItems.size()); + System.assertEquals(2, opps[1].OpportunityLineItems.size()); + System.assertEquals(3, opps[2].OpportunityLineItems.size()); + System.assertEquals(4, opps[3].OpportunityLineItems.size()); + System.assertEquals(5, opps[4].OpportunityLineItems.size()); + System.assertEquals(6, opps[5].OpportunityLineItems.size()); + System.assertEquals(7, opps[6].OpportunityLineItems.size()); + System.assertEquals(8, opps[7].OpportunityLineItems.size()); + System.assertEquals(9, opps[8].OpportunityLineItems.size()); + System.assertEquals(10, opps[9].OpportunityLineItems.size()); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SObjectUnitOfWorkTest.cls-meta.xml b/rolluptool/src/classes/fflib_SObjectUnitOfWorkTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SObjectUnitOfWorkTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SecurityUtils.cls b/rolluptool/src/classes/fflib_SecurityUtils.cls new file mode 100644 index 00000000..2aa075f7 --- /dev/null +++ b/rolluptool/src/classes/fflib_SecurityUtils.cls @@ -0,0 +1,348 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * Utility class for checking FLS/CRUD. NOTE: all "check" methods will throw a SecurityException (or subclass) if the + * user does not have the proper security granted. + **/ +public class fflib_SecurityUtils +{ + @testVisible + private Enum OperationType { CREATE, READ, MODIFY, DEL } //UPDATE and DELETE are reserved words + + /** + * SecurityException is never be thrown directly by fflib_SecurityUtils, instead all + * forms of CRUD and FLD violations throw subclasses of it. It is provided as a conveneience + * in the event you wish to handle CRUD and FLS violations the same way (e.g. die and display an error) + **/ + public virtual class SecurityException extends Exception { + protected OperationType m_operation; + protected Schema.SObjectType m_objectType; + } + + /** + * CrudException represents a running user's lack of read/create/update/delete access at a profile (or permission set) + * level. Sharing and field level security issues will never cause this. + **/ + public class CrudException extends SecurityException{ + + private CrudException(OperationType operation, Schema.SObjectType objectType){ + this.m_operation = operation; + this.m_objectType = objectType; + if(operation == OperationType.CREATE) + this.setMessage(System.Label.fflib_security_error_object_not_insertable); + else if(operation == OperationType.READ) + this.setMessage(System.Label.fflib_security_error_object_not_readable); + else if(operation == OperationType.MODIFY) + this.setMessage(System.Label.fflib_security_error_object_not_updateable); + else if(operation == OperationType.DEL) + this.setMessage(System.Label.fflib_security_error_object_not_deletable); + + this.setMessage( + String.format( + this.getMessage(), + new List{ + objectType.getDescribe().getName() + } + ) + ); + } + } + /** + * FlsException represents a running user's lack of field level security to a specific field at a profile (or permission set) level + * Sharing and CRUD security issues will never cause this to be thrown. + **/ + public class FlsException extends SecurityException{ + private Schema.SObjectField m_fieldToken; + + private FlsException(OperationType operation, Schema.SObjectType objectType, Schema.SObjectField fieldToken){ + this.m_operation = operation; + this.m_objectType = objectType; + this.m_fieldToken = fieldToken; + if(operation == OperationType.CREATE) + this.setMessage(System.Label.fflib_security_error_field_not_insertable); + else if(operation == OperationType.READ) + this.setMessage(System.Label.fflib_security_error_field_not_readable); + else if(operation == OperationType.MODIFY) + this.setMessage(System.Label.fflib_security_error_field_not_updateable); + + this.setMessage( + String.format( + this.getMessage(), + new List{ + objectType.getDescribe().getName(), + fieldToken.getDescribe().getName() + } + ) + ); + } + } + + /** + * If set to true all check methods will always return void, and never throw exceptions. + * This should really only be set to true if an app-wide setting to disable in-apex + * FLS and CRUD checks exists and is enabled. + * Per security best practices setting BYPASS should be an a opt-in, and not the default behavior. + **/ + public static boolean BYPASS_INTERNAL_FLS_AND_CRUD = false; + + /** + * Check{Insert,Read,Update} methods check both FLS and CRUD + **/ + + /** + * Checks both insert FLS and CRUD for the specified object type and fields. + * @exception FlsException if the running user does not have insert rights to any fields in {@code fieldNames}. + * @exception CrudException if the running user does not have insert rights to {@code objType} + **/ + public static void checkInsert(SObjectType objType, List fieldNames) + { + checkObjectIsInsertable(objType); + for (String fieldName : fieldNames) + { + checkFieldIsInsertable(objType, fieldName); + } + } + + /** + * Identical to {@link #checkInsert(SObjectType,List)}, except with SObjectField instead of String field references. + * @exception FlsException if the running user does not have insert rights to any fields in {@code fieldTokens}. + * @exception CrudException if the running user does not have insert rights to {@code objType} + **/ + public static void checkInsert(SObjectType objType, List fieldTokens) + { + checkObjectIsInsertable(objType); + for (SObjectField fieldToken : fieldTokens) + { + checkFieldIsInsertable(objType, fieldToken); + } + } + + /** + * Checks both read FLS and CRUD for the specified object type and fields. + * @exception FlsException if the running user does not have read rights to any fields in {@code fieldNames}. + * @exception CrudException if the running user does not have read rights to {@code objType} + **/ + public static void checkRead(SObjectType objType, List fieldNames) + { + checkObjectIsReadable(objType); + for (String fieldName : fieldNames) + { + checkFieldIsReadable(objType, fieldName); + } + } + + /** + * Identical to {@link #checkRead(SObjectType,List)}, except with SObjectField instead of String field references. + * @exception FlsException if the running user does not have read rights to any fields in {@code fieldTokens}. + * @exception CrudException if the running user does not have read rights to {@code objType} + **/ + public static void checkRead(SObjectType objType, List fieldTokens) + { + checkObjectIsReadable(objType); + for (SObjectField fieldToken : fieldTokens) + { + checkFieldIsReadable(objType, fieldToken); + } + } + + /** + * Checks both update FLS and CRUD for the specified object type and fields. + * @exception FlsException if the running user does not have update rights to any fields in {@code fieldNames}. + * @exception CrudException if the running user does not have update rights to {@code objType} + **/ + public static void checkUpdate(SObjectType objType, List fieldNames) + { + checkObjectIsUpdateable(objType); + for (String fieldName : fieldNames) + { + checkFieldIsUpdateable(objType, fieldName); + } + } + + /** + * Identical to {@link #checkUpdate(SObjectType,List)}, except with SObjectField instead of String field references. + * @exception FlsException if the running user does not have update rights to any fields in {@code fieldTokens}. + * @exception CrudException if the running user does not have update rights to {@code objType} + **/ + public static void checkUpdate(SObjectType objType, List fieldTokens) + { + checkObjectIsUpdateable(objType); + for (SObjectField fieldToken : fieldTokens) + { + checkFieldIsUpdateable(objType, fieldToken); + } + } + + /** + * CheckFieldIs* method check only FLS + **/ + + /** + * Checks insert field level security only (no CRUD) for the specified fields on {@code objType} + * @exception FlsException if the running user does not have insert rights to the {@code fieldName} field. + **/ + public static void checkFieldIsInsertable(SObjectType objType, String fieldName) + { + checkFieldIsInsertable(objType, fflib_SObjectDescribe.getDescribe(objType).getField(fieldName)); + } + + /** + * Identical to {@link #checkFieldIsInsertable(SObjectType,String)}, except with SObjectField instead of String field reference. + * @exception FlsException if the running user does not have insert rights to the {@code fieldName} field. + **/ + public static void checkFieldIsInsertable(SObjectType objType, SObjectField fieldToken) + { + checkFieldIsInsertable(objType, fieldToken.getDescribe()); + } + + /** + * Identical to {@link #checkFieldIsInsertable(SObjectType,String)}, except with DescribeFieldResult instead of String field reference. + * @exception FlsException if the running user does not have insert rights to the {@code fieldName} field. + **/ + public static void checkFieldIsInsertable(SObjectType objType, DescribeFieldResult fieldDescribe) + { + if (BYPASS_INTERNAL_FLS_AND_CRUD) + return; + if (!fieldDescribe.isCreateable()) + throw new FlsException(OperationType.CREATE, objType, fieldDescribe.getSObjectField()); + } + + /** + * Checks read field level security only (no CRUD) for the specified fields on {@code objType} + * @exception FlsException if the running user does not have read rights to the {@code fieldName} field. + **/ + public static void checkFieldIsReadable(SObjectType objType, String fieldName) + { + checkFieldIsReadable(objType, fflib_SObjectDescribe.getDescribe(objType).getField(fieldName)); + } + + /** + * Identical to {@link #checkFieldIsReadable(SObjectType,String)}, except with SObjectField instead of String field reference. + * @exception FlsException if the running user does not have read rights to the {@code fieldName} field. + **/ + public static void checkFieldIsReadable(SObjectType objType, SObjectField fieldToken) + { + checkFieldIsReadable(objType, fieldToken.getDescribe()); + } + + /** + * Identical to {@link #checkFieldIsReadable(SObjectType,String)}, except with DescribeFieldResult instead of String field reference. + * @exception FlsException if the running user does not have read rights to the {@code fieldName} field. + **/ + public static void checkFieldIsReadable(SObjectType objType, DescribeFieldResult fieldDescribe) + { + if (BYPASS_INTERNAL_FLS_AND_CRUD) + return; + if (!fieldDescribe.isAccessible()) + throw new FlsException(OperationType.READ, objType, fieldDescribe.getSObjectField()); + } + + + /** + * Checks update field level security only (no CRUD) for the specified fields on {@code objType} + * @exception FlsException if the running user does not have update rights to the {@code fieldName} field. + **/ + public static void checkFieldIsUpdateable(SObjectType objType, String fieldName) + { + checkFieldIsUpdateable(objType, fflib_SObjectDescribe.getDescribe(objType).getField(fieldName)); + } + + /** + * Identical to {@link #checkFieldIsUpdateable(SObjectType,String)}, except with SObjectField instead of String field reference. + * @exception FlsException if the running user does not have update rights to the {@code fieldName} field. + **/ + public static void checkFieldIsUpdateable(SObjectType objType, SObjectField fieldToken) + { + checkFieldIsUpdateable(objType, fieldToken.getDescribe()); + } + + /** + * Identical to {@link #checkFieldIsUpdateable(SObjectType,String)}, except with DescribeFieldResult instead of String field reference. + * @exception FlsException if the running user does not have update rights to the {@code fieldName} field. + **/ + public static void checkFieldIsUpdateable(SObjectType objType, DescribeFieldResult fieldDescribe) + { + if (BYPASS_INTERNAL_FLS_AND_CRUD) + return; + if (!fieldDescribe.isUpdateable()) + throw new FlsException(OperationType.MODIFY, objType, fieldDescribe.getSObjectField()); + } + + /** + * CheckObjectIs* methods check only CRUD + **/ + + /** + * Checks insert CRUD for the specified object type. + * @exception CrudException if the running uder does not have insert rights to the {@code objType} SObject. + **/ + public static void checkObjectIsInsertable(SObjectType objType) + { + if (BYPASS_INTERNAL_FLS_AND_CRUD) + return; + if (!objType.getDescribe().isCreateable()) + { + throw new CrudException(OperationType.CREATE, objType); + } + } + + /** + * Checks read CRUD for the specified object type. + * @exception CrudException if the running uder does not have read rights to the {@code objType} SObject. + **/ + public static void checkObjectIsReadable(SObjectType objType) + { + if (BYPASS_INTERNAL_FLS_AND_CRUD) + return; + if (!objType.getDescribe().isAccessible()) + throw new CrudException(OperationType.READ, objType); + } + + /** + * Checks update CRUD for the specified object type. + * @exception CrudException if the running uder does not have update rights to the {@code objType} SObject. + **/ + public static void checkObjectIsUpdateable(SObjectType objType) + { + if (BYPASS_INTERNAL_FLS_AND_CRUD) + return; + if (!objType.getDescribe().isUpdateable()) + throw new CrudException(OperationType.MODIFY, objType); + } + + /** + * Checks delete CRUD for the specified object type. + * @exception CrudException if the running uder does not have delete rights to the {@code objType} SObject. + **/ + public static void checkObjectIsDeletable(SObjectType objType) + { + if (BYPASS_INTERNAL_FLS_AND_CRUD) + return; + if (!objType.getDescribe().isDeletable()) + throw new CrudException(OperationType.DEL, objType); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SecurityUtils.cls-meta.xml b/rolluptool/src/classes/fflib_SecurityUtils.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SecurityUtils.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_SecurityUtilsTest.cls b/rolluptool/src/classes/fflib_SecurityUtilsTest.cls new file mode 100644 index 00000000..65d072a8 --- /dev/null +++ b/rolluptool/src/classes/fflib_SecurityUtilsTest.cls @@ -0,0 +1,267 @@ +/** + * Copyright (c) 2014, FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@isTest +private class fflib_SecurityUtilsTest { + static User setupTestUser(String profileName){ + //username global uniqueness is still enforced in tests + //make sure we get something unique to avoid issues with parallel tests + String uniqueness = DateTime.now()+':'+Math.random(); + try{ + throw new NullPointerException(); + }catch(Exception e){ + uniqueness += e.getStackTraceString(); //includes the top level test method name without having to pass it + } + Profile p = [SELECT id, Name FROM Profile WHERE Name = :profileName]; + User result = new User( + username=UserInfo.getUserId()+'.'+uniqueness.HashCode()+'@'+UserInfo.getOrganizationId()+'.sfdcOrg', + alias = 'testExec', + email='apextests@example.com', + emailencodingkey='UTF-8', + lastname='Testing', + languagelocalekey='en_US', + localesidkey='en_US', + profileid = p.Id, + timezonesidkey='America/Los_Angeles' + ); + insert result; + return result; + } + + @isTest + static void readonly_field_access() { + User testUser = setupTestUser('Read Only'); + System.runAs(testUser){ + { + fflib_SecurityUtils.SecurityException ex; + try{ + fflib_SecurityUtils.checkFieldIsInsertable(Account.SObjectType, 'naMe'); + }catch(fflib_SecurityUtils.SecurityException e){ + ex = e; + } + System.assertNotEquals(null, ex, 'Read only profile should not be able to insert Account.Name'); + System.assert(ex instanceof fflib_SecurityUtils.FlsException, 'Expected an FlsException, got '+ex.getTypeName()); + } + { + fflib_SecurityUtils.SecurityException ex; + try{ + fflib_SecurityUtils.checkFieldIsReadable(Contact.SObjectType, 'LastNAME'); + }catch(fflib_SecurityUtils.SecurityException e){ + ex = e; + } + System.assertEquals(null, ex, 'Read only profile should be able to read Contact.LastName'); + } + { + fflib_SecurityUtils.SecurityException ex; + try{ + fflib_SecurityUtils.checkFieldIsUpdateable(Lead.SObjectType, 'cOMPANY'); + }catch(fflib_SecurityUtils.SecurityException e){ + ex = e; + } + System.assertNotEquals(null, ex, 'Read only profile should not be able to update Lead.Company'); + System.assert(ex instanceof fflib_SecurityUtils.FlsException, 'Expected an FlsException, got '+ex.getTypeName()); + } + + fflib_SecurityUtils.BYPASS_INTERNAL_FLS_AND_CRUD = true; + { //no exceptions, despite no rights + fflib_SecurityUtils.checkFieldIsInsertable(Account.SObjectType, 'naMe'); + fflib_SecurityUtils.checkFieldIsReadable(Contact.SObjectType, 'LastNAME'); + fflib_SecurityUtils.checkFieldIsUpdateable(Lead.SObjectType, 'cOMPANY'); + } + } + } + + @isTest + static void readonly_object_access() { + User testUser = setupTestUser('Read Only'); + System.runAs(testUser){ + { + fflib_SecurityUtils.SecurityException ex; + try{ + fflib_SecurityUtils.checkObjectIsInsertable(Account.SObjectType); + }catch(fflib_SecurityUtils.SecurityException e){ + ex = e; + } + System.assertNotEquals(null, ex, 'Read only profile should not be able to insert Account'); + System.assert(ex instanceof fflib_SecurityUtils.CrudException, 'Expected an CrudException, got '+ex.getTypeName()); + } + { + fflib_SecurityUtils.SecurityException ex; + try{ + fflib_SecurityUtils.checkObjectIsReadable(Contact.SObjectType); + }catch(fflib_SecurityUtils.SecurityException e){ + ex = e; + } + System.assertEquals(null, ex, 'Read only profile should be able to read Contact'); + } + { + fflib_SecurityUtils.SecurityException ex; + try{ + fflib_SecurityUtils.checkObjectIsUpdateable(Lead.SObjectType); + }catch(fflib_SecurityUtils.SecurityException e){ + ex = e; + } + System.assertNotEquals(null, ex, 'Read only profile should not be able to update Lead'); + System.assert(ex instanceof fflib_SecurityUtils.CrudException, 'Expected an CrudException, got '+ex.getTypeName()); + } + { + fflib_SecurityUtils.SecurityException ex; + try{ + fflib_SecurityUtils.checkObjectIsDeletable(Opportunity.SObjectType); + }catch(fflib_SecurityUtils.SecurityException e){ + ex = e; + } + System.assertNotEquals(null, ex, 'Read only profile should not be able to delete Opportunity'); + System.assert(ex instanceof fflib_SecurityUtils.CrudException, 'Expected an CrudException, got '+ex.getTypeName()); + } + + fflib_SecurityUtils.BYPASS_INTERNAL_FLS_AND_CRUD = true; + { //no exceptions, despite no rights + fflib_SecurityUtils.checkObjectIsInsertable(Account.SObjectType); + fflib_SecurityUtils.checkObjectIsReadable(Contact.SObjectType); + fflib_SecurityUtils.checkObjectIsUpdateable(Lead.SObjectType); + fflib_SecurityUtils.checkObjectIsDeletable(Opportunity.SObjectType); + } + } + } + + @isTest + static void readonly_objectAndField_access() { + User testUser = setupTestUser('Read Only'); + System.runAs(testUser){ + { + fflib_SecurityUtils.SecurityException ex; + try{ + fflib_SecurityUtils.checkInsert( + Account.SObjectType, + new List{ + 'Name', + 'ParentId', + 'ownerId' + } + ); + }catch(fflib_SecurityUtils.SecurityException e){ + ex = e; + } + System.assertNotEquals(null, ex, 'Read only profile should not be able to insert Account'); + System.assert(ex instanceof fflib_SecurityUtils.CrudException, 'Expected an CrudException, got '+ex.getTypeName()); + } + { + fflib_SecurityUtils.SecurityException ex; + try{ + fflib_SecurityUtils.checkRead( + Contact.SObjectType, + new List{ + 'LastName', + 'accountId', + 'ownerId' + } + ); + }catch(fflib_SecurityUtils.SecurityException e){ + ex = e; + } + System.assertEquals(null, ex, 'Read only profile should be able to read Contact'); + } + { + fflib_SecurityUtils.SecurityException ex; + try{ + fflib_SecurityUtils.checkUpdate( + Lead.SObjectType, + new List{ + 'LastName', + 'FirstNAMe', + 'cOMPANY' + } + ); + }catch(fflib_SecurityUtils.SecurityException e){ + ex = e; + } + System.assertNotEquals(null, ex, 'Read only profile should not be able to update Lead'); + System.assert(ex instanceof fflib_SecurityUtils.CrudException, 'Expected an CrudException, got '+ex.getTypeName()); + } + + fflib_SecurityUtils.BYPASS_INTERNAL_FLS_AND_CRUD = true; + { //no exceptions, despite no rights + fflib_SecurityUtils.checkInsert( + Account.SObjectType, + new List{ + 'Name', + 'Type', + 'ownerId' + } + ); + fflib_SecurityUtils.checkRead( + Contact.SObjectType, + new List{ + 'LastName', + 'accountId', + 'ownerId' + } + ); + fflib_SecurityUtils.checkUpdate( + Lead.SObjectType, + new List{ + 'LastName', + 'FirstNAMe', + 'cOMPANY' + } + ); + } + } + } + + @isTest + static void sysadmin_objectAndField_access() { + User testUser = setupTestUser('System Administrator'); + System.runAs(testUser){ + fflib_SecurityUtils.checkInsert( + Account.SObjectType, + new List{ + Account.SObjectType.fields.Name, + Account.SObjectType.fields.ParentId, + Account.SObjectType.fields.ownerId + } + ); + fflib_SecurityUtils.checkRead( + Contact.SObjectType, + new List{ + Contact.SObjectType.fields.LastName, + Contact.SObjectType.fields.accountId, + Contact.SObjectType.fields.ownerId + } + ); + fflib_SecurityUtils.checkUpdate( + Lead.SObjectType, + new List{ + Lead.SObjectType.fields.LastName, + Lead.SObjectType.fields.FirstNAMe, + Lead.SObjectType.fields.cOMPANY + } + ); + } + } + +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_SecurityUtilsTest.cls-meta.xml b/rolluptool/src/classes/fflib_SecurityUtilsTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_SecurityUtilsTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_StringBuilder.cls b/rolluptool/src/classes/fflib_StringBuilder.cls new file mode 100644 index 00000000..a20bea3d --- /dev/null +++ b/rolluptool/src/classes/fflib_StringBuilder.cls @@ -0,0 +1,157 @@ +/** + * Copyright (c), FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +/** + * Helper class, roughly based on the Java version, but subclassed to assist in a number of use cases in this library + * + * NOTE: Aspects of this where developed before recent improvements to String handling, as such could likely be enhanced at this stage. + **/ +public virtual class fflib_StringBuilder +{ + protected List buffer = new List(); + + /** + * Construct an empty StringBuilder + **/ + public fflib_StringBuilder() {} + + /** + * Construct a StringBuilder with the given values + **/ + public fflib_StringBuilder(List values) + { + add(values); + } + + /** + * Add the given values to the StringBuilder + **/ + public virtual void add(List values) + { + buffer.addAll(values); + } + + /** + * Add the given value to the StringBuilder + **/ + public virtual void add(String value) + { + buffer.add(value); + } + + public virtual override String toString() + { + return String.join(buffer, ''); + } + + /** + * Return the state of the StringBuilder + **/ + public virtual String getStringValue() + { + return toString(); + } + + /** + * Subclasses the StringBuilder to produce a comma delimited contactination of strings + **/ + public virtual with sharing class CommaDelimitedListBuilder extends fflib_StringBuilder + { + String itemPrefix = ''; + String delimiter = ','; + + public CommaDelimitedListBuilder() {} + + public CommaDelimitedListBuilder(List values) + { + super(values); + } + + public void setItemPrefix(String itemPrefix) + { + this.itemPrefix = itemPrefix; + } + + public void setDelimiter(String delimiter) + { + this.delimiter = delimiter; + } + + public String getStringValue(String itemPrefix) + { + setItemPrefix(itemPrefix); + return toString(); + } + + public override String toString() + { + return itemPrefix + String.join(buffer, delimiter + itemPrefix); + } + } + + /** + * Subclasses the StringCommaDelimitedBuilder to accept native SObjectField tokens and optional FieldSet definitions to concatinate when building queries + **/ + public virtual with sharing class FieldListBuilder extends CommaDelimitedListBuilder + { + public FieldListBuilder(List values) + { + this(values, null); + } + + public FieldListBuilder(List values, List fieldSets) + { + // Create a distinct set of fields (or field paths) to select + for(Schema.SObjectField value : values) + add(String.valueOf(value)); // Alternative to value.getDescribe().getName() + + if(fieldSets!=null) + for(Schema.Fieldset fieldSet : fieldSets) + for(Schema.FieldSetMember fieldSetMember : fieldSet.getFields()) + add(fieldSetMember.getFieldPath()); + } + } + + /** + * Subclasses the FieldListBuilder to auto sense and include when needed the CurrencyIsoCode field in the field list + **/ + public with sharing class MultiCurrencyFieldListBuilder extends FieldListBuilder + { + public MultiCurrencyFieldListBuilder(List values) + { + this(values, null); + } + + public MultiCurrencyFieldListBuilder(List values, List fieldSets) + { + super(values, fieldSets); + + // Dynamically add CurrencyIsoCode field for mult-currency organisations + if(Userinfo.isMultiCurrencyOrganization()) + add('CurrencyIsoCode'); + } + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_StringBuilder.cls-meta.xml b/rolluptool/src/classes/fflib_StringBuilder.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_StringBuilder.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/classes/fflib_StringBuilderTest.cls b/rolluptool/src/classes/fflib_StringBuilderTest.cls new file mode 100644 index 00000000..4b48e377 --- /dev/null +++ b/rolluptool/src/classes/fflib_StringBuilderTest.cls @@ -0,0 +1,115 @@ +/** + * Copyright (c), FinancialForce.com, inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the FinancialForce.com, inc nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + +@IsTest +private with sharing class fflib_StringBuilderTest +{ + static testMethod void testfflib_StringBuilder1() + { + fflib_StringBuilder sb = new fflib_StringBuilder(); + sb.add('this is a string'); + sb.add(new List{', which is made',' up from\r ','a number of smaller strings', '. 5 in this case!'}); + system.assertEquals(sb.getStringValue(),'this is a string, which is made up from\r a number of smaller strings. 5 in this case!'); + } + + static testMethod void testfflib_StringBuilder2() + { + fflib_StringBuilder sb = new fflib_StringBuilder(new List{'apples',' and ','pears',': stairs. '}); + sb.add('this is a string'); + sb.add(new List{', which is made',' up from\r ','a number of smaller strings', '. 5 in this case!'}); + system.assertEquals(sb.getStringValue(),'apples and pears: stairs. this is a string, which is made up from\r a number of smaller strings. 5 in this case!'); + } + + static testMethod void testCommaDelimitedBuilder1() + { + fflib_StringBuilder.CommaDelimitedListBuilder sb = new fflib_StringBuilder.CommaDelimitedListBuilder(); + sb.add('a'); + sb.add(new List{'b','c','d'}); + system.assertEquals(sb.getStringValue(),'a,b,c,d'); + } + + static testMethod void testCommaDelimitedBuilder2() + { + fflib_StringBuilder.CommaDelimitedListBuilder sb = new fflib_StringBuilder.CommaDelimitedListBuilder(new List{'x','y'}); + sb.add('a'); + sb.add(new List{'b','c','d'}); + system.assertEquals(sb.getStringValue(),'x,y,a,b,c,d'); + } + + static testMethod void testCommanDelimitedBuilderWithItemPrefix() + { + fflib_StringBuilder.CommaDelimitedListBuilder sb = new fflib_StringBuilder.CommaDelimitedListBuilder(new List{'x','y'}); + sb.add('a'); + sb.add(new List{'b','c','d'}); + system.assertEquals(sb.getStringValue('$'),'$x,$y,$a,$b,$c,$d'); + } + + static testMethod void testCommanDelimitedBuilderWithAlternativeDelimiter() + { + fflib_StringBuilder.CommaDelimitedListBuilder sb = new fflib_StringBuilder.CommaDelimitedListBuilder(new List{'x','y'}); + sb.setDelimiter(';'); + sb.add('a'); + sb.add(new List{'b','c','d'}); + system.assertEquals(sb.getStringValue(),'x;y;a;b;c;d'); + } + + static testMethod void testCommanDelimitedBuilderWithAlternativeDelimiterAndPrefix() + { + fflib_StringBuilder.CommaDelimitedListBuilder sb = new fflib_StringBuilder.CommaDelimitedListBuilder(new List{'x','y'}); + sb.setItemPrefix('#'); + sb.setDelimiter(':'); + sb.add('a'); + sb.add(new List{'b','c','d'}); + system.assertEquals(sb.getStringValue(),'#x:#y:#a:#b:#c:#d'); + } + + static testMethod void testFieldListBuilder() + { + List fields = new List { Account.Name, Account.Id, Account.AccountNumber, Account.AccountNumber, Account.AnnualRevenue }; + fflib_StringBuilder.FieldListBuilder sb = new fflib_StringBuilder.FieldListBuilder(fields); + List fieldList = sb.getStringValue().split(','); + Set fieldSet = new Set(fieldList); + system.assertEquals(4, fieldSet.size()); + system.assert(fieldSet.contains('Name')); + system.assert(fieldSet.contains('Id')); + system.assert(fieldSet.contains('AccountNumber')); + system.assert(fieldSet.contains('AnnualRevenue')); + } + + static testMethod void testMultiCurrencyFieldListBuilder() + { + List fields = new List { Account.Name, Account.Id, Account.AccountNumber, Account.AnnualRevenue }; + fflib_StringBuilder.MultiCurrencyFieldListBuilder sb = new fflib_StringBuilder.MultiCurrencyFieldListBuilder(fields); + List fieldList = sb.getStringValue().split(','); + Set fieldSet = new Set(fieldList); + system.assert(fieldSet.contains('Name')); + system.assert(fieldSet.contains('Id')); + system.assert(fieldSet.contains('AccountNumber')); + system.assert(fieldSet.contains('AnnualRevenue')); + if(UserInfo.isMultiCurrencyOrganization()) + system.assert(fieldSet.contains('CurrencyIsoCode')); + } +} \ No newline at end of file diff --git a/rolluptool/src/classes/fflib_StringBuilderTest.cls-meta.xml b/rolluptool/src/classes/fflib_StringBuilderTest.cls-meta.xml new file mode 100644 index 00000000..49358969 --- /dev/null +++ b/rolluptool/src/classes/fflib_StringBuilderTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 37.0 + Active + diff --git a/rolluptool/src/components/zip.component-meta.xml b/rolluptool/src/components/zip.component-meta.xml index d8da543d..abf64e1c 100644 --- a/rolluptool/src/components/zip.component-meta.xml +++ b/rolluptool/src/components/zip.component-meta.xml @@ -1,5 +1,10 @@ - 28.0 + 37.0 + + 1 + 7 + sf_com_apps + diff --git a/rolluptool/src/components/zipEntry.component-meta.xml b/rolluptool/src/components/zipEntry.component-meta.xml index d068a2be..66931a7b 100644 --- a/rolluptool/src/components/zipEntry.component-meta.xml +++ b/rolluptool/src/components/zipEntry.component-meta.xml @@ -1,5 +1,10 @@ - 28.0 + 37.0 + + 1 + 7 + sf_com_apps + diff --git a/rolluptool/src/labels/CustomLabels.labels b/rolluptool/src/labels/CustomLabels.labels new file mode 100644 index 00000000..d4002b0a --- /dev/null +++ b/rolluptool/src/labels/CustomLabels.labels @@ -0,0 +1,86 @@ + + + + fflib_QueryFactory_crossobject_fieldsets_not_allowed_error + en_US + false + Error when selecting a cross-object fieldsset is not allowed and attempted. + Cross-object fields not allowed and field "{0}" is a cross-object field. + + + fflib_QueryFactory_fieldset_wrong_sobject_error + en_US + false + Error when selecting a field set for a different sobject type. + Field set "{0}" is not for SObject type "{1}" + + + fflib_QueryFactory_recursive_subquery_error + en_US + false + Presented when attempting to nest subqueries. + Invalid call to subselectQuery. You may not add a subselect query to a subselect query. + + + fflib_QueryFactory_subquery_invalid_relationship + en_US + false + Presented when attempting to create a subquery from an invalid relationship. + Invalid call to subselectQuery. Invalid relationship for table. + + + fflib_security_error_field_not_insertable + security,error + en_US + true + fflib_security_error_field_not_insertable + You do not have permission to insert field {1} on {0} + + + fflib_security_error_field_not_readable + security,error + en_US + true + fflib_security_error_field_not_readable + You do not have permission to read the field {1} on {0} + + + fflib_security_error_field_not_updateable + security,error + en_US + true + fflib_security_error_field_not_updateable + You do not have permission to update the field {1} on {0} + + + fflib_security_error_object_not_deletable + en_US + true + fflib_security_error_object_not_deletable + You do not have permission to delete {0} + + + fflib_security_error_object_not_insertable + security,error + en_US + true + fflib_security_error_object_not_insertable + You do not have permission to insert {0} + + + fflib_security_error_object_not_readable + security,error + en_US + true + fflib_security_error_object_not_readable + You do not have permission to read {0} + + + fflib_security_error_object_not_updateable + security,error + en_US + true + fflib_security_error_object_not_updateable + You do not have permission to update {0} + + diff --git a/rolluptool/src/layouts/LookupChild__c-Lookup Child Layout.layout b/rolluptool/src/layouts/LookupChild__c-Lookup Child Layout.layout index 853c776f..e7900826 100644 --- a/rolluptool/src/layouts/LookupChild__c-Lookup Child Layout.layout +++ b/rolluptool/src/layouts/LookupChild__c-Lookup Child Layout.layout @@ -18,6 +18,22 @@ Edit LookupParent__c + + Edit + Color__c + + + Edit + LookupParent2__c + + + Edit + Description__c + + + Edit + Description2__c + diff --git a/rolluptool/src/layouts/LookupParent__c-Lookup Parent Layout.layout b/rolluptool/src/layouts/LookupParent__c-Lookup Parent Layout.layout index e66a0833..65c9f7db 100644 --- a/rolluptool/src/layouts/LookupParent__c-Lookup Parent Layout.layout +++ b/rolluptool/src/layouts/LookupParent__c-Lookup Parent Layout.layout @@ -1,5 +1,6 @@ + Submit false false @@ -14,6 +15,22 @@ Edit Total__c + + Edit + Total2__c + + + Edit + Colours__c + + + Edit + Descriptions__c + + + Edit + Descriptions2__c + @@ -43,9 +60,10 @@ - false + true false true + @@ -55,9 +73,19 @@ NAME LookupChild__c.LookupParent__c + + NAME + LookupChild__c.LookupParent2__c + false false false false false + + 00hb0000000gOR4 + 4 + 0 + Default + diff --git a/rolluptool/src/layouts/LookupRollupCalculateJob__c-Lookup Rollup Calculate Job Layout.layout b/rolluptool/src/layouts/LookupRollupCalculateJob__c-Lookup Rollup Calculate Job Layout.layout new file mode 100644 index 00000000..f25702e3 --- /dev/null +++ b/rolluptool/src/layouts/LookupRollupCalculateJob__c-Lookup Rollup Calculate Job Layout.layout @@ -0,0 +1,59 @@ + + + + false + false + true + + + + Readonly + Name + + + Required + LookupRollupSummaryId__c + + + + + Edit + OwnerId + + + + + + false + false + true + + + + Readonly + CreatedById + + + + + Readonly + LastModifiedById + + + + + + false + false + true + + + + + + false + false + false + false + false + diff --git a/rolluptool/src/layouts/LookupRollupSummary2__mdt-Lookup Rollup Summary Layout.layout b/rolluptool/src/layouts/LookupRollupSummary2__mdt-Lookup Rollup Summary Layout.layout new file mode 100644 index 00000000..4880b4f1 --- /dev/null +++ b/rolluptool/src/layouts/LookupRollupSummary2__mdt-Lookup Rollup Summary Layout.layout @@ -0,0 +1,204 @@ + + + + false + false + true + + + + Required + MasterLabel + + + Required + DeveloperName + + + + + Edit + IsProtected + + + Required + NamespacePrefix + + + + + + false + false + true + + + + Readonly + CreatedById + + + + + Readonly + LastModifiedById + + + + + + true + true + true + + + + Required + ParentObject__c + + + Required + ChildObject__c + + + + + Required + RelationshipField__c + + + Edit + RelationshipCriteria__c + + + Edit + RelationshipCriteriaFields__c + + + + + + true + true + true + + + + Required + FieldToAggregate__c + + + Edit + FieldToOrderBy__c + + + Required + AggregateOperation__c + + + Required + AggregateResultField__c + + + Edit + AggregateAllRows__c + + + Edit + RowLimit__c + + + + + Edit + Active__c + + + Required + CalculationMode__c + + + Required + CalculationSharingMode__c + + + + + + true + true + true + + + + Edit + ConcatenateDelimiter__c + + + + + + + true + true + true + + + + Edit + Description__c + + + + + + true + true + true + + + + Edit + TestCodeSeeAllData__c + + + + + + false + false + true + + + + + + + true + false + false + + + + + + + + AggregateResultField__c + ChildObject__c + FieldToAggregate__c + ParentObject__c + RelationshipField__c + + false + false + false + false + false + + 00hb000000TUyKh + 4 + 0 + Default + + diff --git a/rolluptool/src/layouts/LookupRollupSummaryScheduleItems__c-Lookup Rollup Summary Queue Layout.layout b/rolluptool/src/layouts/LookupRollupSummaryScheduleItems__c-Lookup Rollup Summary Queue Layout.layout index fc74d924..54e52232 100644 --- a/rolluptool/src/layouts/LookupRollupSummaryScheduleItems__c-Lookup Rollup Summary Queue Layout.layout +++ b/rolluptool/src/layouts/LookupRollupSummaryScheduleItems__c-Lookup Rollup Summary Queue Layout.layout @@ -14,6 +14,10 @@ Required LookupRollupSummary__c + + Edit + LookupRollupSummary2__c + Edit ParentId__c @@ -50,9 +54,10 @@ - false + true false true + @@ -63,4 +68,10 @@ false false false + + 00hb0000000gNhK + 4 + 0 + Default + diff --git a/rolluptool/src/layouts/LookupRollupSummary__c-Lookup Rollup Summary Layout.layout b/rolluptool/src/layouts/LookupRollupSummary__c-Lookup Rollup Summary Layout.layout index f645bc83..0e6e2c1f 100644 --- a/rolluptool/src/layouts/LookupRollupSummary__c-Lookup Rollup Summary Layout.layout +++ b/rolluptool/src/layouts/LookupRollupSummary__c-Lookup Rollup Summary Layout.layout @@ -2,6 +2,7 @@ EnhancedEdit Calculate + Schedule_Calculate ManageChildTrigger Submit @@ -18,15 +19,19 @@ Readonly CreatedById + + Readonly + LastModifiedById + Edit - OwnerId + UniqueName__c - Readonly - LastModifiedById + Edit + OwnerId @@ -72,6 +77,10 @@ Required FieldToAggregate__c + + Edit + FieldToOrderBy__c + Required AggregateOperation__c @@ -80,6 +89,14 @@ Required AggregateResultField__c + + Edit + AggregateAllRows__c + + + Edit + RowLimit__c + @@ -91,10 +108,24 @@ CalculationMode__c - Readonly - CalculateJobId__c + Required + CalculationSharingMode__c + + + + + + true + true + true + + + + Edit + ConcatenateDelimiter__c + @@ -110,6 +141,23 @@ + + true + true + true + + + + Edit + TestCode__c + + + Edit + TestCodeSeeAllData__c + + + + false false diff --git a/rolluptool/src/objects/DeclarativeLookupRollupSummaries__c.object b/rolluptool/src/objects/DeclarativeLookupRollupSummaries__c.object index 52dcdd82..b3fd7476 100644 --- a/rolluptool/src/objects/DeclarativeLookupRollupSummaries__c.object +++ b/rolluptool/src/objects/DeclarativeLookupRollupSummaries__c.object @@ -1,7 +1,6 @@ Hierarchy - Public false CalculateJobScopeSize__c @@ -12,9 +11,19 @@ 6 true 0 + false Number false + + HideManageLookupRollupSummariesInfo__c + false + false + false + + false + Checkbox + ScheduledJobScopeSize__c 100 @@ -24,8 +33,10 @@ 6 true 0 + false Number false + Public diff --git a/rolluptool/src/objects/LookupChild__c.object b/rolluptool/src/objects/LookupChild__c.object index bda48875..24c5dd2e 100644 --- a/rolluptool/src/objects/LookupChild__c.object +++ b/rolluptool/src/objects/LookupChild__c.object @@ -4,6 +4,10 @@ Accept Default + + CancelEdit + Default + Clone Default @@ -16,6 +20,10 @@ Edit Default + + Follow + Default + List Default @@ -24,6 +32,10 @@ New Default + + SaveEdit + Default + Tab Default @@ -32,30 +44,103 @@ View Default + false + SYSTEM Deployed + false false + true false false false + true + true + true Amount__c + false false 18 false 2 + false Number false + + Color__c + false + false + + + + Red + false + + + Yellow + false + + + Green + false + + + Blue + false + + false + + false + Picklist + + + Description2__c + false + false + + 255 + false + false + Text + false + + + Description__c + false + false + + 255 + false + false + Text + false + + + LookupParent2__c + SetNull + false + false + + LookupParent__c + Lookup Children (Lookup Parent 2) + LookupChildren2 + false + false + Lookup + LookupParent__c SetNull + false false LookupParent__c Lookup Children LookupChildren false + false Lookup @@ -65,5 +150,5 @@ Lookup Children - ReadWrite + Private diff --git a/rolluptool/src/objects/LookupParent__c.object b/rolluptool/src/objects/LookupParent__c.object index a062267d..0487ba95 100644 --- a/rolluptool/src/objects/LookupParent__c.object +++ b/rolluptool/src/objects/LookupParent__c.object @@ -4,6 +4,10 @@ Accept Default + + CancelEdit + Default + Clone Default @@ -16,6 +20,10 @@ Edit Default + + Follow + Default + List Default @@ -24,6 +32,10 @@ New Default + + SaveEdit + Default + Tab Default @@ -32,22 +44,98 @@ View Default + false + SYSTEM Deployed + false false + true false false false + true + true + true + + Colours__c + false + false + + + + Red + false + + + Yellow + false + + + Green + false + + + Blue + false + + false + + false + MultiselectPicklist + 4 + + + Descriptions2__c + false + false + + 255 + false + false + Text + false + + + Descriptions__c + false + false + + 255 + false + false + Text + false + + + Total2__c + false + false + + 18 + false + 2 + false + Number + false + Total__c + false false 18 false 2 + false Number false + + All + Everything + + Text diff --git a/rolluptool/src/objects/LookupRollupCalculateJob__c.object b/rolluptool/src/objects/LookupRollupCalculateJob__c.object new file mode 100644 index 00000000..5756fbcc --- /dev/null +++ b/rolluptool/src/objects/LookupRollupCalculateJob__c.object @@ -0,0 +1,86 @@ + + + + Accept + Default + + + CancelEdit + Default + + + Clone + Default + + + Delete + Default + + + Edit + Default + + + Follow + Default + + + List + Default + + + New + Default + + + SaveEdit + Default + + + Tab + Default + + + View + Default + + false + SYSTEM + Deployed + false + false + false + false + false + false + true + false + false + + LookupRollupSummaryId__c + false + false + This can either be the Custom Object record ID, or the Custom Metadata Developer Name for a currently being executed Calculate Job. + false + + 80 + true + false + Text + true + + + + All + Everything + + + + LRCJ-{00000000} + + AutoNumber + + Lookup Rollup Calculate Jobs + + ReadWrite + diff --git a/rolluptool/src/objects/LookupRollupSummary2__mdt.object b/rolluptool/src/objects/LookupRollupSummary2__mdt.object new file mode 100644 index 00000000..75af90fa --- /dev/null +++ b/rolluptool/src/objects/LookupRollupSummary2__mdt.object @@ -0,0 +1,214 @@ + + + + Active__c + false + false + false + DeveloperControlled + For Realtime rollups can only be set when the Child Apex Trigger has been deployed. + + Checkbox + + + AggregateAllRows__c + false + false + false + SubscriberControlled + Includes child records that have been archived by the system and/or placed in the recycle bin. + + Checkbox + + + AggregateOperation__c + false + false + DeveloperControlled + Rollup operation. + + 32 + false + Text + false + + + AggregateResultField__c + false + false + DeveloperControlled + API name of the field that will store the result of the rollup on the Parent Object, e.g. AnnualRevenue + + 80 + true + Text + false + + + CalculationMode__c + false + false + DeveloperControlled + Realtime mode requires an Apex Trigger to be deployed for the Child Object. Click Manage Child Trigger button to deploy. + + 32 + false + Text + false + + + CalculationSharingMode__c + false + false + DeveloperControlled + Determines if the Sharing Rules defined on the Child Object are considered when calculating the rollup. Default is User. + + 32 + false + Text + false + + + ChildObject__c + false + false + DeveloperControlled + API name of the Child Object, e.g. Opportunity + + 80 + true + Text + false + + + ConcatenateDelimiter__c + false + false + DeveloperControlled + Enter the character or characters to delimit values in the Field to Aggregate when rolling up text values into the Aggregate Result Field, enter BR() for new line. Only applies when using Concatenate operation. + + 32 + false + Text + false + + + Description__c + false + false + SubscriberControlled + + false + TextArea + + + FieldToAggregate__c + false + false + DeveloperControlled + API name of the field on the Child Object that contains the value to rollup, e.g. Amount + + 80 + true + Text + false + + + FieldToOrderBy__c + false + Examples: +1) Amount__c +2) Amount__c, Color__c ASC +3) Amount__c NULLS LAST, Color__c DESC NULLS LAST + false + DeveloperControlled + Only applicable when using the Concatenate, Concatenate Distinct, Last and First aggregate operations. Supports multiple fields (comma separated) with optional ASC/DESC and/or NULLS FIRST/LAST. + + 255 + false + Text + false + + + ParentObject__c + false + false + DeveloperControlled + API name of the Parent Object, e.g. Account + + 80 + true + Text + false + + + RelationshipCriteriaFields__c + false + false + DeveloperControlled + If you have specified a relationship criteria, you must confirm the fields referenced by it here on separate lines, for example for criteria StageName = 'Won' list StageName in this field. You do not need to specify the Field to Aggregate field however. + + false + TextArea + + + RelationshipCriteria__c + false + false + DeveloperControlled + SOQL WHERE clause applied when querying Child Object records, e.g. Amount > 200 + + 255 + false + Text + false + + + RelationshipField__c + false + false + DeveloperControlled + API name of the Lookup field on the Child Object relating to the Parent Object, e.g. AccountId + + 80 + true + Text + false + + + RowLimit__c + false + false + DeveloperControlled + Limits the number of rows used in the rollup. Applies only to the Last and Concatenate operators. + + 5 + false + 0 + Number + false + + + TestCodeSeeAllData__c + false + false + false + DeveloperControlled + Only use this option as a last resort to get the generated test or custom test code working. It is generally considered bad practice to make your test dependent on org data. Always try to create test data in the test code if possible. + + Checkbox + + + TestCode__c + false + false + DeveloperControlled + This tool utilises a dynamically generated Apex Trigger and by default a generated Apex Test. Use this field if instructed by a developer to replace the generated test code. See Wiki on GitHub. + + false + TextArea + + + Lookup Rollup Summaries + Public + diff --git a/rolluptool/src/objects/LookupRollupSummaryLog__c.object b/rolluptool/src/objects/LookupRollupSummaryLog__c.object index fa729d57..dc5d68b5 100644 --- a/rolluptool/src/objects/LookupRollupSummaryLog__c.object +++ b/rolluptool/src/objects/LookupRollupSummaryLog__c.object @@ -4,6 +4,10 @@ Accept Default + + CancelEdit + Default + Clone Default @@ -16,6 +20,10 @@ Edit Default + + Follow + Default + List Default @@ -24,6 +32,10 @@ New Default + + SaveEdit + Default + Tab Default @@ -32,18 +44,25 @@ View Default + false + SYSTEM Deployed false false + true false false false + true + true + true ErrorMessage__c false false 32768 + false LongTextArea 3 @@ -55,6 +74,7 @@ 18 true + false Text true @@ -65,6 +85,7 @@ 60 false + false Text false @@ -76,6 +97,7 @@ BlankAsZero false + false Text false diff --git a/rolluptool/src/objects/LookupRollupSummaryScheduleItems__c.object b/rolluptool/src/objects/LookupRollupSummaryScheduleItems__c.object index aa6bc7d6..08e711c4 100644 --- a/rolluptool/src/objects/LookupRollupSummaryScheduleItems__c.object +++ b/rolluptool/src/objects/LookupRollupSummaryScheduleItems__c.object @@ -4,6 +4,10 @@ Accept Default + + CancelEdit + Default + Clone Default @@ -16,6 +20,10 @@ Edit Default + + Follow + Default + List Default @@ -24,6 +32,10 @@ New Default + + SaveEdit + Default + Tab Default @@ -32,12 +44,30 @@ View Default + false + SYSTEM Deployed false false + true false false false + true + true + true + + LookupRollupSummary2__c + false + Either the Id (Custom Object) or Name (Custom Metadata) of the rollup summary definition that generated this schedule item. + false + + 80 + false + false + Text + false + LookupRollupSummary__c false @@ -46,6 +76,8 @@ LookupRollupSummary__c LookupRollupSummaryScheduleQueues 0 + false + false MasterDetail false @@ -56,6 +88,7 @@ 18 false + false Text false @@ -67,6 +100,7 @@ BlankAsZero false + false Text false @@ -78,10 +112,19 @@ 40 true + false Text true + + All + NAME + LookupRollupSummary__c + ParentRecord__c + Everything + + Text diff --git a/rolluptool/src/objects/LookupRollupSummary__c.object b/rolluptool/src/objects/LookupRollupSummary__c.object index b5f0663e..5a81df2a 100644 --- a/rolluptool/src/objects/LookupRollupSummary__c.object +++ b/rolluptool/src/objects/LookupRollupSummary__c.object @@ -4,6 +4,10 @@ Accept Default + + CancelEdit + Default + Clone Default @@ -16,6 +20,10 @@ Edit Default + + Follow + Default + List Default @@ -24,6 +32,10 @@ New Default + + SaveEdit + Default + Tab Default @@ -32,12 +44,18 @@ View Default + false + SYSTEM Deployed false false + true false false false + true + true + true Active__c false @@ -45,6 +63,17 @@ false For Realtime rollups can only be set when the Child Apex Trigger has been deployed. + false + Checkbox + + + AggregateAllRows__c + false + false + false + Includes child records that have been archived by the system and/or placed in the recycle bin. + + false Checkbox @@ -74,8 +103,29 @@ Count false + + Count Distinct + false + + + Concatenate + false + + + Concatenate Distinct + false + + + First + false + + + Last + false + false + false Picklist @@ -86,6 +136,7 @@ 80 true + false Text false @@ -97,6 +148,7 @@ 18 false + false Text false @@ -119,8 +171,33 @@ Developer false + + Process Builder + false + + false + + false + Picklist + + + CalculationSharingMode__c + false + false + Determines if the Sharing Rules defined on the Child Object are considered when calculating the rollup. Default is User. + + + + User + true + + + System + false + false + false Picklist @@ -131,14 +208,29 @@ 80 true + false + Text + false + + + ConcatenateDelimiter__c + false + false + Enter the character or characters to delimit values in the Field to Aggregate when rolling up text values into the Aggregate Result Field, enter BR() for new line. Only applies when using Concatenate operation. + + 32 + false + false Text false Description__c + false false 131072 + false LongTextArea 6 @@ -150,6 +242,23 @@ 80 true + false + Text + false + + + FieldToOrderBy__c + false + Examples: +1) Amount__c +2) Amount__c, Color__c ASC +3) Amount__c NULLS LAST, Color__c DESC NULLS LAST + false + Only applicable when using the Concatenate, Concatenate Distinct, Last and First aggregate operations. Supports multiple fields (comma separated) with optional ASC/DESC and/or NULLS FIRST/LAST. + + 255 + false + false Text false @@ -161,6 +270,7 @@ 80 true + false Text false @@ -171,6 +281,7 @@ If you have specified a relationship criteria, you must confirm the fields referenced by it here on separate lines, for example for criteria StageName = 'Won' list StageName in this field. You do not need to specify the Field to Aggregate field however. false + false TextArea @@ -181,6 +292,7 @@ 255 false + false Text false @@ -192,9 +304,56 @@ 80 true + false Text false + + RowLimit__c + false + false + Limits the number of rows used in the rollup. Applies only to the Last and Concatenate operators. + + 5 + false + 0 + false + Number + false + + + TestCodeSeeAllData__c + false + false + false + Only use this option as a last resort to get the generated test or custom test code working. It is generally considered bad practice to make your test dependent on org data. Always try to create test data in the test code if possible. + + false + Checkbox + + + TestCode__c + false + false + This tool utilises a dynamically generated Apex Trigger and by default a generated Apex Test. Use this field if instructed by a developer to replace the generated test code. For more information see the tools Wiki on GitHub. + + 32768 + false + LongTextArea + 12 + + + UniqueName__c + false + false + false + + 80 + false + false + Text + true + All @@ -255,4 +414,15 @@ managetrigger false + + Schedule_Calculate + online + button + 600 + page + Schedule Calculate + sidebar + rollupscheduledcalculate + false + diff --git a/rolluptool/src/package.xml b/rolluptool/src/package.xml index 904cc1ec..47f44527 100644 --- a/rolluptool/src/package.xml +++ b/rolluptool/src/package.xml @@ -1,83 +1,51 @@ - + - ApexClassesSelector - ApexTriggersSelector - AsyncApexJobsSelector - LREngine - MetadataService - MetadataServiceTest - RollupCalculateController - RollupCalculateJob - RollupController - RollupControllerTest - RollupJob - RollupJobTest - RollupService - RollupServiceException - RollupServiceTest - RollupServiceTest2 - RollupServiceTest3 - RollupSummaries - RollupSummariesSelector - RollupSummariesTest - RollupSummaryEnhancedController - RollupSummaryEnhancedControllerTest - RollupSummaryScheduleItemsSelector - SObjectDomain - SObjectDomainTest - SObjectSelector - SObjectSelectorTest - StringBuilder - TestContext - TestLREngine - WelcomeController - WelcomeControllerTest + * ApexClass - zip - zipEntry + * ApexComponent - managetrigger - rollupcalculate - rollupsummaryenhanced - rollupsummaryenhancednew - welcome + * ApexPage - RollupServiceTest2Trigger - RollupServiceTest3Trigger - RollupServiceTestTrigger - RollupSummariesTrigger + * ApexTrigger * - CustomApplication + StaticResource - * + DeclarativeLookupRollupSummaries__c + LookupChild__c + LookupParent__c + LookupRollupCalculateJob__c + LookupRollupSummary__c + LookupRollupSummaryLog__c + LookupRollupSummaryScheduleItems__c + LookupRollupSummary2__mdt CustomObject - Welcome - CustomPageWebLink + LookupRollupCalculateJob__c-Lookup Rollup Calculate Job Layout + LookupRollupSummary__c-Lookup Rollup Summary Layout + LookupRollupSummary2__mdt-Lookup Rollup Summary Layout + LookupRollupSummaryLog__c-Lookup Rollup Summary Log Layout + LookupRollupSummaryScheduleItems__c-Lookup Rollup Summary Queue Layout + Layout * CustomTab - LookupChild__c-Lookup Child Layout - LookupParent__c-Lookup Parent Layout - LookupRollupSummaryLog__c-Lookup Rollup Summary Log Layout - LookupRollupSummaryScheduleItems__c-Lookup Rollup Summary Queue Layout - LookupRollupSummary__c-Lookup Rollup Summary Layout - Layout + DeclarativeLookupRollupSummaries + CustomApplication LookupRollupSummariesFull @@ -85,8 +53,12 @@ PermissionSet - jszip - StaticResource + * + CustomPageWebLink + + + CustomLabels + CustomLabels - 28.0 + 37.0 diff --git a/rolluptool/src/pages/managelookuprollupsummaries.page b/rolluptool/src/pages/managelookuprollupsummaries.page new file mode 100644 index 00000000..b79880bd --- /dev/null +++ b/rolluptool/src/pages/managelookuprollupsummaries.page @@ -0,0 +1,178 @@ + + + + Classic Lookup Rollup Summaries  + + + Return to the Welcome page + + +   + + + + +

+ + + + + + + + + + + + +

+
+ +
+ + + + + +
+
+ +
+ + + + + + + +
+
+ +
+ + + + + +
+
+ +
+ + + + + +
+
+ +
+ + + + + + + + + + + + + + + + +
+
+ +
+ + + + + + + + + + + + + +
+
+ + + +
+ + + + + +
+
+ + + +
+ + + + + +
+
+ + + +
+ + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rolluptool/src/pages/managelookuprollupsummaries.page-meta.xml b/rolluptool/src/pages/managelookuprollupsummaries.page-meta.xml new file mode 100644 index 00000000..7570f417 --- /dev/null +++ b/rolluptool/src/pages/managelookuprollupsummaries.page-meta.xml @@ -0,0 +1,12 @@ + + + 37.0 + false + false + + + 1 + 7 + sf_com_apps + + diff --git a/rolluptool/src/pages/managetrigger.page b/rolluptool/src/pages/managetrigger.page index f5325bda..0ce18a52 100644 --- a/rolluptool/src/pages/managetrigger.page +++ b/rolluptool/src/pages/managetrigger.page @@ -31,13 +31,29 @@ - + Return to the Welcome page - + + + + + + + + + + + + +
{!ParentTriggerCode}
+
+ +
{!ParentTriggerTestCode}
+
{!TriggerCode}
@@ -52,10 +68,16 @@ + + + + + + diff --git a/rolluptool/src/pages/managetrigger.page-meta.xml b/rolluptool/src/pages/managetrigger.page-meta.xml index 1650e5f6..a45bf86e 100644 --- a/rolluptool/src/pages/managetrigger.page-meta.xml +++ b/rolluptool/src/pages/managetrigger.page-meta.xml @@ -1,10 +1,12 @@ - 28.0 + 37.0 + false + false 1 - 5 - umlcanvas + 7 + sf_com_apps diff --git a/rolluptool/src/pages/managetriggermdt.page b/rolluptool/src/pages/managetriggermdt.page new file mode 100644 index 00000000..ca9305b0 --- /dev/null +++ b/rolluptool/src/pages/managetriggermdt.page @@ -0,0 +1,88 @@ + + + + + + + + + + + Return to the Welcome page + + + + + + + + + + + + + + +
{!ParentTriggerCode}
+
+ +
{!ParentTriggerTestCode}
+
+ +
{!TriggerCode}
+
+ +
{!TriggerTestCode}
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
\ No newline at end of file diff --git a/rolluptool/src/pages/managetriggermdt.page-meta.xml b/rolluptool/src/pages/managetriggermdt.page-meta.xml new file mode 100644 index 00000000..9396c98c --- /dev/null +++ b/rolluptool/src/pages/managetriggermdt.page-meta.xml @@ -0,0 +1,12 @@ + + + 37.0 + false + false + + + 1 + 7 + sf_com_apps + + diff --git a/rolluptool/src/pages/rollupcalculate.page b/rolluptool/src/pages/rollupcalculate.page index 120a99a4..86bfa381 100644 --- a/rolluptool/src/pages/rollupcalculate.page +++ b/rolluptool/src/pages/rollupcalculate.page @@ -29,7 +29,9 @@ +

Filter master object using WHERE clause (OPTIONAL):

+

- + \ No newline at end of file diff --git a/rolluptool/src/pages/rollupcalculate.page-meta.xml b/rolluptool/src/pages/rollupcalculate.page-meta.xml index c987ed36..2babe434 100644 --- a/rolluptool/src/pages/rollupcalculate.page-meta.xml +++ b/rolluptool/src/pages/rollupcalculate.page-meta.xml @@ -1,5 +1,12 @@ - 28.0 + 37.0 + false + false + + 1 + 7 + sf_com_apps + diff --git a/rolluptool/src/pages/rollupcalculatemdt.page b/rolluptool/src/pages/rollupcalculatemdt.page new file mode 100644 index 00000000..f4b80039 --- /dev/null +++ b/rolluptool/src/pages/rollupcalculatemdt.page @@ -0,0 +1,37 @@ + + + + + +

Filter master object using WHERE clause (OPTIONAL):

+

+ + + + \ No newline at end of file diff --git a/rolluptool/src/pages/rollupcalculatemdt.page-meta.xml b/rolluptool/src/pages/rollupcalculatemdt.page-meta.xml new file mode 100644 index 00000000..6bc9407f --- /dev/null +++ b/rolluptool/src/pages/rollupcalculatemdt.page-meta.xml @@ -0,0 +1,12 @@ + + + 37.0 + false + false + + + 1 + 7 + sf_com_apps + + diff --git a/rolluptool/src/pages/rollupscheduledcalculate.page b/rolluptool/src/pages/rollupscheduledcalculate.page new file mode 100644 index 00000000..fb40f2ad --- /dev/null +++ b/rolluptool/src/pages/rollupscheduledcalculate.page @@ -0,0 +1,147 @@ + + + + + +

Filter master object using WHERE clause (OPTIONAL):

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rolluptool/src/pages/rollupscheduledcalculate.page-meta.xml b/rolluptool/src/pages/rollupscheduledcalculate.page-meta.xml new file mode 100644 index 00000000..89f7af70 --- /dev/null +++ b/rolluptool/src/pages/rollupscheduledcalculate.page-meta.xml @@ -0,0 +1,12 @@ + + + 37.0 + false + false + + + 1 + 7 + sf_com_apps + + diff --git a/rolluptool/src/pages/rollupscheduledcalculatemdt.page b/rolluptool/src/pages/rollupscheduledcalculatemdt.page new file mode 100644 index 00000000..da0f33d9 --- /dev/null +++ b/rolluptool/src/pages/rollupscheduledcalculatemdt.page @@ -0,0 +1,147 @@ + + + + + +

Filter master object using WHERE clause (OPTIONAL):

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rolluptool/src/pages/rollupscheduledcalculatemdt.page-meta.xml b/rolluptool/src/pages/rollupscheduledcalculatemdt.page-meta.xml new file mode 100644 index 00000000..e1f5c96c --- /dev/null +++ b/rolluptool/src/pages/rollupscheduledcalculatemdt.page-meta.xml @@ -0,0 +1,12 @@ + + + 37.0 + false + false + + + 1 + 7 + sf_com_apps + + diff --git a/rolluptool/src/pages/rollupsummaryenhanced.page-meta.xml b/rolluptool/src/pages/rollupsummaryenhanced.page-meta.xml index af991d3e..b6293c8f 100644 --- a/rolluptool/src/pages/rollupsummaryenhanced.page-meta.xml +++ b/rolluptool/src/pages/rollupsummaryenhanced.page-meta.xml @@ -1,10 +1,12 @@ - 28.0 + 37.0 + false + false 1 - 5 - umlcanvas + 7 + sf_com_apps diff --git a/rolluptool/src/pages/rollupsummaryenhancednew.page-meta.xml b/rolluptool/src/pages/rollupsummaryenhancednew.page-meta.xml index 6e7a21ad..e82ec8a2 100644 --- a/rolluptool/src/pages/rollupsummaryenhancednew.page-meta.xml +++ b/rolluptool/src/pages/rollupsummaryenhancednew.page-meta.xml @@ -1,5 +1,12 @@ - 28.0 + 37.0 + false + false + + 1 + 7 + sf_com_apps + diff --git a/rolluptool/src/pages/welcome.page b/rolluptool/src/pages/welcome.page index 20531f00..b3d450e5 100644 --- a/rolluptool/src/pages/welcome.page +++ b/rolluptool/src/pages/welcome.page @@ -17,7 +17,7 @@ function createRemoteSite() '' + '' + '' + - 'dlrs_mdapi' + + '{!RemoteSiteName}' + 'Metadata API Remote Site Setting for Declarative Rollup Tool (DLRS)' + 'false' + 'true' + @@ -54,12 +54,15 @@ function createRemoteSite()

Important Post Install Step:

-

In order to utlise the features of this tool you need to permit the tool access to the Salesforce Metadata API by adding a Remote Site Setting with this Salesforce Server URL https://{!Host}

+

In order to utilize the features of this tool you need to permit it to access the Salesforce Metadata API of your organization by adding a Remote Site Setting with this Salesforce Server URL https://{!Host}

Click the Create Remote Site Setting button to have the tool perform this step for you.

Overview: This is a tool that helps address a current platform limitation around rollup summaries. Specifically the inability to do rollup summaries between lookup relationships. This is possible between master detail relationships using the declarative mode of Force.com, but not between lookup relationships. You can read more about the tool and watch a video demo by reading this blog.

Release details can be found here.

+ +

DEBUG USE ONLY: {!metadataApiException}

+
\ No newline at end of file diff --git a/rolluptool/src/pages/welcome.page-meta.xml b/rolluptool/src/pages/welcome.page-meta.xml index dcb1aecf..fdca27de 100644 --- a/rolluptool/src/pages/welcome.page-meta.xml +++ b/rolluptool/src/pages/welcome.page-meta.xml @@ -1,10 +1,12 @@ - 28.0 + 37.0 + false + false 1 - 5 - umlcanvas + 7 + sf_com_apps diff --git a/rolluptool/src/pages/welcometab.page b/rolluptool/src/pages/welcometab.page new file mode 100644 index 00000000..caf1337d --- /dev/null +++ b/rolluptool/src/pages/welcometab.page @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/rolluptool/src/pages/welcometab.page-meta.xml b/rolluptool/src/pages/welcometab.page-meta.xml new file mode 100644 index 00000000..25be2bab --- /dev/null +++ b/rolluptool/src/pages/welcometab.page-meta.xml @@ -0,0 +1,12 @@ + + + 37.0 + false + false + + + 1 + 7 + sf_com_apps + + diff --git a/rolluptool/src/permissionsets/LookupRollupSummariesFull.permissionset b/rolluptool/src/permissionsets/LookupRollupSummariesFull.permissionset index c52943a0..e12cbf60 100644 --- a/rolluptool/src/permissionsets/LookupRollupSummariesFull.permissionset +++ b/rolluptool/src/permissionsets/LookupRollupSummariesFull.permissionset @@ -1,132 +1,8 @@ - - ApexClassesSelector - false - - - ApexTriggersSelector - false - - - AsyncApexJobsSelector - false - - - LREngine - false - - - MetadataService - false - - - MetadataServiceTest - false - - - RollupCalculateController - false - - - RollupCalculateJob - false - - - RollupController - false - - - RollupControllerTest - false - - - RollupJob - false - - - RollupJobTest - false - RollupService - false - - - RollupServiceException - false - - - RollupServiceTest - false - - - RollupServiceTest2 - false - - - RollupServiceTest3 - false - - - RollupSummaries - false - - - RollupSummariesSelector - false - - - RollupSummariesTest - false - - - RollupSummaryEnhancedController - false - - - RollupSummaryEnhancedControllerTest - false - - - RollupSummaryScheduleItemsSelector - false - - - SObjectDomain - false - - - SObjectDomainTest - false - - - SObjectSelector - false - - - SObjectSelectorTest - false - - - StringBuilder - false - - - TestContext - false - - - TestLREngine - false - - - WelcomeController - false - - - WelcomeControllerTest - false + true Provides full configuration access to the rollup summaries. This enabled Author Apex and API access to enable it to deploy the necessary Triggers via the Manage Child Trigger button. @@ -176,7 +52,12 @@ true - LookupRollupSummary__c.CalculateJobId__c + LookupRollupSummary__c.AggregateAllRows__c + true + + + true + LookupRollupSummary__c.RowLimit__c true @@ -194,51 +75,95 @@ LookupRollupSummary__c.RelationshipCriteria__c true + + true + LookupRollupSummary__c.TestCode__c + true + + + true + LookupRollupSummary__c.TestCodeSeeAllData__c + true + + + true + LookupRollupSummary__c.CalculationSharingMode__c + true + + + true + LookupRollupSummary__c.UniqueName__c + true + + + true + LookupRollupSummary__c.FieldToOrderBy__c + true + + + true + LookupRollupSummary__c.Description__c + true + + + true + LookupRollupSummary__c.ConcatenateDelimiter__c + true + true true true true - true + false LookupChild__c - true + false true true true true - true + false LookupParent__c - true + false true true true true - true + false LookupRollupSummaryLog__c - true + false true true true true - true + false LookupRollupSummaryScheduleItems__c - true + false true true true true - true + false LookupRollupSummary__c - true + false + + + true + true + true + true + false + LookupRollupCalculateJob__c + false managetrigger @@ -248,6 +173,10 @@ rollupcalculate true + + rollupscheduledcalculate + true + rollupsummaryenhanced true @@ -260,4 +189,48 @@ welcome true + + welcometab + true + + + managelookuprollupsummaries + true + + + managetriggermdt + true + + + rollupcalculatemdt + true + + + rollupscheduledcalculatemdt + true + + + LookupRollupSummary__c + Available + + + LookupRollupCalculateJob__c + Available + + + LookupRollupSummaryLog__c + Available + + + LookupRollupSummaryScheduleItems__c + Available + + + Welcome + Available + + + ManageLookupRollupSummaries + Available + diff --git a/rolluptool/src/permissionsets/LookupRollupSummariesReadOnly.permissionset b/rolluptool/src/permissionsets/LookupRollupSummariesReadOnly.permissionset index b1f8e072..868d6cac 100644 --- a/rolluptool/src/permissionsets/LookupRollupSummariesReadOnly.permissionset +++ b/rolluptool/src/permissionsets/LookupRollupSummariesReadOnly.permissionset @@ -92,26 +92,6 @@ RollupSummaryScheduleItemsSelector false - - SObjectDomain - false - - - SObjectDomainTest - false - - - SObjectSelector - false - - - SObjectSelectorTest - false - - - StringBuilder - false - TestContext false @@ -181,7 +161,12 @@ false - LookupRollupSummary__c.CalculateJobId__c + LookupRollupSummary__c.AggregateAllRows__c + true + + + false + LookupRollupSummary__c.RowLimit__c true @@ -227,6 +212,15 @@ LookupRollupSummary__c false + + false + false + false + true + false + LookupRollupCalculateJob__c + false + managetrigger false @@ -247,4 +241,48 @@ welcome false + + welcometab + true + + + managelookuprollupsummaries + true + + + managetriggermdt + true + + + rollupcalculatemdt + true + + + rollupscheduledcalculatemdt + true + + + LookupRollupSummary__c + Available + + + LookupRollupCalculateJob__c + Available + + + LookupRollupSummaryLog__c + Available + + + LookupRollupSummaryScheduleItems__c + Available + + + Welcome + Available + + + ManageLookupRollupSummaries + Available + diff --git a/rolluptool/src/tabs/LookupRollupCalculateJob__c.tab b/rolluptool/src/tabs/LookupRollupCalculateJob__c.tab new file mode 100644 index 00000000..35fb89ef --- /dev/null +++ b/rolluptool/src/tabs/LookupRollupCalculateJob__c.tab @@ -0,0 +1,6 @@ + + + true + false + Custom67: Gears + diff --git a/rolluptool/src/tabs/LookupRollupSummaryScheduleItems__c.tab b/rolluptool/src/tabs/LookupRollupSummaryScheduleItems__c.tab new file mode 100644 index 00000000..fbfb6248 --- /dev/null +++ b/rolluptool/src/tabs/LookupRollupSummaryScheduleItems__c.tab @@ -0,0 +1,6 @@ + + + true + false + Custom62: Chalkboard + diff --git a/rolluptool/src/tabs/ManageLookupRollupSummaries.tab b/rolluptool/src/tabs/ManageLookupRollupSummaries.tab new file mode 100644 index 00000000..3ea38b6f --- /dev/null +++ b/rolluptool/src/tabs/ManageLookupRollupSummaries.tab @@ -0,0 +1,7 @@ + + + + false + Custom9: Lightning + managelookuprollupsummaries + diff --git a/rolluptool/src/tabs/Welcome.tab b/rolluptool/src/tabs/Welcome.tab new file mode 100644 index 00000000..6018be49 --- /dev/null +++ b/rolluptool/src/tabs/Welcome.tab @@ -0,0 +1,7 @@ + + + + false + Custom9: Lightning + welcometab + diff --git a/rolluptool/src/triggers/RollupServiceTest2Trigger.trigger b/rolluptool/src/triggers/RollupServiceTest2Trigger.trigger index b1b2d470..246e5e1a 100644 --- a/rolluptool/src/triggers/RollupServiceTest2Trigger.trigger +++ b/rolluptool/src/triggers/RollupServiceTest2Trigger.trigger @@ -8,5 +8,8 @@ trigger RollupServiceTest2Trigger on LookupChild__c (before delete, before insert, before update, after delete, after insert, after undelete, after update) { - RollupService.triggerHandler(); + // Avoids the unit test triggers conflicting with manual testing in the org + if(Test.isRunningTest()) { + RollupService.triggerHandler(); + } } \ No newline at end of file diff --git a/rolluptool/src/triggers/RollupServiceTest2Trigger.trigger-meta.xml b/rolluptool/src/triggers/RollupServiceTest2Trigger.trigger-meta.xml index a015c13b..be45c9e1 100644 --- a/rolluptool/src/triggers/RollupServiceTest2Trigger.trigger-meta.xml +++ b/rolluptool/src/triggers/RollupServiceTest2Trigger.trigger-meta.xml @@ -1,5 +1,5 @@ - 24.0 + 32.0 Active diff --git a/rolluptool/src/triggers/RollupServiceTest3Trigger.trigger b/rolluptool/src/triggers/RollupServiceTest3Trigger.trigger index 0fe0cd35..d48fba7b 100644 --- a/rolluptool/src/triggers/RollupServiceTest3Trigger.trigger +++ b/rolluptool/src/triggers/RollupServiceTest3Trigger.trigger @@ -8,6 +8,10 @@ trigger RollupServiceTest3Trigger on Account (before delete, before insert, before update, after delete, after insert, after undelete, after update) { - if(TestContext.AccountTestTriggerEnabled) - RollupService.triggerHandler(); + // Avoids the unit test triggers conflicting with manual testing in the org + if(Test.isRunningTest()) { + if(TestContext.AccountTestTriggerEnabled) { + RollupService.triggerHandler(); + } + } } \ No newline at end of file diff --git a/rolluptool/src/triggers/RollupServiceTest3Trigger.trigger-meta.xml b/rolluptool/src/triggers/RollupServiceTest3Trigger.trigger-meta.xml index a015c13b..be45c9e1 100644 --- a/rolluptool/src/triggers/RollupServiceTest3Trigger.trigger-meta.xml +++ b/rolluptool/src/triggers/RollupServiceTest3Trigger.trigger-meta.xml @@ -1,5 +1,5 @@ - 24.0 + 32.0 Active diff --git a/rolluptool/src/triggers/RollupServiceTest4Trigger.trigger b/rolluptool/src/triggers/RollupServiceTest4Trigger.trigger new file mode 100644 index 00000000..56211c71 --- /dev/null +++ b/rolluptool/src/triggers/RollupServiceTest4Trigger.trigger @@ -0,0 +1,15 @@ +/** +* NOTE: DO NOT PACKAGE THIS TRIGGER +**/ + +/** + * Auto Generated and Deployed by the Declarative Lookup Rollup Summaries Tool package (dlrs) + **/ +trigger RollupServiceTest4Trigger on Task + (before delete, before insert, before update, after delete, after insert, after undelete, after update) +{ + // Avoids the unit test triggers conflicting with manual testing in the org + if(Test.isRunningTest()) { + RollupService.triggerHandler(); + } +} \ No newline at end of file diff --git a/rolluptool/src/triggers/RollupServiceTest4Trigger.trigger-meta.xml b/rolluptool/src/triggers/RollupServiceTest4Trigger.trigger-meta.xml new file mode 100644 index 00000000..be45c9e1 --- /dev/null +++ b/rolluptool/src/triggers/RollupServiceTest4Trigger.trigger-meta.xml @@ -0,0 +1,5 @@ + + + 32.0 + Active + diff --git a/rolluptool/src/triggers/RollupServiceTest5Trigger.trigger b/rolluptool/src/triggers/RollupServiceTest5Trigger.trigger new file mode 100644 index 00000000..6ed9747a --- /dev/null +++ b/rolluptool/src/triggers/RollupServiceTest5Trigger.trigger @@ -0,0 +1,15 @@ +/** +* NOTE: DO NOT PACKAGE THIS TRIGGER +**/ + +/** + * Auto Generated and Deployed by the Declarative Lookup Rollup Summaries Tool package (dlrs) + **/ +trigger RollupServiceTest5Trigger on Contact + (before delete, before insert, before update, after delete, after insert, after undelete, after update) +{ + // Avoids the unit test triggers conflicting with manual testing in the org + if(Test.isRunningTest()) { + RollupService.triggerHandler(); + } +} \ No newline at end of file diff --git a/rolluptool/src/triggers/RollupServiceTest5Trigger.trigger-meta.xml b/rolluptool/src/triggers/RollupServiceTest5Trigger.trigger-meta.xml new file mode 100644 index 00000000..be45c9e1 --- /dev/null +++ b/rolluptool/src/triggers/RollupServiceTest5Trigger.trigger-meta.xml @@ -0,0 +1,5 @@ + + + 32.0 + Active + diff --git a/rolluptool/src/triggers/RollupServiceTestTrigger.trigger b/rolluptool/src/triggers/RollupServiceTestTrigger.trigger index 73901827..02c92380 100644 --- a/rolluptool/src/triggers/RollupServiceTestTrigger.trigger +++ b/rolluptool/src/triggers/RollupServiceTestTrigger.trigger @@ -8,6 +8,10 @@ trigger RollupServiceTestTrigger on Opportunity (before delete, before insert, before update, after delete, after insert, after undelete, after update) { - if(TestContext.OpportunityTestTriggerEnabled) - RollupService.triggerHandler(); + // Avoids the unit test triggers conflicting with manual testing in the org + if(Test.isRunningTest()) { + if(TestContext.OpportunityTestTriggerEnabled) { + RollupService.triggerHandler(); + } + } } \ No newline at end of file diff --git a/rolluptool/src/triggers/RollupServiceTestTrigger.trigger-meta.xml b/rolluptool/src/triggers/RollupServiceTestTrigger.trigger-meta.xml index a015c13b..be45c9e1 100644 --- a/rolluptool/src/triggers/RollupServiceTestTrigger.trigger-meta.xml +++ b/rolluptool/src/triggers/RollupServiceTestTrigger.trigger-meta.xml @@ -1,5 +1,5 @@ - 24.0 + 32.0 Active diff --git a/rolluptool/src/triggers/RollupSummariesTrigger.trigger b/rolluptool/src/triggers/RollupSummariesTrigger.trigger index e548da4c..aeb4b87d 100644 --- a/rolluptool/src/triggers/RollupSummariesTrigger.trigger +++ b/rolluptool/src/triggers/RollupSummariesTrigger.trigger @@ -27,5 +27,5 @@ trigger RollupSummariesTrigger on LookupRollupSummary__c (after delete, after insert, after update, before delete, before insert, before update) { - SObjectDomain.triggerHandler(RollupSummaries.class); + fflib_SObjectDomain.triggerHandler(RollupSummaries.class); } \ No newline at end of file diff --git a/rolluptool/src/triggers/RollupSummariesTrigger.trigger-meta.xml b/rolluptool/src/triggers/RollupSummariesTrigger.trigger-meta.xml index 9a6de2a6..be45c9e1 100644 --- a/rolluptool/src/triggers/RollupSummariesTrigger.trigger-meta.xml +++ b/rolluptool/src/triggers/RollupSummariesTrigger.trigger-meta.xml @@ -1,5 +1,5 @@ - 28.0 + 32.0 Active